Muc-app: some refactoring.
This commit is contained in:
parent
86cac34ef3
commit
20cb668e09
@ -3,7 +3,7 @@
|
|||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { api } from '@converse/headless'
|
import { api } from '@converse/headless'
|
||||||
import { MUCApp } from '../../../shared/components/muc-app.js'
|
import { MUCApp } from '../../../shared/components/muc-app/index.js'
|
||||||
import { tplMUCNoteApp } from '../templates/muc-note-app.js'
|
import { tplMUCNoteApp } from '../templates/muc-note-app.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { converseLocalizedHelpUrl } from '../../../shared/lib/help'
|
import { converseLocalizedHelpUrl } from '../../../shared/lib/help'
|
||||||
|
import { tplMUCApp } from '../../../shared/components/muc-app/templates/muc-app.js'
|
||||||
import { html } from 'lit'
|
import { html } from 'lit'
|
||||||
import { __ } from 'i18n'
|
import { __ } from 'i18n'
|
||||||
|
|
||||||
@ -28,19 +29,11 @@ export function tplMUCNoteApp (el, mucModel) {
|
|||||||
page: 'documentation/user/streamers/notes'
|
page: 'documentation/user/streamers/notes'
|
||||||
})
|
})
|
||||||
|
|
||||||
return html`
|
return tplMUCApp(
|
||||||
<div class="livechat-converse-muc-app-header">
|
el,
|
||||||
<h5>${i18nNotes}</h5>
|
i18nNotes,
|
||||||
<a href="${helpUrl}" target="_blank"><converse-icon
|
helpUrl,
|
||||||
class="fa fa-circle-question"
|
i18nHelp,
|
||||||
size="1em"
|
html`<livechat-converse-muc-notes .model=${mucModel.notes}></livechat-converse-muc-notes>`
|
||||||
title="${i18nHelp}"
|
)
|
||||||
></converse-icon></a>
|
|
||||||
<button class="livechat-converse-muc-app-close" @click=${el.toggleApp} title="${__('Close')}">
|
|
||||||
<converse-icon class="fa fa-times" size="1em"></converse-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="livechat-converse-muc-app-body">
|
|
||||||
<livechat-converse-muc-notes .model=${mucModel.notes}></livechat-converse-muc-notes>
|
|
||||||
</div>`
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { api } from '@converse/headless'
|
import { api } from '@converse/headless'
|
||||||
import { MUCApp } from '../../../shared/components/muc-app.js'
|
import { MUCApp } from '../../../shared/components/muc-app/index.js'
|
||||||
import { tplMUCTaskApp } from '../templates/muc-task-app.js'
|
import { tplMUCTaskApp } from '../templates/muc-task-app.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { converseLocalizedHelpUrl } from '../../../shared/lib/help'
|
import { converseLocalizedHelpUrl } from '../../../shared/lib/help'
|
||||||
|
import { tplMUCApp } from '../../../shared/components/muc-app/templates/muc-app.js'
|
||||||
import { html } from 'lit'
|
import { html } from 'lit'
|
||||||
import { __ } from 'i18n'
|
import { __ } from 'i18n'
|
||||||
|
|
||||||
@ -28,19 +29,11 @@ export function tplMUCTaskApp (el, mucModel) {
|
|||||||
page: 'documentation/user/streamers/tasks'
|
page: 'documentation/user/streamers/tasks'
|
||||||
})
|
})
|
||||||
|
|
||||||
return html`
|
return tplMUCApp(
|
||||||
<div class="livechat-converse-muc-app-header">
|
el,
|
||||||
<h5>${i18nTasks}</h5>
|
i18nTasks,
|
||||||
<a href="${helpUrl}" target="_blank"><converse-icon
|
helpUrl,
|
||||||
class="fa fa-circle-question"
|
i18nHelp,
|
||||||
size="1em"
|
html`<livechat-converse-muc-task-lists .model=${mucModel.tasklists}></livechat-converse-muc-task-lists>`
|
||||||
title="${i18nHelp}"
|
)
|
||||||
></converse-icon></a>
|
|
||||||
<button class="livechat-converse-muc-app-close" @click=${el.toggleApp} title="${__('Close')}">
|
|
||||||
<converse-icon class="fa fa-times" size="1em"></converse-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="livechat-converse-muc-app-body">
|
|
||||||
<livechat-converse-muc-task-lists .model=${mucModel.tasklists}></livechat-converse-muc-task-lists>
|
|
||||||
</div>`
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import { html } from 'lit'
|
||||||
|
import { __ } from 'i18n'
|
||||||
|
|
||||||
|
export function tplMUCApp (el, i18nTitle, helpUrl, i18nHelp, content) {
|
||||||
|
return html`
|
||||||
|
<div class="livechat-converse-muc-app-header">
|
||||||
|
<h5>${i18nTitle}</h5>
|
||||||
|
<a href="${helpUrl}" target="_blank"><converse-icon
|
||||||
|
class="fa fa-circle-question"
|
||||||
|
size="1em"
|
||||||
|
title="${i18nHelp}"
|
||||||
|
></converse-icon></a>
|
||||||
|
<button class="livechat-converse-muc-app-close" @click=${el.toggleApp} title="${__('Close')}">
|
||||||
|
<converse-icon class="fa fa-times" size="1em"></converse-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="livechat-converse-muc-app-body">
|
||||||
|
${content}
|
||||||
|
</div>`
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user