]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/configuration_payment_types.html.twig
Some slight accessibility related improvements
[galette.git] / galette / templates / default / pages / configuration_payment_types.html.twig
1 {% extends 'page.html.twig' %}
2
3 {% block content %}
4 <form action="{{ url_for('paymentTypes') }}" 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("Name") }}</th>
11 <th>{{ _T("Actions") }}</th>
12 </tr>
13 </thead>
14 <tfoot>
15 <tr>
16 <td data-scope="row">
17 <span class="displaynone">
18 {{ _T("Add payment type") }}
19 </span>
20 </td>
21 <td class="left" data-title="{{ _T("Label") }}">
22 <div class="required field">
23 <label for="name" class="displaynone">{{ _T("Name") }}</label>
24 <input size="20" type="text" name="name" required="required"/>
25 </div>
26 </td>
27 <td class="center actions_row">
28 <input type="hidden" name="new" value="1" />
29 <button type="submit" name="valid" class="ui labeled icon button">
30 <i class="plus green icon" aria-disabled="true"></i>
31 {{ _T("Add") }}
32 </button>
33 </td>
34 </tr>
35 </tfoot>
36 <tbody>
37 {% for ptype in list %}
38 <tr>
39 <td data-scope="row">
40 {% if preferences.pref_show_id %}
41 {{ ptype.__get('id') }}
42 {% else %}
43 {{ loop.index }}
44 {% endif %}
45 <span class="displaynone">
46 <a href="{{ url_for('editPaymentType', {'id': ptype.__get('id')}) }}">
47 {{ _T("%s payment type")|replace({'%s': ptype.getName()}) }}
48 </a>
49 </span>
50 </td>
51 <td class="left" data-title="{{ _T("Name") }}">{{ ptype.getName() }}</td>
52 <td class="center actions_row">
53 <a
54 href="{{ url_for('editPaymentType', {'id': ptype.__get('id')}) }}"
55 class="action single-edit"
56 >
57 <i class="ui edit icon tooltip" aria-hidden="true"></i>
58 <span class="ui special popup">{{ _T("Edit '%s' payment type")|replace({'%s': ptype.getName()}) }}</span>
59 </a>
60 <a
61 href="{{ url_for('dynamicTranslations', {'text_orig': ptype.getName(false)|escape}) }}"
62 class="action single-translate"
63 >
64 <i class="ui language grey icon tooltip" aria-hidden="true"></i>
65 <span class="ui special popup">{{ _T("Translate '%s'")|replace({'%s': ptype.getName()}) }}</span>
66 </a>
67 {% if ptype.isSystemType() %}
68 <i class="ui icon">&nbsp;</i>
69 {% else %}
70 <a
71 href="{{ url_for('removePaymentType', {'id': ptype.__get('id')}) }}"
72 class="delete"
73 >
74 <i class="ui trash red icon tooltip" aria-hidden="true"></i>
75 <span class="ui special popup">{{ _T("Delete '%s' payment type")|replace({'%s': ptype.getName()}) }}</span>
76 </a>
77 {% endif %}
78 </td>
79 </tr>
80 {% endfor %}
81 </tbody>
82 </table>
83 </div>
84 {% include 'components/forms/csrf.html.twig' %}
85 </form>
86 {% endblock %}
87
88 {% block javascripts %}
89 <script type="text/javascript">
90 $(function() {
91 {% set modal_onapprove = "
92 $('.modal-form form #redirect_uri').val(window.location.href);
93 $('.modal-form form').submit();
94 " %}
95
96 {% include "elements/js/modal_action.js.twig" with {
97 selector: ".single-edit",
98 modal_title_twig: _T("Edit payment type")|e("js"),
99 modal_class: "mini",
100 modal_onapprove: modal_onapprove
101 } %}
102
103 {% set extra_success = "
104 $('.modal-form form').on('submit', function(event) {
105 event.preventDefault();
106 var _form = $(this);
107 var _data = _form.serialize();
108 $.ajax({
109 url: _form.attr('action'),
110 type: 'POST',
111 datatype: 'json',
112 data: _data,
113 error: function() {
114 $.modal({
115 title: '%error%',
116 class: 'mini',
117 actions: [{
118 text: '%close%',
119 icon: 'times',
120 class: 'icon labeled cancel'
121 }],
122 className: {
123 modal: 'ui redalert modal',
124 title: 'center aligned header',
125 content: 'center aligned content',
126 actions: 'center aligned actions'
127 }
128 }).modal('show');
129 }
130 });
131 });
132 " %}
133 {% include "elements/js/modal_action.js.twig" with {
134 selector: ".single-translate",
135 extra_success: extra_success|replace({'%error%': _T("An error occurred :(")|e("js"), '%close%': _T("Close")|e("js")}),
136 modal_title_twig: _T("Translate labels")|e("js"),
137 modal_content_class: "scrolling",
138 modal_onapprove: modal_onapprove
139 } %}
140
141 {% include "elements/js/removal.js.twig" with {
142 single_action: "true"
143 } %}
144 });
145 </script>
146 {% endblock %}