TPAC: Add record detail navigation to page bottom
authorDan Scott <dan@coffeecode.net>
Sat, 16 Jun 2012 02:10:15 +0000 (22:10 -0400)
committerDan Wells <dbw2@calvin.edu>
Mon, 18 Jun 2012 11:32:25 +0000 (07:32 -0400)
A usability rule of thumb suggests that navigation on long pages should
not require you to scroll back up to the top of the page from the
bottom; that gets old fast. We already do this on search results pages;
bring the same good practice to record details.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Dan Wells <dbw2@calvin.edu>

Open-ILS/src/templates/opac/parts/record/body.tt2
Open-ILS/src/templates/opac/parts/record/navigation.tt2 [new file with mode: 0644]
Open-ILS/web/css/skin/default/opac/style.css

index 664abc9..0d9a58b 100644 (file)
@@ -5,49 +5,12 @@
     ctx.record_attrs = attrs; # capture for JS
 %]
 <div id='canvas_main' class='canvas' itemscope itemtype='[% args.schema.itemtype %]'>
-
-    [% IF ctx.search_result_index >= 0 %]
-    <div id="rdetail_header">
-        <span id="rdetail_results">
-            <a href='[% mkurl(ctx.opac_root _ '/results', {}, stop_parms); %]'>[% l('&#9668; Search Results') %]</a>
-            <span id="rdetail_result_count">
-                [% 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;
-                    prev_args = {};
-                    IF ctx.search_page > 0 AND 
-                            ctx.search_result_index % ((ctx.page_size * ctx.search_page)) == 0; # first record in the page
-                        prev_args.page = ctx.search_page - 1;
-                    END;
-                    ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args, stop_parms);
-            %]
-            <a class='np_nav_link classic_link' title='[% l("Previous Record") %]'
-                href='[% ctx.prev_rec_url %]'>&#9668; [% l('Previous') %]</a>
-            [% END %]
-
-            [% 
-                IF ctx.next_search_record;
-                    next_args = {};
-                    IF (ctx.page_size * (ctx.search_page + 1)) == ctx.search_result_index + 1;
-                        next_args.page = ctx.search_page + 1;
-                    END;
-                    ctx.next_rec_url = mkurl(ctx.next_search_record, next_args, stop_parms);
-            %]
-            <a class='np_nav_link classic_link' title='[% l("Next Record") %]'
-                href='[% ctx.next_rec_url %]'>[% l('Next') %] &#9658;</a>
-            [% END %]
-
-        </div>
-    </div>
-    [% END %]
+    [%- INCLUDE "opac/parts/record/navigation.tt2" %]
     [%- IF ctx.bib_is_dead %]
     <div id='rdetail_deleted_exp'>
         [% l("This record has been deleted from the database.  We recommend that you remove this title from any bookbags it may have been added to.") %]
     </div>
     [%- END %]
     [% INCLUDE "opac/parts/record/summary.tt2" %]
+    [%- INCLUDE "opac/parts/record/navigation.tt2" %]
 </div>
diff --git a/Open-ILS/src/templates/opac/parts/record/navigation.tt2 b/Open-ILS/src/templates/opac/parts/record/navigation.tt2
new file mode 100644 (file)
index 0000000..29b1106
--- /dev/null
@@ -0,0 +1,38 @@
+[% IF ctx.search_result_index >= 0 %]
+<div class="rdetail_header">
+    <span class="rdetail_results">
+        <a href='[% mkurl(ctx.opac_root _ '/results', {}, stop_parms); %]'>[% l('&#9668; Search Results') %]</a>
+        <span class="rdetail_result_count">
+            [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %]
+        </span>
+    </span>
+    [%- INCLUDE "opac/parts/pref_lib_display.tt2" %]
+    <div class="rdetail_result_nav">
+        [%
+            IF ctx.prev_search_record;
+                prev_args = {};
+                IF ctx.search_page > 0 AND 
+                        ctx.search_result_index % ((ctx.page_size * ctx.search_page)) == 0; # first record in the page
+                    prev_args.page = ctx.search_page - 1;
+                END;
+                ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args, stop_parms);
+        %]
+        <a class='np_nav_link classic_link' title='[% l("Previous Record") %]'
+            href='[% ctx.prev_rec_url %]'>&#9668; [% l('Previous') %]</a>
+        [% END %]
+
+        [% 
+            IF ctx.next_search_record;
+                next_args = {};
+                IF (ctx.page_size * (ctx.search_page + 1)) == ctx.search_result_index + 1;
+                    next_args.page = ctx.search_page + 1;
+                END;
+                ctx.next_rec_url = mkurl(ctx.next_search_record, next_args, stop_parms);
+        %]
+        <a class='np_nav_link classic_link' title='[% l("Next Record") %]'
+            href='[% ctx.next_rec_url %]'>[% l('Next') %] &#9658;</a>
+        [% END %]
+
+    </div>
+</div>
+[% END %]
index 6e69772..8a80c04 100644 (file)
@@ -335,26 +335,26 @@ span.dash_divider {
     color: #666;
 }
 
-#rdetail_header {
+.rdetail_header {
     padding: 5px 7px 6px 0px;
     margin-left: 1em;
     border-bottom: 1px dotted #ccc;
 }
 
-#rdetail_results a {
+.rdetail_results a {
     color:#007a54;
     font-weight:bold;
     font-size: 1.2em;
 }
 
-#rdetail_result_count {
+.rdetail_result_count {
     color: black;
     font-weight: normal;
     padding-left: 1em;
     display: inline-block;
 }
 
-#rdetail_result_nav {
+.rdetail_result_nav {
     font-weight:normal;
     padding-left: 1em;
     display: inline-block;