Some html fixes
[platal.git] / templates / admin / valider.tpl
index 6ad4a45..f7ea92f 100644 (file)
 
 {if $vit->total()}
 
+{counter print=false start=0 assign=hidden}
+
 {iterate item=valid from=$vit|smarty:nodefaults}
+{assign var=type value=$valid->type}
+{if !$hide_requests[$type]}
 <br />
 <table class="bicol">
   <tr>
@@ -62,6 +66,7 @@
           <input type="hidden" name="uid"    value="{$valid->uid}" />
           <input type="hidden" name="type"   value="{$valid->type}" />
           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
+          <input type="hidden" name="formid" value="{0|rand:65535}" />
           <textarea rows="3" cols="50" name="comm"></textarea>
           <br />
           <input type="submit" name="hold"   value="Commenter" />
   </tr>
   <tr><th colspan='2'>Réponse</th></tr>
   <tr>
-    <td colspan='2' class='center' {popup caption="Règles de validation" text=$valid->rules}>
+    <td colspan='2' {popup caption="Règles de validation" text=$valid->rules}>
       <form action="admin/validate" method="post">
         <div>
+          Réponse préremplie :
+          <select onchange="this.form.comm.value=this.value">
+            <option value=""></option>
+            {foreach from=$valid->answers() item=automatic_answer}
+              <option value="{$automatic_answer.answer}">{$automatic_answer.title}</option>
+            {/foreach}
+          </select>
+          <a href="admin/validate/answers">{icon name="page_edit" title="Editer les réponses automatiques"}</a>
+        </div>
+        <div class='center'>
           Ajouté dans l'email :<br />
           <textarea rows="5" cols="50" name="comm"></textarea><br />
 
     </td>
   </tr>
 </table>
+{else}
+{counter print=false assign=hidden}
+{/if}
 {/iterate}
 
+{if $hidden}
+<p>{$hidden} validation{if $hidden > 1}s ont été masquées{else} a été masquée{/if}.</p>
+{/if}
+
 {else}
 
 <p>Rien à valider</p>
 
 {/if}
 
+<p>
+  Afficher seulement les validation suivantes :
+  <form action="admin/validate" method="post">
+    {foreach from=$categories item=type}
+      <div style="float:left;width:33%"><input type="checkbox" name="{$type}" id="hide_{$type}"{if !$hide_requests[$type]} checked="checked"{/if}/>
+      <label for="hide_{$type}">{$type}</label></div>
+    {/foreach}
+    <div class="center" style="clear:left"><input type="submit" name="hide" value="Valider" /></div>
+  </form>
+</p>
 
 {* vim:set et sw=2 sts=2 sws=2: *}