{extends "../window.tpl"}
{block title}
    {'emailSettings'|translate}
{/block}

{block size}
   width = 1200;
{/block}

{block tabs}
    {windowTab id="orders" label={'emailSettings'|translate}}
    {if findModule("orders")}
        {windowTab id="messages" label={'emailMessages'|translate}}
    {/if}
    {windowTab id="smtp" label={'emailSMTP'|translate}}
    {windowTab id="advanced" label={'emailAdvanced'|translate}}
{/block}

{block tabsContent}
    {function showPlaceholders}
       <div class="placeholders panel panel-default" id="#symbols">
          <div class="panel-collapse collapse symbol-collapse {if $smarty.get.symbols}in{/if}" id="symbol-collapse{$type}">
             <p>{'Description2'|translate}</p>

             <p>{'Description3'|translate} <strong>{literal}{Cena balíku:123}{/literal}</strong>.</p>

              {$placeholders = $body.email->getPlaceholders($type)}
              {$half = (($placeholders|count)/ 2)|round}
              {foreach $placeholders as $key => $placeholder}
                  {if $placeholder@first}
                     <div>
                     <table class="table table-striped">
                  {/if}
                  {if $placeholder@index == $half}
                     </table>
                     </div>
                     <div>
                     <table class="table table-striped">
                  {/if}
                 <tr>
                    <td><strong>{literal}{{/literal}{$key}{literal}}{/literal}</strong></td>
                    <td>{$placeholder.text nofilter}</td>
                 </tr>
                  {if $placeholder@last}
                     </table>
                     </div>
                  {/if}
              {/foreach}
          </div>
       </div>
    {/function}

   <div id="orders" class="tab-pane fade boxStatic">
       {include "window/email.orders.tpl"}
   </div>
    {if findModule("orders")}
       <div id="messages" class="tab-pane fade boxStatic">
           {include "window/email.messages.tpl"}
       </div>
    {/if}
   <div id="smtp" class="tab-pane face boxStatic">
      {include "window/email.smtp.tpl"}
   </div>
   <div id="advanced" class="tab-pane face boxStatic">
       {include "window/email.advanced.tpl"}
   </div>

{/block}

{block buttonsRight}
   {if $view->hasRights('save')}
      <div class="col-md-2">
         <button type="submit" name="Submit" class="btn btn-primary btn-block"
                 value="{'windowSave'|translate:'button'}">{'windowSave'|translate:'button'}</button>
      </div>
   {/if}
   <div class="col-md-2">
      <input type="button" class="btn btn-primary btn-block" onClick="closeWindow();"
             value="{'windowCancel'|translate:'button'}"/>
   </div>

   <div class="col-md-2 pull-right d-flex justify-end">
      <button class="btn" type="button" title="Nápověda" data-beacon>
         <i class="bi bi-question-circle"></i>
      </button>
   </div>
{/block}
