Bug 8884: (follow-up) rearrange placement of the top-bar div in CCSR
authorGalen Charlton <gmc@esilibrary.com>
Fri, 14 Jun 2013 22:55:02 +0000 (15:55 -0700)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 30 Jun 2013 15:32:48 +0000 (08:32 -0700)
This patch makes it easier to avoid having the top bar
overlap other OPAC page content (particularly custom
header content set via the opacheader system preference).

This is done by moving the top-nav div outside of the
main doc3 div and adjusting the CSS accordingly.  Yes,
this does end up having top-nav.inc be included from
opac-bottom.inc, but it would require touching rather
more templates to have it be included immediately after
the <body> tag.

This patch also removes a duplicate instance of the
cmspan span.

To test:

[1] Change to the CCSR OPAC theme.
[2] Before applying the patch, open a set of OPAC
    pages (e.g., main page, user page, search results, bib
    details) in your web browser.
[3] Apply the patch, and open the same OPAC pages in separate
    tabs.  Comparing the pre- and post- version of each page
    to verify that the placement
[4] Add an OpAC header using the opacheader system preference.
[5] Verify that the header is displayed without overlapping
    the top bar.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/opac-tmpl/ccsr/en/css/colors.css
koha-tmpl/opac-tmpl/ccsr/en/css/opac.css
koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc
koha-tmpl/opac-tmpl/ccsr/en/includes/opac-bottom.inc
koha-tmpl/opac-tmpl/ccsr/en/includes/top-bar.inc [new file with mode: 0644]

index 69f90f7..c3d4b39 100644 (file)
@@ -60,7 +60,6 @@ a:hover {
     background: none;
     border: none;
     display: table;
-    margin: 40px 0 0 !important;
     padding: 0.7em 0 0 0.5em;
     width: 100%;
 }
index 9f9979c..5c01112 100644 (file)
@@ -1,6 +1,10 @@
 @import url("../../../lib/yui/reset-fonts-grids.css");
 @import url("../../../lib/yui/skin.css");
 
+#doc3 {
+    padding-top: 35px;
+}
+
 a {
       font-weight : bold;
 }
index 0069f74..4eb56c8 100644 (file)
@@ -1,79 +1,5 @@
 <div id="header-wrapper">
 
-<div id="top-bar">
-<ul id="menu-left">
-    <!-- [% IF ( opacbookbag ) %] -->
-        <li>
-            <span id="cmspan"></span>
-            <div id="cartDetails">Your cart is empty.</div>
-        </li>
-    <!-- [% END %] -->
-
-    [% IF ( virtualshelves ) %]
-
-    <li id="listsmenulink">
-        <a href="/cgi-bin/koha/opac-shelves.pl"  class="">
-            <span>Lists</span>
-        </a>
-    <div id="listsmenu" class="yuimenu" style="display: none">
-        <h4>Public lists</h4>
-            [% IF ( pubshelves ) %]
-                <ul class="first-of-type">
-                [% FOREACH pubshelvesloo IN pubshelvesloop %]
-                <li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% pubshelvesloo.shelfnumber %]&amp;sortfield=[% pubshelvesloo.sortfield %]">[% pubshelvesloo.shelfname |html %]</a></li>
-                [% END %]
-                <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">[View All]</a></li>
-            </ul>
-            [% ELSE %]
-            No public lists
-            [% END %]
-      [% IF ( opacuserlogin ) %]
-        <h4>Your lists</h4>
-        [% IF ( loggedinusername ) %]
-            [% IF ( barshelves ) %]
-                <ul class="first-of-type">
-                [% FOREACH barshelvesloo IN barshelvesloop %]
-                <li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% barshelvesloo.shelfnumber %]&amp;sortfield=[% barshelvesloo.sortfield %]">[% barshelvesloo.shelfname |html %]</a></li>
-                [% END %]
-            <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">[View all]</a></li>
-            </ul>
-            [% ELSE %]
-                <ul class="first-of-type">
-            <li>No private lists</li>
-            <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">[New list]</a></li></ul>
-            [% END %]
-        [% ELSE %]
-            <ul class="first-of-type"><li><a href="/cgi-bin/koha/opac-user.pl">Log in to create your own lists</a></li></ul>
-        [% END %]
-      [% END %]
-    </div><!-- /listmenu /virtualshelves -->
-[% END %]
-<div id="listsDetails"></div>
-
-</li>
-</ul>
-
-    <div id="members">
-      [% IF ( opacuserlogin ) %]
-        <ul>
-    [% UNLESS ( loggedinusername ) %]
-                   <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>[% END %]
-                [% IF ( loggedinusername ) %]
-                    <li><span class="members">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></span></li>
-
-                [% END %]
-                [% IF ( ShowOpacRecentSearchLink ) %]
-                    <li><a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a></li>
-                [% END %]
- [% IF ( loggedinusername ) %]<li>[% IF persona %]<a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>[% ELSE %]<a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">[% END %]Log Out</a></li>[% END %]
-        </ul>
-      [% END %]
-    </div>
-
-    <div class="clear"></div>
-
-</div>
-
 <div id="opac-custom-header">
 [% IF ( opacheader ) %]
     [% opacheader %]
 
 
     <input type="submit" value="Go" id="searchsubmit" class="left" />
