]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/configuration_dynamic_translations.html.twig
Fix keyboard navigation accessibility
[galette.git] / galette / templates / default / pages / configuration_dynamic_translations.html.twig
1 {% extends (mode == 'ajax') ? "ajax.html.twig" : "page.html.twig" %}
2
3 {% block content %}
4 {% if trans is defined and trans|length > 0 %}
5 {% if exists and mode != 'ajax' %}
6 <div class="ui top attached accordion-styled header">
7 {{ _T("Choose label to translate") }}
8 </div>
9 <div class="ui bottom attached accordion-styled segment">
10 <form action="{{ url_for('dynamicTranslations') }}" method="get" enctype="multipart/form-data" id="select_orig" class="ui form">
11 <div class="inline field">
12 <div class="ui dropdown selection autosubmit">
13 <input type="hidden" name="text_orig" value="{{ text_orig }}">
14 <i class="dropdown icon"></i>
15 <div class="text">{{ text_orig }}</div>
16 <div class="menu">
17 {% for value in orig %}
18 <div class="item{% if value == text_orig %} active selected {% endif %}" data-value="{{ value }}">{{ value }}</div>
19 {% endfor %}
20 </div>
21 </div>
22 {% include "components/forms/csrf.html.twig" %}
23 </div>
24 </form>
25 </div>
26 {% endif %}
27
28 <form action="{{ url_for('editDynamicTranslation') }}" method="post" enctype="multipart/form-data" class="ui equal width form">
29 {% if not exists %}
30 <div class="field">
31 <label>{{ _T("Original text: '%s'")|replace({'%s': text_orig|escape}) }}</label>
32 <input type="hidden" name="new" value="true"/>
33 </div>
34 {% endif %}
35 <div class="ui top attached accordion-styled header">
36 {{ _T("Translation of '%s' label")|replace({'%s': text_orig}) }}
37 </div>
38 <div class="ui bottom attached accordion-styled segment">
39 <div class="active content field">
40 <table class="ui striped table">
41 {% for k, text in trans %}
42 <tr>
43 <td class="three wide"><label for="text_trans_{{ text.key }}">{{ text.name }}</label></td>
44 <td class="thirteen wide">
45 <input type="text" name="text_trans_{{ text.key }}" id="text_trans_{{ text.key }}" value="{% if text.text %}{{ text.text|escape }}{% endif %}"/>
46 </td>
47 </tr>
48 {% endfor %}
49 </table>
50 <input type=hidden name="text_orig" value="{{ text_orig|escape }}"/>
51 </div>
52 </div>
53 {% if mode != 'ajax' %}
54 <div class="ui basic center aligned segment">
55 <button type="submit" name="trans" class="ui labeled icon primary button action">
56 <i class="save icon" aria-hidden="true"></i> {{ _T("Save") }}
57 </button>
58 </div>
59 {% else %}
60 <input type="hidden" name="trans" id="trans" value="true"/>
61 <input type="hidden" name="redirect_uri" id="redirect_uri" value=""/>
62 {% endif %}
63 {% include "components/forms/csrf.html.twig" %}
64 </form>
65 {% else %}
66 <p>{{ _T("No fields to translate.") }}</p>
67 {% endif %}
68 {% endblock %}