{config_load file="$language.conf" section="notifications"}
<link rel="stylesheet" href="{$module_path}css/style.css"/>

<h2>{#notifications#}</h2>

{if $single_view}
<ul data-role="listview" data-inset="true">

  {foreach from=$notifications item=notification}
  {include file="sub_notifications_single.tpl.html"}
  {/foreach}
</ul>
{else}


<div data-role="navbar">
  <ul>
    <li>
      <a href="{$dashboard_page_link}&dashboard_viewpage=open" data-role="button" {if $dashboard_viewpage == 'open'} class="ui-btn-active" {/if}>{#title_open#}</a>
    </li>
    <li>
      <a href="{$dashboard_page_link}&dashboard_viewpage=dismissed" data-role="button" {if $dashboard_viewpage == 'dismissed'} class="ui-btn-active" {/if}>{#title_dismissed#}</a>
    </li>
  </ul>
</div>

<ul data-role="listview" data-filter="false" data-inset="true" data-filter-placeholder="{#search#}">
  {foreach from=$notifications item=notification}
  {if $notification.orders_id > 0}
  {assign var=notification_header value=$notification.datecreated|date_format:"%Y"|cat:" - #"|cat:$notification.orders_id}
  {else}
  {assign var=notification_header value=$notification.datecreated|date_format:"%Y"}
  {/if}
  {if $notification_header ne $prev_ynotification_header}
  <li data-role="list-divider">{$notification_header}</li>
  {assign var=prev_notification_header value=$notification_header}
  {/if}

  {include file="sub_notifications_single.tpl.html"}

  {foreachelse}
  <li>
    <p><br>{#no_message#}</p>
  </li>
  {/foreach}
</ul>
{/if}