From 16d54581b275ba75cdc3fff9c821eaa40fc08a56 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 9 Nov 2022 15:43:50 +0000 Subject: [PATCH] Bug 32146: Add page-section to course reserves This patch adds a "page-section" wrapping div to two Course Reserves templates. Note: This patch contains indentation changes. To test, apply the patch and go to Course Reserves. - The table of course reserves should appear in a white section. - View the details of a course: There should be a white section for the list of details at the top and another for the table of reserves. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../modules/course_reserves/course-details.tt | 421 +++++++++--------- .../course_reserves/course-reserves.tt | 83 ++-- 2 files changed, 255 insertions(+), 249 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 c22cd08c07..0ca98ead0a 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 @@ -79,238 +79,243 @@ [% 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 %] - - [% END %] -
    -
  12. -
  13. Staff note [% course.staff_note | html %]
  14. -
  15. Public note [% course.public_note | $raw %]
  16. -
  17. Student count [% course.students_count | html %]
  18. -
  19. Status [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]
  20. -
-
+
+ +
+
    +
  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 %] + + [% END %] +
    +
  12. +
  13. Staff note [% course.staff_note | html %]
  14. +
  15. Public note [% course.public_note | $raw %]
  16. +
  17. Student count [% course.students_count | html %]
  18. +
  19. Status [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]
  20. +
