[Rt-commit] rt branch, menuing, updated. rt-3.9.4-333-g120050c
Jesse Vincent
jesse at bestpractical.com
Tue Nov 2 23:54:00 EDT 2010
The branch, menuing has been updated
via 120050c5f8945aedc1dd6e35535fe5de1b25d3b8 (commit)
via c163b4336437cc5450c7a7b8253121a6b6b6ed46 (commit)
via a4bd18c52615763ee12d91faf2cacded91a806c1 (commit)
via 89307a2bc1b51aedacdbc65e63a4797c1ea7ef9f (commit)
via 418a20b217d257ddde6918f72a28b5f749c7cb6b (commit)
from d1e43b0b1e13775ece0394baaabb2f72aeed8939 (commit)
Summary of changes:
lib/RT/Interface/Web.pm | 7 ++
share/html/Elements/Menu | 3 -
share/html/Elements/PageLayout | 93 +---------------------------
share/html/Elements/Tabs | 35 ++++++++---
share/html/Elements/{Section => WidgetBar} | 10 +++-
share/html/Elements/Widgets | 4 -
share/html/NoAuth/css/web2/layout.css | 2 +-
share/html/SelfService/Elements/GotoTicket | 2 +-
share/html/SelfService/Elements/Header | 2 +-
9 files changed, 47 insertions(+), 111 deletions(-)
copy share/html/Elements/{Section => WidgetBar} (93%)
mode change 100755 => 100644
delete mode 100644 share/html/Elements/Widgets
- Log -----------------------------------------------------------------
commit 418a20b217d257ddde6918f72a28b5f749c7cb6b
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Nov 2 23:06:01 2010 -0400
Remove old "topactions" code
diff --git a/share/html/Elements/PageLayout b/share/html/Elements/PageLayout
index 1380940..492fb7e 100755
--- a/share/html/Elements/PageLayout
+++ b/share/html/Elements/PageLayout
@@ -45,12 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<div id="topactions">
-% foreach my $action (reverse sort keys %{$topactions}) {
-<span class="topaction" id="topaction-<%$action%>"><% $topactions->{"$action"}->{'html'} |n %></span>
-% }
-</div>
-
% if ( $show_menu ) {
<div id="main-navigation"><& /Elements/Menu, menu => Menu(), id => 'app-nav' &></div>
commit 89307a2bc1b51aedacdbc65e63a4797c1ea7ef9f
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Nov 2 23:06:42 2010 -0400
Remove dead code from PageLayout
diff --git a/share/html/Elements/PageLayout b/share/html/Elements/PageLayout
index 492fb7e..ac1eaf8 100755
--- a/share/html/Elements/PageLayout
+++ b/share/html/Elements/PageLayout
@@ -69,80 +69,7 @@ jQuery(document).ready(function(){ jQuery("#actions-menu").superfish(); });
<div id="body">
% $m->callback( %ARGS, CallbackName => 'BeforeBody' );
% $m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
-
-<%INIT>
-if ( defined $current_toptab ) {
- foreach my $tab ( values %{$toptabs} ) {
- next unless $tab->{'path'} eq $current_toptab;
- @{ $tab }{ qw(subtabs current_subtab) } = ($tabs, $current_tab);
- }
-}
-
-my ($menu_depth, $almost_last, $page_tabs);
-
-# don't pull out the last submenu for 3.5-compat theme
-# see #14853 for details.
-if (RT->Config->Get( 'WebDefaultStylesheet', $session{'CurrentUser'} ) ne '3.4-compat') {
- ($menu_depth, $almost_last) = @{ $m->comp('.menu_recurse', data => $toptabs, current => $current_toptab ) };
-
- if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
- $page_tabs = {
- current_toptab => $almost_last->{current_subtab},
- %{$almost_last->{subtabs}},
- };
-
- delete $almost_last->{subtabs};
- delete $almost_last->{current_subtab};
- }
-}
-</%INIT>
-
-%# There's probably a better way to do this that involves three times as
-%# much work and redoing the whole menu/tab system... which would seem a
-%# bit out of scope.
-%#
-%# This function recurses through the menu and returns the second to
-%# last menu, that is, the menu holding the last reference to
-%# and submenu. It also returns the number of menu levels minus
-%# the last submenu.
-<%def .menu_recurse>
- <%args>
- $data => { }
- $current => ''
- $pdata => { }
- $ppdata => { }
- $level => 0
- </%args>
- <%init>
- if ($current) {
- for my $key (keys %$data) {
- next if !defined $data->{$key}->{'path'}
- || $data->{$key}->{'path'} ne $current;
- next unless ref( $data->{$key} ) eq 'HASH'
- && ref( $data->{$key}->{'subtabs'} ) eq 'HASH'
- && keys %{ $data->{$key}->{'subtabs'} };
- return $m->comp('.menu_recurse',
- data => $data->{$key}->{'subtabs'},
- current => $data->{$key}->{'current_subtab'} || '',
- pdata => $data->{$key},
- ppdata => $pdata,
- level => $level + 1,
- );
- }
- }
- $ppdata->{last_system_menu_level}++;
- return [$level, $pdata];
- </%init>
-</%def>
-
<%ARGS>
-$current_toptab => undef
-$current_tab => undef
-$toptabs => undef
-$topactions => undef
-$tabs => undef
-$actions => undef
-$subactions => undef
$title => $m->callers(-1)->path
$show_menu => 1
</%ARGS>
commit a4bd18c52615763ee12d91faf2cacded91a806c1
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Nov 2 23:07:05 2010 -0400
remove an old bit of topactions code
diff --git a/share/html/SelfService/Elements/Header b/share/html/SelfService/Elements/Header
index 06ea508..d5f22ef 100755
--- a/share/html/SelfService/Elements/Header
+++ b/share/html/SelfService/Elements/Header
@@ -45,5 +45,5 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &>
+<& /Elements/Header &>
<& /Elements/Tabs, %ARGS &>
commit c163b4336437cc5450c7a7b8253121a6b6b6ed46
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Nov 2 23:36:59 2010 -0400
reworking how widgets work
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 1c8d276..d2c4d86 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -288,6 +288,7 @@ sub MaybeShowNoAuthPage {
sub InitializeMenu {
$HTML::Mason::Commands::m->notes('menu', RT::Interface::Web::Menu->new());
$HTML::Mason::Commands::m->notes('page-menu', RT::Interface::Web::Menu->new());
+ $HTML::Mason::Commands::m->notes('page-widgets', RT::Interface::Web::Menu->new());
}
@@ -828,6 +829,12 @@ sub PageMenu {
return $HTML::Mason::Commands::m->notes('page-menu');
}
+sub PageWidgets {
+ return $HTML::Mason::Commands::m->notes('page-widgets');
+}
+
+
+
=head2 loc ARRAY
loc is a nice clean global routine which calls $session{'CurrentUser'}->loc()
diff --git a/share/html/Elements/Menu b/share/html/Elements/Menu
index 08fa385..3975119 100755
--- a/share/html/Elements/Menu
+++ b/share/html/Elements/Menu
@@ -70,9 +70,6 @@
% }
% }
<%" " x $depth%></ul>\
-<%INIT>
-
-</%INIT>
<%ARGS>
$menu
$id => undef
diff --git a/share/html/Elements/PageLayout b/share/html/Elements/PageLayout
index ac1eaf8..c1851aa 100755
--- a/share/html/Elements/PageLayout
+++ b/share/html/Elements/PageLayout
@@ -50,22 +50,14 @@
<div id="page-navigation"><& /Elements/Menu, menu => PageMenu(), id => 'page-menu', 'parent_id' => 'page' &></div>
% }
-<div id="widgets"><& /Elements/Widgets &></div>
+% # toplevel 0 disables the superfish js stuff
+<div id="topactions"><& /Elements/WidgetBar, menu => PageWidgets() &></div>
<script type="text/javascript">
jQuery(document).ready(function(){ jQuery("#app-nav").superfish(); });
jQuery(document).ready(function(){ jQuery("#page-menu").superfish(); });
jQuery(document).ready(function(){ jQuery("#actions-menu").superfish(); });
</script>
-
-<div id="header">
-<h1><% $title %></h1>
-% my $sep = 0;
-% my $postsep = 0;
-% my $count = 0;
-% my $class = { };
-%
-
-</div>
+<div id="header"><h1><% $title %></h1></div>
<div id="body">
% $m->callback( %ARGS, CallbackName => 'BeforeBody' );
% $m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 695660e..da8c080 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -510,7 +510,9 @@ if ( $request_path !~ qr{^/SelfService/} ) {
if ( $request_path =~ /^\/(?:index.html|$)/ ) {
PageMenu()->child( edit => title => loc('Edit'), path => '/Prefs/MyRT.html' );
}
-
+
+ PageWidgets()->child( simple_search => title => $m->scomp('SimpleSearch'), escape_title => 0 );
+ PageWidgets()->child( create_ticket => title => $m->scomp('CreateTicket'), escape_title => 0 );
}
if ( $request_path =~ qr'/SelfService' ) {
diff --git a/share/html/Elements/Menu b/share/html/Elements/WidgetBar
old mode 100755
new mode 100644
similarity index 75%
copy from share/html/Elements/Menu
copy to share/html/Elements/WidgetBar
index 08fa385..22c7f7c
--- a/share/html/Elements/Menu
+++ b/share/html/Elements/WidgetBar
@@ -45,38 +45,13 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-
-<%" " x $depth%><ul<%$id ? ' id="'.$id.'"' : '' |n%><% $toplevel? ' class="sf-menu sf-js-enabled sf-shadow"' : '' |n %>>
% for my $child ($menu->children) {
-% my $item_id = lc(($parent_id? $parent_id."-" : "") .$child->key);
-% $item_id =~ s/\s/-/g;
-<%" " x ($depth+1)%><li>\
-% if ($child->link_item) {
-<a id="<%$item_id%>" <% $child->path ? ' href="'.RT->Config->Get('WebPath').$child->path.'"' : '' |n%>>\
-% }
% if ($child->escape_title) {
<%$child->title%>\
% } else {
<%$child->title |n%>\
% }
-% if ($child->link_item) {
-</a>\
-% }
-% if ($child->has_children) {
-<& Menu, menu => $child, toplevel => 0, parent_id => ($parent_id? $parent_id."-": '').$child->key, depth=> ($depth+1) &>
-<%" " x ($depth+1)%></li>
-% } else {
-</li>
-% }
% }
-<%" " x $depth%></ul>\
-<%INIT>
-
-</%INIT>
<%ARGS>
$menu
-$id => undef
-$toplevel => 1
-$parent_id => ''
-$depth => 0
</%ARGS>
diff --git a/share/html/Elements/Widgets b/share/html/Elements/Widgets
deleted file mode 100644
index 778a846..0000000
--- a/share/html/Elements/Widgets
+++ /dev/null
@@ -1,4 +0,0 @@
-<div id="topactions">
-<& /Elements/SimpleSearch &>
-<& /Elements/CreateTicket &>
-</div>
commit 120050c5f8945aedc1dd6e35535fe5de1b25d3b8
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Nov 2 23:53:57 2010 -0400
Menuing for SelfService
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index da8c080..226220a 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -197,11 +197,14 @@ if ( $request_path !~ qr{^/SelfService/} ) {
$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', );
}
+
my $about_me = Menu->child( 'preferences' => title =>
loc( 'Logged in as <span class="current-user">[_1]</span>', $session{'CurrentUser'}->Name),
escape_title => 0,
sort_order => 99
);
+
+
if ( $session{'CurrentUser'}->UserObj
&& $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
my $settings = $about_me->child( settings => title => loc('Settings'), path => '/Prefs/Other.html', );
@@ -530,22 +533,34 @@ if ( $request_path =~ qr'/SelfService' ) {
last if ( $queue_count > 1 );
}
- my $TOP = Menu();
- $TOP->child( open => title => loc('Open tickets'), path => '/SelfService/', );
- $TOP->child( closed => title => loc('Closed tickets'), path => '/SelfService/Closed.html', );
+ my $tickets = Menu->child(tickets => title =>loc('Tickets'));
+ $tickets->child( open => title => loc('Open tickets'), path => '/SelfService/', );
+ $tickets->child( closed => title => loc('Closed tickets'), path => '/SelfService/Closed.html', );
if ( $queue_count > 1 ) {
- $TOP->child( new => title => loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' );
+ $tickets->child( new => title => loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' );
} else {
- $TOP->child( new => title => loc('New ticket'), path => '/SelfService/Create.html?queue=' . $queue_id );
+ $tickets->child( new => title => loc('New ticket'), path => '/SelfService/Create.html?queue=' . $queue_id );
}
+
+ my $about_me = Menu->child( 'preferences' => title =>
+ loc( 'Logged in as <span class="current-user">[_1]</span>', $session{'CurrentUser'}->Name),
+ escape_title => 0,
+ sort_order => 99
+ );
+
if ( $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System ) ) {
- $TOP->child( prefs => title => loc('Preferences'), path => '/SelfService/Prefs.html' );
+ $about_me->child( prefs => title => loc('Preferences'), path => '/SelfService/Prefs.html' );
+ }
+
+ if ( $session{'CurrentUser'}->Name
+ && ( !RT->Config->Get('WebExternalAuth')
+ || RT->Config->Get('WebFallbackToInternalAuth') )) {
+ $about_me->child( logout => title => loc('Logout'), path => '/NoAuth/Logout.html' );
}
- # XXX TODO RENDER GOTO TICKET WIDGET
- Menu->child( goto => title => $m->scomp('GotoTicket'), escape_title => 0 );
+ PageWidgets->child( goto => title => $m->scomp('/SelfService/Elements/GotoTicket'), escape_title => 0 );
}
</%INIT>
diff --git a/share/html/NoAuth/css/web2/layout.css b/share/html/NoAuth/css/web2/layout.css
index af99a8b..b7e52ac 100644
--- a/share/html/NoAuth/css/web2/layout.css
+++ b/share/html/NoAuth/css/web2/layout.css
@@ -108,7 +108,7 @@ div#body {
}
-#topactions #CreateTicketInQueue {
+#topactions #GotoTicket, #topactions #CreateTicketInQueue {
text-align: right;
}
diff --git a/share/html/SelfService/Elements/GotoTicket b/share/html/SelfService/Elements/GotoTicket
index 83dfc86..84f631a 100755
--- a/share/html/SelfService/Elements/GotoTicket
+++ b/share/html/SelfService/Elements/GotoTicket
@@ -45,6 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<form action="<% RT->Config->Get('WebPath') %>/SelfService/Display.html" method="get" id="GotoTicket">
+<form action="<% RT->Config->Get('WebPath') %>/SelfService/Display.html" method="get" id="GotoTicket" name="GotoTicket">
<input type="submit" class="button" value="<&|/l&>Goto ticket</&>" /> <input size="4" name="id" />
</form>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list