summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components/messaging_menu/messaging_menu.xml
blob: fc779231dd8f8c6c3b90224e885caf521bbfbd6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

    <t t-name="mail.MessagingMenu" owl="1">
        <li class="o_MessagingMenu" t-att-class="{ 'o-is-open': messagingMenu ? messagingMenu.isOpen : false, 'o-mobile': env.messaging ? env.messaging.device.isMobile : false }">
            <a class="o_MessagingMenu_toggler" t-att-class="{ 'o-no-notification': messagingMenu ? !messagingMenu.counter : false }" href="#" title="Conversations" role="button" t-att-aria-expanded="messagingMenu and messagingMenu.isOpen ? 'true' : 'false'" aria-haspopup="true" t-on-click="_onClickToggler">
                <i class="o_MessagingMenu_icon fa fa-comments" role="img" aria-label="Messages"/>
                <t t-if="!env.isMessagingInitialized()">
                    <i class="o_MessagingMenu_loading fa fa-spinner fa-spin"/>
                </t>
                <t t-elif="messagingMenu.counter > 0">
                    <span class="o_MessagingMenu_counter badge badge-pill">
                        <t t-esc="messagingMenu.counter"/>
                    </span>
                </t>
            </a>
            <t t-if="messagingMenu and messagingMenu.isOpen">
                <div class="o_MessagingMenu_dropdownMenu dropdown-menu dropdown-menu-right" t-att-class="{ 'o-mobile': env.messaging.device.isMobile, 'o-messaging-not-initialized': !env.messaging.isInitialized }" role="menu">
                    <t t-if="!env.messaging.isInitialized">
                        <span><i class="o_MessagingMenu_dropdownLoadingIcon fa fa-spinner fa-spin"/>Please wait...</span>
                    </t>
                    <t t-else="">
                        <div class="o_MessagingMenu_dropdownMenuHeader" t-att-class="{ 'o-mobile': env.messaging.device.isMobile }">
                            <t t-if="!env.messaging.device.isMobile">
                                <t t-foreach="['all', 'chat', 'channel']" t-as="tabId" t-key="tabId">
                                    <button class="o_MessagingMenu_tabButton o-desktop btn btn-link" t-att-class="{ 'o-active': messagingMenu.activeTabId === tabId, }" t-on-click="_onClickDesktopTabButton" type="button" role="tab" t-att-data-tab-id="tabId">
                                        <t t-if="tabId === 'all'">All</t>
                                        <t t-elif="tabId === 'chat'">Chat</t>
                                        <t t-elif="tabId === 'channel'">Channels</t>
                                    </button>
                                </t>
                            </t>
                            <t t-if="env.messaging.device.isMobile">
                                <t t-call="mail.MessagingMenu.newMessageButton"/>
                            </t>
                            <div class="o-autogrow"/>
                            <t t-if="!env.messaging.device.isMobile and !discuss.isOpen">
                                <t t-call="mail.MessagingMenu.newMessageButton"/>
                            </t>
                            <t t-if="env.messaging.device.isMobile and messagingMenu.isMobileNewMessageToggled">
                                <AutocompleteInput
                                    class="o_MessagingMenu_mobileNewMessageInput"
                                    customClass="id + '_mobileNewMessageInputAutocomplete'"
                                    isFocusOnMount="true"
                                    placeholder="mobileNewMessageInputPlaceholder"
                                    select="_onMobileNewMessageInputSelect"
                                    source="_onMobileNewMessageInputSource"
                                    t-on-o-hide="_onHideMobileNewMessage"
                                />
                            </t>
                        </div>
                        <NotificationList
                            class="o_MessagingMenu_notificationList"
                            t-att-class="{ 'o-mobile': env.messaging.device.isMobile }"
                            filter="messagingMenu.activeTabId"
                        />
                        <t t-if="env.messaging.device.isMobile">
                            <MobileMessagingNavbar
                                class="o_MessagingMenu_mobileNavbar"
                                activeTabId="messagingMenu.activeTabId"
                                tabs="tabs"
                                t-on-o-select-mobile-messaging-navbar-tab="_onSelectMobileNavbarTab"
                            />
                        </t>
                    </t>
                </div>
            </t>
        </li>
    </t>

    <t t-name="mail.MessagingMenu.newMessageButton" owl="1">
        <button class="o_MessagingMenu_newMessageButton btn"
            t-att-class="{
                'btn-link': !env.messaging.device.isMobile,
                'btn-secondary': env.messaging.device.isMobile,
                'o-mobile': env.messaging.device.isMobile,
            }" t-on-click="_onClickNewMessage" type="button"
        >
            New message
        </button>
    </t>

</templates>