1 {% extends 'page.html.twig' %}
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">
9 <th class="id_row">#</th>
10 <th>{{ _T("Name") }}</th>
11 <th>{{ _T("Actions") }}</th>
17 <span class="displaynone">
18 {{ _T("Add payment type") }}
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"/>
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>
37 {% for ptype in list %}
40 {% if preferences.pref_show_id %}
41 {{ ptype.__get('id') }}
45 <span class="displaynone">
46 <a href="{{ url_for('editPaymentType', {'id': ptype.__get('id')}) }}">
47 {{ _T("%s payment type")|replace({'%s': ptype.getName()}) }}
51 <td class="left" data-title="{{ _T("Name") }}">{{ ptype.getName() }}</td>
52 <td class="center actions_row">
54 href="{{ url_for('editPaymentType', {'id': ptype.__get('id')}) }}"
55 class="action single-edit"
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>
61 href="{{ url_for('dynamicTranslations', {'text_orig': ptype.getName(false)|escape}) }}"
62 class="action single-translate"
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>
67 {% if ptype.isSystemType() %}
68 <i class="ui icon"> </i>
71 href="{{ url_for('removePaymentType', {'id': ptype.__get('id')}) }}"
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>
84 {% include 'components/forms/csrf.html.twig' %}
88 {% block javascripts %}
89 <script type="text/javascript">
91 {% set modal_onapprove = "
92 $('.modal-form form #redirect_uri').val(window.location.href);
93 $('.modal-form form').submit();
96 {% include "elements/js/modal_action.js.twig" with {
97 selector: ".single-edit",
98 modal_title_twig: _T("Edit payment type")|e("js"),
100 modal_onapprove: modal_onapprove
103 {% set extra_success = "
104 $('.modal-form form').on('submit', function(event) {
105 event.preventDefault();
107 var _data = _form.serialize();
109 url: _form.attr('action'),
120 class: 'icon labeled cancel'
123 modal: 'ui redalert modal',
124 title: 'center aligned header',
125 content: 'center aligned content',
126 actions: 'center aligned actions'
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
141 {% include "elements/js/removal.js.twig" with {
142 single_action: "true"