[Rt-commit] rt branch, 3.9-menu_index_page, created. rt-3.9.6-348-gfbcedff

Ruslan Zakirov ruz at bestpractical.com
Sat Dec 4 18:48:32 EST 2010


The branch, 3.9-menu_index_page has been created
        at  fbcedff7588250771e72747e17fb26d16d010650 (commit)

- Log -----------------------------------------------------------------
commit d05dc80c7274b33784b1aae5148ddaca1b8711a7
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Dec 5 02:44:16 2010 +0300

    move menu elements' description from Admin/index.html

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 4179c26..d1e55e4 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -113,26 +113,26 @@ if ( $request_path !~ qr{^/SelfService/} ) {
     {
         my $admin = $tools->child( config => title => loc('Configuration'), path   => '/Admin/', sort_order => 1 );
         if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers' ) ) {
-            my $users = $admin->child( users => title => loc('Users'), path => '/Admin/Users/', );
+            my $users = $admin->child( users => title => loc('Users'), path => '/Admin/Users/', description => loc('Manage users and passwords') );
             $users->child( select => title => loc('Select'), path   => "/Admin/Users/" );
             $users->child( create => title => loc('Create'), path => "/Admin/Users/Modify.html?Create=1" );
         }
-        my $groups = $admin->child( loc('Groups'), path => '/Admin/Groups/', );
+        my $groups = $admin->child( loc('Groups'), path => '/Admin/Groups/', description => loc('Manage groups and group membership') );
 
         $groups->child( select => title => loc('Select'), path => "/Admin/Groups/" );
         $groups->child( create => title => loc('Create'), path => "/Admin/Groups/Modify.html?Create=1" );
 
-        my $queues = $admin->child( queues => title => loc('Queues'), path => '/Admin/Queues/', );
+        my $queues = $admin->child( queues => title => loc('Queues'), path => '/Admin/Queues/', description => loc('Manage queues and queue-specific properties') );
         $queues->child( select => title => loc('Select'), path => "/Admin/Queues/" );
         $queues->child( create => title => loc('Create'), path => "/Admin/Queues/Modify.html?Create=1" );
 
         if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomField' ) ) {
-            my $cfs = $admin->child( 'custom-fields' => title => loc('Custom Fields'), path => '/Admin/CustomFields/', );
+            my $cfs = $admin->child( 'custom-fields' => title => loc('Custom Fields'), path => '/Admin/CustomFields/', description => loc('Manage custom fields and custom field values') );
             $cfs->child( select => title => loc('Select'), path   => "/Admin/CustomFields/" );
             $cfs->child( create => title => loc('Create'), path => "/Admin/CustomFields/Modify.html?Create=1" );
         }
 
-        my $admin_global = $admin->child( global => title => loc('Global'), path   => '/Admin/Global/', );
+        my $admin_global = $admin->child( global => title => loc('Global'), path   => '/Admin/Global/', description => loc('Manage properties and configuration which apply to all queues') );
 
         my $scrips = $admin_global->child( scrips => title => loc('Scrips'), path => '/Admin/Global/Scrips.html', );
         $scrips->child( select => title => loc('Select'), path => "/Admin/Global/Scrips.html" );
