forked from sympa-community/sympa
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathls_templates.tt2
206 lines (193 loc) · 11.8 KB
/
ls_templates.tt2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!-- ls_templates.tt2 -->
<h2>[%|loc%]Template edition system[%END%]</h2>
<article id="template_editor">
<p>
[%|loc%]This page is suggested in order to edit or create mail or web tt2 templates.[%END%]
</p>
<p>
[%|loc%]Priority rules for template selection:[%END%]
</p>
<ul>
<li>
[% "IF list context defined, apply list template if exist\nELSE apply robot defined template if exist\nELSE apply locally defined template if exist\nELSE apply template included in the distribution (these must not be edited because Sympa's update will over write these files)" | loc | replace("\n", '</li><li>') %]
</li>
</ul>
<p>
[%|loc%]First, you may list a category of templates. The list should include a default template and may include any templates designated for a particular list. You will then have an opportunity to copy and edit templates for the current robot or the named list.[%END%]
</p>
<form action="[% 'ls_templates' | url_rel %]" method="post">
<fieldset>
<ul>
<li>
[%|loc%]Select templates type:[%END%]
<input id="webormail.web" type="radio" name="webormail" value="web"
[% IF webormail == 'web' %]checked="checked"[% END %] />
<label for="webormail.web">[%|loc%]web[%END%]</label>
<input id="webormail.mail" type="radio" name="webormail" value="mail"
[% IF webormail == 'mail' %]checked="checked"[% END %] />
<label for="webormail.mail">[%|loc%]mail[%END%]</label>
</li>
<li>
<label for="list">[%|loc%]Select a list:[%END%]</label>
<input id="list" type="text" name="list" value="[% list %]"/>
</li>
<li>
<input class="MainMenuLinks" type="submit" name="action_ls_templates" value="[%|loc%]Reload[%END%]" />
</li>
</ul>
</fieldset>
</form>
</article>
<p>
[% IF templates %]
<table class="responsive ls_template">
<caption>[%|loc%]This table contain all templates you can copy or see[%END%]</caption>
<tr>
<th>[%|loc%]template name[%END%]</th>
<th colspan="[% colspan_per_level.distrib %]">[%|loc%]default[%END%]</th>
<th colspan="[% colspan_per_level.site %]">[%|loc%]site[%END%]</th>
<th colspan="[% colspan_per_level.robot %]">[%|loc%]robot[%END%]</th>
<th colspan="[% colspan_per_level.list %]">[%|loc(list)%]list %1[%END%]</th>
</tr>
[% SET dark = 1 %]
<th> </th>
<!-- print list of languages -->
[% FOREACH lang = lang_per_level.distrib %]
[%- IF lang.key == 'default' -%]
<th> </th>
[%- ELSE -%]
<th class="neutral" lang="[%lang.value.lang%]" xml:lang="[%lang.value.lang%]">
[%~ lang.value.lang | optdesc('lang',1) %]
</th>
[%- END %]
[% END %]
[% FOREACH lang = lang_per_level.site %]
[%- IF lang.key == 'default' -%]
<th> </th>
[%- ELSE -%]
<th class="neutral" lang="[%lang.value.lang%]" xml:lang="[%lang.value.lang%]">
[%~ lang.key | optdesc('lang',1) %]
</th>
[%- END %]
[% END %]
[% FOREACH lang = lang_per_level.robot %]
[%- IF lang.key == 'default' -%]
<th> </th>
[%- ELSE -%]
<th class="neutral" lang="[%lang.value.lang%]" xml:lang="[%lang.value.lang%]">
[%~ lang.key | optdesc('lang',1) %]
</th>
[%- END %]
[% END %]
[% FOREACH lang = lang_per_level.list %]
[%- IF lang.key == 'default' -%]
<th> </th>
[%- ELSE -%]
<th class="neutral" lang="[%lang.value.lang%]" xml:lang="[%lang.value.lang%]">
[%~ lang.key | optdesc('lang',1) %]
</th>
[%- END %]
[% END %]
[% FOREACH file = templates %]
[% IF dark == '1' %]
<tr>[% SET dark = 0 %]
[% ELSE %]
<tr class="color0">[% SET dark=1 %]
[% END %]
<td>[% file.key %]</td>
[% FOREACH lang = file.value.distrib %]
<td class="text_center">
[% IF lang.value %]
<form action="[% 'edit_template' | url_rel %]" method="post">
<fieldset>
<input type="hidden" name="template_path" value="[% lang.value %]" />
<input type="hidden" name="template_name" value="[% file.key %]" />
<input type="hidden" name="scope" value="distrib" />
<input type="hidden" name="tpl_lang" value="[% lang.key %]" />
<input type="hidden" name="webormail" value="[% webormail %]" />
<input class="MainMenuLinks" type="submit" name="action_view_template" value="[%|loc%]view[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_copy_template" value="[%|loc%]cp[% END %]" />
</fieldset>
</form>
[% END %]
</td>
[% END %]
[% FOREACH lang = file.value.site %]
<td class="text_center">
[% IF lang.value %]
<form action="[% 'edit_template' | url_rel %]" method="post">
<fieldset>
<input type="hidden" name="template_name" value="[% file.key %]" />
<input type="hidden" name="template_path" value="[% lang.value %]" />
<input type="hidden" name="scope" value="site" />
<input type="hidden" name="tpl_lang" value="[% lang.key %]" />
<input type="hidden" name="webormail" value="[% webormail %]" />
[% IF is_super_listmaster ~%]
<input class="MainMenuLinks" type="submit" name="action_edit_template"
value="[%|loc%]edit[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_copy_template"
value="[%|loc%]cp[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_remove_template"
value="[%|loc%]rm[% END %]" />
[%~ ELSE ~%]
<input class="MainMenuLinks" type="submit" name="action_view_template"
value="[%|loc%]view[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_copy_template"
value="[%|loc%]cp[% END %]" />
[%~ END %]
</fieldset>
</form>
[% END %]
</td>
[% END %]
[% IF default_robot %]
<td></td>
[% ELSE %]
[% FOREACH lang = file.value.robot %]
<td class="text_center">
[% IF lang.value %]
<form action="[% 'edit_template' | url_rel %]" method="post">
<fieldset>
<input type="hidden" name="template_name" value="[% file.key %]" />
<input type="hidden" name="template_path" value="[% lang.value %]" />
<input type="hidden" name="scope" value="robot" />
<input type="hidden" name="tpl_lang" value="[% lang.key %]" />
<input type="hidden" name="webormail" value="[% webormail %]" />
<input class="MainMenuLinks" type="submit" name="action_edit_template" value="[%|loc%]edit[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_copy_template" value="[%|loc%]cp[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_remove_template" value="[%|loc%]rm[% END %]" />
</fieldset>
</form>
[% END %]
</td>
[% END %]
[% END %]
[% IF list %]
[% FOREACH lang = file.value.list %]
<td class="text_center">
[% IF lang.value %]
<form action="[% 'edit_template' | url_rel %]" method="post">
<fieldset>
<input type="hidden" name="template_name" value="[% file.key %]" />
<input type="hidden" name="template_path" value="[% lang.value %]" />
<input type="hidden" name="scope" value="list" />
<input type="hidden" name="tpl_lang" value="[% lang.key %]" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="webormail" value="[% webormail %]" />
<input class="MainMenuLinks" type="submit" name="action_edit_template" value="[%|loc%]edit[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_copy_template" value="[%|loc%]cp[% END %]" />
<input class="MainMenuLinks" type="submit" name="action_remove_template" value="[%|loc%]rm[% END %]" />
</fieldset>
</form>
[% END %]
</td>
[% END %]
[% ELSE %]
<td></td>
[% END %]
</tr>
[% END %]
</table>
[% END %]
</p>
<!-- end ls_templates.tt2 -->