{extends "[shared]/windowFrame.tpl"}

{block content}
   <div id="flapStoresLocations" class="tab-pane fade boxStatic">
      <div class="row bottom-space">
         <div class="col-md-12">
            <h1 class="h4 main-panel-title">{'warehouseLocationAssignment'|translate:'storesLocationsTab'}</h1>
         </div>
      </div>
      <div class="form-group" id="locations">
         <div class="col-md-2 control-label">
            <label>{'locations'|translate:'storesLocationsTab'}</label>
         </div>
         <div class="col-md-8">
            <select multiple="multiple"
                    class="selecter selecter-sortable"
                    data-autocomplete="warehouse_locations"
                    data-preload="warehouse_locations"
                    data-placeholder="{'selectLocation'|translate:"storesLocationsTab"}"
                    name="data[data][warehouse_locations][]">
                {foreach $body.data.data.warehouse_locations as $location}
                   <option value="{$location}" selected>{$location}</option>
                {/foreach}
            </select>
         </div>
      </div>
      <div class="form-group">
             <div class="col-md-2 control-label two-lines"><label>{'base_position'|translate}</label></div>
             <div class="col-md-6">
                 {print_select name="data[id_base_position]" var=$body.base_positions selected=$body.data.id_base_position}
             </div>
         </div>
      <div class="form-group">
          <div class="col-md-2 control-label"><label>{'return_table_position'|translate}</label></div>
          <div class="col-md-6">
              {print_select name="data[id_return_table]" var=$body.base_positions selected=$body.data.id_return_table}
          </div>
      </div>
   </div>
   <script type="application/javascript">
      initForm({
         selector: '#locations',
         beforeAdd: function (original) {
            var $item = original();
            window.preloadAutocompletes($item);
         },
      });
   </script>
{/block}
