Update/merge Newsletter-related code. (Closes #1226, #858, #1047)
[platal.git] / templates / newsletter / edit.tpl
CommitLineData
0337d704 1{**************************************************************************}
2{* *}
12262f13 3{* Copyright (C) 2003-2011 Polytechnique.org *}
0337d704 4{* http://opensource.polytechnique.org/ *}
5{* *}
6{* This program is free software; you can redistribute it and/or modify *}
7{* it under the terms of the GNU General Public License as published by *}
8{* the Free Software Foundation; either version 2 of the License, or *}
9{* (at your option) any later version. *}
10{* *}
11{* This program is distributed in the hope that it will be useful, *}
12{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
13{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
14{* GNU General Public License for more details. *}
15{* *}
16{* You should have received a copy of the GNU General Public License *}
17{* along with this program; if not, write to the Free Software *}
18{* Foundation, Inc., *}
19{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
20{* *}
21{**************************************************************************}
22
23<h1>
84163d58 24 {$nl->name} de {$issue->date|date_format:"%B %Y"}
0337d704 25</h1>
26
27{if !$art}
28
29<p>
84163d58
RB
30[<a href="{$nl->adminPrefix()}">liste</a>]
31[<a href="{$nl->prefix()}/show/{$issue->id()}">visualiser</a>]
32
0337d704 33</p>
34
84163d58 35<form action='{$nl->adminPrefix()}/edit/{$issue->id(true)}/update' method='post'>
0337d704 36 <table class="bicol" cellpadding="3" cellspacing="0">
37 <tr>
38 <th colspan='2'>
a7de4ef7 39 Propriétés de la newsletter
0337d704 40 </th>
41 </tr>
42 <tr>
43 <td class='titre'>
84163d58
RB
44 État
45 </td>
46 <td>
47{if $issue->isPending()}
48 En attente d'envoi
49 {if $nl->automaticMailingEnabled()}
50 [<a href="{$nl->adminPrefix()}/edit/cancel/{$issue->id()}?token={xsrf_token}" onclick="return confirm('Es-tu sûr de vouloir annuler l\'envoi de ce message&nbsp;?');">{*
51 *}{icon name=delete} Annuler l'envoi</a>]
52 {/if}
53{elseif $issue->isEditable()}
54 En cours d'édition
55
56 {if $nl->automaticMailingEnabled()}
57 [<a href="{$nl->adminPrefix()}/edit/valid/{$issue->id()}?token={xsrf_token}" onclick="return confirm('Es-tu sûr de vouloir déclencher l\'envoi de ce message&nbsp;? Tu ne pourras plus le modifier après cela.');">{*
58 *}{icon name=tick} Valider l'envoi</a>]
59 {/if}
60
61 [<a href="{$nl->adminPrefix()}/edit/delete/{$issue->id()}?token={xsrf_token}" onclick="return confirm('Es-tu sûr de vouloir supprimer cette lettre&nbsp;? Toutes les données en seront perdues.');">{*
62 *}{icon name=cross} Supprimer</a>]
63{else}
64 Envoyée
65{/if}
66
67 <tr>
68 <td class='titre'>
fbd95de7 69 ID
70 </td>
71 <td>
84163d58 72 {$issue->id}
fbd95de7 73 </td>
74 </tr>
75 <tr>
76 <td class='titre'>
ed76a506 77 Nom
78 </td>
79 <td>
84163d58
RB
80 {if $issue->isEditable()}
81 <input type='text' size='16' name='shortname' value="{$issue->shortname}" />
82 <span class="smaller">(Ex&nbsp;: 2006-06 pour la NL de juin 2006)</span>
83 {else}
84 {$issue->shortname}
85 {/if}
ed76a506 86 </td>
87 </tr>
88 <tr>
89 <td class='titre'>
faefdbb7 90 Titre de l'email
8269d2d6 91 </td>
92 <td>
84163d58 93 <input type='text' size='60' name='title_mail' value="{$issue->title(true)}" />
8269d2d6 94 </td>
95 </tr>
96 <tr>
97 <td class='titre'>
0337d704 98 Titre
99 </td>
100 <td>
84163d58 101 <input type='text' size='60' name='title' value="{$issue->title()}" />
0337d704 102 </td>
103 </tr>
104 <tr>
105 <td class='titre'>
84163d58
RB
106 Date
107 </td>
108 <td>
109 {if $issue->isEditable()}
110 {valid_date name="date" value=$issue->date from=0 to=60}
111 {else}
112 {$issue->date}
113 {/if}
114 </td>
115 </tr>
116 <tr>
117 <td class='titre'>
118 Intro de la lettre<br />(ou contenu pour les lettres exceptionnelles)
0337d704 119 </td>
120 <td>
84163d58 121 <textarea name='head' cols='60' rows='20'>{$issue->head()}</textarea>
0337d704 122 </td>
123 </tr>
124 <tr>
125 <td class='titre'>
84163d58 126 Signature de la lettre
0337d704 127 </td>
128 <td>
84163d58 129 <input type='text' size='60' name='signature' value="{$issue->signature}"</input>
0337d704 130 </td>
131 </tr>
84163d58
RB
132 {if $nl->automaticMailingEnabled() && ($issue->isEditable() || $issue->isPending())}
133 <tr>
134 <td class='titre'>
135 Date d'envoi
136 </td>
137 <td>
138 {if $issue->isEditable()}
139 Le {valid_date name="send_before_date" value=$issue->getSendBeforeDate() from=3 to=15} vers {html_select_time prefix="send_before_time_" time=$issue->getSendBeforeTime() display_hours=true display_minutes=false display_seconds=false display_meridian=false use_24_hours=true} heures
140 {else}
141 Le {$issue->send_before|date_format:"%X vers %Hh"}
142 {/if}
143 </td>
144 </tr>
145 {/if}
146 {if $issue->isEditable()}
147 {if $nl->criteria->hasFlag('promo')}
148 <tr>
149 <td class='titre'>
150 Promotions
151 </td>
152 <td>
153 <script type="text/javascript">/*<![CDATA[*/
154 {literal}
155 function updatepromofields(egal1) {
156 var f = egal1.form;
157 f.egal2.disabled = f.promo2.disabled = egal1.value == '=';
158 f.egal2.readOnly = true;
159 if (f.egal1.value == '>=') {
160 f.egal2.value = '<=';
161 } else {
162 f.egal2.value = '>=';
163 }
164 }
165 $(function() { updatepromofields($('select[name=egal1]')[0]); });
166 {/literal}
167 /*]]>*/</script>
168 <select name="egal1" onchange="updatepromofields(this)" style="text-align:center">
169 <option value="=" {if $smarty.request.egal1 eq "="}selected="selected"{/if}>&nbsp;=&nbsp;</option>
170 <option value="&gt;=" {if $smarty.request.egal1 eq "&gt;="}selected="selected"{/if}>&nbsp;&gt;=&nbsp;</option>
171 <option value="&lt;=" {if $smarty.request.egal1 eq "&lt;="}selected="selected"{/if}>&nbsp;&lt;=&nbsp;</option>
172 </select>
173 <input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
174 &nbsp;et&nbsp;
175 <input type="text" name="egal2" size="1" style="text-align:center" value="{if t($smarty.request.egal2) eq '&lt;'}&lt;{else}&gt;{/if}" readonly="readonly" />
176 <input type="text" name="promo2" size="4" maxlength="4" value="{$smarty.request.promo2}" />
177 </td>
178 </tr>
179 {/if}
180 {if $nl->criteria->hasFlag('axid')}
181 <tr>
182 <td>Matricule AX</td>
183 <td>
184 <textarea name="axid" rows="10" cols="12">{$smarty.request.axid}</textarea>
185 <br />
186 <i>Entrer une liste de matricules AX (un par ligne)</i><br />
187 <input type="checkbox" name="axid_reversed" id="axid_reversed" {if $smarty.request.axid_reversed}checked="checked"{/if} value="1" />
188 </td>
189 </tr>
190 {/if}
191 {/if}
0337d704 192 <tr class='center'>
193 <td colspan='2'>
84163d58 194 <input type='submit' value='Sauver' />
0337d704 195 </td>
196 </tr>
197 </table>
198</form>
199
200<br />
201
202<table class="bicol" cellpadding="3" cellspacing="0">
203 <tr>
204 <td>
6e828e47 205 Créer un nouvel article&hellip;
0337d704 206 </td>
36fbd4c4 207 <td style='vertical-align:middle; border-left: 1px gray solid' class="center">
84163d58 208 <a href="{$nl->adminPrefix()}/edit/{$issue->id}/new#edit">{icon name=add title="créer"}</a>
0337d704 209 </td>
210 </tr>
84163d58 211 {foreach from=$issue->arts item=arts key=cat}
0337d704 212 <tr>
213 <th>
84163d58 214 {$issue->category($cat)|default:"[no category]"}
0337d704 215 </th>
216 <th></th>
217 </tr>
218 {foreach from=$arts item=art}
219 <tr class="{cycle values="impair,pair"}">
220 <td>
aacc771b 221 <pre>{$art->toText('%hash%','%login%')}</pre>
0337d704 222 </td>
7e3f1cfa 223 <td style="vertical-align: middle; border-left: 1px gray solid; text-align: center">
84163d58
RB
224 <small><strong>Pos:&nbsp;{$art->pos}</strong></small><br />
225 <a href="{$nl->adminPrefix()}/edit/{$issue->id}/{$art->aid}/edit#edit">
7e3f1cfa
SJ
226 {icon name="page_edit" title="Editer"}
227 </a>
228 <br /><br /><br />
84163d58 229 <a href="{$nl->adminPrefix()}/edit/{$issue->id}/{$art->aid}/delete"
6bb2f79a 230 onclick="return confirm('Es-tu sûr de vouloir supprimer cet article&nbsp;?')">
7e3f1cfa
SJ
231 {icon name="delete" title="Supprimer"}
232 </a>
0337d704 233 </td>
234 </tr>
235 {/foreach}
236 {/foreach}
237</table>
238
9e2a6a32
SJ
239<br />
240
84163d58 241<form action="{$nl->adminPrefix()}/edit/{$issue->id(true)}/blacklist_check" method="post">
9e2a6a32
SJ
242 <table class="bicol" cellpadding="3" cellspacing="0">
243 <tr>
244 <th colspan="2">
245 Vérifier les url et adresses emails sur Spamhaus
246 </th>
247 </tr>
248 {if $ips_to_check|@count > 0}
249 {foreach from=$ips_to_check item=ip_list key=title}
250 {foreach from=$ip_list item=domain key=ip}
251 <tr>
252 <td>{$title}</td>
253 <td><a href="{#globals.mail.blacklist_check_url#}{$ip}">{$domain}</a></td>
254 </tr>
255 {assign var=title value=''}
256 {/foreach}
257 {/foreach}
258 {else}
259 <tr class="center">
260 <td colspan="2">
261 <input type="submit" value="Vérifier" />
262 </td>
263 </tr>
264 {/if}
265 </table>
266</form>
267
0337d704 268{else}
269
270<p>
84163d58 271[<a href="{$nl->adminPrefix()}/edit/{$issue->id}">retour</a>]
0337d704 272</p>
273
0337d704 274<table class='bicol'>
275 <tr><th>Version texte</th></tr>
276 <tr id='text'>
277 <td><pre>{$art->toText()}</pre></td>
278 </tr>
279 <tr><th>Version html</th></tr>
280 <tr id='html'>
281 <td>
282 <div class='nl'>
283 {$art->toHtml()|smarty:nodefaults}
284 </div>
285 </td>
286 </tr>
287</table>
288
289<br />
290
84163d58 291<form action="{$nl->adminPrefix()}/edit/{$issue->id}/{$art->aid}/edit#edit" method="post">
0337d704 292 <table class='bicol'>
293 <tr>
294 <th colspan='2'>
661e78f7 295 <a id='edit'></a>Éditer un article
0337d704 296 </th>
297 </tr>
298 <tr class="impair">
299 <td class='titre'>Sujet</td>
300 <td>
301 <input size='60' type='text' value="{$art->title()}" name='title' />
302 </td>
303 </tr>
304 <tr class="impair">
a7de4ef7 305 <td class='titre'>Catégorie</td>
0337d704 306 <td>
307 <select name='cid'>
308 <option value='0'>-- none --</option>
84163d58
RB
309 {foreach from=$nl->cats item=text key=cid}
310 <option value='{$cid}' {if $art->cid eq $cid}selected="selected"{/if}>{$text}</option>
0337d704 311 {/foreach}
312 </select>
313 </td>
314 </tr>
315 <tr class="impair">
316 <td class='titre'>Position</td>
317 <td>
84163d58 318 <input type='text' value='{$art->pos}' name='pos' />
0337d704 319 </td>
320 </tr>
321 <tr class="pair">
322 <td class='titre'>Contenu</td>
323 <td>
324 <textarea cols="68" rows="10" name='body'>{$art->body()}</textarea>
325 </td>
326 </tr>
327 <tr class="impair">
6e828e47 328 <td class='titre'>Ajouts (emails, contacts, tarifs, site web&hellip;)</td>
0337d704 329 <td>
330 <textarea cols="68" rows="6" name='append'>{$art->append()}</textarea>
331 </td>
332 </tr>
3ad44e08 333 <tr class="pair smaller">
334 <td></td>
335 <td>
336 <a href="wiki_help/notitle" class="popup3">{icon name=information} Voir la documentation du wiki</a>
337 </td>
338 </tr>
0337d704 339 <tr class='pair'>
340 <td colspan='2' class='center'>
341 <input type='submit' value='visualiser' />
342 <input type='submit' name='save' value='Sauver' />
343 </td>
344 </tr>
345 </table>
346</form>
347
348{/if}
349
350
a7de4ef7 351{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}