Merge remote branch 'origin/platal-1.0.0' into platal-1.0.1
[platal.git] / templates / profile / groups.tpl
index 253c64b..116f1f3 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  *}
 {*                                                                        *}
 {**************************************************************************}
 
-<table class="bicol" style="margin-bottom: 1em" summary="Profil: Informations Polytechniciennes">
+<table class="bicol" style="margin-bottom: 1em" summary="Profil&nbsp;: Informations Polytechniciennes">
   <tr>
     <th colspan="2">
+      <div class="flags" style="float: left">
+        <input type="checkbox" name="accesX" checked="checked" disabled="disabled" />
+        {icon name="flag_red" title="privé"}
+      </div>
       Informations polytechniciennes
     </th>
   </tr>
-  <tr>
-    <td colspan="2" class="flags">
-      <span class="rouge"><input type="checkbox" name="accesX" checked="checked" disabled="disabled" /></span>
-      <span class="texte">privé</span>
-    </td>
-  </tr>
   <tr class="top">
     <td class="titre" style="width: 30%">{if $old}ex-{/if}Section</td>
     <td>
       <select name="section">
-        {select_db_table table="sections" valeur=$section}
+        {select_db_table table="profile_section_enum" valeur=$section pad="1"}
       </select>
     </td>
   </tr>
   <!-- Binets -->
-  <tr id="binets">
+  <tr id="binets_table">
     <td class="titre">{if $old}ex-{/if}Binet(s)</td>
     <td>
-      <select name="binets_sel" onchange="updateGroup('binets')">
-        {select_db_table table="binets_def" valeur=0 champ="text" pad='1'}
+      <select name="binets_sel" onchange="updateElement('binets')">
+        {select_db_table table="profile_binet_enum" valeur=0 champ="text" pad="1"}
       </select>
       <a id="binets_add" style="display: none"
-         href="javascript:addGroup('binets')">{icon name="add" title="Ajouter ce binet"}</a>
+         href="javascript:addBinet()">{icon name="add" title="Ajouter ce binet"}</a>
     </td>
   </tr>
   {foreach item=text key=bid from=$binets}
@@ -60,7 +58,7 @@
       <div style="float: left; width: 70%">
         {$text}
       </div>
-      <a href="javascript:removeGroup('binets', {$bid})">{icon name="cross" title="Supprimer ce binet"}</a>
+      <a href="javascript:removeElement('binets',{$bid})">{icon name="cross" title="Supprimer ce binet"}</a>
     </td>
   </tr>
   {/foreach}
       <p>
         La gestion des annuaires des groupes X est réalisée grâce à
         <a href="http://www.polytechnique.net">Polytechnique.net</a>. Pour faire apparaître un groupe sur ta fiche
-        il faut que soit inscrit dans ce groupe sur l'annuaire sur Polytechnique.net.
-      </p>
-      <p>
-        Tu es actuellement inscrit aux groupes X suivants&nbsp;:
+        il faut que tu sois inscrit dans ce groupe sur <a href="http://www.polytechnique.net">Polytechnique.net</a>.
       </p>
     </td>
   </tr>
-  {iterate from=$mygroups item=group}
   <tr>
-    <td class="titre">
-      {if $group.pub neq 'public'}{icon name=error title="Liste de membres a accès restreint"}{/if}
-      {if $group.perms eq 'admin'}{icon name=wrench title="Tu es administrateur du groupe"}{/if}
-      {if $group.site}<a href="{$group.site}">{else}<a href="http://www.polytechnique.net/{$group.diminutif}">{/if}
-      {$group.nom}
-      </a>
-    </td>
-    <td style="text-align: right; width: 30%">
-      <a href="{if $group.unsub_url}{$group.unsub_url}{else}http://www.polytechnique.net/{$group.diminutif}/unsubscribe{/if}">
-        {icon name=cross title="Demander désinscription"} Demander ta désinscription
-      </a>
-    </td>
-  </tr>
-  {/iterate}
-  <tr>
-    <td colspan="2" class="smaller">
-      <div class="titre">Signification des symboles&nbsp;:</div>
-      {icon name=error} L'annuaire du groupe est à visibilité restreinte et ce groupe n'apparaîtra pas sur ta fiche<br />
-      {icon name=wrench} Tu es administrateur du groupe
-    </td>
-  </tr>
-  <tr class="pair">
     <td colspan="2">
       <p>
         Tu peux demander ton inscription aux groupes X qui t'intéressent. Voici la liste de ceux disponibles actuellement
         sur Polytechnique.net et qui autorisent les demandes d'inscription&nbsp;:
       </p>
     </td>
-  <tr class="pair">
+  </tr>
+  <tr>
     <td>
       {assign var=groupcat value=""}
       {assign var=ingroup value=false}
-      <select name="groupesx_sub" onchange="updateSubLink(this)">
+      <select name="groupesx_sub" onchange="updateGroupSubLink()">
         {iterate from=$listgroups item=group}
         {if $group.dom neq $groupcat}
           {if $ingroup}
       </a>
     </td>
   </tr>
+  {if $mygroups->total()}
+  <tr class="pair">
+    <td colspan="2">Tu es actuellement dans les groupes suivants&nbsp;:</td>
+  </tr>
+  {/if}
+  {assign var=grp_admin value=false}
+  {assign var=grp_public value=false}
+  {iterate from=$mygroups item=group}
+  <tr class="pair">
+    <td class="titre">
+      {if $group.pub neq 'public'}
+        {icon name=error title="Liste de membres a accès restreint"}
+        {assign var=grp_public value=true}
+      {/if}
+      {if $group.perms eq 'admin'}
+        {icon name=wrench title="Tu es administrateur du groupe"}
+        {assign var=grp_admin value=true}
+      {/if}
+      {if $group.site}<a href="{$group.site}">{else}<a href="http://www.polytechnique.net/{$group.diminutif}">{/if}
+      {$group.nom}
+      </a>
+    </td>
+    <td style="text-align: right; width: 30%">
+      <a href="{if $group.unsub_url}{$group.unsub_url}{else}http://www.polytechnique.net/{$group.diminutif}/unsubscribe{/if}">
+        {icon name=cross title="Demander désinscription"} Demander ta désinscription
+      </a>
+    </td>
+  </tr>
+  {/iterate}
+  {if $grp_admin || $grp_public}
+  <tr class="pair">
+    <td colspan="2" class="smaller">
+      <div class="titre">Signification des symboles&nbsp;:</div>
+      {if $grp_public}{icon name=error} L'annuaire du groupe est à visibilité restreinte et ce groupe n'apparaîtra pas sur ta
+      fiche.{/if}
+      {if $grp_public && $grp_admin}<br />{/if}
+      {if $grp_admin}{icon name=wrench} Tu es administrateur du groupe.{/if}
+    </td>
+  </tr>
+  {/if}
 </table>
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}