New "valid_date" smarty function to select purge dates
[platal.git] / templates / xnetgrp / announce-edit.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2007 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 <script type="text/javascript">
24 {literal}
25 function visibilityChange(box)
26 {
27     var state = (box.checked ? 'none' : '');
28     document.getElementById('promo_titre').style.display = state;
29     document.getElementById('promo_min').style.display = state;
30     document.getElementById('promo_max').style.display = state;
31     document.getElementById('promo_desc').style.display = state;
32 }
33 {/literal}
34 </script>
35 <h1>{$asso.nom} : Edition d'une annonce</h1>
36
37 {if $art.texte}
38 <div>
39 {include file="xnetgrp/form.announce.tpl" admin=true}
40 <br />
41 </div>
42 {/if}
43
44 <form method="post" action="{$platal->ns}announce/{if $new}new{else}edit/{$art.id}{/if}">
45 <div>
46   <table class="bicol">
47     <tr>
48       <th colspan="2">Editer une annonce</th>
49     </tr>
50     <tr class="pair">
51       <td class="titre">Titre :</td>
52       <td><input type="text" name="titre" value="{$art.titre}" size="50" maxlength="200" /></td>
53     </tr>
54     <tr>
55       <td class="titre">Contenu de l'annonce :</td>
56       <td>
57         <small>
58           Le contenu est destiné à recevoir la descriptioin de ce qui est annoncé.
59           Il faut éviter d'y mettre des adresses mails ou web (surtout si l'annonce est publique),
60           qui devront être placées dans la section "contacts".
61         </small>
62       </td>
63     </tr>
64     <tr>
65       <td colspan="2">
66         <textarea name="texte" rows="10" cols="60" onfocus="update_texte_count(this.form)">{$art.texte}</textarea>
67         <br />
68         <script type="text/javascript">
69           var form_propose_texte = false;
70           {literal}
71           function update_texte_count(f) {
72             if (!form_propose_texte && f) form_propose_texte = f;
73             form_propose_texte.texte_count.value=form_propose_texte.texte.value.length;
74             setTimeout("update_texte_count(0)", 100);
75           }
76           {/literal}
77         </script>
78         <small>
79           Essaie de faire un <strong>texte court</strong>, une annonce ne doit pas excéder 600 caractères soit une dizaine de ligne.
80           Tu en es déjà à <input type='text' name='texte_count' size="4"/> caractères.
81           Si tu veux proposer cette annonce pour la Lettre Mensuelle, il faut te limiter à 8 lignes.
82         </small>
83       </td>
84     </tr>
85     <tr style="border-top: 1px solid gray">
86       <td class="titre">Contacts :</td>
87       <td>
88         <small>
89           La section "contacts" sert à noter les informations telles que les adresses mails de contact, les sites web.
90           Elle n'est accessible qu'aux personnes authentifiées. Si l'annonce est attachée à une événement, un lien vers
91           la page d'inscription est automatiquement ajouté.
92         </small>
93       </td>
94     </tr>
95     <tr>
96       <td colspan="2">
97         <textarea cols="60" rows="6" name='contacts'>{$art.contacts}</textarea>
98       </td>
99     </tr>
100     <tr style="border-top: 1px solid gray">
101       <td colspan="2" class="center">
102         <a href="wiki_help/notitle" class="popup3">
103           {icon name=information title="Syntaxe wiki"} Voir la liste des marqueurs de mise en forme autorisés
104         </a>
105       </td>
106     </tr>
107   </table>
108   <br />
109
110   <table class="tinybicol">
111     <tr>
112       <td class="titre">Date de péremption :</td>
113       <td>
114         {valid_date name="peremption" value=$art.peremption}
115       </td>
116     </tr>
117     {if $events}
118     <tr>
119       <td class="titre">Attacher à un événement :</td>
120       <td>
121         <select name="event">
122           <option value="" {if !$art.event}selected="selected"{/if}>-- Aucun --</option>
123           {iterate item=evt from=$events}
124           <option value="{$evt.short_name|default:$evt.eid}" 
125             {if $art.event eq $evt.short_name|default:$evt.eid}selected="selected"{/if}>
126             {$evt.intitule}
127           </option>
128           {/iterate}
129         </select>
130       </td>
131     </tr>
132     {/if}
133     <tr>
134       <td class="titre">Visibilité :</td>
135       <td>
136         <input type="checkbox" name="public" {if $art.public}checked="checked"{/if} onchange="visibilityChange(this)" />
137         Rendre cette annonce publique
138       </td>
139     </tr>
140     <tr id="promo_titre" {if $art.public}style="display: none"{/if}>
141       <th colspan="2">Promotions cibles</th>
142     </tr>
143     <tr id="promo_min"  {if $art.public}style="display: none"{/if}>
144       <td class="titre">Promotion minimale :</td>
145       <td>
146         <input type="text" size="4" maxlength="4" name="promo_min" value="{$art.promo_min|default:0}" />
147         incluse*  (ex : 1980)
148       </td>
149     </tr>
150     <tr id="promo_max"  {if $art.public}style="display: none"{/if}>
151       <td class="titre">Promotion maximale :</td>
152       <td>
153         <input type="text" size="4" maxlength="4" name="promo_max" value="{$art.promo_max|default:0}" />
154         incluse*  (ex : 2000)
155       </td>
156     </tr>
157     <tr class="pair" id="promo_desc"  {if $art.public}style="display: none"{/if}>
158       <td colspan="2">
159         <small>* 0 signifie qu'il n'y a pas de limite</small>
160       </td>
161     </tr>
162     {if $new}
163     <tr>
164       <th colspan="2">Demandes de publication</th>
165     </tr>
166     <tr>
167       <td colspan="2">
168         <input type="checkbox" name="xorg" {if $art.xorg}checked="checked"{/if} />
169         sur la page d'accueil de Polytechnique.org
170       </td>
171     </tr>
172     <tr>
173       <td colspan="2">
174         <input type="checkbox" name="nl" {if $art.nl}checked="checked"{/if} />
175         dans la Lettre Mensuelle de Polytechnique.org
176       </td>
177     </tr>
178     <tr class="pair">
179       <td colspan="2">
180         <small>Les demandes de publication sont soumises à validation par l'équipe
181         de Polytechnique.org</small>
182       </td>
183     </tr>
184     {/if}
185   </table>
186
187   <div class="center">
188     {if $art.id}
189     <input type="hidden" name="id" value="{$art.id}" />
190     {/if}
191     <input type="submit" name="valid" value="Visualiser" /><br />
192     {if $art.texte}
193     <input type="submit" name="valid" value="Enregistrer" /> 
194     {if !$new}
195     <input type="submit" name="valid" value="Annuler" />
196     {/if}
197     {/if}
198   </div>
199 </div>
200 </form>
201
202 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}