-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-edit.html
More file actions
219 lines (180 loc) · 12.7 KB
/
Copy pathtemplate-edit.html
File metadata and controls
219 lines (180 loc) · 12.7 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'configuration'}
{/block}
{block name="page-title"}{intl l='Edit a template'}{/block}
{block name="check-resource"}admin.configuration.template{/block}
{block name="check-access"}update{/block}
{block name="main-content"}
<div class="templates edit-template">
<div id="wrapper" class="container">
{loop name="template_edit" type="product-template" id="$template_id" backend_context="1" lang="$edit_language_id"}
<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/templates'}">{intl l="Templates"}</a></li>
<li>{intl l='Editing template "%name"' name={$NAME}}</li>
</ul>
{hook name="template-edit.top" template_id=$template_id}
<div class="row">
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-12 title title-without-tabs">
{intl l='Edit template "%name"' name={$NAME}}
</div>
<div class="form-container">
<div class="col-md-12">
{form name="thelia.admin.template.modification"}
<form method="POST" action="{url path='/admin/configuration/templates/save'}" {form_enctype} class="clearfix">
{* Be sure to get the template ID, even if the form could not be validated *}
<input type="hidden" name="template_id" value="{$template_id}" />
{include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/configuration/templates'}"}
{form_hidden_fields}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/templates'}" />
{/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='name'}
<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}" required="required" name="{$name}" value="{$value}" title="{intl l='Template name'}" placeholder="{intl l='Template name'}" class="form-control">
</div>
{/form_field}
</form>
{/form}
</div>
</div>
</div>
<div class="row">
<div class="form-container">
<div class="col-md-6">
<div class="well well-sm">
<p class="title title-without-tabs">
<a href="{url path='/admin/configuration/attributes'}">{intl l='Attributes'}</a>
</p>
<p>{intl l="Manage attributes included in this product template"}</p>
<div id="attribute_list_management">
<div class="loading"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<p class="title title-without-tabs">
<a href="{url path='/admin/configuration/features'}">{intl l='Features'}</a>
</p>
<p>{intl l="Manage features included in this product template"}</p>
<div id="feature_list_management">
<div class="loading"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
{$max_products = {$smarty.get.p|default:50}}
{$total = {count type="product" backend_context=1 visible='*' template_id=$template_id}}
{$not_loaded = $total - $max_products}
<p class="title title-without-tabs">
{intl l='Products using this template (%num)' num=$total}
</p>
{ifloop rel='prod-using'}
<table id="product-list" class="table table-condensed table-striped">
<tr>
<th>{intl l="ID"}</th>
<th>{intl l="Reference"}</th>
<th>{intl l="Title"}</th>
</tr>
{loop type="product" name="prod-using" backend_context=1 visible='*' template_id=$template_id limit=$max_products order='ref'}
{$url = {url path="/admin/products/update" product_id=$ID}}
<tr>
<td><a href="{$url}">{$ID}</a></td>
<td><a href="{$url}">{$REF}</a></td>
<td>{$TITLE}</td>
</tr>
{/loop}
</table>
{if $total > $max_products}
<p class="text-center">
<a href="{navigate to="current" p=$total}#product-list">{intl l="Showing %loaded products. Click here to load the %remaining other products" loaded=$max_products remaining=$not_loaded}</a>
</p>
{/if}
{/ifloop}
{elseloop rel='prod-using'}
<div class="alert alert-info">
{intl l='This template is not used by any product.'}
</div>
{/elseloop}
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
{$max_categories = {$smarty.get.c|default:50}}
{$total = {count type="category" name="cat-using" backend_context=1 visible='*' template_id=$template_id}}
{$not_loaded = $total - $max_categories}
<p class="title title-without-tabs">
{intl l='Is the default template for categories (%num)' num={count type="category" backend_context=1 visible='*' template_id=$template_id}}
</p>
{ifloop rel='cat-using'}
<table id="category-list" class="table table-condensed table-striped">
<tr>
<th>{intl l="ID"}</th>
<th>{intl l="Title"}</th>
</tr>
{loop type="category" name="cat-using" backend_context=1 visible='*' template_id=$template_id limit=$loaded_categories order='alpha'}
{$url = {url path="/admin/categories/update" category_id=$ID}}
<tr>
<td><a href="{$url}">{$ID}</a></td>
<td><a href="{$url}">{$TITLE}</a></td>
</tr>
{/loop}
</table>
{if $total > $max_categories}
<p class="text-center">
<a href="{navigate to="current" p=$total}#category-list">{intl l="Showing %loaded categories. Click here to load the %remaining other categories" loaded=$max_categories remaining=$not_loaded}</a>
</p>
{/if}
{/ifloop}
{elseloop rel='cat-using'}
<div class="alert alert-info">
{intl l='No categories are using this template as the default.'}
</div>
{/elseloop}
</div>
</div>
</div>
</div>
</div>
{hook name="template-edit.bottom" template_id=$template_id}
{/loop}
{elseloop rel="template_edit"}
<div class="row">
<div class="col-md-12">
<div class="alert alert-error">
{intl l="Sorry, template ID=%id was not found." id={$template_id}}
</div>
</div>
</div>
{/elseloop}
</div>
</div>
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(function() {
$('#feature_list_management').load("{url noamp='1' path='/admin/configuration/templates/features/list' template_id=$template_id}");
$('#attribute_list_management').load("{url noamp='1' path='/admin/configuration/templates/attributes/list' template_id=$template_id}");
});
</script>
{/block}
{block name="javascript-last-call"}
{hook name="template.edit-js" location="template-edit-js" }
{/block}