[Rt-commit] rt branch, 4.2/search-tab, created. rt-4.1.6-287-g3a8c6fa

Kevin Falcone falcone at bestpractical.com
Tue Feb 26 17:32:03 EST 2013


The branch, 4.2/search-tab has been created
        at  3a8c6fa879b7060e30e0ca16ce74e268477b811e (commit)

- Log -----------------------------------------------------------------
commit a3316c882538f1a6921ab908082238923a4b52de
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Feb 5 18:25:24 2013 -0500

    Allow ListMenu to show 2 levels of menus
    
    For Searches, it's kind of tedious to only see Tickets/Articles/Users,
    really we want to maintain the older links to New Search and Simple
    Search, etc.  This is less needed in the /Admin/ tabs where you are
    expected to navigate to another Admin/Foo/index.html, but in Search
    where you jump right in to Build.html or Simple.html, it helps to see
    all the options.

diff --git a/share/html/Elements/ListMenu b/share/html/Elements/ListMenu
index 34ef1c7..916bb07 100644
--- a/share/html/Elements/ListMenu
+++ b/share/html/Elements/ListMenu
@@ -47,6 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <%args>
 $menu
+$show_children => undef
 </%args>
 <ul class="list-menu">
 % for my $child ($menu->children) {
@@ -55,6 +56,9 @@ $menu
 <span class="description"><% $description %></span>\
 % }
 </li>
+% if ($show_children && $child->children) {
+<& /Elements/ListMenu, menu => $child &>
+% }
 % }
 </ul>
 

commit 3a8c6fa879b7060e30e0ca16ce74e268477b811e
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 8 16:29:12 2013 -0500

    Rejigger Tickets and Articles under a Searches tab
    
    I think this is clearer than remembering that 'Tickets' is where you
    click to search.  It does bury the Prev/Next links for navigating a
    search deeper, but we may want to make those more accessible instead of
    burying them up here (such as in the floating actions).
    
    This also means that Searches wants a top level tab like /Admin/ has.
    Showing more than one level of menus resulted in the css top margin
    looking really gappy and raggedy so that's been snugged up a bit.
    
    Very few tests failed as a result of this change.
      /Articles/ matches the search instead of the top level articles UI
      The id of the 'New Search' link changed
      Clicking on Search got you the Search listing, rather than the
        Articles Search.

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 14536ae..a263761 100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -483,15 +483,18 @@ my $build_main_nav = sub {
         $dashes->child('dashboard_create' => title => loc('New Dashboard'), path => "/Dashboards/Modify.html?Create=1" );
     }
 
-    my $tickets = Menu->child( search => title => loc('Tickets'), path => '/Search/Build.html' );
+    my $search = Menu->child( search => title => loc('Search'), path => '/Search/' );
+
+    my $tickets = $search->child( tickets => title => loc('Tickets'), path => '/Search/Build.html' );
     $tickets->child( simple => title => loc('Simple Search'), path => "/Search/Simple.html" );
     $tickets->child( new    => title => loc('New Search'),    path => "/Search/Build.html?NewQuery=1" );
 
+    $search->child( articles => title => loc('Articles'),   path => "/Articles/Article/Search.html" );
+
 
     my $tools = Menu->child( tools => title => loc('Tools'), path => '/Tools/index.html' );
     my $articles = $tools->child( articles => title => loc('Articles'), path => "/Articles/index.html");
     $articles->child( articles => title => loc('Overview'), path => "/Articles/index.html" );
