{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
<h1>Sondages</h1>
-<table class="bicol">
+{if $active->total() > 0}
+<table class="bicol" id="surveyList">
<tr>
<th>
Sondages en cours
</th>
+ {if hasPerm('admin')}
+ <th></th>
+ {/if}
</tr>
- {iterate item=s from=$survey_current}
- {if $smarty.session.auth || $s.mode == Survey::MODE_ALL}
- <tr class="{cycle name=cs_cycle values="impair,pair"}">
- <td class="half">
- •
- <a href="survey/vote/{$s.id}">
- {$s.title} [{$s.end|date_format:"%x"} - {$survey_modes[$s.mode]}]
- </a>
+ {iterate from=$active item=survey}
+ <tr class="{cycle values="impair,pair"}">
+ <td>
+ <a href="survey/vote/{$survey->shortname}">{$survey->title}</a>
</td>
- </tr>
- {assign var="has_cs" value="true"}
- {/if}
- {/iterate}
- <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>
-</table>
-
-<br />
-
-<table class="bicol">
- <tr>
- <th>
- Anciens sondages
- </th>
- </tr>
- {iterate item=s from=$survey_old}
- {if $smarty.session.auth || $s.mode == Survey::MODE_ALL}
- <tr class="{cycle name=os_cycle values="impair,pair"}">
- <td class="half">
- •
- <a href="survey/result/{$s.id}">
- {$s.title} [{$s.end|date_format:"%x"} - {$survey_modes[$s.mode]}]
- </a>
+ {if hasPerm('admin')}
+ <td style="text-align: right">
+ <a href="survey/edit/{$survey->shortname}">{icon name=page_edit}</a>
</td>
- </tr>
- {assign var="has_os" value="true"}
{/if}
- {/iterate}
- {if !$has_os}
- <tr>
- <td class="half">Aucun ancien sondage</td>
</tr>
- {/if}
+ {/iterate}
</table>
+{/if}
+<br />
+<div class="center">
+ <a href="survey/edit">{icon name=page_edit} Proposer un nouveau sondage</a>
+</div>
{* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}