Bug 10566 - Improve OPAC course reserves pages
authorOwen Leonard <oleonard@myacpl.org>
Wed, 10 Jul 2013 13:51:26 +0000 (09:51 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 28 Aug 2013 15:01:45 +0000 (15:01 +0000)
This patch makes various improvements to the OPAC course reserve pages:

- Descriptive page titles for both pages.
- More compact display of course information on course detail page
  (a list instead of a table, consistent with other displays of similar
  information in Koha).
- Correct capitalization.
- Added label and fieldset to course reserve search form.
- Added breadcrumb navigation to course reserve detail page as a path
  back to course reserves main page.

To test, apply the patch and confirm that the changes haven't broken
anything and are an improvement.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and improves the display.
Tested with only 1 course, 2 courses,
courses with and without items selected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt

index e627cec..f8313c0 100644 (file)
@@ -165,6 +165,56 @@ fieldset.action p {
        margin-bottom : 1em;
 }
 
+div.rows+div.rows {
+    margin-top : .6em;
+}
+
+div.rows {
+    float : left;
+    clear : left;
+    margin: 0 0 0 0;
+    padding: 0;
+    width: 100%;
+}
+
+
+div.rows span.label {
+    float: left;
+    font-weight : bold;
+    width: 9em;
+    margin-right: 1em;
+    text-align: left;
+}
+
+div.rows ol {
+    padding: .5em 1em 0 0;
+    list-style-type: none;
+}
+
+div.rows ol li li {
+    border-bottom: 0;
+}
+
+div.rows li {
+    border-bottom :  1px solid #EEE;
+    float : left;
+    clear : left;
+    padding-bottom: .2em;
+    padding-top: .1em;
+    list-style-type: none;
+    width: 100%;
+}
+
+div.rows ul li:first-child {
+    float: none;
+    clear: none;
+    margin-left: 0;
+}
+
+div.rows ul li {
+    margin-left : 9em;
+}
+
 form {
        display : inline;
        margin : 0;
index 523ba04..4d0e121 100644 (file)
@@ -4,7 +4,7 @@
 [% USE ItemTypes %]
 [% USE Branches %]
 [% INCLUDE 'doc-head-open.inc' %]
-[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Course reserves for [% course.course_name %]
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="opac-main">
 
 <div id="doc2" class="yui-t7">
     <div id="yui-main">
+        <h2><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a> &#8674; Course reserves for <i>[% course.course_name %]</i></h2>
+        <div class="rows clearfix">
+            <ol>
+                [% IF ( course.term ) %]<li><span class="label">Term:</span> [% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</li>[% END %]
+                <li><span class="label">Department:</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</li>
+                [% IF ( course.course_number ) %]<li><span class="label">Course number:</span> [% course.course_number %]</li>[% END %]
+                [% IF ( course.section ) %]<li><span class="label">Section:</span> [% course.section %]</li>[% END %]
+                [% IF ( course.instructors ) %]
+                    <li><span class="label">Instructors:</span>
+                        <ul>
+                            [% FOREACH i IN course.instructors %]
+                                <li><div class="instructor">[% i.firstname %] [% i.surname %]</div></li>
+                            [% END %]
+                        </ul>
+                    </li>
+                [% END %]
+                [% IF ( course.public_note ) %]<li><span class="label">Notes:</span> [% course.public_note %]</li>[% END %]
+            </ol>
+        </div>
 
-        <table>
-            <tr><th>Course Name</th><td>[% course.course_name %]</td></tr>
-            <tr><th>Term</th><td>[% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</td></tr>
-            <tr><th>Department</th><td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</td></tr>
-            <tr><th>Course Number</th><td>[% course.course_number %]</td></tr>
-            <tr><th>Section</th><td>[% course.section %]</td></tr>
-            <tr><th>Instructors</th><td>[% FOREACH i IN course.instructors %]<div class="instructor">[% i.firstname %] [% i.surname %]</div>[% END %]</td></tr>
-            <tr><th>Notes</th><td>[% course.public_note %]</td></tr>
-        </table>
-
-        <table>
-            <thead>
-                <tr>
-                    <th>Title</th>
-                    <th>Item type</th>
-                    <th>Location</th>
-                    <th>Collection</th>
-                    <th>Call number</th>
-                    <th>Copy</th>
-                    <th>Status</td>
-                    <th>Date due</td>
-                    <th>Notes</th>
-                </tr>
-            </thead>
-
-            <tbody>
-                [% FOREACH cr IN course_reserves %]
+        [% IF ( course_reserves ) %]
+            <table>
+                <thead>
                     <tr>
-                        <td><a href="opac-detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td>
-                        <td>[% ItemTypes.GetDescription( cr.item.itype ) %]</td>
-                        <td>[% Branches.GetName( cr.item.holdingbranch ) %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]</i></td>
-                        <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]</td>
-                        <td>[% cr.item.itemcallnumber %]</td>
-                        <td>[% cr.item.copynumber %]</td>
-                        <td>[% INCLUDE 'item-status.inc' item = cr.item %]</td>
-                        <td>[% cr.issue.date_due | $KohaDates %]</td>
-                        <td>[% cr.public_note %]</td>
+                        <th>Title</th>
+                        <th>Item type</th>
+                        <th>Location</th>
+                        <th>Collection</th>
+                        <th>Call number</th>
+                        <th>Copy</th>
+                        <th>Status</td>
+                        <th>Date due</td>
+                        <th>Notes</th>
                     </tr>
-                [% END %]
-            </tbody>
-        </table>
+                </thead>
 
+                <tbody>
+                    [% FOREACH cr IN course_reserves %]
+                        <tr>
+                            <td><a href="opac-detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td>
+                            <td>[% ItemTypes.GetDescription( cr.item.itype ) %]</td>
+                            <td>[% Branches.GetName( cr.item.holdingbranch ) %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]</i></td>
+                            <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]</td>
+                            <td>[% cr.item.itemcallnumber %]</td>
+                            <td>[% cr.item.copynumber %]</td>
+                            <td>[% INCLUDE 'item-status.inc' item = cr.item %]</td>
+                            <td>[% cr.issue.date_due | $KohaDates %]</td>
+                            <td>[% cr.public_note %]</td>
+                        </tr>
+                    [% END %]
+                </tbody>
+            </table>
+        [% ELSE %]
+            <br style="clear:both;" />
+            <div class="dialog message">
+                <p>No reserves have been selected for this course.</p>
+            </div>
+        [% END %]
     </div>
 </div>
 
index 7476e69..d00748e 100644 (file)
@@ -2,7 +2,7 @@
 [% USE AuthorisedValues %]
 
 [% INCLUDE 'doc-head-open.inc' %]
-[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Courses
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="opac-main">
             <div class="yui-b">
                 <div class="yui-g">
 
+                    <h1>Courses</h1>
                     <div id="search-toolbar">
-                        <form id="search_courses_form">
-                            <input type="text" name="search_on" id="search_on" />
-                            <input type="submit" value="Search" />
+                        <form action="/cgi-bin/koha/opac-course-reserves.pl" method="get" id="search_courses_form">
+                            <fieldset>
+                                <label for="search_on">Search courses:</label> <input type="text" name="search_on" id="search_on" />
+                                <input type="submit" value="Search" />
+                            </fieldset>
                         </form>
-                    </div><!-- /toolbar -->
+                    </div><!-- /search-toolbar -->
 
-                    <h1>Courses</h1>
                     <table id="course_reserves_table">
                         <thead>
                             <tr>