8a370f38d2b53ad1459f8ce4a75ba9816a8a2c78
[platal.git] / templates / events / form.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 updatePreview()
26   {
27     var titre = document.getElementById('titre').value;
28     var texte = document.getElementById('texte').value;
29
30     if (titre == '' || texte == '') {
31       document.getElementById('valid').style.display = 'none';
32       document.getElementById('info').style.display = '';
33     } else {
34       document.getElementById('valid').style.display = '';
35       document.getElementById('info').style.display = 'none';
36     }
37     var page  = 'events/preview?titre=' + titre + '&texte=' + texte;
38     if (is_IE) {
39       {/literal}
40       page = "{$globals->baseurl}/" + page;
41       {literal}
42     }
43     Ajax.update_html('preview', page, null);
44     return false;
45   }
46   {/literal}
47 </script>
48
49 <div id="preview">
50 {include file="events/preview.tpl"}
51 </div>
52 <br />
53
54 <form action="{$platal->path}" method="post">
55   <table class="bicol">
56     <tr>
57       <th colspan="2">Contenu de l'annonce</th>
58     </tr>
59     <tr>
60       <td class="titre">Titre</td>
61       <td>
62         <input type="text" name="titre" id="titre" size="50" maxlength="200" value="{$titre}" />
63       </td>
64     </tr>
65     <tr>
66       <td class="titre">Texte</td>
67       <td><textarea name="texte" id="texte" rows="10" cols="60" onfocus="update_texte_count(this.form)">{$texte}</textarea></td>
68     </tr>
69     <tr>
70       <td colspan="2" class="smaller">
71         <script type="text/javascript">
72           var form_propose_texte = false;
73           {literal}
74           function update_texte_count(f) {
75             if (!form_propose_texte && f) form_propose_texte = f;
76             form_propose_texte.texte_count.value=form_propose_texte.texte.value.length;
77             setTimeout("update_texte_count(0)", 100);
78           }
79           {/literal}
80         </script>
81         Essaie de faire un <strong>texte court</strong>, une annonce ne doit pas excéder 800 caractères soit une douzaine de ligne. Tu en es déjà à <input type='text' name='texte_count' size="4" /> caractères.
82       </td>
83     </tr>
84   </table>
85
86   <div class="center">
87     <input type="submit" name="preview" value="Aperçu" onclick="updatePreview(); return false;" />
88   </div>
89   <p id="info" {if trim($texte) && trim($titre)}style="display: none"{/if}>
90     Le bouton de confirmation n'apparaît que si l'aperçu est concluant.
91   </p>
92   <p class="erreur">
93     N'oublie pas de remplir suivantes&nbsp;:
94   </p>
95
96   <table class="bicol">
97     <tr>
98       <th colspan="2">Informations complémentaires</th>
99     </tr>
100     <tr class="pair">
101       <td colspan="2">
102         Tu peux limiter la visibilité de ton annonce aux camarades de certaines promotions :
103       </td>
104     </tr>
105     <tr class="impair">
106       <td class="titre">Promotion la plus ancienne</td>
107       <td>
108         <input type="text" name="promo_min" size="4" maxlength="4" value="{$promo_min}" /> incluse
109         &nbsp;<em>(ex : 1980, 0 signifie pas de minimum)</em>
110       </td>
111     </tr>
112     <tr class="impair">
113       <td class="titre">Promotion la plus jeune</td>
114       <td>
115         <input type="text" name="promo_max" size="4" maxlength="4" value="{$promo_max}" /> incluse
116         &nbsp;<em>(ex : 2000, 0 signifie pas de maximum)</em>
117       </td>
118     </tr>
119     <tr class="pair">
120       <td colspan="2">
121         Choisis la date d'expiration de ton annonce :
122       </td>
123     </tr>
124     <tr>
125       <td class="titre">
126         Dernier jour d'affichage
127       </td>
128       <td>
129         <select name="peremption">
130           {$select|smarty:nodefaults}
131         </select>
132       </td>
133     </tr>
134   </table>
135
136   <div class="center" {if !trim($texte) || !trim($titre)}style="display: none"{/if} id="valid">
137     <input type="hidden" name="evt_id" value="{$smarty.post.evt_id}" />
138     <input type="submit" name="action" value="Proposer" />
139   </div>
140
141 </form>
142
143 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}