+
+
[% IF course_reserves %] - - - - - - - - [% IF item_level_itypes %][% END %] - - - - - - - - - - [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] - - [% END %] - - +
+
TitleAuthorBarcodeCall numberItem typeCollectionLocationHome libraryHolding libraryStaff notePublic noteLinkOther course reservesStatusActions
+ + + + + + + [% IF item_level_itypes %][% END %] + + + + + + + + + + [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] + + [% END %] + + - - [% FOREACH cr IN course_reserves %] - - - + + [% FOREACH cr IN course_reserves %] + + + - [% IF cr.item %] - + [% IF cr.item %] + - - [% IF item_level_itypes %] - - [% END %] - + [% IF item_level_itypes %] + - + [% END %] + + - + + + [% ELSE # record-level course reserve %] + + + + + + + [% END %] - - + - [% ELSE # record-level course reserve %] - - - - - - - - [% END %] + - - + - + - + - + [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] + [% END %] - [% IF CAN_user_coursereserves_delete_reserves %] - - Remove - [% END %] - + [% END %] - - - [% END %] - -
TitleAuthorBarcodeCall numberItem typeCollectionLocationHome libraryHolding libraryStaff notePublic noteLinkOther course reservesStatusActions
[% INCLUDE 'biblio-title.inc' biblio=cr.biblio %][% cr.biblio.author | html %]
[% INCLUDE 'biblio-title.inc' biblio=cr.biblio %][% cr.biblio.author | html %][% cr.item.barcode | html %][% cr.item.barcode | html %][% cr.item.itemcallnumber | html %] - [% IF cr.course_item.itype_enabled %] - [% IF cr.course_item.enabled == 'yes' %] - [% ItemTypes.GetDescription( cr.item.effective_itemtype ) | html %] - ([% ItemTypes.GetDescription( cr.course_item.itype_storage ) | html %]) - [% ELSE %] - [% ItemTypes.GetDescription( cr.course_item.itype ) | html %] - ([% ItemTypes.GetDescription( cr.item.effective_itemtype) | html %]) - [% END %] - [% ELSE %] - Unchanged - [% IF cr.item.itype %] - ([% ItemTypes.GetDescription( cr.item.itype ) | html %]) - [% END %] - [% END %] - - [% IF cr.course_item.ccode_enabled %] - [% IF cr.course_item.enabled == 'yes' %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %] - [% IF cr.item.ccode %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.course_item.ccode_storage ) | html %]) - [% END %] - [% ELSE %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.course_item.ccode ) | html %] - [% IF cr.item.ccode %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %]) + [% cr.item.itemcallnumber | html %] + [% IF cr.course_item.itype_enabled %] + [% IF cr.course_item.enabled == 'yes' %] + [% ItemTypes.GetDescription( cr.item.effective_itemtype ) | html %] + ([% ItemTypes.GetDescription( cr.course_item.itype_storage ) | html %]) + [% ELSE %] + [% ItemTypes.GetDescription( cr.course_item.itype ) | html %] + ([% ItemTypes.GetDescription( cr.item.effective_itemtype) | html %]) + [% END %] + [% ELSE %] + Unchanged + [% IF cr.item.itype %] + ([% ItemTypes.GetDescription( cr.item.itype ) | html %]) + [% END %] [% END %] - [% END %] - [% ELSE %] - Unchanged - [% IF cr.item.ccode %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %]) - [% END %] - [% END %] - - [% IF cr.course_item.location_enabled %] - [% IF cr.course_item.enabled == 'yes' %] - [% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %] + + [% IF cr.course_item.ccode_enabled %] + [% IF cr.course_item.enabled == 'yes' %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %] + [% IF cr.item.ccode %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.course_item.ccode_storage ) | html %]) + [% END %] + [% ELSE %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.course_item.ccode ) | html %] + [% IF cr.item.ccode %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %]) + [% END %] + [% END %] + [% ELSE %] + Unchanged + [% IF cr.item.ccode %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %]) + [% END %] + [% END %] + + [% IF cr.course_item.location_enabled %] + [% IF cr.course_item.enabled == 'yes' %] + [% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %] + [% IF cr.item.permanent_location %] + ([% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location_storage ) | html %]) + [% END %] + [% ELSE %] + [% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location ) | html %] + [% IF cr.item.permanent_location %] + ([% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %]) + [% END %] + [% END %] + [% ELSE %] + Unchanged [% IF cr.item.permanent_location %] - ([% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location_storage ) | html %]) + ([% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %]) [% END %] - [% ELSE %] - [% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location ) | html %] - [% IF cr.item.permanent_location %] - ([% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %]) [% END %] - [% END %] - [% ELSE %] - Unchanged - [% IF cr.item.permanent_location %] - ([% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %]) - [% END %] - [% END %] - - [% IF cr.course_item.homebranch_enabled %] - [% IF cr.course_item.enabled == 'yes' %] - [% Branches.GetName( cr.item.homebranch ) | html %] - [% IF cr.item.homebranch %] - ([% Branches.GetName( cr.course_item.homebranch_storage ) | html %]) + + [% IF cr.course_item.homebranch_enabled %] + [% IF cr.course_item.enabled == 'yes' %] + [% Branches.GetName( cr.item.homebranch ) | html %] + [% IF cr.item.homebranch %] + ([% Branches.GetName( cr.course_item.homebranch_storage ) | html %]) + [% END %] + [% ELSE %] + [% Branches.GetName( cr.course_item.homebranch ) | html %] + [% IF cr.item.homebranch %] + ([% Branches.GetName( cr.item.homebranch ) | html %]) + [% END %] + [% END %] + [% ELSE %] + Unchanged + [% IF cr.item.homebranch %] + ([% Branches.GetName( cr.item.homebranch ) | html %]) + [% END %] [% END %] - [% ELSE %] - [% Branches.GetName( cr.course_item.homebranch ) | html %] - [% IF cr.item.homebranch %] - ([% Branches.GetName( cr.item.homebranch ) | html %]) + + [% IF cr.course_item.holdingbranch_enabled %] + [% IF cr.course_item.enabled == 'yes' %] + [% Branches.GetName( cr.item.holdingbranch ) | html %] + [% IF cr.item.holdingbranch %] + ([% Branches.GetName( cr.course_item.holdingbranch_storage ) | html %]) + [% END %] + [% ELSE %] + [% Branches.GetName( cr.course_item.holdingbranch ) | html %] + [% IF cr.item.holdingbranch %] + ([% Branches.GetName( cr.item.holdingbranch ) | html %]) + [% END %] + [% END %] + [% ELSE %] + Unchanged + [% IF cr.item.holdingbranch %] + ([% Branches.GetName( cr.item.holdingbranch ) | html %]) + [% END %] [% END %] - [% END %] - [% ELSE %] - Unchanged - [% IF cr.item.homebranch %] - ([% Branches.GetName( cr.item.homebranch ) | html %]) - [% END %] + +
Item information is not available for record-level course reserve
+
- [% IF cr.course_item.holdingbranch_enabled %] - [% IF cr.course_item.enabled == 'yes' %] - [% Branches.GetName( cr.item.holdingbranch ) | html %] - [% IF cr.item.holdingbranch %] - ([% Branches.GetName( cr.course_item.holdingbranch_storage ) | html %]) - [% END %] - [% ELSE %] - [% Branches.GetName( cr.course_item.holdingbranch ) | html %] - [% IF cr.item.holdingbranch %] - ([% Branches.GetName( cr.item.holdingbranch ) | html %]) - [% END %] + + [% IF (cr.staff_note) %] + [% cr.staff_note | html %] + [% ELSIF (cr.item.itemnotes_nonpublic) %] + [% cr.item.itemnotes_nonpublic | html %] [% END %] - [% ELSE %] - Unchanged - [% IF cr.item.holdingbranch %] - ([% Branches.GetName( cr.item.holdingbranch ) | html %]) + [% IF (cr.public_note) %] + [% cr.public_note | $raw %] + [% ELSIF (cr.item.itemnotes) %] + [% cr.item.itemnotes | $raw %] [% END %] - [% END %] - -
Item information is not available for record-level course reserve
-
[% IF (cr.staff_note) %] - [% cr.staff_note | html %] - [% ELSIF (cr.item.itemnotes_nonpublic) %] - [% cr.item.itemnotes_nonpublic | html %] - [% END %] - [% IF (cr.public_note) %] - [% cr.public_note | $raw %] - [% ELSIF (cr.item.itemnotes) %] - [% cr.item.itemnotes | $raw %] - [% END %] - + [% IF (cr.item.uri) %] + Item URI + [% ELSIF (cr.biblioitem.url) %] + Record URL + [% END %] + - [% IF (cr.item.uri) %] - Item URI - [% ELSIF (cr.biblioitem.url) %] - Record URL - [% END %] - + [% FOREACH c IN cr.courses %] + [% UNLESS cr.course_id == c.course_id %] +

