Bug 38351: Improve layout of course reserve details

This patch makes some simple markup and CSS changes to the course
details page in order to improve the layout of the section:
- Add colons after labels.
- Replace fieldset.rows with div.rows (there's no form).
- Make list of instructors line up with other details.
- Do not display fields which are empty.

ALSO: Replaced the "Reserves" heading with course name, matching
breadcrumbs and page title.

To test, apply the patch and go to Course reserves.

- If necessary, create a course.
- View the details of the course.
- Confirm that the list of details looks correct.
  - Test with all the optional fields empty: Section, term, instructor,
    staff note, public note. There should not be empty lines for these
    fields in the course details.
  - "Number of students" should show "0" if you left the field empty.
- Add multiple instructors to confirm that they are displayed in
  alignment with other course details.
- The page heading should match the page breadcrumb.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-11-04 17:41:04 +00:00 committed by Katrin Fischer
parent 67ca808aba
commit fb5f5b6596
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -28,6 +28,15 @@
padding: 0.5em;
position: absolute;
}
div.rows span.label {
float: left;
}
#course_instructors {
float: left;
}
.instructor_line {
padding: 0.3em;
}
</style>
[% END %]
</head>
@ -50,7 +59,7 @@
[% END #/ WRAPPER sub-header.inc %]
[% WRAPPER 'main-container.inc' %]
<h1>Reserves</h1>
<h1>[% tx("Course details for {course_name}", { course_name = course.course_name }) | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</h1>
[% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %]
<div id="toolbar">
@ -80,30 +89,51 @@
><!-- /toolbar -->
[% END %]
<div class="page-section clearfix">
<fieldset class="rows clearfix">
<div class="page-section">
<div class="rows">
<ol>
<li><span class="label">Course name</span> [% course.course_name | html %]</li>
<li><span class="label">[% tp('Semester', 'Term') | html %]</span> [% AuthorisedValues.GetByCode( 'TERM', course.term ) | html %]</li>
<li><span class="label">Department</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) | html %]</li>
<li><span class="label">Course number</span> [% course.course_number | html %]</li>
<li><span class="label">Section</span> [% course.section | html %]</li>
<li>
<span class="label">Instructors</span>
<div id="instructors">
[% FOREACH i IN course.instructors %]
<div class="instructor_line">
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% i.borrowernumber | uri %]">[% i.firstname | html %] [% i.surname | html %]</a>
<li><span class="label">Course name: </span> [% course.course_name | html %]</li>
[% IF ( course.term ) %]
<li>
<span class="label">[% tp('Semester', 'Term') | html %]: </span>
[% AuthorisedValues.GetByCode( 'TERM', course.term ) | html %]
</li>
[% END %]
<li><span class="label">Department: </span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) | html %]</li>
<li><span class="label">Course number: </span> [% course.course_number | html %]</li>
[% IF ( course.section ) %]
<li>
<span class="label">Section: </span>
[% course.section | html %]
</li>
[% END %]
[% IF course.instructors && course.instructors.count > 0 %]
<li>
<span class="label">Instructors: </span>
<div id="course_instructors">
<div id="instructors">
[% FOREACH i IN course.instructors %]
<div class="instructor_line">
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% i.borrowernumber | uri %]">[% i.firstname | html %] [% i.surname | html %]</a>
</div>
[% END %]
</div>
[% END %]
</div>
</li>
<li><span class="label">Staff note</span> [% course.staff_note | html %]</li>
<li><span class="label">Public note</span> [% course.public_note | $raw %]</li>
<li><span class="label">Student count</span> [% course.students_count | html %]</li>
<li><span class="label">Status</span> [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]</li>
</div>
</li>
[% END %]
[% IF ( course.staff_note ) %]
<li>
<span class="label">Staff note: </span>
[% course.staff_note | html %]
</li>
[% END %]
[% IF ( course.public_note ) %]
<li><span class="label">Public note: </span> [% course.public_note | $raw %]</li>
[% END %]
<li><span class="label">Student count: </span> [% course.students_count || "0" | html %]</li>
<li><span class="label">Status: </span> [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]</li>
</ol>
</fieldset>
</div>
</div>
<!-- /.page-section -->