2024-05-11 15:37:20 +00:00
|
|
|
import { html } from 'lit'
|
|
|
|
import { __ } from 'i18n'
|
|
|
|
|
|
|
|
export function tplMUCTaskApp (el, mucModel) {
|
2024-05-12 13:38:11 +00:00
|
|
|
if (!mucModel) {
|
|
|
|
// should not happen
|
|
|
|
el.classList.add('hidden') // we must do this, otherwise will have CSS side effects
|
|
|
|
return html``
|
|
|
|
}
|
|
|
|
if (!mucModel.tasklists) {
|
|
|
|
// too soon, not initialized yet (this will happen)
|
|
|
|
el.classList.add('hidden') // we must do this, otherwise will have CSS side effects
|
|
|
|
return html``
|
|
|
|
}
|
2024-05-11 15:37:20 +00:00
|
|
|
|
|
|
|
if (!el.show) {
|
2024-05-12 13:38:11 +00:00
|
|
|
el.classList.add('hidden')
|
2024-05-11 15:37:20 +00:00
|
|
|
return html``
|
|
|
|
}
|
|
|
|
|
2024-05-12 13:38:11 +00:00
|
|
|
el.classList.remove('hidden')
|
2024-05-11 15:37:20 +00:00
|
|
|
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
const i18nTasks = __(LOC_tasks)
|
2024-05-12 14:21:07 +00:00
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
const i18nHint = __(LOC_task_app_info)
|
2024-05-11 15:37:20 +00:00
|
|
|
return html`
|
|
|
|
<div class="livechat-converse-muc-app-header">
|
|
|
|
<h5>${i18nTasks}</h5>
|
2024-05-12 14:21:07 +00:00
|
|
|
<converse-icon
|
|
|
|
class="fa fa-info-circle"
|
|
|
|
size="1em"
|
|
|
|
title="${i18nHint}"
|
|
|
|
></converse-icon>
|
2024-05-12 13:38:11 +00:00
|
|
|
<button class="livechat-converse-muc-app-close" @click=${el.toggleApp} title="${__('Close')}">
|
2024-05-11 15:37:20 +00:00
|
|
|
<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>`
|
|
|
|
}
|