+ + [% c.course_name | html %] + [% IF c.section %] [% c.section | html %] [% END %] + [% IF c.term %] [% AuthorisedValues.GetByCode( 'TERM', c.term ) | html %] [% END %] + +

+ [% END %] + [% END %] +
- [% FOREACH c IN cr.courses %] - [% UNLESS cr.course_id == c.course_id %] -

- - [% c.course_name | html %] - [% IF c.section %] [% c.section | html %] [% END %] - [% IF c.term %] [% AuthorisedValues.GetByCode( 'TERM', c.term ) | html %] [% END %] - -

- [% END %] - [% END %] -
+ + [% IF cr.item.onloan %] + Checked out + [% ELSE %] + Available + [% END %] + + - - [% IF cr.item.onloan %] - Checked out - [% ELSE %] - Available - [% END %] - - + [% IF CAN_user_coursereserves_add_reserves %] + Edit + [% END %] - [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] - - [% IF CAN_user_coursereserves_add_reserves %] - Edit + [% IF CAN_user_coursereserves_delete_reserves %] + + Remove + [% END %] +
+ + + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt index ee5037c941..c54b09467a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt @@ -45,49 +45,50 @@ [% END %]

Courses

- - - - - - - - - - - - - - - - - - [% FOREACH c IN courses %] +
+
NameDept.Course #Section[% tp('Semester', 'Term') | html %]InstructorsStaff notePublic note# of studentsEnabled
+ - - - - - - - - - - - [% END %] - -
[% c.course_name | html %][% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department ) | html %][% c.course_number | html %][% c.section | html %][% AuthorisedValues.GetByCode( 'TERM' c.term ) | html %] - [% FOREACH i IN c.instructors %] - - [% END %] - [% c.staff_note | html %][% c.public_note | $raw %][% c.students_count | html %] - [% IF c.enabled == 'yes' %] - Yes - [% ELSE %] - No - [% END %] -
+ Name + Dept. + Course # + Section + [% tp('Semester', 'Term') | html %] + Instructors + Staff note + Public note + # of students + Enabled + + + + [% FOREACH c IN courses %] + + [% c.course_name | html %] + [% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department ) | html %] + [% c.course_number | html %] + [% c.section | html %] + [% AuthorisedValues.GetByCode( 'TERM' c.term ) | html %] + + [% FOREACH i IN c.instructors %] + + [% END %] + + [% c.staff_note | html %] + [% c.public_note | $raw %] + [% c.students_count | html %] + + [% IF c.enabled == 'yes' %] + Yes + [% ELSE %] + No + [% END %] + + [% END %] + + + -- 2.39.5