Tabbed page for admin/user.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 4 Jan 2009 21:06:13 +0000 (22:06 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 4 Jan 2009 21:06:13 +0000 (22:06 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Makefile
core
htdocs/css/base.css
htdocs/css/keynote.css
modules/admin.php
templates/admin/utilisateurs.tpl

index 958a9b1..d982bca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -164,7 +164,10 @@ $(MEDAL_THUMBNAILS): $(subst /medals/thumb/,/medals/,$(@F))
 JQUERY_PLUGINS=color
 JQUERY_PLUGINS_PATHES=$(addprefix htdocs/javascript/jquery.,$(addsuffix .js,$(JQUERY_PLUGINS)))
 
-jquery: htdocs/javascript/jquery.js htdocs/javascript/jquery.autocomplete.js $(JQUERY_PLUGINS_PATHES)
+JQUERY_UI=core tabs
+JQUERY_UI_PATHES=$(addprefix htdocs/javascript/ui.,$(addsuffix .js,$(JQUERY_UI)))
+
+jquery: htdocs/javascript/jquery.js htdocs/javascript/jquery.autocomplete.js $(JQUERY_PLUGINS_PATHES) $(JQUERY_UI_PATHES)
 
 htdocs/javascript/jquery.js: DOWNLOAD_SRC = http://jquery.com/src/jquery-latest.min.js
 htdocs/javascript/jquery.js:
@@ -178,6 +181,10 @@ $(JQUERY_PLUGINS_PATHES): DOWNLOAD_SRC = http://plugins.jquery.com/files/$(@F).t
 $(JQUERY_PLUGINS_PATHES):
        @$(download)
 
+$(JQUERY_UI_PATHES): DOWNLOAD_SRC = http://ui.jquery.com/latest/ui/$(@F)
+$(JQUERY_UI_PATHES):
+       @$(download)
+
 ################################################################################
 
 .PHONY: build dist clean core wiki build-wiki banana htdocs/images/banana htdocs/css/banana.css include/banana/banana.inc.php http* check
diff --git a/core b/core
index 35fff9b..3b6b056 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 35fff9b04585817e74f4709f36b70d959ce3224c
+Subproject commit 3b6b056cf9637480527957d1a6f45f0f68b10a05
index a8e2a1e..128b11c 100644 (file)
@@ -67,4 +67,6 @@
     display: none;
 }
 
+.ui-tabs-hide { display: none; }
+
 /* vim: set et ts=4 sts=4 sw=4: */
index 9f33b87..0b95b5f 100644 (file)
@@ -360,46 +360,59 @@ div.long td.rt { width: 85%; }
         [ onglets des profils ]
 *******************************************************************************/
 
-.wizard {
+.wizard, .ui-tabs-nav {
+    margin: 0;
+    padding: 0;
     margin-left: -16px;
+    clear: both;
 }
 
-.wizard .wiz_header {
+.wizard .wiz_header, .ui-tabs-nav {
     height: 32px;
     width: 100%;
     background: url('../images/skins/wiz_background.png') top right repeat-x;
     margin-bottom: 1em;
+    text-align: left;
 }
 
-.wizard .wiz_header .wiz_tab {
+.wizard .wiz_header .wiz_tab, .ui-tabs-nav li {
     background: url('../images/skins/wiz_normal.png') #aaa top left repeat-x;
     height: 100%;
     text-align: center;
     font-size: 75%;
     border-right: 1px solid #888;
+    float: left;
+    vertical-align: middle;
 }
 
-.wizard .wiz_header .wiz_tab:hover {
+.ui-tabs-nav li {
+    margin: 0;
+    padding: 0;
+    list-style-type: none;
+}
+
+.wizard .wiz_header .wiz_tab:hover, .ui-tabs-nav li:hover {
     background: url('../images/skins/wiz_hover.png') #777 top left repeat-x;
     color: #fff;
 }
 
-.wizard .wiz_header .active, .wizard .wiz_header .active:hover {
+.wizard .wiz_header .active, .wizard .wiz_header .active:hover, li.ui-tabs-selected {
     background: url('../images/skins/wiz_active.png') #444 top left repeat-x;
     color: #fff;
 }
 
-.wizard .wiz_header a {
+.wizard .wiz_header a, .ui-tabs-nav a {
     color: #000;
     text-decoration: none;
 }
 
-.wizard .wiz_header a.active {
+.wizard .wiz_header a.active, .ui-tabs-selected a {
     color: #fff;
 }
 
-.wizard .wiz_content {
+.wizard .wiz_content, .ui-tabs-panel {
     margin-left: 16px;
+    clear: both;
 }
 
 .flags .texte {
index 2ea835e..de8381f 100644 (file)
@@ -465,6 +465,8 @@ class AdminModule extends PLModule
             $page->trigSuccess('Données du compte mise à jour avec succès');
             $user = User::getWithUID($user->id());
         }
+        $page->addJsLink('ui.core.js');
+        $page->addJsLink('ui.tabs.js');
 
 
         // Processes admin requests, if any.
index c68cf78..4d5af27 100644 (file)
@@ -31,8 +31,8 @@
   </div>
 </form>
 {elseif $user}
-
 {literal}
+
 <script type="text/javascript">
 //<![CDATA[
 function doEditUser() {
@@ -70,10 +70,23 @@ function ban_read()
     document.forms.bans.read_perm.value = "!xorg.*";
 }
 
+$(document).ready(function() {
+  $('#tabs > ul').tabs();
+  $('.ui-tabs-nav li').width('33%');
+});
+
 // ]]>
 </script>
 {/literal}
 
+<div id="tabs">
+<ul>
+  <li><a href="{$platal->pl_self()}#account"><span >Compte</span></a></li>
+  <li><a href="{$platal->pl_self()}#emails"><span>Emails</span></a></li>
+  <li><a href="{$platal->pl_self()}#forums"><span>Forums</span></a></li>
+</ul>
+
+<div id="account">
 <form id="auth" method="post" action="admin/user/{$user->login()}">
   {xsrf_token_field}
   <h1>Informations sur le compte</h1>
@@ -157,7 +170,7 @@ function ban_read()
       <td>
         <select name="state">
           <option value="pending" {if $user->state eq 'pending'}selected="selected"{/if}>pending (Non-inscrit)</option>
-          <option value="active" {if $user->state eq 'active'}selected="selected"{/if}>active (Inscrit, peu se logguer)</option>
+          <option value="active" {if $user->state eq 'active'}selected="selected"{/if}>active (Inscrit, peut se logguer)</option>
           <option value="disabled" {if $user->state eq 'disabled'}selected="selected"{/if}>disabled (Inscrit, accès interdit)</option>
         </select><br />
         <label>
@@ -203,6 +216,7 @@ function ban_read()
     <input type="submit" name="log_account" value="Consulter les logs" />
   </div>
 </form>
+</div>
 
 <!--
   <h1>Informations sur la fiche</h1>
@@ -331,6 +345,11 @@ function ban_read()
 Ne pas utiliser [Désinscrire] si le but est d'exclure la personne.
 Pour ceci changer ses permissions en 'disabled'.
 </p>
+-->
+
+<div id="emails">
+<h1>Gestion des emails de {$user->login()}</h1>
+
 <form id="alias" method="post" action="admin/user">
   {xsrf_token_field}
   <table class="tinybicol" cellpadding="2" cellspacing="0">
@@ -376,57 +395,9 @@ Pour ceci changer ses permissions en 'disabled'.
     </tr>
   </table>
 </form>
--->
 
 <p><strong>* à ne modifier qu'avec l'accord express de l'utilisateur !!!</strong></p>
 
-<form id="bans" method="post" action="admin/user/{$user->login()}">
-  {xsrf_token_field}
-  <table cellspacing="0" cellpadding="2" class="tinybicol">
-    <tr>
-      <th colspan="4">
-        Permissions sur les forums
-      </th>
-    </tr>
-    <tr class="impair">
-      <td class="titre">
-        Poster
-      </td>
-      <td>
-        <input type="text" name="write_perm" size="32" maxlength="255" value="{$bans.write_perm}" />
-      </td>
-      <td class="action">
-        <a href="javascript:ban_write()">Bannir</a>
-      </td>
-    </tr>
-    <tr class="pair">
-      <td class="titre">
-        Lire
-      </td>
-      <td>
-        <input type="text" name="read_perm" size="32" maxlength="255" value="{$bans.read_perm}" />
-      </td>
-      <td class="action">
-        <a href="javascript:ban_read()">Bannir</a>
-      </td>
-    </tr>
-    <tr class="impair">
-      <td class="titre">
-        Commentaire
-      </td>
-      <td colspan="2">
-        <input type="text" name="comment" size="40" maxlength="255" value="{$bans.comment}" />
-      </td>
-    </tr>
-    <tr class="center">
-      <td colspan="3">
-        <input type="hidden" name="user_id" value="{$mr.user_id}" />
-        <input type="submit" name="b_edit" value="Modifier" />
-      </td>
-    </tr>
-  </table>
-</form>
-
 {javascript name="ajax"}
 {test_email hruid=$user->login()}
 
@@ -516,6 +487,61 @@ Pour ceci changer ses permissions en 'disabled'.
   </table>
 </form>
 
+</div>
+
+<div id="forums">
+
+<h1>Gestion de l'accès au forums de {$user->login()}</h1>
+
+<form id="bans" method="post" action="admin/user/{$user->login()}">
+  {xsrf_token_field}
+  <table cellspacing="0" cellpadding="2" class="tinybicol">
+    <tr>
+      <th colspan="4">
+        Permissions sur les forums
+      </th>
+    </tr>
+    <tr class="impair">
+      <td class="titre">
+        Poster
+      </td>
+      <td>
+        <input type="text" name="write_perm" size="32" maxlength="255" value="{$bans.write_perm}" />
+      </td>
+      <td class="action">
+        <a href="javascript:ban_write()">Bannir</a>
+      </td>
+    </tr>
+    <tr class="pair">
+      <td class="titre">
+        Lire
+      </td>
+      <td>
+        <input type="text" name="read_perm" size="32" maxlength="255" value="{$bans.read_perm}" />
+      </td>
+      <td class="action">
+        <a href="javascript:ban_read()">Bannir</a>
+      </td>
+    </tr>
+    <tr class="impair">
+      <td class="titre">
+        Commentaire
+      </td>
+      <td colspan="2">
+        <input type="text" name="comment" size="40" maxlength="255" value="{$bans.comment}" />
+      </td>
+    </tr>
+    <tr class="center">
+      <td colspan="3">
+        <input type="hidden" name="user_id" value="{$mr.user_id}" />
+        <input type="submit" name="b_edit" value="Modifier" />
+      </td>
+    </tr>
+  </table>
+</form>
+</div>
+
+
 {/if}
 {/if}