@@ -173,7 +173,7 @@ if ( $request_path !~ qr{^/SelfService/} ) {
         $admin_global->child( 'my-rt' => title => loc('RT at a glance'), path => '/Admin/Global/MyRT.html', );
         $admin_global->child( theme => title => loc('Theme'), path => '/Admin/Global/Theme.html', );
 
-        my $admin_tools = $admin->child( tools => title => loc('Tools'), path => '/Admin/Tools/', );
+        my $admin_tools = $admin->child( tools => title => loc('Tools'), path => '/Admin/Tools/', description => loc('Use other RT administrative tools') );
         $admin_tools->child( configuration => title => loc('System Configuration'), path => '/Admin/Tools/Configuration.html', );
         $admin_tools->child( 'sql-queries' => title => loc('SQL Queries'), path => '/Admin/Tools/Queries.html', );
         $admin_tools->child( shredder => title => loc('Shredder'), path => '/Admin/Tools/Shredder', );

commit 986aad2e194125cbbcfdf9be8b7ec1a56b4c37b3
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Dec 5 02:45:08 2010 +0300

    re-use Menu instead of repeating tabs in index.html

diff --git a/share/html/Admin/index.html b/share/html/Admin/index.html
index 0c941e4..5eae4ce 100755
--- a/share/html/Admin/index.html
+++ b/share/html/Admin/index.html
@@ -47,49 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <& /Admin/Elements/Header, Title => loc('RT Administration') &>
 <& /Elements/Tabs &>
-<& /Elements/ListMenu, items => $tabs &>
+<& /Elements/ListMenu, menu => Menu()->child('tools')->child('config')  &>
 % if (RT->Config->Get('ShowRTNews')) {
 <& /Admin/Elements/Newsbox &>
 % }
-<%init>
-
-my $tabs = {
-    A => {
-        title       => loc('Users'),
-        path        => '/Admin/Users/index.html',
-        description => loc('Manage users and passwords'),
-    },
-    B => {
-        title => loc('Groups'),
-        path  => '/Admin/Groups/index.html',
-        description => loc('Manage groups and group membership'),
-    },
-    C => {
-        title       => loc('Queues'),
-        path        => '/Admin/Queues/index.html',
-        description => loc('Manage queues and queue-specific properties'),
-    },
-    D => {
-        'title'     => loc('Custom Fields'),
-        description => loc('Manage custom fields and custom field values'),
-          path      => '/Admin/CustomFields/index.html',
-    },
-    E => {
-        'title'     => loc('Global'),
-        path        => '/Admin/Global/index.html',
-        description =>
-          loc('Manage properties and configuration which apply to all queues'),
-    },
-    F => {
-        'title'     => loc('Tools'),
-        path        => '/Admin/Tools/index.html',
-        description => loc('Use other RT administrative tools')
-    },
-};
-
-  $m->callback( %ARGS, tabs => $tabs );
-
-
-
-
-</%init>

commit a29dca684958a68be8b3a87a751ddf1a6fcdba1e
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Dec 5 02:46:11 2010 +0300

    description accessor in Menu.pm

diff --git a/lib/RT/Interface/Web/Menu.pm b/lib/RT/Interface/Web/Menu.pm
index f5aa8a3..d2a1699 100644
--- a/lib/RT/Interface/Web/Menu.pm
+++ b/lib/RT/Interface/Web/Menu.pm
@@ -58,7 +58,7 @@ use Scalar::Util qw(weaken);
 
 __PACKAGE__->mk_accessors(qw(
     title sort_order target escape_title class render_children_inline
-    link_item raw_html key
+    link_item raw_html key description
 ));
 
 =head1 NAME

commit 33a8b30118dbb8fa315133a0dd0335b0061680c8
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Dec 5 02:46:37 2010 +0300

    ListMenu that renders Menu objects instead of hashes

diff --git a/share/html/Elements/ListMenu b/share/html/Elements/ListMenu
index a4bad80..2c08a1e 100644
--- a/share/html/Elements/ListMenu
+++ b/share/html/Elements/ListMenu
@@ -46,13 +46,52 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <%args>
-$items
+$menu
 </%args>
 <ul class="list-menu">
-%    foreach my $key (sort keys %$items) {
-<li><span class="menu-item"><a href="<%RT->Config->Get('WebPath')%><%$items->{$key}->{'path'}|n %>"><%$items->{$key}->{'title'}%></a></span><br />
-<span class="description"><%$items->{$key}->{description} || $items->{$key}->{text} || '' %></span>
-
+% for my $child ($menu->children) {
+<li><span class="menu-item"><% $show_link->( $child ) |n %></span><br />
+% if ( my $description = $child->description ) {
+<span class="description"><% $description %></span>\
+% }
+% if ( $child->has_children ) {
+<ul>
+% for my $grand ($child->children) {
+<li><% $show_link->( $grand ) |n %></li>
+% }
+</ul>
+% }
 </li>
-%}
+% }
 </ul>
+
+<%INIT>
+my $web_path = RT->Config->Get('WebPath');
+my $interp = $m->interp;
+my $show_link = sub {
+    my $e = shift;
+    my $res = '';
+    if ( $e->link_item ) {
+        $res .= '<a';
+        my $url = (not $e->path or $e->path =~ m{^\w+:/})
+            ? $e->path
+            : $web_path . $e->path;
+        $res .= ' href="'. $interp->apply_escapes($url, 'h') .'"'
+            if $url;
+
+        if ( $e->target ) {
+            $res .= ' target="'. $interp->apply_escapes( $e->target, 'h' ) .'"';
+        }
+        $res .= '>';
+    }
+
+    my $title = $e->title;
+    $title = $interp->apply_escapes( $title, 'h' );
+    $res .= $title;
+
+    if ( $e->link_item ) {
+        $res .= '</a>';
+    }
+    return $res;
+};
+</%INIT>

commit fbcedff7588250771e72747e17fb26d16d010650
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Dec 5 02:47:34 2010 +0300

    css for two level MenuLists

diff --git a/share/html/NoAuth/css/base/admin.css b/share/html/NoAuth/css/base/admin.css
index d3388d7..2a146f6 100644
--- a/share/html/NoAuth/css/base/admin.css
+++ b/share/html/NoAuth/css/base/admin.css
@@ -54,12 +54,22 @@ ul.list-menu {
 
 }
 ul.list-menu .description {
+ font-style: italic;
  display: block;
  padding: 0.5em;
- font-style: italic;
  padding-left: 1em;
 }
 
+ul.list-menu ul {
+ list-style: none;
+ padding: 0.5em;
+ padding-left: 1em;
+}
+ul.list-menu ul li {
+ display: inline;
+ margin-right: 0.5em;
+}
+
 #rt-news .titlebox iframe {
     height: 100%;
     width: 100%;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list