]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/configuration_titles.html.twig
0aeeabf469384e4138d61ba509c9b17bd4432a83
[galette.git] / galette / templates / default / pages / configuration_titles.html.twig
1 {% extends 'page.html.twig' %}
2
3 {% block content %}
4 <form action="{{ url_for('titles') }}" method="post" enctype="multipart/form-data" class="ui form">
5 <div class="ui basic fitted segment loader_selector">
6 <table class="listing ui celled striped table">
7 <thead>
8 <tr>
9 <th class="id_row">#</th>
10 <th>{{ _T("Short form") }}</th>
11 <th>{{ _T("Long form") }}</th>
12 <th>{{ _T("Actions") }}</th>
13 </tr>
14 </thead>
15 <tfoot>
16 <tr>
17 <td data-scope="row">
18 <span class="visually-hidden">
19 {{ _T("Add title") }}
20 </span>
21 </td>
22 <td class="left" data-title="{{ _T("Short form") }}">
23 <div class="required field">
24 <label for="short_label" class="visually-hidden">{{ _T("Short form") }}</label>
25 <input size="20" type="text" name="short_label" required="required"/>
26 </div>
27 </td>
28 <td class="left" data-title="{{ _T("Long form") }}">
29 <div class="required field">
30 <label for="long_label" class="visually-hidden">{{ _T("Long form") }}</label>
31 <input size="20" type="text" name="long_label" required="required"/>
32 </div>
33 </td>
34 <td class="center actions_row">
35 <input type="hidden" name="new" value="1" />
36 <button type="submit" name="valid" class="ui labeled icon button">
37 <i class="plus green icon" aria-hidden="true"></i>
38 {{ _T("Add") }}
39 </button>
40 </td>
41 </tr>
42 </tfoot>
43 <tbody>
44 {% for title in titles_list %}
45 <tr>
46 <td data-scope="row">
47 {% if preferences.pref_show_id %}
48 {{ title.id }}
49 {% else %}
50 {{ loop.index }}
51 {% endif %}
52 <span class="displaynone">
53 <a href="{{ url_for('editTitle', {'id': title.id}) }}">
54 {{ _T("%s title")|replace({'%s': title.short|escape}) }}
55 </a>
56 </span>
57 </td>
58 <td class="left" data-title="{{ _T("Short form") }}">{{ title.short|escape }}</td>
59 <td class="left" data-title="{{ _T("Long form") }}">{{ title.long|escape }}</td>
60 <td class="center actions_row">
61 <a
62 href="{{ url_for('editTitle', {'id': title.id}) }}"
63 class="action single-edit"
64 >
65 <i class="ui edit icon tooltip" aria-hidden="true"></i>
66 <span class="ui special popup">{{ _T("Edit '%s' title")|replace({'%s': title.short|escape}) }}</span>
67 </a>
68 {% if title.id == 1 or title.id == 2 %}
69 <i class="ui icon">&nbsp;</i>
70 {% else %}
71 <a
72 href="{{ url_for('removeTitle', {'id': title.id}) }}"
73 class="delete "
74 >
75 <i class="ui trash red icon tooltip" aria-hidden="true"></i>
76 <span class="ui special popup">{{ _T("Delete '%s' title")|replace({'%s': title.short|escape}) }}</span>
77 </a>
78 {% endif %}
79 </td>
80 </tr>
81 {% endfor %}
82 </tbody>
83 </table>
84 </div>
85 {% include 'components/forms/csrf.html.twig' %}
86 </form>
87 {% endblock %}
88
89 {% block javascripts %}
90 <script type="text/javascript">
91 $(function() {
92 {% set modal_onapprove = "
93 $('.modal-form form #redirect_uri').val(window.location.href);
94 $('.modal-form form').submit();
95 " %}
96 {% include "elements/js/modal_action.js.twig" with {
97 selector: ".single-edit",
98 modal_title_twig: _T("Edit title")|e("js"),
99 modal_class: "mini",
100 modal_onapprove: modal_onapprove
101 } %}
102
103 {% include "elements/js/removal.js.twig" with {
104 single_action: "true"
105 } %}
106 });
107 </script>
108 {% endblock %}