Happy New Year!
[platal.git] / templates / events / form.tpl
CommitLineData
0337d704 1{**************************************************************************}
2{* *}
5e1513f6 3{* Copyright (C) 2003-2011 Polytechnique.org *}
0337d704 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
794feea7 23{if $smarty.request.texte}
0ba71f30
FB
24{assign var=texte value=$smarty.request.texte|smarty:nodefaults}
25{/if}
26{if $smarty.request.titre}
27{assign var=titre value=$smarty.request.titre|smarty:nodefaults}
28{/if}
29{if $smarty.request.promo_min}
30{assign var=promo_min value=$smarty.request.promo_min|smarty:nodefaults}
31{/if}
32{if $smarty.request.promo_max}
33{assign var=promo_max value=$smarty.request.promo_max|smarty:nodefaults}
34{/if}
b58e5ac2
SJ
35{if $smarty.request.expiration}
36{assign var=expiration value=$smarty.request.expiration|smarty:nodefaults}
0ba71f30
FB
37{/if}
38{if $smarty.request.important}
39{assign var=important value=$smarty.request.important|smarty:nodefaults}
794feea7 40{/if}
1b602af5 41
4550539f 42<script type="text/javascript">//<![CDATA[
db3bd146 43 {literal}
44 function updatePreview()
45 {
02838718 46 if (document.getElementById('image').value != '' || document.getElementById('image_url').value != '') {
47 return true;
48 }
db3bd146 49 var titre = document.getElementById('titre').value;
50 var texte = document.getElementById('texte').value;
51
52 if (titre == '' || texte == '') {
53 document.getElementById('valid').style.display = 'none';
54 document.getElementById('info').style.display = '';
55 } else {
56 document.getElementById('valid').style.display = '';
57 document.getElementById('info').style.display = 'none';
58 }
4550539f 59 var page = 'events/preview?titre=' + encodeURIComponent(titre) + '&texte=' + encodeURIComponent(texte);
db3bd146 60 if (is_IE) {
61 {/literal}
62 page = "{$globals->baseurl}/" + page;
63 {literal}
64 }
b0e935d6 65 $('#preview').updateHtml(page);
db3bd146 66 return false;
67 }
68 {/literal}
4550539f 69//]]></script>
db3bd146 70
71<div id="preview">
72{include file="events/preview.tpl"}
73</div>
74<br />
75
02838718 76<form action="{$platal->path}" method="post" enctype="multipart/form-data">
7b642046 77 {xsrf_token_field}
0337d704 78 <table class="bicol">
79 <tr>
db3bd146 80 <th colspan="2">Contenu de l'annonce</th>
09e37980 81 </tr>
0337d704 82 <tr>
09e37980 83 <td class="titre">Titre</td>
0337d704 84 <td>
db3bd146 85 <input type="text" name="titre" id="titre" size="50" maxlength="200" value="{$titre}" />
0337d704 86 </td>
87 </tr>
88 <tr>
09e37980 89 <td class="titre">Texte</td>
72b2f8bb 90 <td>
91 <textarea name="texte" id="texte" rows="10" cols="60" onfocus="update_texte_count(this.form)">{$texte}</textarea>
92 </td>
93 </tr>
94 <tr>
95 <td></td>
96 <td class="smaller">
97 <a href="wiki_help/notitle" class="popup3">
98 {icon name=information title="Syntaxe wiki"} Voir la syntaxe wiki autorisée pour le texte de l'annonce
99 </a>
100 </td>
7095511f 101 </tr>
102 <tr>
09e37980 103 <td colspan="2" class="smaller">
ea1fdc8c 104 <script type="text/javascript">//<![CDATA[
7095511f 105 var form_propose_texte = false;
106 {literal}
107 function update_texte_count(f) {
108 if (!form_propose_texte && f) form_propose_texte = f;
109 form_propose_texte.texte_count.value=form_propose_texte.texte.value.length;
110 setTimeout("update_texte_count(0)", 100);
111 }
112 {/literal}
ea1fdc8c 113 //]]></script>
db3bd146 114 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.
1b602af5 115 <script type="text/javascript">update_texte_count(document.getElementById('texte').form);</script>
09e37980 116 </td>
0337d704 117 </tr>
02838718 118 <tr class="pair">
119 <td class="titre">Illustration</td>
120 <td>
121 {if $eid && $img}
122 <div style="float: left; text-align: center">
123 <em>Image actuelle</em><br />
b0da2aea 124 <img src="events/photo/{$eid}?{$smarty.now}" alt="Image actuelle" /><br />
02838718 125 <input type="submit" name="action" value="Pas d'image" />
126 </div>
127 {/if}
128 {if $upload && $upload->exists()}
129 <div style="float: right; text-align: center">
130 <em>Nouvelle image</em><br />
b0da2aea 131 <img src="events/photo?{$smarty.now}" alt="Nouvelle Image" /><br />
02838718 132 <input type="submit" name="action" value="Supprimer l'image" />
133 </div>
134 {/if}
135 <div style="clear: both">
e8439508
FB
136 Choisir un fichier&nbsp;: <input type="file" name="image" id="image" /><br />
137 Indiquer une adresse&nbsp;: <input type="text" name="image_url" id="image_url" value="" />
02838718 138 </div>
139 </td>
140 </tr>
09e37980 141 </table>
142
db3bd146 143 <div class="center">
02838718 144 <input type="submit" name="preview" value="Aperçu" onclick="return updatePreview();" />
db3bd146 145 </div>
146 <p id="info" {if trim($texte) && trim($titre)}style="display: none"{/if}>
147 Le bouton de confirmation n'apparaît que si l'aperçu est concluant.
148 </p>
149 <p class="erreur">
ea1fdc8c 150 N'oublie pas de remplir les informations suivantes&nbsp;:
db3bd146 151 </p>
152
09e37980 153 <table class="bicol">
db3bd146 154 <tr>
155 <th colspan="2">Informations complémentaires</th>
156 </tr>
09e37980 157 <tr class="pair">
2f5102a0 158 <td colspan="2">
e8439508 159 Tu peux limiter la visibilité de ton annonce aux camarades de certaines promotions&nbsp;:
2f5102a0 160 </td>
161 </tr>
05cb05c0 162 {include file="include/field.promo.tpl"}
09e37980 163 <tr class="pair">
2f5102a0 164 <td colspan="2">
e8439508 165 Choisis la date d'expiration de ton annonce&nbsp;:
0337d704 166 </td>
167 </tr>
168 <tr>
2f5102a0 169 <td class="titre">
170 Dernier jour d'affichage
0337d704 171 </td>
172 <td>
b58e5ac2 173 {valid_date name="expiration" value=$expiration to=60}
0337d704 174 </td>
175 </tr>
9ed396c0 176 {if $admin_evts}
177 <tr>
178 <td class="titre">
179 Importance
180 </td>
181 <td>
a44f405e
SJ
182 <label><input type="checkbox" name="important" {if $important}checked="checked"{/if}/>
183 Marquer cette annonce comme très importante</label>
9ed396c0 184 </td>
185 </tr>
186 {/if}
0337d704 187 </table>
188
db3bd146 189 <div class="center" {if !trim($texte) || !trim($titre)}style="display: none"{/if} id="valid">
0337d704 190 <input type="hidden" name="evt_id" value="{$smarty.post.evt_id}" />
191 <input type="submit" name="action" value="Proposer" />
192 </div>
193
194</form>
195
a7de4ef7 196{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}