-    $articles->child( search   => title => loc('Search'),   path => "/Articles/Article/Search.html" );
     $articles->child( topics   => title => loc('Topics'),   path => "/Articles/Topics.html" );
 
     $tools->child( my_day =>
@@ -710,7 +713,7 @@ my $build_main_nav = sub {
                         $session{"tickets"}->PrepForSerialization();
                     }
 
-                    my $search = Menu()->child('search');
+                    my $search = Menu()->child('search')->child('tickets');
                     # Don't display prev links if we're on the first ticket
                     if ( $item_map->{$id}->{prev} ) {
                         $search->child( first =>
@@ -739,7 +742,7 @@ my $build_main_nav = sub {
             && $DECODED_ARGS->{'q'} )
       )
     {
-        my $search = Menu()->child('search');
+        my $search = Menu()->child('search')->child('tickets');
         my $args      = '';
         my $has_query = '';
         my $current_search = $session{"CurrentSearchHash"} || {};
diff --git a/share/html/NoAuth/css/base/admin.css b/share/html/NoAuth/css/base/admin.css
index 7df2f91..926cacc 100644
--- a/share/html/NoAuth/css/base/admin.css
+++ b/share/html/NoAuth/css/base/admin.css
@@ -53,7 +53,8 @@ ul.list-menu {
     width: 35%;
 }
 ul.list-menu > li {
-    margin-bottom: 1em;
+    margin-bottom: .5em;
+    margin-top: .5em;
 }
 ul.list-menu .description {
  font-style: italic;
diff --git a/share/html/NoAuth/css/base/admin.css b/share/html/Search/index.html
similarity index 71%
copy from share/html/NoAuth/css/base/admin.css
copy to share/html/Search/index.html
index 7df2f91..0e024c4 100644
--- a/share/html/NoAuth/css/base/admin.css
+++ b/share/html/Search/index.html
@@ -45,60 +45,6 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-ul.list-menu .menu-item {
- font-size: 1.25em;
-}
-ul.list-menu {
- list-style: none;
-    width: 35%;
-}
-ul.list-menu > li {
-    margin-bottom: 1em;
-}
-ul.list-menu .description {
- font-style: italic;
- display: block;
- padding: 0.2em 0 0 1em;
-}
-
-ul.list-menu ul {
- list-style: none;
- padding: 0.25em 0 0 1em;
-}
-ul.list-menu ul li {
- display: inline;
- margin-right: 0.5em;
-}
-
-#rt-portal .titlebox iframe {
-    height: 100%;
-    width: 100%;
-    border: 0;
-}
-
-#rt-portal .titlebox {
-    position: absolute;
-    top: 1em;
-    right: 1em;
-    bottom: 3em;
-    width: 55%;
-    padding-bottom: 1em;
-}
-
-#rt-portal .titlebox-content {
-    height: 100%;
-    padding: 0;
-}
-
-#rt-portal .titlebox.rolled-up {
-    bottom: auto;
-    padding-bottom: 0;
-}
-
-.admin-hint {
-    font-style: italic;
-}
-
-h2 + .admin-hint {
-    margin-top: -1em;
-}
+<& /Admin/Elements/Header, Title => loc('Searches') &>
+<& /Elements/Tabs &>
+<& /Elements/ListMenu, menu => Menu()->child('search'), show_children => 1 &>
diff --git a/t/articles/interface.t b/t/articles/interface.t
index cb2ea72..198162f 100644
--- a/t/articles/interface.t
+++ b/t/articles/interface.t
@@ -161,7 +161,7 @@ ok($ret, "Test ticket for articles created: $msg");
 
 isa_ok($m, 'Test::WWW::Mechanize');
 ok($m->login, 'logged in');
-$m->follow_link_ok( { text => 'Articles', url_regex => qr!^/Articles/! },
+$m->follow_link_ok( { text => 'Articles', url_regex => qr!^/Articles/index.html! },
     'UI -> Articles' );
 
 $m->content_contains($article3->Name);
diff --git a/t/articles/search-interface.t b/t/articles/search-interface.t
index ce32145..acd5710 100644
--- a/t/articles/search-interface.t
+++ b/t/articles/search-interface.t
@@ -147,7 +147,7 @@ sub DoArticleSearch{
   my $class_name = shift;
   my $search_text = shift;
 
-  $m->follow_link_ok( {text => 'Search'}, 'Articles -> Search');
+  $m->follow_link_ok( {text => 'Articles'}, 'Articles Search');
   $m->follow_link_ok( {text => 'in class '. $class_name}, 'Articles in class '. $class_name);
   $m->text_contains('First article');
 
diff --git a/t/web/cf_access.t b/t/web/cf_access.t
index ec095c0..91dbca7 100644
--- a/t/web/cf_access.t
+++ b/t/web/cf_access.t
@@ -215,7 +215,7 @@ diag "create a ticket with an image";
 }
 
 $m->get( $m->rt_base_url );
-$m->follow_link( id => 'search-new');
+$m->follow_link( id => 'search-tickets-new');
 $m->title_is(q/Query Builder/, 'Query building');
 $m->submit_form(
     form_name => "BuildQuery",

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


More information about the Rt-commit mailing list