Add option to change default or suppress 'Show More Details' button
authorArt Rhyno <art632000@yahoo.ca>
Thu, 9 Aug 2012 17:24:59 +0000 (13:24 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 13 Aug 2012 22:48:25 +0000 (18:48 -0400)
Conifer makes heavy use of Dan Scott's ResolverResolver service for
e-content and typically wants to bring most details about entries on a results
screen to the front. This adds a 'show_more_details.default' option
in 'config.tt2' that can have the values 'true', 'false' and 'hide'. The
'true' and 'false' values set the default for the button to more and
less respectively, and 'hide' suppresses the button from showing at all.

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Open-ILS/src/templates_windsor/opac/parts/config.tt2
Open-ILS/src/templates_windsor/opac/parts/searchbar.tt2
Open-ILS/src/templates_windsor/opac/results.tt2 [new file with mode: 0644]

index ce1f78e..b0d0042 100644 (file)
@@ -71,6 +71,12 @@ allow_phone_notifications = 'false';
 ##############################################################################
 # Misc. UI Settings
 ##############################################################################
+# Option for full details as a default, esp. impt. for e-content
+# that uses resolver plumbing. Valid values are 'true', 'false' and 'hide'.
+# Setting this to 'true' shows full details by default but allows the link
+# to appear for 'Show Fewer Details'. The 'hide' option shows full details
+# and also suppresses the link from displaying at all.
+show_more_details.default = 'hide';
 
 ##############################################################################
 # Size of the jacket image to display on the record detail summary.
index 4fc0fa3..69afe1e 100644 (file)
@@ -31,7 +31,7 @@
             l(' in '); INCLUDE build_org_selector show_loc_groups=1
     %]
     <span>
-        [% IF show_more_details.default == 'true' AND !CGI.param('detail_record_view') %]
+        [% IF (show_more_details.default == 'true' OR show_more_details.default == 'hide') AND !CGI.param('detail_record_view') %]
            <input id="detail" type="hidden" name="detail_record_view" value="1"/>
         [% END %]
         <input id='search-submit-go' type="submit" value="[% l('Search') %]" alt="[% l('Search') %]" class="opac-button"
diff --git a/Open-ILS/src/templates_windsor/opac/results.tt2 b/Open-ILS/src/templates_windsor/opac/results.tt2
new file mode 100644 (file)
index 0000000..73c3f07
--- /dev/null
@@ -0,0 +1,81 @@
+[%  PROCESS "opac/parts/header.tt2";
+
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+
+    IF is_advanced || is_special;
+        ctx.page_title = l("Search Results");
+    ELSE;
+        ctx.page_title = l("Search Results: ") _ CGI.param('query') | html;
+    END;
+
+    page = CGI.param('page');
+    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);
+%]
+    <form action="[% ctx.opac_root %]/results" method="GET">
+    <div id="search-wrapper">
+        [% INCLUDE "opac/parts/searchbar.tt2" took_care_of_form=1 %]
+    </div>
+    <div class="almost-content-wrapper">
+        <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>
+                </div>
+                <div class="results_header_btns">
+                    <a href="[% mkurl(ctx.opac_root _ '/advanced') %]">[% l('Advanced Search') %]</a>
+                </div>
+                [% IF ctx.mylist.size %]
+                <div class="results_header_btns cached_list_div">
+                    [%- IF ctx.user; %]
+                    <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]">[% l('View My List') %]</a>
+                    [%- ELSE %]
+                    <a href="[% mkurl(ctx.opac_root _ '/mylist') %]">[% l('View My List') %]</a>
+                    [%- END %]
+                </div>
+                [% END %]
+                <div class="results_header_div"></div>
+                    <label class="results_header_lbl">[% l('Sort by') %]
+                    [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 %]
+                    </label>
+
+                    [% IF show_more_details.default != 'hide' %]
+                    <div class="results_header_div"></div>
+
+                    <div class='results_header_sel' id='simple-detail-view-links'>
+                        [% IF CGI.param('detail_record_view') %]
+                        <a href="[% mkurl('', {detail_record_view => ''}) %]">[% l('Show Fewer Details') %]</a>
+                        [% ELSE %]
+                        <a href="[% mkurl('', {detail_record_view => 1}) %]">[% l('Show More Details') %]</a>
+                        [% END %]
+                    </div>
+                    [% END %]
+
+                    <div class="results_header_div"></div>
+
+                    <label class="results_header_lbl">
+                        <input type="checkbox" id="limit_to_available" name="modifier" value="available"
+                            onchange="limit_to_avail_onchange(this, true)"
+                            [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
+                        [% l('Limit to available items') %]
+                    </label>
+                <div class="clear-both"></div>
+            </div>
+        </div>
+    </div>
+    </form>
+    <br class="clear-both" />
+    <div id="content-wrapper">
+        <div id="main-content">
+            <div id="results-page">
+                [% path = "opac/parts/result/" _
+                    (ctx.records.size ? "table.tt2" : "lowhits.tt2");
+                INCLUDE $path %]
+            </div>
+            <div class="common-full-pad"></div>    
+        </div>
+        <br class="clear-both" />
+    </div>
+[% END %]