2006 => 2007 Happy New Year\!
[platal.git] / templates / xnetevents / index.tpl
index 6e2339b..cfe5e19 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
+{if !$is_admin}
 <h1>{$asso.nom} : Evénements</h1>
+{else}
+<h1>
+  {$asso.nom} : 
+  {if $archive}[<a href="{$platal->ns}events">Evénements</a>] {else}Evénements {/if}
+  {if $archive}Archives {else}[<a href="{$platal->ns}events/archive">Archives</a>] {/if}
+</h1>
+
+{if $updated}
+<p class='error'>
+  La modification de l'inscription a été prise en compte !
+  {if $updated.topay > $updated.paid}
+    <br/>N'oublie pas de payer {math equation="a-b" a=$updated.topay b=$updated.paid}&nbsp;&euro;
+    {if $updated.paid > 0}
+    (tu as déjà payé {$updated.paid|replace:'.':','}&nbsp;&euro;)
+    {/if}
+    {if $updated.paiement_id}
+    [<a href="{$platal->ns}payment/{$updated.paiement_id}?montant={math equation="a-b" a=$updated.topay b=$updated.paid}">
+    Payer en ligne</a>]
+    {/if}
+  {/if}
+</p>
+{/if}
 
-{if $admin}
+{if !$archive}
 <p class="center">
   [<a href="{$platal->ns}events/edit">Annoncer un nouvel événement</a>]
 </p>
 {/if}
+{/if}
 
 {foreach from=$evenements item=e}
 
     <col width='25%' />
   </colgroup>
   <tr>
-    <th colspan="2">
+    <th colspan="2"{if !$e.inscr_open} class="grayed"{/if}>
+      <a href="{$platal->ns}events/ical/{$e.short_name|default:$e.eid}/{$e.short_name|default:$e.eid}.ics" style="display: block; float: left;">
+        {icon name=calendar_view_day title="Evénement iCal"}
+      </a>
       {$e.intitule}
-      {if $admin}
+      {if !$e.inscr_open}
+      (<span class="error">Inscriptions closes</span>)
+      {/if}
+      {if $is_admin}
       <br />
-      [<a href="{$platal->ns}events/edit/{$e.eid}">
+      [<a href="{$platal->ns}events/edit/{$e.short_name|default:$e.eid}">
         modifier
         {icon name=date_edit title="Edition de l'événement"}</a>]
-      &nbsp;&nbsp;&nbsp;&nbsp;
+      &nbsp;
+      [<a href="javascript:dynpostkv('{$platal->pl_self()}', {if !$archive}'archive'{else}'unarchive'{/if}, {$e.eid})">
+        {if !$archive}
+          archiver
+          {icon name=package_add title="Archivage"}</a>]
+        {else}
+          désarchiver
+          {icon name=package_delete title="Désarchivage"}</a>]
+        {/if}
+      &nbsp;
       [<a href="javascript:dynpostkv('{$platal->ns}events', 'del', {$e.eid})"
         onclick="return confirm('Supprimer l\'événement effacera la liste des inscrits et des paiements.\n Es-tu sûr de vouloir supprimer l\'événement ?')">
         supprimer
     </td>
   </tr>
 
+  {if $is_admin || $e.show_participants || ($e.deadline_inscription && $e.inscr_open)}
   <tr>
     <td class="titre">Informations :</td>
     <td class='actions'>
-      {if $admin || $e.show_participants}
-      <a href="{$platal->ns}events/admin/{$e.eid}">
+      {if $is_admin || $e.show_participants}
+      <a href="{$platal->ns}events/admin/{$e.short_name|default:$e.eid}">
         consulter la liste des participants
         {icon name=group title="Liste des participants"}
       </a><br />
       {/if}
-      {if $e.deadline_inscription}
-        {if $e.inscr_open}
-          dernières inscriptions
-          le {$e.deadline_inscription|date_format:"%d %B %Y"}
-        {else}
-          <span class='error'>Inscriptions closes.</span><br />
-        {/if}
+      {if $e.deadline_inscription && $e.inscr_open}
+        dernières inscriptions
+        le {$e.deadline_inscription|date_format:"%d %B %Y"}
       {/if}
     </td>
   </tr>
+  {/if}
 
   <tr>
     <td class="titre">
 
       {if $e.topay}
       <span class="error">
-      Tu dois payer {$e.topay|replace:'.':','}&nbsp;&euro;
-      {if $e.paid > 0}
-      (tu as déjà payé {$e.paid|replace:'.':','}&nbsp;&euro;)
-      {/if}
-      {if $e.paiement_id}
-        [<a href="https://www.polytechnique.org/payment/{$e.paiement_id}?montant={$e.topay}}">
+        {if !$e.paid}
+        Tu dois payer {$e.topay|replace:'.':','}&nbsp;&euro;.
+        {elseif $e.paid < $e.topay}
+        Tu dois encore payer {math equation="a-b" a=$e.topay b=$e.paid|replace:'.':','}&nbsp;&euro;
+        (tu as déjà payé {$e.paid|replace:'.':','}&nbsp;&euro;)
+        {else}
+        Tu as déjà payé les {$e.paid|replace:'.':','}&nbsp;&euro; de ton inscription.
+        {/if}
+        {if $e.paiement_id &&  $e.paid < $e.topay}
+        [<a href="{$platal->ns}payment/{$e.paiement_id}?montant={math equation="a-b" a=$e.topay b=$e.paid}">
         Payer en ligne</a>]
-      {/if}
+        {/if}
       </span>
       {/if}
     </td>
   <tr>
     <td colspan='2' class='center'>
       <strong>
-      <a href='{$platal->ns}events/sub/{$e.eid}'>
+      <a href='{$platal->ns}events/sub/{$e.short_name|default:$e.eid}'>
         gérer mon inscription
       </a>
       </strong>
 
 {foreachelse}
 
+
 <p class="descr">
+{if $archive}
+  Aucun événement n'a été archivé par les animateurs du groupe.
+{else}
   Aucun événement n'a été référencé par les animateurs du groupe.
+{/if}
 </p>
 
 {/foreach}
 
+{if $evenements}
+<p class="descr">
+  En cliquant sur l'icône {icon name=calendar_view_day title="Evénement iCal"} associée à un événement
+  tu peux télécharger la version iCal de l'événement qui permet de l'ajouter dans ton agenda électronique
+</p>
+{/if}
+
 {* vim:set et sw=2 sts=2 sws=2: *}