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