{extends "../window.tpl"}

{block tabs}
   {windowTab id='flapTemplatesCategories'}
   {windowTab id='flapTemplatesList'}
{/block}

{block tabsContent}
   <div id="flapTemplatesCategories" class="tab-pane fade in boxFlex">
      <div class="row wpj-form-group-flex">
         <div class="col-xs-8">
            <div class="wpj-form-group">
               <label>Jméno</label>
               <input type="text" class="form-control" name="data[name]" maxlength="100" value="{$body.data.name}" />
            </div>
         </div>
         <div class="col-xs-4 d-flex align-items-center">
            {print_toggle value=$body.data.data.show_in_editor name="data][show_in_editor"}
            <label>
               Zobrazovat v Editoru obsahu
               <a class="help-tip" data-toggle="tooltip" title=""
               data-original-title="Aktivujte, pokud obsah slouží jako šablona pro tvorbu v editoru obsahu. Zobrazí se v záložce Šablony > Uživatelské."><i class="bi bi-question-circle"></i></a>
            </label>
         </div>
      </div>
      <div class="row">
         <div class="col-xs-12">
            <div class="wpj-form-group">
               <label>{'productDetailPosition'|translate}</label>
               <select class="selecter" name="data[product_detail_position]">
                  <option value="">{'emptyPosition'|translate}</option>
                  {foreach $cfg.Modules.templates.product_detail_positions as $value => $text}
                     <option value="{$value}" {if $value == $body.data.product_detail_position}selected{/if}>{preg_replace('/^\w+:/', '', $text|translate)}</option>
                  {/foreach}
               </select>
            </div>
         </div>
         {if findModule('templates', 'labels')}
            <div class="col-xs-12">
               <div class="wpj-form-group">
                  <label>Label</label>
                  {print_select name='data[label]' var=$cfg.Modules.templates.labels selected=$body.data.label}
               </div>
            </div>
         {/if}
      </div>
   </div>

   <div id="flapTemplatesList" class="tab-pane fade in boxFlex box">
      <div class="row boxFlex box">
         <iframe class='on-demand boxFlex' src="" data-src="launch.php?s=list.php&amp;type=templates&amp;id_category={$body.data.id}&amp;sortable='true'"></iframe>
      </div>
   </div>
{/block}
