From 899bab9e5438cd5aa4deb573f85c9d70a05e9d4a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 4 Nov 2024 17:41:04 +0000 Subject: [PATCH] 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 --- .../modules/course_reserves/course-details.tt | 74 +++++++++++++------ 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index 929db917c3..27082e4df3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -26,6 +26,15 @@ padding:.5em; position:absolute; } + div.rows span.label { + float: left; + } + #course_instructors { + float: left; + } + .instructor_line { + padding: .3em; + } [% END %] @@ -52,7 +61,7 @@
[% INCLUDE 'messages.inc' %] -

Reserves

+

[% tx("Course details for {course_name}", { course_name = course.course_name }) | html %][%- IF course.section -%] - [% course.section | html %][%- END -%]

[% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %]
@@ -82,30 +91,51 @@
[% END %] -
-
+
+
    -
  1. Course name [% course.course_name | html %]
  2. -
  3. [% tp('Semester', 'Term') | html %] [% AuthorisedValues.GetByCode( 'TERM', course.term ) | html %]
  4. -
  5. Department [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) | html %]
  6. -
  7. Course number [% course.course_number | html %]
  8. -
  9. Section [% course.section | html %]
  10. -
  11. - Instructors -
    - [% FOREACH i IN course.instructors %] -
  12. Course name: [% course.course_name | html %]
  13. + [% IF ( course.term ) %] +
  14. + [% tp('Semester', 'Term') | html %]: + [% AuthorisedValues.GetByCode( 'TERM', course.term ) | html %] +
  15. + [% END %] +
  16. Department: [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) | html %]
  17. +
  18. Course number: [% course.course_number | html %]
  19. + [% IF ( course.section ) %] +
  20. + Section: + [% course.section | html %] +
  21. + [% END %] + [% IF course.instructors && course.instructors.count > 0 %] +
  22. + Instructors: +
    +
    + [% FOREACH i IN course.instructors %] + + [% END %]
    - [% END %] -
    -
  23. -
  24. Staff note [% course.staff_note | html %]
  25. -
  26. Public note [% course.public_note | $raw %]
  27. -
  28. Student count [% course.students_count | html %]
  29. -
  30. Status [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]
  31. +
+ + [% END %] + [% IF ( course.staff_note ) %] +
  • + Staff note: + [% course.staff_note | html %] +
  • + [% END %] + [% IF ( course.public_note ) %] +
  • Public note: [% course.public_note | $raw %]
  • + [% END %] +
  • Student count: [% course.students_count || "0" | html %]
  • +
  • Status: [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]
  • -
    +
    [% IF course_reserves %] -- 2.39.5