{extends "account/account-wrapper.tpl"}

{block "title"}
   <h1>{$view->getTitle()}</h1>
{/block}

{block "account-content"}
   {block "tpl-vars"}
      {$tpl_vars.btn_class = "btn-secondary"}
   {/block}
   {block "account-info"}
      <div class="account-box">
         <div class="account-image">
            {if $ctrl.customData.profilePicture}
               <img src="{$ctrl.customData.profilePicture}" alt="">
            {else}
               <span>{$body.user.name|substr:0:1}{$body.user.surname|substr:0:1}</span>
            {/if}
         </div>
         <div class="account-info">
            {* ify tam jsou kvuli FB registraci, kdy ty informace clovek nemusi mit vyplnene *}
            <p class="name">{$body.user.name}&nbsp;{$body.user.surname}</p>

            {if $body.user.city or $body.user.zip or $body.user.street}
               <p>
                  {if $body.user.street}{$body.user.street}<br>{/if}
                  {if $body.user.custom_address}{$body.user.custom_address}<br>{/if}
                  {if $body.user.city}{$body.user.city},&nbsp;{/if}{if $body.user.city or $body.user.zip}{$body.user.zip}
                     <br>
                  {/if}
                  {if $body.user.custom_address}{$body.user.custom_address} {/if}{$cfg.Order.Countries[$body.user.country]}
               </p>
            {/if}
            <p>
               <a href="mailto:{$body.user.email}">{$body.user.email}</a><br>
               {$body.user.phone}
            </p>
            <a href="{url s=user}" class="btn {$tpl_vars.btn_class}">{t}Změnit údaje{/t}</a>
         </div>
      </div>
   {/block}

   {if $body.orders}
      <h2>{t}Poslední objednávky{/t}</h2>
      {include "components/orders-list.tpl" show_invoice=false}
      <div class="text-center">
         <a href="{url s=orders}" class="btn {$tpl_vars.btn_class}">{t}Moje objednávky{/t}</a>
      </div>
   {/if}
{/block}
