<?xml version="1.0" encoding="UTF-8"?>
<templates>

    <t t-name="mail.chat.SidebarFailed">
        <span class="o_mail_failed_message_refresh hidden"><i class="fa fa-refresh"/> Outdated</span>
        <span t-attf-class="o_mail_sidebar_failed badge #{(!counter ? 'hide' : '')}">
            <t t-esc="counter"/>
        </span>
    </t>

    <t t-extend="mail.chat.Sidebar">
        <t t-jquery="div[class='o_mail_chat_sidebar']>hr[class='mb8']" t-operation="before">
            <div t-attf-class="o_mail_chat_title_main o_mail_chat_channel_item #{(active_channel_id === 'channel_failed') ? 'o_active': ''}"
                 data-channel-id="channel_failed">
                <span class="o_channel_name"><i class="fa fa-exclamation mr8"/>Failed</span>
                <t t-set="counter" t-value="failed_counter"/>
                <t t-call="mail.chat.SidebarFailed"/>
            </div>
        </t>
    </t>

    <t t-extend="mail.EmptyChannel">
        <t t-jquery="t:last-child" t-operation="after">
            <t t-if="options.channel_id==='channel_failed'">
                <div class="o_thread_title">Congratulations, your failed mailbox is empty</div>
                <div>Failed messages appear here.</div>
            </t>
        </t>
    </t>

    <t t-extend="mail.ChatThread.Message">
        <t t-jquery="span[t-attf-class=o_thread_icons]" t-operation="append">
            <a t-if="message.is_failed &amp;&amp; options.display_retry_button" class="btn btn-link btn-success text-muted btn-sm o_failed_message_reviewed o_activity_link mr8" t-att-data-message-id="message.id">
                <i class="fa fa-check"/> Set as Reviewed
            </a>
            <a t-if="message.is_failed &amp;&amp; options.display_reviewed_button" class="btn btn-link btn-default text-muted btn-sm o_failed_message_retry" t-att-data-message-id="message.id">
                <i class="fa fa-retweet"/> Retry
            </a>
        </t>
    </t>

</templates>
