[Bps-public-commit] r20174 - in RT-BugTracker-Public/html/Public: . Elements

ruz at bestpractical.com ruz at bestpractical.com
Wed Dec 2 00:30:46 EST 2009


Author: ruz
Date: Wed Dec  2 00:30:42 2009
New Revision: 20174

Modified:
   RT-BugTracker-Public/html/Public/Browse.html
   RT-BugTracker-Public/html/Public/Dist/BeginsWith.html
   RT-BugTracker-Public/html/Public/Elements/Tabs

Log:
* merge Browse.html into Dist/BeginsWith.html and add capability
  to enter prefix of the name

Modified: RT-BugTracker-Public/html/Public/Browse.html
==============================================================================
--- RT-BugTracker-Public/html/Public/Browse.html	(original)
+++ RT-BugTracker-Public/html/Public/Browse.html	Wed Dec  2 00:30:42 2009
@@ -45,19 +45,14 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, Title => loc("Browse Distributions") &>
-<& /Public/Elements/Tabs,
-    current_toptab => "Public/Browse.html",
-    Title => loc("Browse Distributions"),
-    &>
-
-<p>
-Find distributions that start with...
-</p>
-
-<p>
-% for my $letter ("A".."Z") {
-<a href="<% $RT::WebPath %>/Public/Dist/BeginsWith.html?Name=<% $letter %>"><% $letter %></a>
-% }
-</p>
-
+<%ARGS>
+$Name => undef
+</%ARGS>
+<%INIT>
+$Name = '' unless defined $Name;
+RT::Interface::Web::Redirect(
+    RT->Config->Get('WebURL')
+    .'Public/Dist/BeginsWith.html'
+    .'?Name='. $m->interp->apply_escapes( $Name, 'u' )
+);
+</%INIT>

Modified: RT-BugTracker-Public/html/Public/Dist/BeginsWith.html
==============================================================================
--- RT-BugTracker-Public/html/Public/Dist/BeginsWith.html	(original)
+++ RT-BugTracker-Public/html/Public/Dist/BeginsWith.html	Wed Dec  2 00:30:42 2009
@@ -45,18 +45,40 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, Title => loc("Distributions starting with [_1]", $Name) &>
+<& /Elements/Header, Title => $title &>
 <& /Public/Elements/Tabs,
-    Title => loc("Distributions starting with [_1]", $Name),
-    &>
+    Title => $title,
+    current_toptab => 'Public/Dist/BeginsWith.html',
+&>
 
-<& /Public/Elements/DistributionList, queues => $queues &>
+<form action="<% RT->Config->Get('WebPath') %><% $m->request_path %>" method="GET">
+<p>
+<% loc('First letter is') %>
+% for my $letter ("A".."Z") {
+<a href="<% $RT::WebPath %>/Public/Dist/BeginsWith.html?Name=<% $letter %>">
+<% $letter eq $Name ? "<strong>$letter</strong>" : $letter |n %>
+</a>
+% }
+ <% loc('or prefix is') %> <input type="text" name="Name" value="<% length($Name) > 1? $Name : '' %>" />
+</p>
+</form>
 
-<%init>
-my $queues = RT::Queues->new($session{CurrentUser});
+% if ( length $Name ) {
+<& /Public/Elements/DistributionList, queues => $queues &>
+% }
 
-$queues->Limit(FIELD => 'Name', VALUE => $Name, OPERATOR => 'STARTSWITH');
-</%init>
 <%args>
 $Name => undef
 </%args>
+<%init>
+$Name = '' unless defined $Name;
+
+my ($title, $queues);
+if ( length $Name ) {
+    $title = loc("Distributions starting with '[_1]'", $Name);
+    $queues = RT::Queues->new( $session{CurrentUser} );
+    $queues->Limit(FIELD => 'Name', VALUE => $Name, OPERATOR => 'STARTSWITH');
+} else {
+    $title = loc("Browse Distributions");
+}
+</%init>

Modified: RT-BugTracker-Public/html/Public/Elements/Tabs
==============================================================================
--- RT-BugTracker-Public/html/Public/Elements/Tabs	(original)
+++ RT-BugTracker-Public/html/Public/Elements/Tabs	Wed Dec  2 00:30:42 2009
@@ -77,13 +77,9 @@
         title => loc('Search Distributions'),
         path  => 'Public/',
     },
-#   B => {
-#       title => loc('Report Bug'),
-#       path  => 'Public/Bug/Report.html',
-#   },
     C => {
         title => loc('Browse Distributions'),
-        path  => 'Public/Browse.html'
+        path  => 'Public/Dist/BeginsWith.html',
     },
 };
 



More information about the Bps-public-commit mailing list