#525: Add a user-friendly Id for the NLs.
[platal.git] / templates / newsletter / edit.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2006 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   Lettre de Polytechnique.org de {$nl->_date|date_format:"%B %Y"}
25 </h1>
26
27 {if !$art}
28
29 <p>
30 [<a href="admin/newsletter">liste</a>]
31 [<a href="nl/show/{$nl->id()}">visualiser</a>]
32 </p>
33
34 <form action='admin/newsletter/edit/{$nl->_id}/update' method='post'>
35   <table class="bicol" cellpadding="3" cellspacing="0">
36     <tr>
37       <th colspan='2'>
38         Propriétés de la newsletter
39       </th>
40     </tr>
41     <tr>
42       <td class='titre'>
43         ID
44       </td>
45       <td>
46         {$nl->_id}
47       </td>
48     </tr>
49     <tr>
50       <td class='titre'>
51         Nom
52       </td>
53       <td>
54         <input type='text' size='16' name='shortname' value="{$nl->_shortname}" />
55         <span class="smaller">(Ex : 2006-06 pour la NL de juin 2006)</span>
56       </td>
57     </tr>
58     <tr>
59       <td class='titre'>
60         Titre
61       </td>
62       <td>
63         <input type='text' size='60' name='title' value="{$nl->title()}" />
64       </td>
65     </tr>
66     <tr>
67       <td class='titre'>
68         Date d'envoi
69       </td>
70       <td>
71         <input type='text' size='60' name='date' value="{$nl->_date}" />
72       </td>
73     </tr>
74     <tr>
75       <td class='titre'>
76         Intro de la lettre
77       </td>
78       <td>
79         <textarea name='head' cols='60' rows='6'>{$nl->head()}</textarea>
80       </td>
81     </tr>
82     <tr class='center'>
83       <td colspan='2'>
84         <input type='submit' value='sauver' />
85       </td>
86     </tr>
87   </table>
88 </form>
89
90 <br />
91
92 <table class="bicol" cellpadding="3" cellspacing="0">
93   <tr>
94     <td>
95       Créer un nouvel article ...
96     </td>
97     <td style='vertical-align:middle; border-left: 1px gray solid'>
98       [<a href="admin/newsletter/edit/{$nl->_id}/new#edit">créer</a>]
99     </td>
100   </tr>
101   {foreach from=$nl->_arts item=arts key=cat}
102   <tr>
103     <th>
104       {$nl->_cats[$cat]|default:"[no cat]"}
105     </th>
106     <th></th>
107   </tr>
108   {foreach from=$arts item=art}
109   <tr class="{cycle values="impair,pair"}">
110     <td>
111       <pre>{$art->toText($smarty.session.prenom,$smarty.session.nom,$smarty.session.femme)|smarty:nodefaults}</pre>
112     </td>
113     <td style='vertical-align:middle; border-left: 1px gray solid'>
114       <strong>Pos: {$art->_pos}</strong><br />
115       [<a href="admin/newsletter/edit/{$nl->_id}/{$art->_aid}/edit#edit">edit</a>]<br />
116       [<a href="admin/newsletter/edit/{$nl->_id}/{$art->_aid}/delete">delete</a>]
117     </td>
118   </tr>
119   {/foreach}
120   {/foreach}
121 </table>
122
123 {else}
124
125 <p>
126 [<a href="admin/newsletter/edit/{$nl->_id}">retour</a>]
127 </p>
128
129 {if !$art->check()}<p class='erreur'>article trop long !</p>{/if}
130 <table class='bicol'>
131   <tr><th>Version texte</th></tr>
132   <tr id='text'>
133   <td><pre>{$art->toText()}</pre></td>
134   </tr>
135   <tr><th>Version html</th></tr>
136   <tr id='html'>
137     <td>
138       <div class='nl'>
139         {$art->toHtml()|smarty:nodefaults}
140       </div>
141     </td>
142   </tr>
143 </table>
144
145 <br />
146
147 <form action="admin/newsletter/edit/{$nl->_id}/{$art->_aid}/edit#edit" method="post">
148   <table class='bicol'>
149     <tr>
150       <th colspan='2'>
151         <a id='edit'></a>Editer un article
152       </th>
153     </tr>
154     <tr class="impair">
155       <td class='titre'>Sujet</td>
156       <td>
157         <input size='60' type='text' value="{$art->title()}" name='title' />
158       </td>
159     </tr>
160     <tr class="impair">
161       <td class='titre'>Catégorie</td>
162       <td>
163         <select name='cid'>
164           <option value='0'>-- none --</option>
165           {foreach from=$nl->_cats item=text key=cid}
166           <option value='{$cid}' {if $art->_cid eq $cid}selected="selected"{/if}>{$text}</option>
167           {/foreach}
168         </select>
169       </td>
170     </tr>
171     <tr class="impair">
172       <td class='titre'>Position</td>
173       <td>
174         <input type='text' value='{$art->_pos}' name='pos' />
175       </td>
176     </tr>
177     <tr class="pair">
178       <td class='titre'>Contenu</td>
179       <td>
180         <textarea cols="68" rows="10" name='body'>{$art->body()}</textarea>
181       </td>
182     </tr>
183     <tr class="impair">
184       <td class='titre'>Ajouts (emails, contacts, tarifs, site web, ...)</td>
185       <td>
186         <textarea cols="68" rows="6" name='append'>{$art->append()}</textarea>
187       </td>
188     </tr>
189     <tr class='pair'>
190       <td colspan='2' class='center'>
191         <input type='submit' value='visualiser' />
192         <input type='submit' name='save' value='Sauver' />
193       </td>
194     </tr>
195   </table>
196 </form>
197
198 {/if}
199
200
201 {* vim:set et sw=2 sts=2 sws=2: *}