shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

tax_class_form.twig (7941B)


      1 {{ header }}{{ column_left }}
      2 <div id="content">
      3   <div class="page-header">
      4     <div class="container-fluid">
      5       <div class="pull-right">
      6         <button type="submit" form="form-tax-class" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
      7         <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      8       <h1>{{ heading_title }}</h1>
      9       <ul class="breadcrumb">
     10         {% for breadcrumb in breadcrumbs %}
     11         <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
     12         {% endfor %}
     13       </ul>
     14     </div>
     15   </div>
     16   <div class="container-fluid"> {% if error_warning %}
     17     <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
     18       <button type="button" class="close" data-dismiss="alert">&times;</button>
     19     </div>
     20     {% endif %}
     21     <div class="panel panel-default">
     22       <div class="panel-heading">
     23         <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
     24       </div>
     25       <div class="panel-body">
     26         <form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal" id="form-tax-class">
     27           <fieldset>
     28             <legend>{{ text_tax_class }}</legend>
     29             <div class="form-group required">
     30               <label class="col-sm-2 control-label" for="input-title">{{ entry_title }}</label>
     31               <div class="col-sm-10">
     32                 <input type="text" name="title" value="{{ title }}" placeholder="{{ entry_title }}" id="input-title" class="form-control" />
     33                 {% if error_title %}
     34                 <div class="text-danger">{{ error_title }}</div>
     35                 {% endif %} </div>
     36             </div>
     37             <div class="form-group required">
     38               <label class="col-sm-2 control-label" for="input-description">{{ entry_description }}</label>
     39               <div class="col-sm-10">
     40                 <input type="text" name="description" value="{{ description }}" placeholder="{{ entry_description }}" id="input-description" class="form-control" />
     41                 {% if error_description %}
     42                 <div class="text-danger">{{ error_description }}</div>
     43                 {% endif %} </div>
     44             </div>
     45           </fieldset>
     46           <fieldset>
     47             <legend>{{ text_tax_rate }}</legend>
     48             <table id="tax-rule" class="table table-striped table-bordered table-hover">
     49               <thead>
     50                 <tr>
     51                   <td class="text-left">{{ entry_rate }}</td>
     52                   <td class="text-left">{{ entry_based }}</td>
     53                   <td class="text-left">{{ entry_priority }}</td>
     54                   <td></td>
     55                 </tr>
     56               </thead>
     57               <tbody>
     58               
     59               {% set tax_rule_row = 0 %}
     60               {% for tax_rule in tax_rules %}
     61               <tr id="tax-rule-row{{ tax_rule_row }}">
     62                 <td class="text-left"><select name="tax_rule[{{ tax_rule_row }}][tax_rate_id]" class="form-control">
     63                     
     64                     
     65                     {% for tax_rate in tax_rates %}
     66                     {% if tax_rate.tax_rate_id == tax_rule.tax_rate_id %}
     67                     
     68                     
     69                     <option value="{{ tax_rate.tax_rate_id }}" selected="selected">{{ tax_rate.name }}</option>
     70                     
     71                     
     72                     {% else %}
     73                     
     74                     
     75                     <option value="{{ tax_rate.tax_rate_id }}">{{ tax_rate.name }}</option>
     76                     
     77                     
     78                     {% endif %}
     79                     {% endfor %}
     80                   
     81                   
     82                   </select></td>
     83                 <td class="text-left"><select name="tax_rule[{{ tax_rule_row }}][based]" class="form-control">
     84                     
     85                     
     86                     {% if tax_rule.based == 'shipping' %}
     87                     
     88                     
     89                     <option value="shipping" selected="selected">{{ text_shipping }}</option>
     90                     
     91                     
     92                     {% else %}
     93                     
     94                     
     95                     <option value="shipping">{{ text_shipping }}</option>
     96                     
     97                     
     98                     {% endif %}
     99                      {% if tax_rule.based == 'payment' %}
    100                     
    101                     
    102                     <option value="payment" selected="selected">{{ text_payment }}</option>
    103                     
    104                     
    105                     {% else %}
    106                     
    107                     
    108                     <option value="payment">{{ text_payment }}</option>
    109                     
    110                     
    111                     {% endif %}
    112                     {% if tax_rule.based == 'store' %}
    113                     
    114                     
    115                     <option value="store" selected="selected">{{ text_store }}</option>
    116                     
    117                     
    118                     {% else %}
    119                     
    120                     
    121                     <option value="store">{{ text_store }}</option>
    122                     
    123                     
    124                     {% endif %}
    125                   
    126                   
    127                   </select></td>
    128                 <td class="text-left"><input type="text" name="tax_rule[{{ tax_rule_row }}][priority]" value="{{ tax_rule.priority }}" placeholder="{{ entry_priority }}" class="form-control" /></td>
    129                 <td class="text-left"><button type="button" onclick="$('#tax-rule-row{{ tax_rule_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
    130               </tr>
    131               {% set tax_rule_row = tax_rule_row + 1 %}
    132               {% endfor %}
    133                 </tbody>
    134               
    135               <tfoot>
    136                 <tr>
    137                   <td colspan="3"></td>
    138                   <td class="text-left"><button type="button" onclick="addRule();" data-toggle="tooltip" title="{{ button_rule_add }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
    139                 </tr>
    140               </tfoot>
    141             </table>
    142           </fieldset>
    143         </form>
    144       </div>
    145     </div>
    146   </div>
    147   <script type="text/javascript"><!--
    148 var tax_rule_row = {{ tax_rule_row }};
    149 
    150 function addRule() {
    151 	html  = '<tr id="tax-rule-row' + tax_rule_row + '">';
    152 	html += '  <td class="text-left"><select name="tax_rule[' + tax_rule_row + '][tax_rate_id]" class="form-control">';
    153     {% for tax_rate in tax_rates %}
    154     html += '    <option value="{{ tax_rate.tax_rate_id }}">{{ tax_rate.name|escape('js') }}</option>';
    155     {% endfor %}
    156     html += '  </select></td>';
    157 	html += '  <td class="text-left"><select name="tax_rule[' + tax_rule_row + '][based]" class="form-control">';
    158     html += '    <option value="shipping">{{ text_shipping }}</option>';
    159     html += '    <option value="payment">{{ text_payment }}</option>';
    160     html += '    <option value="store">{{ text_store }}</option>';
    161     html += '  </select></td>';
    162 	html += '  <td class="text-left"><input type="text" name="tax_rule[' + tax_rule_row + '][priority]" value="" placeholder="{{ entry_priority }}" class="form-control" /></td>';
    163 	html += '  <td class="text-left"><button type="button" onclick="$(\'#tax-rule-row' + tax_rule_row + '\').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
    164 	html += '</tr>';
    165 	
    166 	$('#tax-rule tbody').append(html);
    167 	
    168 	tax_rule_row++;
    169 }
    170 //--></script></div>
    171 {{ footer }}