[Rt-commit] r3381 - in rt/branches/3.5-TESTING: . html/Elements
html/Ticket/Elements
trs at bestpractical.com
trs at bestpractical.com
Mon Jul 4 16:33:19 EDT 2005
Author: trs
Date: Mon Jul 4 16:33:18 2005
New Revision: 3381
Modified:
rt/branches/3.5-TESTING/ (props changed)
rt/branches/3.5-TESTING/html/Elements/Menu
rt/branches/3.5-TESTING/html/Elements/PageLayout
rt/branches/3.5-TESTING/html/Ticket/Elements/Tabs
Log:
r4795 at wintermute: tom | 2005-07-04 16:25:11 -0400
Proper separators in the menus
Modified: rt/branches/3.5-TESTING/html/Elements/Menu
==============================================================================
--- rt/branches/3.5-TESTING/html/Elements/Menu (original)
+++ rt/branches/3.5-TESTING/html/Elements/Menu Mon Jul 4 16:33:18 2005
@@ -46,6 +46,7 @@
<ul<% !$level ? ' id="system-menu"' : ''|n %><% $menu_class ? qq[ class="$menu_class"] : ''|n %>>
<div>
% my $sep = 0;
+% my $postsep = 0;
% my $accesskey = 1;
%
% $count = 0;
@@ -60,7 +61,7 @@
% $path =~ s#/index.html$##gi;
% $current =~ s#/index.html$##gi;
%
-% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
+% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
%
% $class->{a} = $path eq $current ? ' class="selected"' : undef;
%
@@ -68,20 +69,27 @@
% push @li, 'first'
% if $count == 1;
%
-% push @li, 'separator'
+% push @li, 'pre-separator'
% if $sep;
%
+% push @li, 'post-separator'
+% if $postsep;
+%
% $class->{li} = join ' ', @li;
%
-%
- <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && "· "|n%><a href="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %><% !$level && " accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></a>
+ <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "· "|n%><a href="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %><% !$level && " accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></a>
%# Second-level items
% if ($toptabs->{$tab}->{'subtabs'}) {
<& /Elements/Menu, level => $level+1,
current_toptab => $toptabs->{$tab}->{'current_subtab'},
toptabs => $toptabs->{$tab}->{'subtabs'} &>
+% }
</li>
+% if ($sep) {
+ <li class="separator">···</li>
% }
+%
+% $postsep = $sep;
% }
</div>
</ul>
Modified: rt/branches/3.5-TESTING/html/Elements/PageLayout
==============================================================================
--- rt/branches/3.5-TESTING/html/Elements/PageLayout (original)
+++ rt/branches/3.5-TESTING/html/Elements/PageLayout Mon Jul 4 16:33:18 2005
@@ -67,8 +67,10 @@
<div class="clear"></div>
<h1><%$title%></h1>
-% my $count = 0;
-% my $class = {};
+% my $sep = 0;
+% my $postsep = 0;
+% my $count = 0;
+% my $class = { };
%
<ul id="page-menu"<% ($actions || $subactions) && q[ class="actions-present"] | n %>>
<div><div><div>
@@ -83,7 +85,7 @@
% $path =~ s#/index.html$##gi;
% $current =~ s#/index.html$##gi;
%
-% my $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
+% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
%
% $class->{a} = $path eq $current ? ' class="selected"' : undef;
%
@@ -91,13 +93,21 @@
% push @li, 'first'
% if $count == 1;
%
-% push @li, 'separator'
+% push @li, 'pre-separator'
% if $sep;
%
+% push @li, 'post-separator'
+% if $postsep;
+%
% $class->{li} = join ' ', @li;
%
%
- <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && "· "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li>
+ <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "· "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li>
+%
+% if ($sep) {
+ <li class="separator">···</li>
+% }
+% $postsep = $sep;
% }
% } else {
@@ -108,36 +118,44 @@
% if ($actions or $subactions) {
<ul id="actions-menu">
<div><div><div>
-% $count = 0;
+% $sep = 0;
+% $postsep = 0;
+% $count = 0;
+% $class = { };
%
-% if ($actions) {
-% my @actions;
-% foreach my $action (sort keys %{$actions}) {
+% for my $type ($actions, $subactions) {
+%
+% if ($type) {
+% foreach my $action (sort keys %{$type}) {
% $count++;
- <li<% $count == 1 ? q[ class="first"] : '' |n %>><% $count > 1 && "· "|n%>
-% if ($actions->{"$action"}->{'html'}) {
-<% $actions->{"$action"}->{'html'} | n %>
-% } elsif ($actions->{$action}->{separator}) {
-·
+%
+% $sep = $type->{$action}->{'separator'} ? 1 : 0;
+%
+% my @li;
+% push @li, 'first'
+% if $count == 1;
+%
+% push @li, 'pre-separator'
+% if $sep;
+%
+% push @li, 'post-separator'
+% if $postsep;
+%
+% $class->{li} = join ' ', @li;
+%
+ <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "· "|n%>
+% if ($type->{"$action"}->{'html'}) {
+ <% $type->{"$action"}->{'html'} | n %>
% } else {
-<a href="<%$RT::WebPath%>/<%$actions->{$action}->{'path'}%>"><%$actions->{$action}->{'title'}%></a>
+ <a href="<%$RT::WebPath%>/<%$type->{$action}->{'path'}%>"><%$type->{$action}->{'title'}%></a>
+% }
+ </li>
+% if ($sep) {
+ <li class="separator">···</li>
% }
-</li>
+% $postsep = $sep;
% }
% }
-%
-% if ($subactions) {
-% my $sep;
-% if ($count) {
-% $sep = 1;
-<li class="separator">···</li>
-% }
-%
-% my @actions;
-% foreach my $action (sort keys %{$subactions}) {
-% $count++;
-<li<% $count == 1 ? q[ class="first"] : '' |n %>><% $count > 1 && !$sep && "· "|n%><% $subactions->{"$action"}->{'html'} | n %></li>
-% }
% }
</div></div></div>
</ul>
@@ -177,7 +195,8 @@
</%INIT>
%# There's probably a better way to do this that involves three times as
-%# much work and redoing the whole menu/tab system...
+%# 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
Modified: rt/branches/3.5-TESTING/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/3.5-TESTING/html/Ticket/Elements/Tabs (original)
+++ rt/branches/3.5-TESTING/html/Ticket/Elements/Tabs Mon Jul 4 16:33:18 2005
@@ -183,7 +183,10 @@
if ( defined $actions->{A} || defined $actions->{B} || defined $actions->{C}
&& defined $actions->{E} || defined $actions->{F} || defined $actions->{G}) {
- $actions->{D} = { separator => 1 };
+
+ if (defined $actions->{C}) { $actions->{C}->{separator} = 1 }
+ elsif (defined $actions->{B}) { $actions->{B}->{separator} = 1 }
+ elsif (defined $actions->{A}) { $actions->{A}->{separator} = 1 }
}
my $args;
More information about the Rt-commit
mailing list