TPAC: Reduce vertical space in results paginator
authorDan Scott <dscott@laurentian.ca>
Tue, 24 Sep 2013 02:29:23 +0000 (22:29 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 25 Sep 2013 22:45:12 +0000 (18:45 -0400)
An unnecessary span element with inline CSS results in additional blank
vertical space being generated for searches with only one page of
results. Avoid creating the span (which would normally contain the list
of pages), move the CSS to the style sheet, and use ems rather than
hard-coded px values for the padding to adjust relative to the font
size.

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 5973d5f..680ba2d 100644 (file)
@@ -1189,7 +1189,10 @@ 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-selected { color: [% css_colors.text_alert %]; }
 .inactive-hold { background: [% css_colors.accent_lightest %]; }
 
index 066cd8c..d41822f 100644 (file)
                     <a class='[% class %]' href='[% href %]' 
                         title='[% l("Previous page") %]'><span class="nav_arrow_fix">&#9668;</span> [% l('Previous') %] </a>
 
-                    <span style='padding-left: 11px; padding-right:11px;'>
-                        [%  # 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
+                    [%- # 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
+                    -%]
+                    <span class='results-paginator-list'>
+                    [%-
                                 WHILE (pageitr = pageitr + 1) < page_count;
                                     IF pageitr < 0; NEXT; END;
                                     IF pageitr == page; %]
@@ -42,9 +44,9 @@
                                     added = added + 1;
                                     IF added == 8; LAST; END;
                                 END;
-                            END;
-                        %]
+                    -%]
                     </span>
+                    [%- END; -%]
 
                     [%  class = 'search_page_nav_link';
                         href = '#';