Only uses autoload to require validation classes.
[platal.git] / templates / survey / index.tpl
index 9c65e5b..9a97536 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  *}
@@ -22,6 +22,8 @@
 
 <h1>Sondages</h1>
 
+{* Survey::MODE_ALL equals 0. *}
+{assign var=SurveyMODE_ALL value=0}
 <table class="bicol">
   <tr>
     <th>
@@ -29,8 +31,8 @@
     </th>
   </tr>
   {iterate item=s from=$survey_current}
-    {if $smarty.session.auth || $s.mode == Survey::MODE_ALL}
-  <tr class="{cycle values="impair,pair"}">
+  {if $smarty.session.auth || $s.mode == $SurveyMODE_ALL}
+  <tr class="{cycle name=cs_cycle values="impair,pair"}">
     <td class="half">
       &bull;
       <a href="survey/vote/{$s.id}">
       </a>
     </td>
   </tr>
-      {assign var="has_cs" value="true"}
-    {/if}
+    {assign var="has_cs" value="true"}
+  {/if}
   {/iterate}
-  {if !$has_cs}
-  <tr>
-    <td class="half">Aucun sondage en cours</td>
+  <tr class="impair">
+    <td class="half">
+      {if !$has_cs}Aucun sondage en cours{/if}
+      {if $smarty.session.auth}<a style="display: block; float: right;" href="survey/edit/new">{icon name=page_edit} Proposer un sondage</a>{/if}
+    </td>
   </tr>
-  {/if}
 </table>
 
 <br />
@@ -57,8 +60,8 @@
     </th>
   </tr>
   {iterate item=s from=$survey_old}
-    {if $smarty.session.auth || $s.mode == Survey::MODE_ALL}
-  <tr class="{cycle values="impair,pair"}">
+    {if $smarty.session.auth || $s.mode == $SurveyMODE_ALL}
+  <tr class="{cycle name=os_cycle values="impair,pair"}">
     <td class="half">
       &bull;
       <a href="survey/result/{$s.id}">
@@ -76,6 +79,4 @@
   {/if}
 </table>
 
-<a href="./survey/edit/new">Proposer un sondage</a>
-
 {* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}