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