Merge remote-tracking branch 'origin/xorg/maint' into xorg/master
[platal.git] / templates / newsletter / edit.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2011 Polytechnique.org                             *}
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>
24   {$nl->name} de {$issue->date|date_format:"%B %Y"}
25 </h1>
26
27 {if !$art}
28
29 <p>
30 [<a href="{$nl->adminPrefix()}">liste</a>]
31 [<a href="{$nl->prefix()}/show/{$issue->id()}">visualiser</a>]
32
33 </p>
34
35 <form action='{$nl->adminPrefix()}/edit/{$issue->id(true)}/update' method='post'>
36   <table class="bicol" cellpadding="3" cellspacing="0">
37     <tr>
38       <th colspan='2'>
39         Propriétés de la newsletter
40       </th>
41     </tr>
42     <tr>
43       <td class='titre'>
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'>
69         ID
70       </td>
71       <td>
72         {$issue->id}
73       </td>
74     </tr>
75     <tr>
76       <td class='titre'>
77         Nom
78       </td>
79       <td>
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}
86       </td>
87     </tr>
88     <tr>
89       <td class='titre'>
90         Titre de l'email
91       </td>
92       <td>
93         <input type='text' size='60' name='title_mail' value="{$issue->title(true)}" />
94       </td>
95     </tr>
96     <tr>
97       <td class='titre'>
98         Titre
99       </td>
100       <td>
101         <input type='text' size='60' name='title' value="{$issue->title()}" />
102       </td>
103     </tr>
104     <tr>
105       <td class='titre'>
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)
119       </td>
120       <td>
121         <textarea name='head' cols='60' rows='20'>{$issue->head()}</textarea>
122       </td>
123     </tr>
124     <tr>
125       <td class='titre'>
126         Signature de la lettre
127       </td>
128       <td>
129         <input type='text' size='60' name='signature' value="{$issue->signature}"</input>
130       </td>
131     </tr>
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:"%d/%m/%Y 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           Inverser la sélection <i>(sélectionner dans l'intervalle de promotions, à l'exception des matricules indiqués)</i>
189         </td>
190       </tr>
191       {/if}
192     {/if}
193     <tr class='center'>
194       <td colspan='2'>
195         <input type='submit' name='submit' value='Sauver' />
196       </td>
197     </tr>
198   </table>
199 </form>
200
201 <br />
202
203 <table class="bicol" cellpadding="3" cellspacing="0">
204   <tr>
205     <td>
206       Créer un nouvel article&hellip;
207     </td>
208     <td style='vertical-align:middle; border-left: 1px gray solid' class="center">
209       <a href="{$nl->adminPrefix()}/edit/{$issue->id}/new#edit">{icon name=add title="créer"}</a>
210     </td>
211   </tr>
212   {foreach from=$issue->arts item=arts key=cat}
213   <tr>
214     <th>
215       {$issue->category($cat)|default:"[no category]"}
216     </th>
217     <th></th>
218   </tr>
219   {foreach from=$arts item=art}
220   <tr class="{cycle values="impair,pair"}">
221     <td>
222       <pre>{$art->toText('%hash%','%login%')}</pre>
223     </td>
224     <td style="vertical-align: middle; border-left: 1px gray solid; text-align: center">
225       <small><strong>Pos:&nbsp;{$art->pos}</strong></small><br />
226       <a href="{$nl->adminPrefix()}/edit/{$issue->id}/{$art->aid}/edit#edit">
227         {icon name="page_edit" title="Editer"}
228       </a>
229       <br /><br /><br />
230       <a href="{$nl->adminPrefix()}/edit/{$issue->id}/{$art->aid}/delete"
231          onclick="return confirm('Es-tu sûr de vouloir supprimer cet article&nbsp;?')">
232         {icon name="delete" title="Supprimer"}
233       </a>
234     </td>
235   </tr>
236   {/foreach}
237   {/foreach}
238 </table>
239
240 <br />
241
242 <form action="{$nl->adminPrefix()}/edit/{$issue->id(true)}/blacklist_check" method="post">
243   <table class="bicol" cellpadding="3" cellspacing="0">
244     <tr>
245       <th colspan="2">
246         Vérifier les url et adresses emails sur Spamhaus
247       </th>
248     </tr>
249     {if $ips_to_check|@count > 0}
250     {foreach from=$ips_to_check item=ip_list key=title}
251     {foreach from=$ip_list item=domain key=ip}
252     <tr>
253       <td>{$title}</td>
254       <td><a href="{#globals.mail.blacklist_check_url#}{$ip}">{$domain}</a></td>
255     </tr>
256     {assign var=title value=''}
257     {/foreach}
258     {/foreach}
259     {else}
260     <tr class="center">
261       <td colspan="2">
262         <input type="submit" value="Vérifier" />
263       </td>
264     </tr>
265     {/if}
266   </table>
267 </form>
268
269 {else}
270
271 <p>
272 [<a href="{$nl->adminPrefix()}/edit/{$issue->id}">retour</a>]
273 </p>
274
275 <table class='bicol'>
276   <tr><th>Version texte</th></tr>
277   <tr id='text'>
278   <td><pre>{$art->toText()}</pre></td>
279   </tr>
280   <tr><th>Version html</th></tr>
281   <tr id='html'>
282     <td>
283       <div class='nl'>
284         {$art->toHtml()|smarty:nodefaults}
285       </div>
286     </td>
287   </tr>
288 </table>
289
290 <br />
291
292 <form action="{$nl->adminPrefix()}/edit/{$issue->id}/{$art->aid}/edit#edit" method="post">
293   <table class='bicol'>
294     <tr>
295       <th colspan='2'>
296         <a id='edit'></a>Éditer un article
297       </th>
298     </tr>
299     <tr class="impair">
300       <td class='titre'>Sujet</td>
301       <td>
302         <input size='60' type='text' value="{$art->title()}" name='title' />
303       </td>
304     </tr>
305     <tr class="impair">
306       <td class='titre'>Catégorie</td>
307       <td>
308         <select name='cid'>
309           <option value='0'>-- none --</option>
310           {foreach from=$nl->cats item=text key=cid}
311           <option value='{$cid}' {if $art->cid eq $cid}selected="selected"{/if}>{$text}</option>
312           {/foreach}
313         </select>
314       </td>
315     </tr>
316     <tr class="impair">
317       <td class='titre'>Position</td>
318       <td>
319         <input type='text' value='{$art->pos}' name='pos' />
320       </td>
321     </tr>
322     <tr class="pair">
323       <td class='titre'>Contenu</td>
324       <td>
325         <textarea cols="68" rows="10" name='body'>{$art->body()}</textarea>
326       </td>
327     </tr>
328     <tr class="impair">
329       <td class='titre'>Ajouts (emails, contacts, tarifs, site web&hellip;)</td>
330       <td>
331         <textarea cols="68" rows="6" name='append'>{$art->append()}</textarea>
332       </td>
333     </tr>
334     <tr class="pair smaller">
335       <td></td>
336       <td>
337         <a href="wiki_help/notitle" class="popup3">{icon name=information} Voir la documentation du wiki</a>
338       </td>
339     </tr>
340     <tr class='pair'>
341       <td colspan='2' class='center'>
342         <input type='submit' value='visualiser' />
343         <input type='submit' name='save' value='Sauver' />
344       </td>
345     </tr>
346   </table>
347 </form>
348
349 {/if}
350
351
352 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}