<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="mail_tracking.failed_message">
        <div class="o_thread_message" style="margin-bottom: 10px">
            <div class="o_thread_message_sidebar">
                <div class="o_avatar_stack">
                    <img t-attf-src="/web/image/res.partner/#{message.author[0]}/image_small" class="o_thread_message_avatar img-circle mb8" t-att-title="message.author[1]"/>
                    <i class="o_avatar_icon fa fa-exclamation bg-danger-full" title="Failed"></i>
                </div>
            </div>
            <div class="o_thread_message_core">
                <div class="o_mail_info">
                    <strong class="o_thread_author">
                        <t t-esc="message.author[1]"/>
                    </strong>
                    - <small class="o_mail_timestamp" t-att-title="message.date.format(date_format)"><t t-esc="message.hour"/></small>
                    <span t-attf-class="o_thread_icons">
                        <a href="#" class="btn btn-link btn-success text-muted btn-sm o_failed_message_reviewed o_activity_link" t-att-data-message-id="message.id">
                            <i class="fa fa-check"/> Mark Reviewed
                        </a>
                        <a href="#" 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>
                    </span>
                    <br/>
                    <strong class="text-danger">Failed Recipients:</strong>
                    <t t-foreach="message.failed_recipients" t-as="recipient">
                        <t t-if="!recipient_first">
                            -
                        </t>
                        <a class="o_mail_action_tracking_partner"
                           t-att-data-partner="recipient[0]"
                           t-attf-href="#model=res.partner&amp;id=#{recipient[0]}">
                            <t t-esc="recipient[1]"/>
                        </a>
                    </t>
                </div>
                <div class="o_thread_message_note small">
                    <t t-raw="message.body"/>
                </div>
            </div>
        </div>
    </t>

    <t t-name="mail_tracking.failed_message_items">
        <div class="o_thread_date_separator o_border_dashed collapsed" data-toggle="collapse" data-target="#o_chatter_failed_message">
            <span class="o_thread_date btn">
                <i class="fa fa-fw fa-caret-down"/>
                Failed messages
                <small class="o_chatter_failed_message_summary ml8">
                    <span class="label img-circle label-danger"><t t-esc="nbFailedMessages"/></span>
                </small>
            </span>
        </div>
        <div id="o_chatter_failed_message" class="collapse">
            <t t-foreach="failed_messages" t-as="message">
                <t t-call="mail_tracking.failed_message" />
            </t>
        </div>
    </t>

</templates>
