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