[IMP] mail: client action: sidebar: hide livechat when empty
Channel types that disable the 'add a channel' feature like the livechat are now only rendered in the sidebar of the client action if there exists at least one channel of that type.
This commit is contained in:
committed by
Géry Debongnie
parent
4884b41f55
commit
765cfa040d
@@ -50,10 +50,22 @@
|
||||
</span>
|
||||
</t>
|
||||
<t t-name="mail.chat.SidebarTitle">
|
||||
<div class="o_mail_sidebar_title">
|
||||
<h4><t t-esc="channel_title"/></h4>
|
||||
<span t-if="!disable_add_channel" class="fa fa-plus o_add" t-att-title="_t('Add')" t-attf-data-type="#{channel_type}"/>
|
||||
</div>
|
||||
<!-- Don't display the channel type if there is no channel of such type
|
||||
and the 'add a channel' option is disabled for this type -->
|
||||
<t t-if="disable_add_channel">
|
||||
<t t-set="empty" t-value="true"/>
|
||||
<t t-foreach="channels" t-as="channel">
|
||||
<t t-if="channel.type === channel_type">
|
||||
<t t-set="empty" t-value="false"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="!disable_add_channel || !empty">
|
||||
<div class="o_mail_sidebar_title">
|
||||
<h4><t t-esc="channel_title"/></h4>
|
||||
<span t-if="!disable_add_channel" class="fa fa-plus o_add" t-att-title="_t('Add')" t-attf-data-type="#{channel_type}"/>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="mail.chat.SidebarItems">
|
||||
<t t-foreach="channels" t-as="channel">
|
||||
|
||||
Reference in New Issue
Block a user