[Rt-commit] rt branch, 3.999-trunk, updated. b3e32a8b2b3883e67188f49635237c5627e74c2f

jesse jesse at bestpractical.com
Wed Nov 18 22:04:07 EST 2009


The branch, 3.999-trunk has been updated
       via  b3e32a8b2b3883e67188f49635237c5627e74c2f (commit)
       via  569e4fcfff3bc6d37221cdc94c47b648b707f050 (commit)
       via  f56323f08d96c9dd8e0ae0be95c22c2f3b55a41e (commit)
       via  1c1947108241394a7c5e476019a43e781ee022be (commit)
       via  ef041f6b6e82371db9c7892ba0af5004fb4b96ed (commit)
       via  03b638058f1f5009b84a6109db4546914f15c098 (commit)
       via  d22c7516556c949ee24c7e4fccf922b10c9d3910 (commit)
       via  95aaee9956bf9c276b4f2099a15fc5cdb0709c2a (commit)
      from  4f190e181f7d06e898be15a40f061177c00b944d (commit)

Summary of changes:
 etc/config.yml                    |    2 +
 lib/RT/Dispatcher.pm              |   46 +++++++++++++-------
 lib/RT/Interface/Web/Menu.pm      |   66 ---------------------------
 lib/RT/Interface/Web/Menu/Item.pm |   88 -------------------------------------
 lib/RT/View.pm                    |    8 +++
 share/html/Elements/Header        |    6 +--
 6 files changed, 42 insertions(+), 174 deletions(-)
 delete mode 100644 lib/RT/Interface/Web/Menu.pm
 delete mode 100644 lib/RT/Interface/Web/Menu/Item.pm

- Log -----------------------------------------------------------------
commit 95aaee9956bf9c276b4f2099a15fc5cdb0709c2a
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:06:40 2009 -0500

    Start standardizing Select/New in menus

diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index c0c979a..d39dd07 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -670,8 +670,8 @@ before 'User/Group' => run {
         $group->child( _('Members'), url => "/User/Groups/Members.html?id=" . $obj->id );
 
     }
-    page_nav( _('Select group') => url => "/User/Groups/index.html" );
-    page_nav( _('New group') => url => "/User/Groups/Modify.html?create=1", separator => 1 );
+    page_nav( _('Select') => url => "/User/Groups/index.html" );
+    page_nav( _('New') => url => "/User/Groups/Modify.html?create=1", separator => 1 );
 
 };
 

commit d22c7516556c949ee24c7e4fccf922b10c9d3910
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:09:39 2009 -0500

    remove old lib/RT/Interface/Web/Menu

diff --git a/lib/RT/Interface/Web/Menu.pm b/lib/RT/Interface/Web/Menu.pm
deleted file mode 100644
index ca0f4ec..0000000
--- a/lib/RT/Interface/Web/Menu.pm
+++ /dev/null
@@ -1,66 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/copyleft/gpl.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-package RT::Interface::Web::Menu;
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, $class;
-    $self->{'root_node'} = RT::Interface::Web::Menu::Item->new();
-    return $self;
-}
-
-sub as_hash_of_hashes {
-
-}
-
-sub root {
-    my $self = shift;
-    return $self->{'root_node'};
-}
-
-1;
diff --git a/lib/RT/Interface/Web/Menu/Item.pm b/lib/RT/Interface/Web/Menu/Item.pm
deleted file mode 100644
index 8208b6f..0000000
--- a/lib/RT/Interface/Web/Menu/Item.pm
+++ /dev/null
@@ -1,88 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/copyleft/gpl.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-package RT::Interface::Web::Menu::Item;
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, $class;
-    $self->{'_attributes'} = {};
-    return ($self);
-}
-
-sub label        { my $self = shift; $self->_accessor( label        => @_ ) }
-sub absolute_url { my $self = shift; $self->_accessor( absolute_url => @_ ) }
-sub rt_path      { my $self = shift; $self->_accessor( rt_path      => @_ ) }
-
-sub hilight {
-    my $self = shift;
-    $self->_accessor( hilight => @_ );
-    $self->parent->hilight(1);
-}
-sub sort_order { my $self = shift; $self->_accessor( sort_order => @_ ) }
-
-sub add_child {
-}
-
-sub delete {
-}
-
-sub children {
-
-}
-
-sub _accessor {
-    my $self = shift;
-    my $key  = shift;
-    if (@_) {
-        $self->{'attributes'}->{$key} = shift;
-
-    }
-    return $self->{'_attributes'}->{$key};
-}
-
-1;

