TPAC: Centralized preferred library indicator
authorDan Scott <dan@coffeecode.net>
Thu, 29 Mar 2012 03:10:17 +0000 (23:10 -0400)
committerMike Rylander <mrylander@gmail.com>
Sun, 1 Apr 2012 02:46:22 +0000 (22:46 -0400)
Create an explicit "Preferred library: Foobar" entry at the top of the
page (on the same line as pagination information), and include a subtle
checkmark to enable users to quickly jump to their "Search preferences"
settings and change their preferred library.

This enables us to remove the "(Preferred library)" note in the copy
counts for search results.

At the same time, move from a table display (for a single row? what?) to
a simple div/span layout for the search results.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/opac/parts/pref_lib_display.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/record/body.tt2
Open-ILS/src/templates/opac/parts/result/copy_counts.tt2
Open-ILS/src/templates/opac/parts/result/paginate.tt2
Open-ILS/web/css/skin/default/opac/style.css

diff --git a/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2 b/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2
new file mode 100644 (file)
index 0000000..635c766
--- /dev/null
@@ -0,0 +1,7 @@
+[%- IF ctx.pref_ou && ctx.pref_ou != ctx.search_ou; %]
+<span class="preflib">[%
+    l('Preferred library: [_1][_2][_3]', '<b>', ctx.get_aou(ctx.pref_ou).name, '</b>');
+    %]<a href="[% mkurl(ctx.opac_root _ '/myopac/prefs_settings')
+    %]" class="preflib_change" title="[% l("Change preferred library"); %]">[% l('?') %]</a>
+</span>
+[%- END; %]
index 4b49435..9f120c6 100644 (file)
@@ -13,6 +13,7 @@
                 [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %]
             </span>
         </span>
+        [%- INCLUDE "opac/parts/pref_lib_display.tt2" %]
         <div id="rdetail_result_nav">
             [%
                 IF ctx.prev_search_record;
index d95d3a7..c183744 100644 (file)
@@ -28,7 +28,7 @@
         attrs.plib_copy_counts.$depth.available,
         attrs.plib_copy_counts.$depth.count,
         ou_name) | html
-    %]<span> [% l('(Preferred)') %]</span>
+    %]
 </div>
 [%- END %]
 [%- END %]
index bcce1c8..edcc817 100644 (file)
@@ -1,17 +1,16 @@
 [% BLOCK results_count_header %]
 <div class="results_header_nav1">
-    <table cellpadding="0" cellspacing="0" border="0" width="100%">
-        <tr>
-            <td class="h1" width="116">[% ctx.bookbag ? l('List Contents') : l('Search Results') %]</td>
-            <td valign="bottom" nowrap="nowrap" class="result_number">
+    <span class="h1">[% ctx.bookbag ? l('List Contents') : l('Search Results') %]</span>
+    <span nowrap="nowrap" class="result_number">
                 [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %]
                 Results <strong>[_1]</strong> - <strong>[_2]</strong> of <strong>[_3]</strong>
                 [% END %]
                 <span style='padding-left: 6px;'>
                     [% |l(page + 1, page_count) %](page <strong>[_1]</strong> of <strong>[_2]</strong>)[% END %]
                 </span>
-            </td>
-            <td align="right" valign="bottom">
+    </span>
+    [%- INCLUDE "opac/parts/pref_lib_display.tt2" %]
+    <span>
                 <span class='start_end_links_span'>
 
                     [%  class = 'search_page_nav_link';
@@ -51,9 +50,7 @@
                     <a class='[% class %]' href='[% href %]' 
                         title='[% l("Next page") %]'> [% l('Next') %] <span class="nav_arrow_fix">&#9658;</span></a>
                 </span>
-            </td>
-        </tr>
-    </table>
+    </span>
 </div>
 [% END %]
 
index 0279eea..f36511c 100644 (file)
@@ -1413,3 +1413,12 @@ table.result_holdings_table thead tr {
 table.result_holdings_table thead tr th {
     font-weight: bold;
 }
+span.preflib {
+    margin: 0 2em 0 2em;
+}
+a.preflib_change {
+  vertical-align: super;
+  font-size: smaller;
+  line-height: normal;
+  text-decoration: none;
+}