[Jifty-commit] r5108 - in apps/CASPlus/trunk: lib/CASPlus/View

Jifty commits jifty-commit at lists.jifty.org
Thu Feb 14 15:43:54 EST 2008


Author: sterling
Date: Thu Feb 14 15:43:53 2008
New Revision: 5108

Modified:
   apps/CASPlus/trunk/   (props changed)
   apps/CASPlus/trunk/lib/CASPlus/View/User.pm

Log:
 r15309 at riddle:  andrew | 2008-02-14 14:37:40 -0600
 Reordered the tabs on the user page and added a roles tab.


Modified: apps/CASPlus/trunk/lib/CASPlus/View/User.pm
==============================================================================
--- apps/CASPlus/trunk/lib/CASPlus/View/User.pm	(original)
+++ apps/CASPlus/trunk/lib/CASPlus/View/User.pm	Thu Feb 14 15:43:53 2008
@@ -13,11 +13,18 @@
 
     { title is _(q{%1's Profile}, $user->username) }
 
+    my @tabs = (
+        { label => 'Password', path => '/user/password', defer => 1 },
+        { label => 'View',     path => '/user/display',  defer => 1 },
+    );
+
+    if (Jifty->web->current_user->may_manage_users) {
+        push @tabs,
+            { label => 'Roles', path => '/user/roles', defer => 1 };
+    }
+
     form {
-        $self->render_tabs('profile', [qw(id)], 
-            { label => 'View',     path => '/user/display',  defer => 1 },
-            { label => 'Password', path => '/user/password', defer => 1 },
-        );
+        $self->render_tabs('profile', [qw(id)], @tabs);
     };
 };
 
@@ -67,4 +74,18 @@
         ;
 };
 
+template 'roles' => sub {
+    my $user = get 'user';
+
+    p { _('This just shows the roles assigned to this user.'); };
+
+#    h3 { _('Roles') };
+
+    ul {
+        for my $role ($user->roles) {
+            li { $role->name };
+        }
+    };
+};
+
 1;


More information about the Jifty-commit mailing list