Grey submit button on send mail page after click.
[platal.git] / templates / admin / user.tpl
index 0b98fff..61696d0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2014 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -93,8 +93,8 @@ function ban_read()
     document.forms.bans.read_perm.value = "!xorg.*";
 }
 
-$(document).ready(function() {
-  $('#tabs > ul').tabs();
+$(function() {
+  $('#tabs').tabs();
   $('.ui-tabs-nav li').width('24%')
     .click(function() { $(this).children('a').click() });
 });
@@ -105,12 +105,11 @@ $(document).ready(function() {
 
 <div id="tabs">
   <ul style="margin-top: 0">
-    <li><a href="{$platal->pl_self()}#account"><span >Compte de {$user->login()}</span></a></li>
-    <li><a href="{$platal->pl_self()}#emails"><span>Emails</span></a></li>
-    <li><a href="{$platal->pl_self()}#authext"><span>OpenID</span></a></li>
-    <li><a href="{$platal->pl_self()}#forums"><span>Forums</span></a></li>
+    <li><a href="#account"><span>Compte de {$user->login()}</span></a></li>
+    <li><a href="#emails"><span>Emails</span></a></li>
+    <li><a href="#authext"><span>OpenID</span></a></li>
+    <li><a href="#forums"><span>Forums</span></a></li>
   </ul>
-</div>
 
 <div id="account">
 <form id="auth" method="post" action="admin/user/{$user->login()}#account">
@@ -138,21 +137,31 @@ $(document).ready(function() {
       </th>
     </tr>
     <tr>
-      <td class="titre">Nom complet<br />
-        <span class="smaller">Prénom NOM</span>
-      </br></td>
-      <td>{if $hasProfile}{$user->fullName()}{else}<input type="text" name="full_name" maxlength="255" value="{$user->fullName()}" />{/if}</td>
+      <td class="titre">Nom complet</td>
+      <td>{$user->fullName()}</td>
     </tr>
     <tr>
-      <td class="titre">Nom annuaire<br />
-        <span class="smaller">NOM Prénom</span>
-      </td>
-      <td>{if $hasProfile}{$user->directoryName()}{else}<input type="text" name="directory_name" maxlength="255" value="{$user->directoryName()}" />{/if}</td>
+      <td class="titre">Nom annuaire</td>
+      <td>{$user->directoryName()}</td>
     </tr>
+    {if !$hasProfile}
+    <tr>
+      <td class="titre">Nom</td>
+      <td><input type="text" name="lastname" maxlength="255" value="{$user->lastname}" /></td>
+    </tr>
+    {if $user->type neq 'virtual'}
+    <tr>
+      <td class="titre">Prénom</td>
+      <td><input type="text" name="firstname" maxlength="255" value="{$user->firstname}" /></td>
+    </tr>
+    {/if}
+    {/if}
+    {if $user->type neq 'virtual'}
     <tr>
       <td class="titre">Nom affiché</td>
       <td>{if $hasProfile}{$user->displayName()}{else}<input type="text" name="display_name" maxlength="255" value="{$user->displayName()}" />{/if}</td>
     </tr>
+    {/if}
     <tr>
       <td class="titre">Sexe</td>
       <td>
@@ -160,6 +169,10 @@ $(document).ready(function() {
         <label><input type="radio" name="sex" value="male" {if !$user->isFemale()}checked="checked"{/if} /> homme</label>
       </td>
     </tr>
+    <tr>
+      <td class="titre">Email</td>
+      <td>{if $user->checkPerms('mail')}{$user->forlifeEmail()}{else}<input type="text" name="email" size="40" maxlength="255" value="{$user->forlifeEmail()}" />{/if}</td>
+    </tr>
     <tr class="impair">
       <td class="titre">Mot de passe</td>
       <td>
@@ -249,7 +262,7 @@ $(document).ready(function() {
     </tr>
     <tr class="impair">
       <td colspan="2" class="center">
-        <input type="submit" name="update_account" value="Mettre à jour" onclick="return hashResponse('new_plain_password', false, false);" />
+        <input type="submit" name="update_account" value="Mettre à jour" onclick="return hashResponse('new_plain_password', false, false, false);" />
         <input type="submit" name="su_account" value="Prendre l'identité" />
         <input type="submit" name="log_account" value="Consulter les logs" />
         {if $user->state neq 'pending'}
@@ -276,7 +289,7 @@ $(document).ready(function() {
     <tr>
       <td><input type="radio" name="owner" value="{$profile.pid}" {if $profile.owner}checked="checked"{/if}
                  onclick="this.form.submit()" /></td>
-      <td>{$profile.hrpid} (pid {$profile.pid})</td>
+      <td>{$profile.hrpid} (pid {$profile.pid}, ax_id {$profile.ax_id})</td>
       <td class="right">
         <a href="profile/edit/{$profile.hrpid}">{icon name=user_edit}</a>
         <a href="profile/{$profile.hrpid}" class="popup2">{icon name=user_suit}</a>
@@ -303,6 +316,26 @@ $(document).ready(function() {
   </table>
 </form>
 
+<h1>Groupes dont l'utilisateur est membre</h1>
+
+<table class="bicol">
+  <tr>
+    <th>Nom du groupe</th>
+    <th>Permissions</th>
+  </tr>
+  {foreach from=$user->groups() item=group}
+  <tr class="impair">
+    <td>{$group.nom}</td>
+    <td style="text-align: right">
+      {$group.perms}
+      <a href="http://www.polytechnique.net/{$group.diminutif}/member/{$user->hruid}">
+      {icon name="user_edit" title="Modifier l'inscription"}
+      </a>
+    </td>
+  </tr>
+  {/foreach}
+</table>
+
 </div>
 
 <div id="emails">
@@ -319,24 +352,24 @@ $(document).ready(function() {
     {iterate from=$aliases item=a}
     <tr class="{cycle values="impair,pair"}">
       <td>
-        <input type="radio" name='best' {if $a.best}checked="checked"{/if} value='{$a.alias}' onclick="this.form.submit()" />
+        <input type="radio" name='best' {if $a.bestalias}checked="checked"{/if} value='{$a.email}' onclick="this.form.submit()" />
       </td>
       <td>
-        {if $a.for_life}<strong>{$a.alias}</strong>{else}{$a.alias}{/if}
+        {if $a.forlife}<strong>{$a.email}</strong>{elseif $a.alias}<em>{$a.email}</em>{else}{$a.email}{/if}
         {if $a.expire}<span class='erreur'>(expire le {$a.expire|date_format})</span>{/if}
       </td>
-      {if $a.for_life}
+      {if $a.forlife}
       <td>garanti à vie*</td>
       {else}
       <td class="action">
-        <a href="javascript:del_alias('{$a.alias}')">{icon name=cross}</a>
+        <a href="javascript:del_alias('{$a.email}')">{icon name=cross}</a>
       </td>
       {/if}
     </tr>
     {/iterate}
     <tr class="{cycle values="impair,pair"}">
       <td colspan="2" class="detail">
-        <input type="text" name="email" size="29" maxlength="60" value="" />
+        <input type="text" name="email" size="29" maxlength="255" value="" />
       </td>
       <td class="action">
         <input type="hidden" name="uid" value="{$user->id()}" />
@@ -358,7 +391,7 @@ $(document).ready(function() {
   {xsrf_token_field}
   <table class="bicol" cellpadding="2" cellspacing="0">
     <tr>
-      <th colspan="4">
+      <th colspan="5">
         Redirections
       </th>
     </tr>
@@ -386,23 +419,26 @@ $(document).ready(function() {
       </td>
       <td>
         {if $mail->broken}<span style="color: #f00">{/if}
-        {if $mail->email == 'googleapps'}<a href="admin/googleapps/user/{$user->login()}">{/if}
+        {if $mail->type == 'googleapps'}<a href="admin/googleapps/user/{$user->login()}">{/if}
         {$mail->display_email}
-        {if $mail->email == 'googleapps'}</a>{/if}
+        {if $mail->type == 'googleapps'}</a>{/if}
         {if $mail->broken}<em> (en panne)</em></span>{/if}
       </td>
+      <td>
+        {if $mail->type != 'imap'}<span class="smaller">(niveau {$mail->filter_level} : {$mail->action})</span>{/if}
+      </td>
       <td class="action">
         {if $mail->is_removable()}
         <a href="javascript:del_fwd('{$mail->email}')">{icon name=cross}</a>
         {/if}
       </td>
     </tr>
-    {if $mail->panne && $mail->panne neq "0000-00-00"}
+    {if $mail->broken && $mail->broken_date neq "0000-00-00"}
     <tr class="{$class}">
-      <td colspan="3" class="smaller" style="color: #f00">
+      <td colspan="4" class="smaller" style="color: #f00">
         {icon name=error title="Panne"}
-        Panne de {$mail->display_email} le {$mail->panne|date_format}
-        {if $mail->panne neq $mail->last}confirmée le {$mail->last|date_format}{/if}
+        Panne de {$mail->display_email} le {$mail->broken_date|date_format}
+        {if $mail->broken_date neq $mail->last}confirmée le {$mail->last|date_format}{/if}
       </td>
       <td class="action">
         <a href="javascript:clean_fwd('{$mail->email}')">effacer les pannes</a>
@@ -415,8 +451,8 @@ $(document).ready(function() {
       <td class="titre" colspan="2">
         Ajouter une adresse
       </td>
-      <td>
-        <input type="text" name="email" size="29" maxlength="60" value="" />
+      <td colspan="2">
+        <input type="text" name="email" size="29" maxlength="255" value="" />
       </td>
       <td class="action">
         <input type="hidden" name="uid" value="{$user->id()}" />
@@ -428,7 +464,7 @@ $(document).ready(function() {
       </td>
     </tr>
     <tr class="{$class}">
-      <td colspan="4" class="center">
+      <td colspan="5" class="center">
         {if $actives}
         <input type="submit" name="disable_fwd" value="Désactiver la redirection des emails" />
         {/if}
@@ -440,14 +476,35 @@ $(document).ready(function() {
   </table>
 </form>
 
-{javascript name="ajax"}
 {test_email hruid=$user->login()}
 
 <h1>Autres adresses de l'utilisateur</h1>
 
 <table class="bicol">
   <tr>
-    <th>Virtual aliases auquel l'utilisateur appartient</th>
+    <th colspan="3">Mailing lists auquelles l'utilisateur appartient</th>
+  </tr>
+  {foreach from=$mlists item=mlist}
+  <tr>
+    <td>
+      <a href="http://listes.polytechnique.org/members/{$mlist.addr|replace:"@":"_"}">
+      {$mlist.addr}
+      </a>
+    </td>
+    <td>
+      <input type="checkbox" disabled="disabled" {if $mlist.sub}checked="checked"{/if} /> Membre
+    </td>
+    <td>
+      <input type="checkbox" disabled="disabled" {if $mlist.own}checked="checked"{/if} /> Modérateur
+    </td>
+  </tr>
+  {/foreach}
+</table>
+
+<br />
+<table class="bicol">
+  <tr>
+    <th>Alias de groupe auquel l'utilisateur appartient</th>
   </tr>
   {foreach from=$virtuals item=virtual}
   <tr class="{cycle values="impair,pair"}">
@@ -527,6 +584,7 @@ $(document).ready(function() {
   </table>
 </form>
 </div>
+</div>
 {/if}
 
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
+{* vim:set et sw=2 sts=2 sws=2 fenc=utf-8: *}