{extends "index.tpl"}

{block "body-content"}
   <div class="row pos-rel m-b-3">

      {include "block.userNav.tpl"}

      <div class="col-xs-12 col-md-9 col-lg-8 col-xl-offset-2 col-lg-offset-1 user-content">

         <div class="subpage-header p-b-2">
            <h1 class="after">{$view->getTitle()}</h1>
         </div>

         <div class="row">
            <div class="col-xs-12 benefit-program">
               <div class="benefit-program-inner">
                  <p class="icons_star">Máte celkem <strong>{$body.active_points} {t plural="body" plural5="bodů" count=$body.active_points}bod{/t}</strong> ve věrnostním programu.
                  </p>
               </div>
            </div>
         </div>

         <div class="row p-t-3">
            <div class="col-xs-12">
               <h2 class="m-b-2">{t}Historie bodů{/t}</h2>
               <table class="table-orders table">
                  <tr>
                     <th>{t}Datum{/t}</th>
                     <th>{t}Body{/t}</th>
                     <th>{t}Poznámka{/t}</th>
                     <th>{t}Objednávka{/t}</th>
                  </tr>

                  {foreach $body.points_history as $point}
                     <tr>
                        <td>{$point.date_created|date_format:"%d. %m. %Y"}<span class="hidden-sm-down"> {$point.date_created|date_format:"%H:%M"}</span></td>
                        <td><strong>{if $point.points > 0 }+{/if}{$point.points}</strong></td>
                        <td>{$point.note}</td>
                        <td>{if $point.id_order}<a href="{url s=orderView IDo=$point.id_order}pdf" download>{t}Faktura{/t} {t}č.{/t} {$point.order_no}</a>{/if}</td>
                     </tr>
                     {foreachelse}
                     <tr>
                        <td colspan="5">{t}Prozatím nemáte žádné body.{/t}</td>
                     </tr>
                  {/foreach}
               </table>
               {if $body.pager.count > 1}
                  {include "block.pager.tpl" pager=$body.pager}
               {/if}
            </div>
         </div>
      </div>
   </div>
{/block}
