]> git.agnieray.net Git - galette.git/blob - galette/templates/default/traduire_libelles.tpl
02833973e9871170761c493d940ec94267eeb933
[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 </p>
15 </form>
16 {/if}
17
18 <form action="{path_for name="editDynamicTranslation"}" method="post" enctype="multipart/form-data">
19 {if not $exists}
20 <p class="right">
21 <span>{_T string="Original text: '%s'" pattern='/%s/' replace=$text_orig|escape}</span>
22 <input type="hidden" name="new" value="true"/>
23 </p>
24 {/if}
25 <fieldset class="cssform">
26 <legend class="ui-state-active ui-corner-top">{_T string="Translation of '%s' label" pattern="/%s/" replace=$text_orig|escape}</legend>
27 {section name="lang" loop=$trans}
28 <p>
29 <label for="text_trans_{$trans[lang].key}" class="bline">{$trans[lang].name}</label>
30 <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}"/>
31 <input type=hidden name="text_orig" value="{$text_orig|escape}"/>
32 </p>
33 {/section}
34 </fieldset>
35 </div>
36 <div class="button-container">
37 <button type="submit" name="trans" class="action">
38 <i class="fas fa-save fa-fw"></i> {_T string="Save"}
39 </button>
40 </div>
41 </form>
42 {else}
43 <p>{_T string="No fields to translate."}</p>
44 {/if}
45 {/block}
46
47 {block name="javascripts"}
48 {if $exists}
49 <script type="text/javascript">
50 $('#text_orig').change(function(e) {
51 e.preventDefault();
52 var _selected = $('#text_orig option:selected').val();
53 var _form = $('#select_orig');
54 _form.attr('action', _form.attr('action') + '/' + _selected)
55 $('#select_orig').submit();
56 });
57 </script>
58 {/if}
59 {/block}