Translates peremption to expiration.
[platal.git] / templates / events / form.tpl
index 8411cfc..a1e1dc5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
+{if $smarty.request.texte}
+{assign var=texte value=$smarty.request.texte|smarty:nodefaults}
+{/if}
+{if $smarty.request.titre}
+{assign var=titre value=$smarty.request.titre|smarty:nodefaults}
+{/if}
+{if $smarty.request.promo_min}
+{assign var=promo_min value=$smarty.request.promo_min|smarty:nodefaults}
+{/if}
+{if $smarty.request.promo_max}
+{assign var=promo_max value=$smarty.request.promo_max|smarty:nodefaults}
+{/if}
+{if $smarty.request.expiration}
+{assign var=expiration value=$smarty.request.expiration|smarty:nodefaults}
+{/if}
+{if $smarty.request.important}
+{assign var=important value=$smarty.request.important|smarty:nodefaults}
+{/if}
+
 <script type="text/javascript">//<![CDATA[
   {literal}
   function updatePreview()
@@ -55,6 +74,7 @@
 <br />
 
 <form action="{$platal->path}" method="post" enctype="multipart/form-data">
+  {xsrf_token_field}
   <table class="bicol">
     <tr>
       <th colspan="2">Contenu de l'annonce</th>
           {/literal}
         //]]></script>
         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.
+        <script type="text/javascript">update_texte_count(document.getElementById('texte').form);</script>
       </td>
     </tr>
     <tr class="pair">
         {if $eid && $img}
         <div style="float: left; text-align: center">
           <em>Image actuelle</em><br />
-          <img src="events/photo/{$eid}" alt="Image actuelle" /><br />
+          <img src="events/photo/{$eid}?{$smarty.now}" alt="Image actuelle" /><br />
           <input type="submit" name="action" value="Pas d'image" />
         </div>
         {/if}
         {if $upload && $upload->exists()}
         <div style="float: right; text-align: center">
           <em>Nouvelle image</em><br />
-          <img src="events/photo" alt="Nouvelle Image" /><br />
+          <img src="events/photo?{$smarty.now}" alt="Nouvelle Image" /><br />
           <input type="submit" name="action" value="Supprimer l'image" />
         </div>
         {/if}
         <div style="clear: both">
-          Choisir un fichier : <input type="file" name="image" id="image" /><br />
-          Indiquer une adresse : <input type="text" name="image_url" id="image_url" value="" />
+          Choisir un fichier&nbsp;: <input type="file" name="image" id="image" /><br />
+          Indiquer une adresse&nbsp;: <input type="text" name="image_url" id="image_url" value="" />
         </div>
       </td>
     </tr>
     </tr>
     <tr class="pair">
       <td colspan="2">
-        Tu peux limiter la visibilité de ton annonce aux camarades de certaines promotions :
+        Tu peux limiter la visibilité de ton annonce aux camarades de certaines promotions&nbsp;:
       </td>
     </tr>
     {include file="include/field.promo.tpl"}
     <tr class="pair">
       <td colspan="2">
-        Choisis la date d'expiration de ton annonce :
+        Choisis la date d'expiration de ton annonce&nbsp;:
       </td>
     </tr>
     <tr>
         Dernier jour d'affichage
       </td>
       <td>
-        {valid_date name="peremption" value=$peremption}
+        {valid_date name="expiration" value=$expiration to=60}
       </td>
     </tr>
     {if $admin_evts}
         Importance
       </td>
       <td>
-        <input type="checkbox" name="important" {if $important}checked="checked"{/if}/> Marquer cette annonce comme très importante
+        <label><input type="checkbox" name="important" {if $important}checked="checked"{/if}/>
+        Marquer cette annonce comme très importante</label>
       </td>
     </tr>
     {/if}