[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9c54bcb71017d3679841b51457069bbfd4b55c75

Evergreen Git git at git.evergreen-ils.org
Mon Oct 31 12:18:19 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  9c54bcb71017d3679841b51457069bbfd4b55c75 (commit)
       via  4d1273d822af9c754dd4fd52e842594191f9e0da (commit)
      from  d2e88db7f4ac78a89ea604c480f653e1431d7639 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9c54bcb71017d3679841b51457069bbfd4b55c75
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Mon Oct 31 11:00:02 2011 -0400

    Tpac: show staff saved searches on no-results page
    
    Not having it there is awkward for the user who relies on the feature
    and enters a search term that gets no results.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/result/lowhits.tt2 b/Open-ILS/src/templates/opac/parts/result/lowhits.tt2
index ecf245d..db8266a 100644
--- a/Open-ILS/src/templates/opac/parts/result/lowhits.tt2
+++ b/Open-ILS/src/templates/opac/parts/result/lowhits.tt2
@@ -1,6 +1,9 @@
 <div>
     <div id="zero_search_hits">
-        <div>
+        <div class="zero_search_hits_saved">
+            [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
+        </div>
+        <div class="zero_search_hits_main">
             <p>[% l('Sorry, no entries were found for') %]
                 [% IF is_advanced OR is_special; l('your search'); ELSE %]
                 <q>[% CGI.param('query') | html %]</q>
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index 91b789c..e81b9d6 100644
--- a/Open-ILS/web/css/skin/default/opac/style.css
+++ b/Open-ILS/web/css/skin/default/opac/style.css
@@ -685,7 +685,8 @@ span.dash_divider {
 	padding-bottom:5px;
 }
 
-#zero_search_hits div { float:left;width:300px;margin-top:20px; }
+.zero_search_hits_main { float:left; width:300px; margin-top: 2ex; }
+.zero_search_hits_saved { float:left; width:200px; margin-top: 2ex; margin-right: 2em; }
 
 #zero_search_hits p {
 	margin-top:0;

commit 4d1273d822af9c754dd4fd52e842594191f9e0da
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Thu Oct 27 18:20:00 2011 -0400

    Tpac: staff saved searches expand/collapse, use right ou context for setting
    
    1) Display staff saved searches collapsed by default. This makes the facet
    display right underneath it more accessible in the case of long search
    histories.
    
    2) When checking the org unit setting for the limiting number of
    searches to save, use the user's ws_ou as the context, since this is a
    staff-client feature.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
index 4a50820..e934a39 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
@@ -26,6 +26,7 @@ my $U = 'OpenILS::Application::AppUtils';
 
 use constant COOKIE_SES => 'ses';
 use constant COOKIE_PHYSICAL_LOC => 'eg_physical_loc';
+use constant COOKIE_SSS_EXPAND => 'eg_sss_expand';
 
 use constant COOKIE_ANON_CACHE => 'anoncache';
 use constant ANON_CACHE_MYLIST => 'mylist';
@@ -249,9 +250,35 @@ sub load_common {
         }
     }
 
+    $self->staff_saved_searches_set_expansion_state if $ctx->{is_staff};
+
     return Apache2::Const::OK;
 }
 
+sub staff_saved_searches_set_expansion_state {
+    my $self = shift;
+
+    my $param = $self->cgi->param('sss_expand');
+    my $value;
+    
+    if (defined $param) {
+        $value = ($param ? 1 : 0);
+        $self->apache->headers_out->add(
+            "Set-Cookie" => $self->cgi->cookie(
+                -name => COOKIE_SSS_EXPAND,
+                -path => $self->ctx->{base_path},
+                -secure => 1,   # not strictly necessary, but this feature is staff-only, so may as well
+                -value => $value,
+                -expires => undef
+            )
+        );
+    } else {
+        $value = $self->cgi->cookie(COOKIE_SSS_EXPAND);
+    }
+
+    $self->ctx->{saved_searches_expanded} = $value;
+}
+
 # physical_loc (i.e. "original location") passed in as a URL 
 # param will replace any existing physical_loc stored as a cookie.
 sub get_physical_loc {
diff --git a/Open-ILS/src/templates/opac/parts/staff_saved_searches.tt2 b/Open-ILS/src/templates/opac/parts/staff_saved_searches.tt2
index fb8ce21..0250651 100644
--- a/Open-ILS/src/templates/opac/parts/staff_saved_searches.tt2
+++ b/Open-ILS/src/templates/opac/parts/staff_saved_searches.tt2
@@ -1,8 +1,26 @@
 [% IF ctx.saved_searches.size %]
-    <div class="saved-searches-header big-strong">[% l("Your recent searches:") %]</div>
-    [% FOR s IN ctx.saved_searches %]
-    <ul>
-        <li><a href="[% ctx.opac_root %]/results?query=[% s | uri %]&amp;_adv=1">[% s | html %]</a></li>
-    </ul>
+
+    <div class="saved-searches-header">
+        <div class="text">
+            [% l("Recent searches") %]
+        </div>
+        <div class="button">
+            [% IF ctx.saved_searches_expanded %]
+            <a href="[% mkurl('', {'sss_expand' => 0}) %]" title="[% l('Collapse') %]"><img src="[% ctx.media_prefix %]/images/adv_search_minus_btn.png" alt="[% l('Collapse') %]" /></a>
+            [% ELSE %]
+            <a href="[% mkurl('', {'sss_expand' => 1}) %]" title="[% l('Expand') %]"><img src="[% ctx.media_prefix %]/images/adv_search_plus_btn.png" alt="[% l('Expand') %]" /></a>
+            [% END %]
+        </div>
+        <div class="clear">&nbsp;</div>
+    </div>
+    <div class="clear">&nbsp;</div>
+    <div class="saved-searches">
+    [% IF ctx.saved_searches_expanded %]
+        [% FOR s IN ctx.saved_searches %]
+        <ul>
+            <li><a href="[% ctx.opac_root %]/results?query=[% s | uri %]&amp;_adv=1">[% s | html %]</a></li>
+        </ul>
+        [% END %]
     [% END %]
+    </div>
 [% END %]
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index e3a425d..91b789c 100644
--- a/Open-ILS/web/css/skin/default/opac/style.css
+++ b/Open-ILS/web/css/skin/default/opac/style.css
@@ -1166,3 +1166,11 @@ table.bookbag-specific {
     margin-bottom: 2ex;
 }
 .save-notes { padding-bottom: 1.5ex; }
+.saved-searches-header { width: 100%; font-weight: bold; font-size: 120%; }
+.saved-searches-header .button { float: right; width: 28px; }
+.saved-searches-header .text { float: left; padding-right: 1em; margin: 0.5ex 0;}
+.saved-searches-header {font-weight: bold; font-size: 120%; }
+.saved-searches { border-bottom: 1px solid #666; }
+#staff-saved-search { /* wraps .saved-searches-header and .saved-searches on the record page */
+    border-right: 1px solid #333;
+}

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm    |   27 +++++++++++++++++++
 .../src/templates/opac/parts/result/lowhits.tt2    |    5 +++-
 .../templates/opac/parts/staff_saved_searches.tt2  |   28 ++++++++++++++++---
 Open-ILS/web/css/skin/default/opac/style.css       |   11 +++++++-
 4 files changed, 64 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list