]> git.agnieray.net Git - galette.git/blob - galette/templates/default/elements/edit_dynamic_fields.html.twig
Some slight accessibility related improvements
[galette.git] / galette / templates / default / elements / edit_dynamic_fields.html.twig
1 <div class="ui basic fitted segment">
2 <a
3 href="{{ url_for('addDynamicField', {'form_name': form_name}) }}"
4 class="ui labeled icon button addfield"
5 >
6 <i class="plus green icon" aria-hidden="true"></i>
7 {{ _T("Add") }}
8 </a>
9 </div>
10 <div class="ui basic fitted segment loader_selector">
11 <table class="listing ui celled striped table">
12 <thead>
13 <tr>
14 <th class="id_row">#</th>
15 <th>{{ _T("Name") }}</th>
16 <th>{{ _T("Permissions") }}</th>
17 <th class="date_row">{{ _T("Type") }}</th>
18 <th class="date_row">{{ _T("Required") }}</th>
19 <th>{{ _T("Actions") }}</th>
20 </tr>
21 </thead>
22 <tbody>
23 {% for field in fields_list %}
24 <tr>
25 <td>{{ field.getIndex() }}</td>
26 <td class="left">{{ field.getName()|escape }}</td>
27 <td class="left">{{ field.getPermName() }}</td>
28 <td class="left">{{ field.getTypeName() }}</td>
29 <td>
30 {% if field.getType != 0 %}
31 {% if field.isRequired() %}{{ _T("Yes") }}{% else %}{{ _T("No") }}{% endif %}
32 {% endif %}
33 </td>
34 <td class="center actions_row">
35 <a
36 href="{{ url_for('editDynamicField', {'form_name': form_name, 'id': field.getId()}) }}"
37 class="action single-edit"
38 >
39 <i class="ui user edit blue icon tooltip" aria-hidden="true"></i>
40 <span class="ui special popup">{{ _T("Edit '%s' field")|replace({'%s': field.getName()}) }}</span>
41 </a>
42 <a
43 href="{{ url_for('dynamicTranslations', {'text_orig': field.getName(false)}) }}"
44 class="action single-translate"
45 >
46 <i class="ui language grey icon tooltip" aria-hidden="true"></i>
47 <span class="ui special popup">{{ _T("Translate '%s' field")|replace({'%s': field.getName()}) }}</span>
48 </a>
49 <a
50 href="{{ url_for('removeDynamicField', {'form_name': form_name, 'id': field.getId()}) }}"
51 class="delete"
52 >
53 <i class="ui trash red icon tooltip" aria-hidden="true"></i>
54 <span class="ui special popup">{{ _T("Delete '%s' field")|replace({'%s': field.getName()}) }}</span>
55 </a>
56 {% if field.getIndex() == 1 %}
57 <i class="ui icon">&nbsp;</i>
58 {% else %}
59 <a
60 href="{{ url_for('moveDynamicField', {'form_name': form_name, 'direction': 'up', 'id': field.getId()}) }}"
61 >
62 <i class="ui caret up grey icon tooltip" aria-hidden="true"></i>
63 <span class="ui special popup">{{ _T("Move up '%s' field")|replace({'%s': field.getName()}) }}</span>
64 </a>
65 {% endif %}
66 {% if field.getIndex() == fields_list|length %}
67 <i class="ui icon">&nbsp;</i>
68 {% else %}
69 <a
70 href="{{ url_for('moveDynamicField', {'form_name': form_name, 'direction': 'down', 'id': field.getId()}) }}"
71 >
72 <i class="ui caret down grey icon tooltip" aria-hidden="true"></i>
73 <span class="ui special popup">{{ _T("Move down '%s' field")|replace({'%s': field.getName()}) }}</span>
74 </a>
75 {% endif %}
76 </td>
77 </tr>
78 {% else %}
79 <tr>
80 <td colspan="7">
81 {{ _T("There is not yet any dynamic field configured for '%formname'")|replace({'%formname': form_title}) }}
82 </td>
83 </tr>
84 {% endfor %}
85 </tbody>
86 </table>
87 </div>
88 <script type="text/javascript">
89 {% include "elements/js/removal.js.twig" with {
90 single_action: "true"
91 } %}
92 </script>