-[% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %]
 
     <div class="clear"></div>
 
 
 
     <input type="submit" value="Go" id="searchsubmit" class="left transparent" disabled="disabled" />
-[% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %]
 
     <div class="clear"></div>
 
index a0eb3f4..4b4e456 100644 (file)
 </div>
 </div>
 
+[%# Sticking the div for the top bar here; since the
+    top bar is positioned absolutely in this theme, it
+    it makes the positioning of the rest of the elements
+    easier to keep it out of the doc3 div.
+%]
+[% INCLUDE 'top-bar.inc' %]
+
 <div id="main_footer">
     <div class="colleft">
     </div>
diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/top-bar.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/top-bar.inc
new file mode 100644 (file)
index 0000000..42d9576
--- /dev/null
@@ -0,0 +1,73 @@
+<div id="top-bar">
+<ul id="menu-left">
+    <!-- [% IF ( opacbookbag ) %] -->
+        <li>
+            <span id="cmspan"></span>
+            <div id="cartDetails">Your cart is empty.</div>
+        </li>
+    <!-- [% END %] -->
+
+    [% IF ( virtualshelves ) %]
+
+    <li id="listsmenulink">
+        <a href="/cgi-bin/koha/opac-shelves.pl"  class="">
+            <span>Lists</span>
+        </a>
+    <div id="listsmenu" class="yuimenu" style="display: none">
+        <h4>Public lists</h4>
+            [% IF ( pubshelves ) %]
+                <ul class="first-of-type">
+                [% FOREACH pubshelvesloo IN pubshelvesloop %]
+                <li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% pubshelvesloo.shelfnumber %]&amp;sortfield=[% pubshelvesloo.sortfield %]">[% pubshelvesloo.shelfname |html %]</a></li>
+                [% END %]
+                <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">[View All]</a></li>
+            </ul>
+            [% ELSE %]
+            No public lists
+            [% END %]
+      [% IF ( opacuserlogin ) %]
+        <h4>Your lists</h4>
+        [% IF ( loggedinusername ) %]
+            [% IF ( barshelves ) %]
+                <ul class="first-of-type">
+                [% FOREACH barshelvesloo IN barshelvesloop %]
+                <li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% barshelvesloo.shelfnumber %]&amp;sortfield=[% barshelvesloo.sortfield %]">[% barshelvesloo.shelfname |html %]</a></li>
+                [% END %]
+            <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">[View all]</a></li>
+            </ul>
+            [% ELSE %]
+                <ul class="first-of-type">
+            <li>No private lists</li>
+            <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">[New list]</a></li></ul>
+            [% END %]
+        [% ELSE %]
+            <ul class="first-of-type"><li><a href="/cgi-bin/koha/opac-user.pl">Log in to create your own lists</a></li></ul>
+        [% END %]
+      [% END %]
+    </div><!-- /listmenu /virtualshelves -->
+[% END %]
+<div id="listsDetails"></div>
+
+</li>
+</ul>
+
+    <div id="members">
+      [% IF ( opacuserlogin ) %]
+        <ul>
+    [% UNLESS ( loggedinusername ) %]
+                   <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>[% END %]
+                [% IF ( loggedinusername ) %]
+                    <li><span class="members">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></span></li>
+
+                [% END %]
+                [% IF ( ShowOpacRecentSearchLink ) %]
+                    <li><a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a></li>
+                [% END %]
+ [% IF ( loggedinusername ) %]<li>[% IF persona %]<a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>[% ELSE %]<a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">[% END %]Log Out</a></li>[% END %]
+        </ul>
+      [% END %]
+    </div>
+
+    <div class="clear"></div>
+
+</div>