Translates peremption to expiration.
[platal.git] / templates / xnetgrp / announce-edit.tpl
index c905a36..92ecf00 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  *}
@@ -26,38 +26,39 @@ function visibilityChange(box)
 {
     var state = (box.checked ? 'none' : '');
     document.getElementById('promo_titre').style.display = state;
-    document.getElementById('promo_min').style.display = state;
-    document.getElementById('promo_max').style.display = state;
-    document.getElementById('promo_desc').style.display = state;
+    document.getElementById('promo_min_tr').style.display = state;
+    document.getElementById('promo_max_tr').style.display = state;
+    document.getElementById('promo_range_tr').style.display = state;
 }
 {/literal}
 </script>
-<h1>{$asso.nom} : Edition d'une annonce</h1>
+<h1>{$asso->nom}&nbsp;: Édition d'une annonce</h1>
 
 {if $art.texte}
 <div>
-{include file="xnet/groupe/form.announce.tpl" admin=true}
+{include file="xnetgrp/form.announce.tpl" admin=true}
 <br />
 </div>
 {/if}
 
-<form method="post" action="{$platal->ns}announce/{if $new}new{else}edit/{$art.id}{/if}">
+<form method="post" action="{$platal->ns}announce/{if $new}new{else}edit/{$art.id}{/if}" enctype="multipart/form-data">
+{xsrf_token_field}
 <div>
   <table class="bicol">
     <tr>
-      <th colspan="2">Editer une annonce</th>
+      <th colspan="2">Éditer une annonce</th>
     </tr>
     <tr class="pair">
-      <td class="titre">Titre :</td>
+      <td class="titre">Titre&nbsp;:</td>
       <td><input type="text" name="titre" value="{$art.titre}" size="50" maxlength="200" /></td>
     </tr>
     <tr>
-      <td class="titre">Contenu de l'annonce :</td>
+      <td class="titre">Contenu de l'annonce&nbsp;:</td>
       <td>
         <small>
-          Le contenu est destiné à recevoir la descriptioin de ce qui est annoncé.
-          Il faut éviter d'y mettre des adresses mails ou web (surtout si l'annonce est publique),
-          qui devront être placées dans la section "contacts".
+          Le contenu est destiné à recevoir la description de ce qui est annoncé.
+          Il faut éviter d'y mettre des adresses emails ou web (surtout si l'annonce est publique),
+          qui devront être placées dans la section "contacts".
         </small>
       </td>
     </tr>
@@ -76,19 +77,19 @@ function visibilityChange(box)
           {/literal}
         </script>
         <small>
-          Essaie de faire un <strong>texte court</strong>, une annonce ne doit pas excéder 600 caractères soit une dizaine de ligne.
-          Tu en es déjà à <input type='text' name='texte_count' size="4"/> caractères.
-          Si tu veux proposer cette annonce pour la Lettre Mensuelle, il faut te limiter à 8 lignes.
+          Essaie de faire un <strong>texte court</strong>, une annonce ne doit pas excéder 600 caractères soit une dizaine de lignes.
+          Tu en es déjà à <input type='text' name='texte_count' size="4"/> caractères.
+          Si tu veux proposer cette annonce pour la Lettre Mensuelle, il faut te limiter à 8 lignes.
         </small>
       </td>
     </tr>
     <tr style="border-top: 1px solid gray">
-      <td class="titre">Contacts :</td>
+      <td class="titre">Contacts&nbsp;:</td>
       <td>
         <small>
-          La section "contacts" sert à noter les informations telles que les adresses mails de contact, les sites web.
-          Elle n'est accessible qu'aux personnes authentifiées. Si l'annonce est attachée à une événement, un lien vers
-          la page d'inscription est automatiquement ajouté.
+          La section "contacts" sert à noter les informations telles que les adresses emails de contact, les sites web.
+          Elle n'est accessible qu'aux personnes authentifiées. Si l'annonce est attachée à un événement, un lien vers
+          la page d'inscription est automatiquement ajouté.
         </small>
       </td>
     </tr>
@@ -97,26 +98,55 @@ function visibilityChange(box)
         <textarea cols="60" rows="6" name='contacts'>{$art.contacts}</textarea>
       </td>
     </tr>
+    <tr style="border-top: 1px solid gray">
+      <td class="titre">Illustration&nbsp;:</td>
+      <td>
+        {if $art.id && $art.photo}
+        <div style="float: left; text-align: center">
+          <em>Image actuelle</em><br />
+          <img src="{$platal->ns}announce/photo/{$art.id}" alt="Image actuelle" /><br />
+          <input type="submit" name="valid" value="Pas d'image" />
+          <input type="hidden" name="photo" value="1" />
+        </div>
+        {/if}
+        {if $upload && $upload->exists()}
+        <div style="float: right; text-align: center">
+          <em>Nouvelle image</em><br />
+          <img src="{$platal->ns}announce/photo" alt="Nouvelle Image" /><br />
+          <input type="submit" name="valid" value="Supprimer l'image" />
+        </div>
+        {/if}
+        <div style="clear: both">
+          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 style="border-top: 1px solid gray">
+      <td colspan="2" class="center">
+        <a href="wiki_help/notitle" class="popup3">
+          {icon name=information title="Syntaxe wiki"} Voir la liste des marqueurs de mise en forme autorisés.
+        </a>
+      </td>
+    </tr>
   </table>
   <br />
 
   <table class="tinybicol">
     <tr>
