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