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 <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-09-20 15:11:08 +00:00 committed by Tomas Cohen Arazi
parent cb2abacf21
commit 0716caf2f8
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
14 changed files with 128 additions and 153 deletions

View file

@ -140,10 +140,16 @@
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
[%# Include the Home link every time %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-main.pl" title="Home">Home</a>
[% IF ( content.trim == "") # There are no other breadcrumb items, Home is the only link %]
[% WRAPPER breadcrumb_item bc_active = 1 %]
<span>Home</span>
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-main.pl" title="Home">Home</a>
[% END %]
[% content | $raw %]
[% END %]
[% content | $raw %]
</ol>
</nav>
[% END %]

View file

@ -19,19 +19,14 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Course reserves for &nbsp;<em>[% course.course_name | html %]</em></a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Course reserves for &nbsp;<em>[% course.course_name | html %]</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -17,16 +17,11 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Course reserves</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Course reserves</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -43,16 +43,11 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page"><span>Details for: </span>[% INCLUDE 'biblio-title.inc' %]</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Details for: </span>[% INCLUDE 'biblio-title.inc' %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -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' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
[% IF ( logged_in_user ) %]
<li class="breadcrumb-item"><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a></li>
[% WRAPPER breadcrumbs %]
[% IF ( logged_in_user ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
[% END %]
<li class="breadcrumb-item">
[% IF shelf.public %]
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=1">Public lists</a>
[% ELSE %]
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0">Your lists</a>
[% END %]
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Download list <em>[% shelf.shelfname | html %]</em></a>
</li>
</ul>
</nav> <!-- /#breadcrumbs -->
[% END %]
[% WRAPPER breadcrumb_item %]
[% IF shelf.public %]
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=1">Public lists</a>
[% ELSE %]
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0">Your lists</a>
[% END %]
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Download list '[% shelf.shelfname | html %]'</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -1,3 +1,4 @@
[% USE raw %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
@ -59,19 +60,14 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Full subscription history</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Full subscription history</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -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' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item">
[% INCLUDE 'biblio-title.inc' %]
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Images</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
[% INCLUDE 'biblio-title.inc' link = 1 %]
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Images</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -1,3 +1,4 @@
[% USE raw %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
@ -22,7 +23,7 @@
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Editing issue note for [% title | html %] [% author | html %]</a>
<a href="#" aria-current="page">Editing issue note for '[% title | html %]' [% author | html %]</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->

View file

@ -61,25 +61,20 @@
[% END %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
[% IF ( library ) %]
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-library.pl">Libraries</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">[% library.branchname | html %]</a>
</li>
[% ELSE %]
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Libraries</a>
</li>
[% WRAPPER breadcrumbs %]
[% IF ( library ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-library.pl">Libraries</a>
[% END %]
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% library.branchname | html %]
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Libraries</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -21,22 +21,14 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
[% IF news_item %]
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">[% news_item.title | html %]</a>
</li>
[% ELSE %]
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Home</a>
</li>
[% WRAPPER breadcrumbs %]
[% IF news_item %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% news_item.title | html %]
[% END %]
</ol>
</nav> <!-- /#breadcrumbs -->
[% ELSE %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% IF ( loggedinusername ) %]

View file

@ -13,22 +13,15 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% IF page %]
<li class="breadcrumb-item active">
<a href="#" aria-current="page">[% page.title | html %]</a>
</li>
<span>[% page.title | html %]</span>
[% ELSE %]
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Page error</a>
</li>
<span>Page error</span>
[% END %]
</ol>
</nav> <!-- /#breadcrumbs -->
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -17,8 +17,17 @@
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Change your password</span>
[% IF ( password_updated ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-passwd.pl">Change your password</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Password updated</span>
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Change your password</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]

View file

@ -1,3 +1,4 @@
[% USE raw %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
@ -13,19 +14,14 @@
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav aria-label="breadcrumb">
<ul class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Details for: [% biblio.title | html %]</a>
</li>
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% biblio.biblionumber | uri %]">Place recall</a>
</li>
</ul>
</nav>
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Details for: [% biblio.title | html %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Place recall</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">

View file

@ -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' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Report a problem</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% IF messages %]
[% FOR m IN messages %]
[% SWITCH m.code %]
[% CASE 'success_on_send' %]
<span>Report submitted</span>
[% CASE 'error_on_send' %]
<span>Error submitting report</span>
[% CASE %]
[% END %]
[% END %]
[% ELSE %]
<span>Report a problem</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
<div class="container-fluid">
<div class="row">