-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtax-edit.html
169 lines (127 loc) · 7.76 KB
/
tax-edit.html
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
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'configuration'}
{/block}
{block name="page-title"}{intl l='Edit a tax'}{/block}
{block name="check-resource"}admin.configuration.tax{/block}
{block name="check-access"}update{/block}
{block name="main-content"}
<div class="taxes-rules edit-taxes-rules">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/taxes_rules'}">{intl l="Taxes"}</a></li>
<li>{intl l='Editing tax'}</li>
</ul>
{loop type="tax" name="tax" id=$tax_id backend_context="1" lang=$edit_language_id}
{hook name="tax-edit.top" tax_id=$tax_id}
<div class="row">
<div class="col-md-12 general-block-decorator clearfix">
<div class="form-container">
{form name="thelia.admin.tax.modification"}
<form method="POST" action="{url path="/admin/configuration/taxes/save"}" {form_enctype} >
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
page_url = {url path="/admin/configuration/taxes/update/%id" id=$tax_id}
close_url = {url path="/admin/configuration/taxes_rules"}
}
{* Be sure to get the product ID, even if the form could not be validated *}
<input type="hidden" name="tax_id" value="{$ID}" />
{form_hidden_fields}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/taxes_rules"}" />
{/form_field}
{form_field field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{form_field field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $form_error}{$value}{else}{if $IS_TRANSLATED == 1}{$TITLE}{/if}{/if}">
</div>
{/form_field}
{form_field field='description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
<span class="label-help-block">{intl l="The detailed description."}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $form_error}{$value}{else}{if $IS_TRANSLATED == 1}{$DESCRIPTION}{/if}{/if}</textarea>
</div>
{/form_field}
{form_field field='type'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<div class="form-group">
<select name="{$name}" class="js-change-tax-type" data-toggle="selectpicker">
{foreach $choices as $choice}
<option value="{$choice->value}" {if !$form_error && $choice->value == $ESCAPED_TYPE || $form_error && $choice->value == $value}selected="selected" {/if}>{$choice->label}</option>
{/foreach}
</select>
</div>
</div>
{$typeValue = $value}
{/form_field}
{form_tagged_fields tag='requirements'}
<div class="form-group {if $error}has-error{/if} js-tax-requirements" data-tax-type="{$attr_list.tax_type}" {if !$form_error && $attr_list.tax_type != $ESCAPED_TYPE || $form_error && $attr_list.tax_type != $typeValue}style="display: none"{/if}>
<label for="{$label_attr.for}" class="control-label">
{$label}
</label>
{if $formType == 'choice'}
<select name="{$name}" data-toggle="selectpicker" {if !$form_error && $attr_list.tax_type != $ESCAPED_TYPE || $form_error && $attr_list.tax_type != $typeValue}disabled="disabled"{/if}>
{foreach $choices as $choice}
<option value="{$choice->value}" {if !$form_error && $REQUIREMENTS[$label_attr.type] == $choice->value || $form_error && $value == $choice->value}selected="selected" {/if}>{$choice->label}</option>
{/foreach}
</select>
{/if}
{if $formType == 'text'}
<input type="text" {if !$form_error && $attr_list.tax_type != $ESCAPED_TYPE || $form_error && $attr_list.tax_type != $typeValue}disabled="disabled"{/if} id="{$label_attr.for}" name="{$name}" required="required" class="form-control" value="{if $form_error}{$value}{else}{$REQUIREMENTS[$label_attr.type]}{/if}">
{/if}
</div>
{/form_tagged_fields}
<div class="row">
<div class="col-md-12">
<div class="control-group">
<label> </label>
<div class="controls">
<p>{intl l='Tax created on %date_create. Last modification: %date_change' date_create={format_date date=$CREATE_DATE} date_change={format_date date=$UPDATE_DATE}}</p>
</div>
</div>
</div>
</div>
</form>
{/form}
</div>
</div>
</div>
{hook name="tax-edit.bottom" tax_id=$tax_id}
{/loop}
</div>
</div>
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
<script src='{$asset_url}'></script>
{/javascripts}
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(function() {
$('.js-change-tax-type').change(function(e){
$('.js-tax-requirements').children('select, input').attr('disabled', true);
$('.js-tax-requirements').hide();
$('.js-tax-requirements[data-tax-type="' + $(this).val() + '"]').children('select, input').attr('disabled', false);
$('.js-tax-requirements[data-tax-type="' + $(this).val() + '"]').children('select').selectpicker("refresh");
$('.js-tax-requirements[data-tax-type="' + $(this).val() + '"]').show();
});
});
</script>
{/block}
{block name="javascript-last-call"}
{hook name="tax.edit-js" location="tax-edit-js" }
{hook name="wysiwyg.js" location="wysiwyg-tax-edit-js" }
{/block}