From 47265a7bfcb0ae02f55e31dac8df1af1fcfd32b2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 20 Sep 2023 15:11:08 +0000 Subject: [PATCH] Bug 34855: Use template wrapper for breadcrumbs: OPAC part 3 This patch updates several OPAC templates so that they use a new WRAPPER for displaying breadcrumbs. This patch also updates html_helpers.inc to add some logic for handling the case where the "Home" link is the only breadcrumb (on the OPAC main page). The change allows for the link to be disabled in this case. Apply the patch and log in to the OPAC. Test each of the following pages and their variations. Breadcrumbs should look correct, and each link should be correct: - OPAC main page - Course reserves - Course reserves details - Libraries - Follow the link for a specific library - View the details of a bibliographic record - Navigate directly to /cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=X where X is the id of an existing list. (I don't think this page is ever seen unless the user has JavaScript disabled). - Locate a serial record and click the "More details" link under the "Subscriptions" tab. - Click the "Full history" tab. - Log into the OPAC as a user with checkouts. Navigate directly to /cgi-bin/koha/opac-issue-note.pl?issue_id=X where X is the id (issue_id) of one of the user's checkouts. (Another page which is only accessed directly if the user has JS disabled). - From the logged-in user summary page, click "Change password" - Submit a password change. - With "UseRecalls" enabled, locate a bibliographic record you can place a recall request for. - Place a recall. - With "OPACLocalCoverImages" enabled, locate a bibliographic record which has a local cover image attached. - Under the "Images" tab, click the image thumbnail. - If you have no custom OPAC pages, go to Tools -> Pages in the staff interface anc create one. - View the page in the OPAC. - With "OPACReportProblem" enabled, click the "Report a problem" link at the bottom of any OPAC page. - Submit a report. Signed-off-by: David Nind --- .../bootstrap/en/includes/html_helpers.inc | 12 +++++-- .../en/modules/opac-course-details.tt | 21 +++++------ .../en/modules/opac-course-reserves.tt | 15 +++----- .../bootstrap/en/modules/opac-detail.tt | 15 +++----- .../en/modules/opac-downloadshelf.tt | 36 +++++++++---------- .../en/modules/opac-full-serial-issues.tt | 22 +++++------- .../bootstrap/en/modules/opac-imageviewer.tt | 22 +++++------- .../bootstrap/en/modules/opac-issue-note.tt | 3 +- .../bootstrap/en/modules/opac-library.tt | 31 +++++++--------- .../bootstrap/en/modules/opac-main.tt | 22 ++++-------- .../bootstrap/en/modules/opac-page.tt | 19 ++++------ .../bootstrap/en/modules/opac-passwd.tt | 13 +++++-- .../bootstrap/en/modules/opac-recall.tt | 22 +++++------- .../en/modules/opac-reportproblem.tt | 28 +++++++++------ 14 files changed, 128 insertions(+), 153 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc index e728b48f8f..b98e31d483 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc @@ -140,10 +140,16 @@ [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt index 42df1cef2e..3849dbba4d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt @@ -19,19 +19,14 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item %] + Course reserves + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Course reserves for  [% course.course_name | html %] + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt index 0b5e0aabf3..8924690baa 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt @@ -17,16 +17,11 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Course reserves + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index c62cda2726..789244f9d3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -43,16 +43,11 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Details for: [% INCLUDE 'biblio-title.inc' %] + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt index 076fed519f..81768b0049 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt @@ -1,3 +1,4 @@ +[% USE raw %] [% USE Koha %] [% USE AdditionalContents %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] @@ -10,26 +11,23 @@ [% INCLUDE 'bodytag.inc' bodyid='opac-downloadlist' %] [% INCLUDE 'masthead.inc' %]
- + [% END %] + [% WRAPPER breadcrumb_item %] + [% IF shelf.public %] + Public lists + [% ELSE %] + Your lists + [% END %] + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Download list '[% shelf.shelfname | html %]' + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt index e644c9439c..c5769ff993 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt @@ -1,3 +1,4 @@ +[% USE raw %] [% USE Koha %] [% USE KohaDates %] [% USE Branches %] @@ -59,19 +60,14 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item %] + Details for [% bibliotitle | html %] + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Full subscription history + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt index 107c6b5f14..117def57c6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt @@ -1,3 +1,4 @@ +[% USE raw %] [% USE Koha %] [% USE AdditionalContents %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] @@ -39,19 +40,14 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item %] + [% INCLUDE 'biblio-title.inc' link = 1 %] + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Images + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-issue-note.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-issue-note.tt index 4ee19b6e2c..350b75ee7e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-issue-note.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-issue-note.tt @@ -1,3 +1,4 @@ +[% USE raw %] [% USE Koha %] [% USE KohaDates %] [% USE Branches %] @@ -22,7 +23,7 @@ [% INCLUDE 'patron-title.inc' patron = logged_in_user %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt index 508af182e0..09ed26ebe1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt @@ -61,25 +61,20 @@ [% END %]
- + [% ELSE %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Libraries + [% END %] + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt index e8cf85bc9d..e11454336e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt @@ -21,22 +21,14 @@ [% INCLUDE 'masthead.inc' %]
- + [% ELSE %] + [% END %] + [% END #/ WRAPPER breadcrumbs %] [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] [% IF ( loggedinusername ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt index ed5f55c3c3..0591bb2e48 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt @@ -13,22 +13,15 @@ [% INCLUDE 'masthead.inc' %]
- + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt index 7a0218ca4b..9a28c12aa3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt @@ -17,8 +17,17 @@ [% WRAPPER breadcrumb_item %] [% INCLUDE 'patron-title.inc' patron = logged_in_user %] [% END %] - [% WRAPPER breadcrumb_item bc_active= 1 %] - Change your password + [% IF ( password_updated ) %] + [% WRAPPER breadcrumb_item %] + Change your password + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Password updated + [% END %] + [% ELSE %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Change your password + [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt index f2804af257..8bd3830b0e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt @@ -1,3 +1,4 @@ +[% USE raw %] [% USE Koha %] [% USE KohaDates %] [% USE Branches %] @@ -13,19 +14,14 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item %] + Details for: [% biblio.title | html %] + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Place recall + [% END %] + [% END #/ WRAPPER breadcrumbs %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt index 6367abd469..773f824aa7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt @@ -1,3 +1,4 @@ +[% USE raw %] [% USE Koha %] [% USE AdditionalContents %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] @@ -11,16 +12,23 @@ [% INCLUDE 'masthead.inc' %]
- + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + [% IF messages %] + [% FOR m IN messages %] + [% SWITCH m.code %] + [% CASE 'success_on_send' %] + Report submitted + [% CASE 'error_on_send' %] + Error submitting report + [% CASE %] + [% END %] + [% END %] + [% ELSE %] + Report a problem + [% END %] + [% END %] + [% END #/ WRAPPER breadcrumbs %]
-- 2.30.2