-      <td class="titre">Date de péremption :</td>
+      <td class="titre">Date de péremption&nbsp;:</td>
       <td>
-        <select name="peremption">
-          {$select|smarty:nodefaults}
-        </select>
+        {valid_date name="expiration" value=$art.expiration}
       </td>
     </tr>
     {if $events}
     <tr>
-      <td class="titre">Attacher à un événement :</td>
+      <td class="titre">Attacher à un événement&nbsp;:</td>
       <td>
         <select name="event">
           <option value="" {if !$art.event}selected="selected"{/if}>-- Aucun --</option>
           {iterate item=evt from=$events}
-          <option value="{$evt.short_name|default:$evt.eid}" 
+          <option value="{$evt.short_name|default:$evt.eid}"
             {if $art.event eq $evt.short_name|default:$evt.eid}selected="selected"{/if}>
             {$evt.intitule}
           </option>
@@ -126,54 +156,43 @@ function visibilityChange(box)
     </tr>
     {/if}
     <tr>
-      <td class="titre">Visibilité :</td>
+      <td class="titre">Visibilité&nbsp;:</td>
       <td>
-        <input type="checkbox" name="public" {if $art.public}checked="checked"{/if} onchange="visibilityChange(this)" />
-        Rendre cette annonce publique
+        <label><input type="checkbox" name="public" {if $art.public}checked="checked"{/if} onchange="visibilityChange(this)" />
+        Rendre cette annonce publique.</label>
       </td>
     </tr>
     <tr id="promo_titre" {if $art.public}style="display: none"{/if}>
       <th colspan="2">Promotions cibles</th>
     </tr>
-    <tr id="promo_min"  {if $art.public}style="display: none"{/if}>
-      <td class="titre">Promotion minimale :</td>
-      <td>
-        <input type="text" size="4" maxlength="4" name="promo_min" value="{$art.promo_min|default:0}" />
-        incluse*  (ex : 1980)
-      </td>
-    </tr>
-    <tr id="promo_max"  {if $art.public}style="display: none"{/if}>
-      <td class="titre">Promotion minimale :</td>
-      <td>
-        <input type="text" size="4" maxlength="4" name="promo_max" value="{$art.promo_max|default:0}" />
-        incluse*  (ex : 2000)
-      </td>
-    </tr>
-    <tr class="pair" id="promo_desc"  {if $art.public}style="display: none"{/if}>
-      <td colspan="2">
-        <small>* 0 signifie qu'il n'y a pas de limite</small>
-      </td>
-    </tr>
+    {include file="include/field.promo.tpl" promo_min=$art.promo_min promo_max=$art.promo_max}
+    {if $art.public}
+    <script type="text/javascript">//<![CDATA[
+      document.getElementById('promo_min_tr').style.display = 'none';
+      document.getElementById('promo_max_tr').style.display = 'none';
+      document.getElementById('promo_range_tr').style.display = 'none';
+    //]]></script>
+    {/if}
     {if $new}
     <tr>
       <th colspan="2">Demandes de publication</th>
     </tr>
     <tr>
       <td colspan="2">
-        <input type="checkbox" name="xorg" {if $art.xorg}checked="checked"{/if} />
-        sur la page d'accueil de Polytechnique.org
+        <label><input type="checkbox" name="xorg" {if $art.xorg}checked="checked"{/if} />
+        sur la page d'accueil de Polytechnique.org</label>
       </td>
     </tr>
     <tr>
       <td colspan="2">
-        <input type="checkbox" name="nl" {if $art.nl}checked="checked"{/if} />
-        dans la Lettre Mensuelle de Polytechnique.org
+        <label><input type="checkbox" name="nl" {if $art.nl}checked="checked"{/if} />
+        dans la Lettre Mensuelle de Polytechnique.org</label>
       </td>
     </tr>
     <tr class="pair">
       <td colspan="2">
-        <small>Les demandes de publication sont soumises à validation par l'équipe
-        de Polytechnique.org</small>
+        <small>Les demandes de publication sont soumises à validation par l'équipe
+        de Polytechnique.org.</small>
       </td>
     </tr>
     {/if}
@@ -185,7 +204,7 @@ function visibilityChange(box)
     {/if}
     <input type="submit" name="valid" value="Visualiser" /><br />
     {if $art.texte}
-    <input type="submit" name="valid" value="Enregistrer" /> 
+    <input type="submit" name="valid" value="Enregistrer" />
     {if !$new}
     <input type="submit" name="valid" value="Annuler" />
     {/if}
@@ -194,4 +213,4 @@ function visibilityChange(box)
 </div>
 </form>
 
-{* vim:set et sw=2 sts=2 sws=2: *}
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}