/
edit.html.twig
71 lines (70 loc) · 3.65 KB
/
edit.html.twig
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
{{ pageAddAsset('javascript', zasset('@ZikulaCategoriesModule:js/ZikulaCategoriesModule.Category.Edit.js')) }}
{% form_theme form with [
'ZikulaFormExtensionBundle:Form:bootstrap_3_zikula_admin_layout.html.twig',
'ZikulaFormExtensionBundle:Form:form_div_layout.html.twig'
] %}
{{ form_start(form) }}
{{ form_errors(form) }}
<fieldset>
<legend>{{ __("Basic properties") }}</legend>
{{ form_row(form.name) }}
{{ form_row(form.parent) }}
{{ form_row(form.is_locked) }}
{{ form_row(form.is_leaf) }}
{{ form_row(form.value) }}
{{ form_row(form.status) }}
</fieldset>
<fieldset>
<legend>{{ __('Localized output') }}</legend>
<div class="zikula-bootstrap-tab-container">
<ul class="nav nav-tabs" role="tablist">
{% for name, code in locales %}
<li role="presentation"{% if code == app.request.locale %} class="active"{% endif %}><a href="#{{ code }}" aria-controls="{{ code }}" role="tab" data-toggle="tab">{{ name }}</a></li>
{% endfor %}
</ul>
<div class="tab-content">
{% for name, code in locales %}
<div role="tabpanel" class="tab-pane{% if code == app.request.locale %} active{% endif %}" id="{{ code }}">
{{ form_row(form.display_name[code], {label: form.display_name.vars.label ~ ' (' ~ code ~ ')' }) }}
{{ form_row(form.display_desc[code], {label: form.display_desc.vars.label ~ ' (' ~ code ~ ')' }) }}
</div>
{% endfor %}
</div>
</div>
</fieldset>
<fieldset>
<legend><a href="#category-attributes" data-toggle="collapse">{{ __('Attributes') }} <i class="fa fa-expand"></i></a></legend>
<div class="collapse" id="category-attributes">
<p><button id="add-another-attribute" class="btn btn-success btn-sm"><i class="fa fa-plus"></i> {{ __('Add attribute') }}</button></p>
<table class="table table-bordered table-striped">
<colgroup>
<col id="cName" />
<col id="cValue" />
<col id="cActions" />
</colgroup>
<thead>
<tr>
<th id="hName" scope="col">{{ __('Name') }}</th>
<th id="hValue" scope="col">{{ __('Value') }}</th>
<th id="hActions" scope="col"> </th>
</tr>
</thead>
<tbody id="attribute-table" data-prototype="<td headers="hName">{{ form_widget(form.attributes.vars.prototype.name)|e }}</td><td headers="hValue">{{ form_widget(form.attributes.vars.prototype.value)|e }}</td><td headers="hActions"><a href="#" class="category_attributes_remove" title="Delete"><i class="fa fa-minus-square fa-lg text-danger"></i></a></td>">
{% for attribute in form.attributes %}
<tr>
<td headers="hName">{{ form_widget(attribute.name) }}</td>
<td headers="hValue">{{ form_widget(attribute.value) }}</td>
<td headers="hActions"><a href="#" class="category_attributes_remove" title="{{ __('Delete') }}"><i class="fa fa-minus-square fa-lg text-danger"></i></a></td>
</tr>
{% endfor %}
<div class="hidden">{# hack to hide 'leftover' label #}{{ form_row(form.attributes) }}</div>
</tbody>
</table>
</div>
</fieldset>
{{ form_row(form.attributes) }}
{{ form_end(form) }}
<script type="text/javascript">
// used in @ZikulaCategoriesModule:js/ZikulaCategoriesModule.Category.Edit.js
var attributeCount = '{{ form.attributes|length }}';
</script>