{**************************************************************************}
{* *}
-{* 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()
{
+ if (document.getElementById('image').value != '' || document.getElementById('image_url').value != '') {
+ return true;
+ }
var titre = document.getElementById('titre').value;
var texte = document.getElementById('texte').value;
</div>
<br />
-<form action="{$platal->path}" method="post">
+<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>
</tr>
<tr>
<td class="titre">Texte</td>
- <td><textarea name="texte" id="texte" rows="10" cols="60" onfocus="update_texte_count(this.form)">{$texte}</textarea></td>
+ <td>
+ <textarea name="texte" id="texte" rows="10" cols="60" onfocus="update_texte_count(this.form)">{$texte}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="smaller">
+ <a href="wiki_help/notitle" class="popup3">
+ {icon name=information title="Syntaxe wiki"} Voir la syntaxe wiki autorisée pour le texte de l'annonce
+ </a>
+ </td>
</tr>
<tr>
<td colspan="2" class="smaller">
- <script type="text/javascript">
+ <script type="text/javascript">//<![CDATA[
var form_propose_texte = false;
{literal}
function update_texte_count(f) {
setTimeout("update_texte_count(0)", 100);
}
{/literal}
- </script>
+ //]]></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">
+ <td class="titre">Illustration</td>
+ <td>
+ {if $eid && $img}
+ <div style="float: left; text-align: center">
+ <em>Image actuelle</em><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?{$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="" />
+ </div>
</td>
</tr>
</table>
<div class="center">
- <input type="submit" name="preview" value="Aperçu" onclick="updatePreview(); return false;" />
+ <input type="submit" name="preview" value="Aperçu" onclick="return updatePreview();" />
</div>
<p id="info" {if trim($texte) && trim($titre)}style="display: none"{/if}>
Le bouton de confirmation n'apparaît que si l'aperçu est concluant.
</p>
<p class="erreur">
- N'oublie pas de remplir suivantes :
+ N'oublie pas de remplir les informations suivantes :
</p>
<table class="bicol">
</tr>
<tr class="pair">
<td colspan="2">
- Tu peux limiter la visibilité de ton annonce aux camarades de certaines promotions :
- </td>
- </tr>
- <tr class="impair">
- <td class="titre">Promotion la plus ancienne</td>
- <td>
- <input type="text" name="promo_min" size="4" maxlength="4" value="{$promo_min}" /> incluse
- <em>(ex : 1980, 0 signifie pas de minimum)</em>
- </td>
- </tr>
- <tr class="impair">
- <td class="titre">Promotion la plus jeune</td>
- <td>
- <input type="text" name="promo_max" size="4" maxlength="4" value="{$promo_max}" /> incluse
- <em>(ex : 2000, 0 signifie pas de maximum)</em>
+ Tu peux limiter la visibilité de ton annonce aux camarades de certaines promotions :
</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 :
</td>
</tr>
<tr>
Dernier jour d'affichage
</td>
<td>
- <select name="peremption">
- {$select|smarty:nodefaults}
- </select>
+ {valid_date name="expiration" value=$expiration to=60}
+ </td>
+ </tr>
+ {if $admin_evts}
+ <tr>
+ <td class="titre">
+ Importance
+ </td>
+ <td>
+ <label><input type="checkbox" name="important" {if $important}checked="checked"{/if}/>
+ Marquer cette annonce comme très importante</label>
</td>
</tr>
+ {/if}
</table>
<div class="center" {if !trim($texte) || !trim($titre)}style="display: none"{/if} id="valid">