]> git.agnieray.net Git - galette.git/blob - galette/templates/default/traduire_libelles.tpl
Various fixes
[galette.git] / galette / templates / default / traduire_libelles.tpl
1 {extends file="page.tpl"}
2
3 {block name="content"}
4 {if isset($trans) && $trans|@count > 0}
5 <div clasis="bigtable">
6 {if $exists}
7 <form action="{path_for name="dynamicTranslations"}" method="get" enctype="multipart/form-data" id="select_orig">
8 <p class="right">
9 <label for="text_orig">{_T string="Choose label to translate"}</label>
10 <select name="text_orig" id="text_orig">
11 {html_options values=$orig output=$orig selected=$text_orig}
12 </select>
13 <noscript> <span><input type="submit" value="{_T string="Change"}" /></span></noscript>
14 {include file="forms_types/csrf.tpl"}
15 </p>
16 </form>
17 {/if}
18
19 <form action="{path_for name="editDynamicTranslation"}" method="post" enctype="multipart/form-data">
20 {if not $exists}
21 <p class="right">
22 <span>{_T string="Original text: '%s'" pattern='/%s/' replace=$text_orig|escape}</span>
23 <input type="hidden" name="new" value="true"/>
24 </p>
25 {/if}
26 <fieldset class="cssform">
27 <legend class="ui-state-active ui-corner-top">{_T string="Translation of '%s' label" pattern="/%s/" replace=$text_orig|escape}</legend>
28 {section name="lang" loop=$trans}
29 <p>
30 <label for="text_trans_{$trans[lang].key}" class="bline">{$trans[lang].name}</label>
31 <input type="text" name="text_trans_{$trans[lang].key}" id="text_trans_{$trans[lang].key}" value="{if $trans[lang].text}{$trans[lang].text|escape}{/if}"/>
32 <input type=hidden name="text_orig" value="{$text_orig|escape}"/>
33 </p>
34 {/section}
35 </fieldset>
36 </div>
37 <div class="button-container">
38 <button type="submit" name="trans" class="action">
39 <i class="fas fa-save fa-fw"></i> {_T string="Save"}
40 </button>
41 {include file="forms_types/csrf.tpl"}
42 </div>
43 </form>
44 {else}
45 <p>{_T string="No fields to translate."}</p>
46 {/if}
47 {/block}
48
49 {block name="javascripts"}
50 {if isset($trans) && $trans|@count > 0}
51 {if $exists}
52 <script type="text/javascript">
53 $('#text_orig').change(function(e) {
54 e.preventDefault();
55 var _selected = $('#text_orig option:selected').val();
56 var _form = $('#select_orig');
57 _form.attr('action', _form.attr('action') + '/' + _selected)
58 $('#select_orig').submit();
59 });
60 </script>
61 {/if}
62 {/if}
63 {/block}