TPAC: Avoid paginator HTML rather than hiding it
authorDan Scott <dscott@laurentian.ca>
Tue, 24 Sep 2013 02:44:18 +0000 (22:44 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 25 Sep 2013 22:45:12 +0000 (18:45 -0400)
Rather than generating HTML and then hiding it via CSS, just don't
generate the HTML at all. In this case, avoid generating the Previous /
Next links in those cases where we're on either page one or the last page
of results respectively.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/result/paginate.tt2

index ea6dd7c..9aa09bf 100644 (file)
@@ -1129,7 +1129,10 @@ div#facet_sidebar {
     color: [% css_colors.text_alert %];
 }
 #acct_prefs_header { float: left; }
-.search_page_nav_link { cursor: pointer; }
+.search_page_nav_link {
+    cursor: pointer;
+    padding-left: 1em;
+}
 #opac.result.sort { width: 160px; }
 .renew-summary { font-size: [% css_fonts.size_bigger %]; font-style: italic; margin: 0.5ex 0; }
 .failure-text { margin-left: 4em; font-style: italic; color: [% css_colors.text_alert %]; }
@@ -1190,10 +1193,7 @@ a.dash-link:hover { text-decoration: underline !important; }
     padding-bottom: 1ex;
 }
 .cn_browse_item { padding: 2ex; }
-.results-paginator-list {
-    padding-left: 1em;
-    padding-right: 1em;
-}
+.results-paginator-list { padding-left: 1em; }
 .results-paginator-selected { color: [% css_colors.text_alert %]; }
 .inactive-hold { background: [% css_colors.accent_lightest %]; }
 
index d41822f..5673a85 100644 (file)
     <span>
                 <span class='start_end_links_span'>
 
-                    [%  class = 'search_page_nav_link';
+                    [%- class = 'search_page_nav_link';
                         href = '#';
                         IF page > 0;
                             href = mkurl('', {page => page - 1});
-                        ELSE; class = class _ ' invisible'; END;
-                    %]
+                    -%]
                     <a class='[% class %]' href='[% href %]' 
                         title='[% l("Previous page") %]'><span class="nav_arrow_fix">&#9668;</span> [% l('Previous') %] </a>
+                    [%- END;
 
-                    [%- # show links to 4 previous pages, the current page, and 3 more pages.
+                        # show links to 4 previous pages, the current page, and 3 more pages.
                         added = 0;
                         pageitr = page - 5; 
                         IF page_count > 1; # no need to paginate 1 page
                                 END;
                     -%]
                     </span>
-                    [%- END; -%]
+                    [%- END;
 
-                    [%  class = 'search_page_nav_link';
+                        class = 'search_page_nav_link';
                         href = '#';
                         IF (page + 1) < page_count;
                             href = mkurl('', {page => page + 1});
-                        ELSE; class = class _ ' invisible'; END;
-                    %]
+                    -%]
                     <a class='[% class %]' href='[% href %]' 
                         title='[% l("Next page") %]'> [% l('Next') %] <span class="nav_arrow_fix">&#9658;</span></a>
+                    [%- END; -%]
                 </span>
     </span>
 </div>