commit 03b638058f1f5009b84a6109db4546914f15c098
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:09:57 2009 -0500

    remove dead var/comment

diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index d39dd07..c733c11 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -676,7 +676,6 @@ before 'User/Group' => run {
 };
 
 before 'Prefs' => run {
-    my $tabs;
     my @searches = RT::System->new->saved_searches();
 
     page_nav->child( 'Quick search' => label => _('Quick search'), url => '/Prefs/Quicksearch.html' );
@@ -721,7 +720,6 @@ before qr{^/Search/Build.html} => run {
     #  Push the updates into the session so we don't lose 'em
     Jifty->web->session->set( 'CurrentSearchHash', { %$saved_search, %$current_search, } );
 
-    #  Build a query_string for the tabs
     if ( Jifty->web->request->argument('new_query') ) {
         $querystring = 'new_query=1';
     } elsif ( $current_search->{'query'} ) {

commit ef041f6b6e82371db9c7892ba0af5004fb4b96ed
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:12:02 2009 -0500

    Try harder not to show any nav to not-logged-in people

diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index c733c11..dd7c493 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -184,6 +184,7 @@ on qr{^/Ticket/Graphs/(\d+)} => run {
 };
 
 before qr{.*} => run {
+	next_rule unless (Jifty->web->current_user->user_object);
     main_nav->child( _('Homepage'),      url => '/' );
     main_nav->child( _('Simple Search'), url => '/Search/Simple.html' );
     main_nav->child( _('Tickets'),       url => '/Search/Build.html' );
@@ -274,8 +275,7 @@ before qr{.*} => run {
         main_nav->child( 'Preferences' => menu => $prefs );
     }
 
-    if (   Jifty->web->current_user->user_object
-        && Jifty->web->current_user->has_right( right => 'ShowApprovalsTab', object => RT->system ) )
+    if ( Jifty->web->current_user->has_right( right => 'ShowApprovalsTab', object => RT->system ) )
     {
         main_nav->child( _('Approval'), url => '/Approvals/' );
     }

commit 1c1947108241394a7c5e476019a43e781ee022be
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:38:07 2009 -0500

    clean up nav by disabling pluin nav

diff --git a/etc/config.yml b/etc/config.yml
index 8836a38..914d725 100644
--- a/etc/config.yml
+++ b/etc/config.yml
@@ -31,6 +31,7 @@ framework:
     - User: {}
     - Authentication::Password:
         login_by: username
+        nav_menu: 0
     - I18N:
         js: 0
     - IEFixes:
@@ -46,6 +47,7 @@ framework:
         restart_url: '/Admin/Global/Jifty/restart.html'
         after_restart_url: '/Admin/Global/System.html'
         wait_seconds: 10
+        nav_menu: 0
     - SetupWizard:
         add_steps:
           - template: basics

commit f56323f08d96c9dd8e0ae0be95c22c2f3b55a41e
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:45:53 2009 -0500

    Move Preferences link out of the header

diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 4347c75..70aad32 100755
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -88,9 +88,6 @@
     <span class="hide"><a href="#skipnav"><% _('Skip Menu') %></a> | </span>
 % if (Jifty->web->current_user->user_object && Jifty->web->current_user->name) {
   <% _('Logged in as %1', "<span>".Jifty->web->current_user->name."</span>") |n%>
-%     if ( Jifty->web->current_user->has_right( right => 'ModifySelf', object => RT->system ) ) {
-    | <a href="<%RT->config->get('web_path')%><%$prefs%>"><% _('Preferences') %></a>
-%     }
 % } else {
     <% _('Not logged in.') %>
 % }

commit 569e4fcfff3bc6d37221cdc94c47b648b707f050
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 14:46:10 2009 -0500

    more nav cleanup

diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index dd7c493..2cb2bbc 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -183,6 +183,14 @@ on qr{^/Ticket/Graphs/(\d+)} => run {
     show('/Ticket/Graphs/Render');
 };
 
+
+my $PREFS_NAV = Jifty::Web::Menu->new( { label => _('Preferences'), url => '/Prefs/Other.html' } );
+$PREFS_NAV->child( _('Settings'),       url => '/Prefs/Other.html', );
+$PREFS_NAV->child( _('About me'),       url => '/User/Prefs.html', );
+$PREFS_NAV->child( _('Search options'), url => '/Prefs/SearchOptions.html', );
+$PREFS_NAV->child( _('RT at a glance'), url => '/Prefs/MyRT.html', );
+
+
 before qr{.*} => run {
 	next_rule unless (Jifty->web->current_user->user_object);
     main_nav->child( _('Homepage'),      url => '/' );
@@ -198,8 +206,7 @@ before qr{.*} => run {
 
     $tools->child( _('My Day'), url => '/Tools/MyDay.html' );
 
-    if (   Jifty->web->current_user->user_object
-        && Jifty->web->current_user->has_right( right => 'ShowConfigTab', object => RT->system ) )
+    if ( Jifty->web->current_user->has_right( right => 'ShowConfigTab', object => RT->system ) )
     {
         my $admin = main_nav->child( Config => label => _('Configuration'), url => '/Admin/' );
         $admin->child( _('Users'),         url => '/Admin/Users/', );
@@ -265,15 +272,11 @@ before qr{.*} => run {
         )
     {
 
-        my $prefs = Jifty::Web::Menu->new( { label => _('Preferences'), url => '/Prefs/Other.html' } );
-
-        $prefs->child( _('Settings'),       url => '/Prefs/Other.html', );
-        $prefs->child( _('About me'),       url => '/User/Prefs.html', );
-        $prefs->child( _('Search options'), url => '/Prefs/SearchOptions.html', );
-        $prefs->child( _('RT at a glance'), url => '/Prefs/MyRT.html', );
+     if ( Jifty->web->current_user->has_right( right => 'ModifySelf', object => RT->system ) ) {
 
-        main_nav->child( 'Preferences' => menu => $prefs );
+        main_nav->child( 'Preferences' => menu => $PREFS_NAV );
     }
+     }
 
     if ( Jifty->web->current_user->has_right( right => 'ShowApprovalsTab', object => RT->system ) )
     {
@@ -671,7 +674,7 @@ before 'User/Group' => run {
 
     }
     page_nav( _('Select') => url => "/User/Groups/index.html" );
-    page_nav( _('New') => url => "/User/Groups/Modify.html?create=1", separator => 1 );
+    page_nav( _('Create') => url => "/User/Groups/Modify.html?create=1", separator => 1 );
 
 };
 

commit b3e32a8b2b3883e67188f49635237c5627e74c2f
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Nov 18 22:03:43 2009 -0500

    more work toward menu sanity

diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index 2cb2bbc..2a37fb6 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -282,7 +282,20 @@ before qr{.*} => run {
     {
         main_nav->child( _('Approval'), url => '/Approvals/' );
     }
-};
+
+	
+	
+	my $create_ticket = show('/Elements/CreateTicket');
+	main_nav->child( 'search' => label =>  $create_ticket, escape_label =>0);	
+	
+	
+	main_nav->child( 'search' => label => '<form action="/" method="get" id="simple-search">
+	  <input size="12" name="q" autocomplete="off" accesskey="0" class="field" />
+	    <input type="submit" class="button" value="'. _('Search') .'" /></form>', 
+		escape_label =>0);	
+	
+	
+	};
 
 before qr'Dashboards/?' => run {
     require RT::Dashboard;    # not a record class, so not autoloaded :/
diff --git a/lib/RT/View.pm b/lib/RT/View.pm
index d8aef8e..b695156 100644
--- a/lib/RT/View.pm
+++ b/lib/RT/View.pm
@@ -87,4 +87,12 @@ template login_widget => sub {
     }
 };
 
+template simple_search_widget => sub {
+	form { { id is 'simple-search'; method is 'GET'; action is '/'};
+	input { {size is "12"; name is "q"; autocomplete is "off"; accesskey is "0"; class is "field"}}
+  input {{type is "submit"; class is "button"; value is _('Search')} }
+	}
+};
+
+
 1;
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 70aad32..0cc0ea0 100755
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -102,7 +102,8 @@
 </div>
 
 % if ( Jifty->web->current_user->user_object) {
-<div id="nav-widgets"><& /Elements/CreateTicket &><& /Elements/SimpleSearch &></div>
+<div id="nav-widgets"><& /Elements/CreateTicket &>
+</div>
 %} 
 <div class="nav">
 <div class="main-nav">

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


More information about the Rt-commit mailing list