]> git.agnieray.net Git - galette.git/blob - galette/templates/default/gestion_textes.tpl
Factorize replacements legends display
[galette.git] / galette / templates / default / gestion_textes.tpl
1 {extends file="page.tpl"}
2
3 {block name="content"}
4 <div id="listfilter">
5 <form action="{path_for name="changeText"}" method="post" enctype="multipart/form-data">
6 <strong>{_T string="Choose an entry"}</strong><br/>
7 <label for="sel_lang">{_T string="Language:"}</label>
8 <select name="sel_lang" id="sel_lang" class="lang">
9 {foreach item=langue from=$langlist}
10 <option value="{$langue->getID()}" {if $cur_lang eq $langue->getID()}selected="selected"{/if}>{$langue->getName()}</option>
11 {/foreach}
12 </select>
13
14 <label for="sel_ref">{_T string="Reference:"}</label>
15 <select name="sel_ref" id="sel_ref">
16 {foreach item=ref from=$reflist}
17 <option value="{$ref.tref}" {if $cur_ref eq $ref.tref}selected="selected"{/if} >{$ref.tcomment}</option>
18 {/foreach}
19 </select>
20 <noscript> <span><input type="submit" value="{_T string="Change"}" /></span></noscript>
21 </form>
22 </div>
23
24 <form action="{path_for name="texts"}" method="post" enctype="multipart/form-data">
25 <div class="bigtable">
26 <fieldset class="cssform" id="{$mtxt->tlang}">
27 <legend class="ui-state-active ui-corner-top">{$mtxt->tcomment}</legend>
28 <p>
29 <label for="tsubject" class="bline">{_T string="Email Subject"}</label>
30 <input type="text" name="text_subject" id="tsubject" value="{$mtxt->tsubject}" maxlength="255" size="32"/> <span class="exemple">{_T string="(Max 255 characters)"}</span>
31 </p>
32 <p>
33 <label id="body_label" for="text_body" class="bline vtop">{_T string="Email Body:"}</label>
34 <textarea name="text_body" id="text_body" cols="64" rows="15">{$mtxt->tbody}</textarea>
35 </p>
36 </fieldset>
37 </div>
38 <div class="button-container">
39 <input type="hidden" name="cur_lang" value="{$cur_lang}"/>
40 <input type="hidden" name="cur_ref" value="{$cur_ref}"/>
41 <input type="hidden" name="valid" id="valid" value="1"/>
42 <button type="submit" class="action">
43 <i class="fas fa-save fa-fw"></i> {_T string="Save"}
44 </button>
45 </div>
46 </form>
47 {include file="replacements_legend.tpl" legends=$texts->getLegend() cur_ref=$cur_ref}
48 {/block}
49
50 {block name="javascripts"}
51 <script type="text/javascript">
52 $(function() {
53 $('#sel_ref, #sel_lang').change(function() {
54 $(':input[type="submit"]').attr('disabled', 'disabled');
55 //Change the input[@id='value'] ; we do not want to validate, but to change lang/ref
56 $('#valid').attr('value', (this.id === 'sel_lang') ? 'change_lang' : 'change_text');
57 this.form.submit();
58 });
59
60 _addLegenButton('fieldset > p:nth-child(2)');
61 _handleLegend();
62 });
63 </script>
64 {/block}