|
@@ -4,41 +4,57 @@ import { _converse, api } from '@converse/headless';
|
|
|
import { html } from 'lit';
|
|
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
|
|
|
|
+/**
|
|
|
+ * @param {import('../user-settings').default} el
|
|
|
+ */
|
|
|
const tplNavigation = (el) => {
|
|
|
const i18n_about = __('About');
|
|
|
const i18n_commands = __('Commands');
|
|
|
+
|
|
|
+ const show_client_info = api.settings.get('show_client_info');
|
|
|
+ const allow_adhoc_commands = api.settings.get('allow_adhoc_commands');
|
|
|
+ const show_tabs = show_client_info && allow_adhoc_commands;
|
|
|
return html`
|
|
|
- <ul class="nav nav-pills justify-content-center">
|
|
|
- <li role="presentation" class="nav-item">
|
|
|
- <a
|
|
|
- class="nav-link ${el.tab === 'about' ? 'active' : ''}"
|
|
|
- id="about-tab"
|
|
|
- href="#about-tabpanel"
|
|
|
- aria-controls="about-tabpanel"
|
|
|
- role="tab"
|
|
|
- data-toggle="tab"
|
|
|
- data-name="about"
|
|
|
- @click=${(ev) => el.switchTab(ev)}
|
|
|
- >${i18n_about}</a
|
|
|
- >
|
|
|
- </li>
|
|
|
- <li role="presentation" class="nav-item">
|
|
|
- <a
|
|
|
- class="nav-link ${el.tab === 'commands' ? 'active' : ''}"
|
|
|
- id="commands-tab"
|
|
|
- href="#commands-tabpanel"
|
|
|
- aria-controls="commands-tabpanel"
|
|
|
- role="tab"
|
|
|
- data-toggle="tab"
|
|
|
- data-name="commands"
|
|
|
- @click=${(ev) => el.switchTab(ev)}
|
|
|
- >${i18n_commands}</a
|
|
|
- >
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ ${show_tabs
|
|
|
+ ? html`<ul class="nav nav-pills justify-content-center">
|
|
|
+ ${show_client_info
|
|
|
+ ? html` <li role="presentation" class="nav-item">
|
|
|
+ <a
|
|
|
+ class="nav-link ${el.tab === 'about' ? 'active' : ''}"
|
|
|
+ id="about-tab"
|
|
|
+ href="#about-tabpanel"
|
|
|
+ aria-controls="about-tabpanel"
|
|
|
+ role="tab"
|
|
|
+ data-toggle="tab"
|
|
|
+ data-name="about"
|
|
|
+ @click=${(ev) => el.switchTab(ev)}
|
|
|
+ >${i18n_about}</a
|
|
|
+ >
|
|
|
+ </li>`
|
|
|
+ : ''}
|
|
|
+ ${allow_adhoc_commands
|
|
|
+ ? html` <li role="presentation" class="nav-item">
|
|
|
+ <a
|
|
|
+ class="nav-link ${el.tab === 'commands' ? 'active' : ''}"
|
|
|
+ id="commands-tab"
|
|
|
+ href="#commands-tabpanel"
|
|
|
+ aria-controls="commands-tabpanel"
|
|
|
+ role="tab"
|
|
|
+ data-toggle="tab"
|
|
|
+ data-name="commands"
|
|
|
+ @click=${(ev) => el.switchTab(ev)}
|
|
|
+ >${i18n_commands}</a
|
|
|
+ >
|
|
|
+ </li>`
|
|
|
+ : ''}
|
|
|
+ </ul>`
|
|
|
+ : ''}
|
|
|
`;
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * @param {import('../user-settings').default} el
|
|
|
+ */
|
|
|
export default (el) => {
|
|
|
const first_subtitle = __(
|
|
|
'%1$s Open Source %2$s XMPP chat client brought to you by %3$s Opkode %2$s',
|
|
@@ -61,19 +77,17 @@ export default (el) => {
|
|
|
|
|
|
<div class="tab-content">
|
|
|
${show_client_info
|
|
|
- ? html` <div
|
|
|
+ ? html`<div
|
|
|
class="tab-pane tab-pane--columns ${el.tab === 'about' ? 'active' : ''}"
|
|
|
id="about-tabpanel"
|
|
|
role="tabpanel"
|
|
|
aria-labelledby="about-tab"
|
|
|
>
|
|
|
- <span class="modal-alert"></span>
|
|
|
- <br />
|
|
|
<div class="container">
|
|
|
- <h6 class="brand-heading">Converse</h6>
|
|
|
- <p class="brand-subtitle">${_converse.VERSION_NAME}</p>
|
|
|
- <p class="brand-subtitle">${unsafeHTML(DOMPurify.sanitize(first_subtitle))}</p>
|
|
|
- <p class="brand-subtitle">${unsafeHTML(DOMPurify.sanitize(second_subtitle))}</p>
|
|
|
+ <converse-brand-logo class="d-flex justify-content-center mt-3" hide_byline></converse-brand-logo>
|
|
|
+ <p class="text-center brand-subtitle">${_converse.VERSION_NAME}</p>
|
|
|
+ <p class="text-center brand-subtitle">${unsafeHTML(DOMPurify.sanitize(first_subtitle))}</p>
|
|
|
+ <p class="text-center brand-subtitle">${unsafeHTML(DOMPurify.sanitize(second_subtitle))}</p>
|
|
|
</div>
|
|
|
</div>`
|
|
|
: ''}
|