{config_load file="$language.conf" section="view_mailbeezstats"}

{if $msg_history > 0 }
  {capture name='MAILBEEZ_EMAIL_ARCHIVE_STATUS'}{mh_cfg key='MAILBEEZ_EMAIL_ARCHIVE_STATUS'}{/capture}
{foreach from=$msg_history item=msg_item name=msg}

<div style="border-bottom: 1px solid #e9e9e9; padding-top: 7px; padding-bottom: 7px;cursor: pointer;"
     onClick="
      {if $smarty.capture.MAILBEEZ_EMAIL_ARCHIVE_STATUS == 'True'}
return openBeezDeskDialog('{$LA_CONTEXT_VIEW_URL}')
      {else}
return openBeezDeskDialog('{$LA_CONTEXT_VIEW_URL}')
      {/if}
">



  <div style="width: 165px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline;
        float: right;">

    <div style="overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 130px;
        float:left;">

    <abbr title="{$msg_item.module}">{$msg_item.module}</abbr>
    </div>
    / {$msg_item.iteration}
    <br/>
    <abbr class="timeago" title="{$msg_item.date_sent}" style="">{$message.date_sent}</abbr>

    {if $msg_item.engagement_bounced > 0}
    <div class="engagement_badge bounced"><abbr title="{#engagement_bounced#}">&nbsp;&nbsp;&nbsp;</abbr></div>
    {/if}
    {if $msg_item.engagement_opened > 0}
    <div class="engagement_badge opened"><abbr title="{#engagement_opened#}">&nbsp;&nbsp;&nbsp;</abbr></div>
    {/if}
    {if $msg_item.engagement_clicked > 0}
    <div class="engagement_badge clicked"><abbr title="{#engagement_clicked#}">&nbsp;&nbsp;&nbsp;</abbr></div>
    {/if}
    {if $msg_item.engagement_ordered > 0}
    <div class="engagement_badge ordered"><abbr title="{#engagement_ordered#}">&nbsp;&nbsp;&nbsp;</abbr></div>
    {/if}
    {if $msg_item.engagement_blocked > 0}
    <div class="engagement_badge blocked"><abbr title="{#engagement_blocked#}">&nbsp;&nbsp;&nbsp;</abbr></div>
    {/if}
  </div>

  <img src="{$module_path}icon.png" class="icon {if $msg_item.engagement_ordered > 0}highlighted_green{/if}" style="width: 24px; {if !$msg_item.engagement_flag}opacity: 0.5{/if}" alt="{$coupon.coupon.module}">

</div>

{if $smarty.foreach.msg.last}
{if $more_msg > 0}
<div style="cursor: pointer; font: inherit" onclick="return openBeezDeskDialog('{$LA_CONTEXT_VIEW_URL}');">
  + {$more_msg} {if $more_msg > 1}{#more_messages#}{else}{#more_message#}{/if}
</div>
{/if}
{/if}
{/foreach}
{else}

<p>
  {#no_history#}
</p>
{/if}
