{extends "[shared]window/sections.tpl"}

{block "custom-data"}
{/block}

{block "sections-own-fields"}
   <div class="form-group">
      <div class="col-md-2 control-label">
         <label>Produkt v menu</label>
      </div>
      <div class="col-md-9">
         <select id="productInMenu" name="data[data][products][]" class="selecter" data-type="ProductId" data-preload="products"
                 data-autocomplete="products">
            {foreach $body.data.data.products as $product}
               <option value="{$product}" selected>{$product}</option>
            {/foreach}
         </select>
      </div>
      <div class="col-md-1">
         <button onclick="document.getElementById('productInMenu').selectedIndex=-1;document.getElementById('productInMenu_chosen').getElementsByClassName('chosen-single')[0].textContent=null; return false;"
                 type="button" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i></button>
      </div>
   </div>

   <div class="form-group">
      <div class="col-md-2 control-label"><label>Výběr parametru</label></div>
      <div class="col-md-3">
         <select id="parameters" name="data[data][parameter]" class="selecter" data-type="ParameterId" data-preload="ParametersValuesOnly" data-autocomplete="parametersListValuesByParameter">
            <option value=""{if !$body.data.data.parameter} selected{/if}></option>
             {foreach $body.parameters as $parameter}
                <option value="{$parameter.id}"{if $body.data.data.parameter == $parameter.id}selected{/if}>{$parameter.name}{$unit = $parameter.unit|replace:'|':', '}
                    {if $unit != ""}
                       [{$unit}]
                    {/if}
                </option>
             {/foreach}
         </select>
      </div>
   </div>
   <div class="form-group">
      <div class="col-md-2 control-label">
         <label>Skrýt na B2C</label>
      </div>
      <div class="col-md-3">
         {print_toggle name="data][hide_B2C]" value=$body.data.data.hide_B2C|default:false}
      </div>
   </div>
   <div class="form-group">
      <div class="col-md-2 control-label">
         <label>Skrýt na B2B</label>
      </div>
      <div class="col-md-3">
         {print_toggle name="data][hide_B2B]" value=$body.data.data.hide_B2B|default:false}
      </div>
   </div>
{/block}
