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

Evergreen Git git at git.evergreen-ils.org
Mon Aug 13 19:05:37 EDT 2012


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  aac4d806af6b3eaebc15a660c99c0f39eb49f14d (commit)
       via  5ac1a89633db39fc409a89592e7cbf4aa9629b38 (commit)
      from  ff2ef0d3f7789e1786efdedf2dff1a7a329257cf (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 aac4d806af6b3eaebc15a660c99c0f39eb49f14d
Author: Ben Shum <bshum at biblio.org>
Date:   Mon Aug 13 18:08:53 2012 -0400

    Change "Reset form" to "Clear Form"
    
    As suggested by Thomas Berezansky in the comments on LP 994058, change
    the button from "Reset form" to "Clear form" to be absolutely clear
    that the button now removes all previous search variables.
    
    Signed-off-by: Ben Shum <bshum at biblio.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 b/Open-ILS/src/templates/opac/parts/advanced/search.tt2
index 59fa216..4328086a 100644
--- a/Open-ILS/src/templates/opac/parts/advanced/search.tt2
+++ b/Open-ILS/src/templates/opac/parts/advanced/search.tt2
@@ -103,5 +103,5 @@
 <input type="hidden" name="_adv" value="1" />
 <input type="submit" value="[% l('Search') %]" class='pointer opac-button' />
 <a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
-    class="pointer opac-button">[% l('Reset form') %]</a>
+    class="pointer opac-button">[% l('Clear Form') %]</a>
 </form>

commit 5ac1a89633db39fc409a89592e7cbf4aa9629b38
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Aug 8 15:08:24 2012 -0400

    TPAC: Reset Form and New Search should clear queries
    
    Currently, clicking "Another Search" in the search results page, or
    "Reset Form" on the advanced search page, keeps the same query terms and
    type around. Clear these parameters as expected; essentially, we keep
    only the search location (loc or locg) in scope.
    
    Note that we explicitly keep parameters around when someone is going
    from a basic search to an advanced search, because the assumption is
    that they want to refine their search further.
    
    Also affected are the org_selector, because we want to pull the logic
    for loc or locg out into a common area (the get_library block in
    misc_util.tt2), and the style (input.opac-button elements now get styled
    the same as a.opac-button elements, which makes it easier to intermingle
    them on the same form).
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2
index 7aef348..695cc7e 100644
--- a/Open-ILS/src/templates/opac/css/style.css.tt2
+++ b/Open-ILS/src/templates/opac/css/style.css.tt2
@@ -1142,7 +1142,7 @@ a.opac-button:hover, .results_header_btns a:hover, #simple-detail-view-links a:h
     text-decoration: none;
 }
 
-a.opac-button {
+a.opac-button, input.opac-button {
     margin: 10px;
     padding: 5px 10px 5px 10px;
 }
diff --git a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 b/Open-ILS/src/templates/opac/parts/advanced/search.tt2
index ecc40fb..59fa216 100644
--- a/Open-ILS/src/templates/opac/parts/advanced/search.tt2
+++ b/Open-ILS/src/templates/opac/parts/advanced/search.tt2
@@ -1,3 +1,7 @@
+[% 
+    PROCESS "opac/parts/misc_util.tt2";
+    PROCESS get_library;
+%]
 <form action="[% ctx.opac_root %]/results" method="GET">
 <table id='adv_global_search' class='data_grid data_grid_center' width='100%'>
     <tr style='border-bottom: none;'>
@@ -95,17 +99,9 @@
             </table>
         </td>
     </tr>
-    <tr class='border_4_2'>
-        <td align="left" colspan='2'>
-            <input type="submit"
-                value="[% l('Search') %]"
-                class='pointer opac-button' />
-            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-            <input type="reset"
-                value="[% l('Reset form') %]"
-                class="opac-button" />
-        </td>
-    </tr>
 </table>
 <input type="hidden" name="_adv" value="1" />
+<input type="submit" value="[% l('Search') %]" class='pointer opac-button' />
+<a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
+    class="pointer opac-button">[% l('Reset form') %]</a>
 </form>
diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 124d124..1a393c7 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -269,4 +269,19 @@
         END;
 
     END;
+
+    # Get the library or location group
+    # get_library()
+    BLOCK get_library;
+        IF !loc_name; 
+            loc_name = 'loc';
+            IF show_loc_groups; loc_name = 'locg'; END;
+        END;
+        IF !loc_value;
+            loc_value = CGI.param('loc') || ctx.search_ou;
+            IF show_loc_groups; 
+                loc_value = CGI.param('locg') || ctx.search_ou;
+            END;
+        END;
+    END;
 %]
diff --git a/Open-ILS/src/templates/opac/parts/org_selector.tt2 b/Open-ILS/src/templates/opac/parts/org_selector.tt2
index 31ba30d..159af59 100644
--- a/Open-ILS/src/templates/opac/parts/org_selector.tt2
+++ b/Open-ILS/src/templates/opac/parts/org_selector.tt2
@@ -6,19 +6,18 @@
 # NOTE: DO NOT USE PROCESS
 # Use of PROCESS results in internal variables, such as value or org_unit, to "leak" out
 
+PROCESS "opac/parts/misc_util.tt2";
+PROCESS get_library;
+
 BLOCK build_org_selector;
     node_stack = [{org => org_unit || ctx.aouct_tree || ctx.aou_tree}];
     inherited_vis = ctx.get_cgf('opac.org_unit.non_inherited_visibility').enabled == 'f';
 
     IF !name; 
-        name = 'loc';
-        IF show_loc_groups; name = 'locg'; END;
+        name = loc_name;
     END;
     IF !value;
-        value = ctx.search_ou;
-        IF show_loc_groups; 
-            value = CGI.param('locg') || ctx.search_ou;
-        END;
+        value = loc_value;
     END;
     %]
 
diff --git a/Open-ILS/src/templates/opac/results.tt2 b/Open-ILS/src/templates/opac/results.tt2
index 976c5e9..e5612cc 100644
--- a/Open-ILS/src/templates/opac/results.tt2
+++ b/Open-ILS/src/templates/opac/results.tt2
@@ -13,6 +13,9 @@
     page = page.match('^\d+$') ? page : 0; # verify page is a sane value
 
     page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size);
+
+    PROCESS "opac/parts/misc_util.tt2";
+    PROCESS get_library;
 %]
     <form action="[% ctx.opac_root %]/results" method="GET">
     [% IF CGI.param('facet') %]
@@ -25,7 +28,7 @@
         <div id="results_header_bar">
             <div id="results_header_inner">
                 <div class="results_header_btns">
-                    <a href="[% mkurl(ctx.opac_root _ '/home') %]">[% l('Another Search') %]</a>
+                    <a href="[% mkurl(ctx.opac_root _ '/home', {$loc_name => loc_value}, 1) %]">[% l('Another Search') %]</a>
                 </div>
                 <div class="results_header_btns">
                     <a href="[% mkurl(ctx.opac_root _ '/advanced') %]">[% l('Advanced Search') %]</a>

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

Summary of changes:
 Open-ILS/src/templates/opac/css/style.css.tt2      |    2 +-
 .../src/templates/opac/parts/advanced/search.tt2   |   18 +++++++-----------
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |   15 +++++++++++++++
 Open-ILS/src/templates/opac/parts/org_selector.tt2 |   11 +++++------
 Open-ILS/src/templates/opac/results.tt2            |    5 ++++-
 5 files changed, 32 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list