Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc
Owen Leonard 0716caf2f8
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>
2023-11-03 12:04:40 -03:00

170 lines
7.7 KiB
HTML

[% BLOCK options_for_libraries %]
[% FOREACH l IN libraries %]
[% IF l.selected %]
<option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
[% ELSE %]
<option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
[% END%]
[% END %]
[% END %]
[% BLOCK koha_news_block %]
[% IF ( news.content && news.content.count > 0 ) %]
<div id="[% news.location | html %]">
[% FOREACH n IN news.content %]
<div class="[% n.lang | html %]_item">
[% IF ( n.title && news.blocktitle ) %]
<h4 class="[% n.lang | html %]_header">[% n.title | html %]</h4>
[% END %]
<div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
</div>
[% END %]
</div>
[% END %]
[% END %]
[% BLOCK biblio_a_href -%]
[%- IF Koha.Preference('BiblioDefaultView') == 'marc' -%]
[%- SET this_biblio_href = "/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=" -%]
[%- ELSIF Koha.Preference('BiblioDefaultView') == 'isbd' -%]
[%- SET this_biblio_href = "/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=" -%]
[%- ELSE -%]
[%- SET this_biblio_href = "/cgi-bin/koha/opac-detail.pl?biblionumber=" -%]
[%- END -%]
[%- this_biblio_href | url %][% biblionumber | url -%]
[%- END %]
[% # BOOTSTRAP TAB WRAPPER USAGE %]
[% # [ WRAPPER tabs id= "tabs_container_id" ] %]
[% # [ WRAPPER tabs_nav ] %]
[% # [ WRAPPER tab_item tabname= "tab_name_1" bt_active= 1 ] <span>Tab text 1</span> [ END ] %]
[% # [ WRAPPER tab_item tabname= "tab_name_2" ] <span>Tab text 2</span> [ END ] %]
[% # ... %]
[% # [ END ] %]
[% # [ WRAPPER tab_panels ] %]
[% # [ WRAPPER tab_panel tabname="tab_name_1" bt_active= 1 ] Panel contents 1 [ END ] %]
[% # [ WRAPPER tab_panel tabname="tab_name_2" ] Panel contents 2 [ END ] %]
[% # ... %]
[% # [ END ] %]
[% # [ END ] %]
[% BLOCK tabs %]
[% IF ( id ) %]
<div id="[% id | html %]" class="toptabs">
[% ELSE %]
<div class="toptabs">
[% END %]
[% content | $raw %]
</div>
[% END %]
[% BLOCK tabs_nav %]
<ul class="nav nav-tabs" role="tablist">
[% content | $raw %]
</ul>
[% END %]
[% BLOCK tab_item %]
<li class="nav-item" role="presentation">
[% IF ( bt_active ) %]
[% SET link_class="nav-link active" %]
[% SET aria_selected="true" %]
[% ELSE %]
[% SET link_class="nav-link" %]
[% SET aria_selected="false" %]
[% END %]
[% IF ( tabid ) %]
[% SET our_tab_id = tabid %]
[% ELSE %]
[% SET our_tab_id = tabname %]
[% END %]
<a href="#[% tabname | uri %]_panel" class="[% link_class | html %]" id="[% our_tab_id | html %]-tab" data-toggle="tab" data-target="#[% tabname | html %]_panel" data-tabname="[% tabname | uri %]" aria-controls="[% tabname | uri %]_panel" role="tab" aria-selected="[% aria_selected | html %]">
[% content | $raw %]
</a>
</li>
[% END %]
[% BLOCK tab_panels %]
[% IF ( id ) %]
<div class="tab-content" id="[% id | html %]_content">
[% ELSE %]
<div class="tab-content">
[% END %]
[% content | $raw %]
</div>
[% END %]
[% BLOCK tab_panel %]
[% IF ( bt_active ) %]
<div role="tabpanel" class="tab-pane show active" id="[% tabname | html %]_panel" aria-labelledby="[% tabname | html %]-tab">
[% ELSE %]
<div role="tabpanel" class="tab-pane" id="[% tabname | html %]_panel" aria-labelledby="[% tabname | html %]-tab">
[% END %]
[% content| $raw %]
</div>
[% END %]
[% # BOOTSTRAP BREADCRUMBS WRAPPER USAGE %]
[% # [ WRAPPER breadcrumbs ] %]
[% # [ Home breadcrumb automatically included ] %]
[% # [ WRAPPER breadcrumb_item ] %]
[% # <a href="/cgi-bin/koha/module/module-home.pl"> Module </a> %]
[% # [ END ] %]
[% # [ IF op == 'add_form' ] %]
[% # [ WRAPPER breadcrumb_item ] %]
[% # <a href="/cgi-bin/koha/module/page.pl"> Module page </a> %]
[% # [ END ] %]
[% # [ WRAPPER breadcrumb_item bc_active = 1 ] %]
[% # <span>Add form</span> %]
[% # [ END ] %]
[% # [ ELSIF op == 'delete_confirm' ] %]
[% # [ WRAPPER breadcrumb_item ] %]
[% # <a href="/cgi-bin/koha/module/page.pl"> Module page </a> %]
[% # [ END ] %]
[% # [ WRAPPER breadcrumb_item bc_active = 1 ] %]
[% # <span>Confirm deletion</span> %]
[% # [ END ] %]
[% # [ ELSE ] %]
[% # [ WRAPPER breadcrumb_item bc_active = 1 ] %]
[% # <span>Module page</span> %]
[% # [ END ] %]
[% # [ END #/IF op = add_form ] %]
[% # [ END #/ WRAPPER breadcrumbs ] %]
[% # Used to build breadcrumb navigation nav %]
[% BLOCK breadcrumbs %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
[%# Include the Home link every time %]
[% 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 %]
</ol>
</nav>
[% END %]
[%# Used to build individual breadcrumb items in the breadcrumb nav %]
[% BLOCK breadcrumb_item %]
[% IF ( bc_active ) %]
<li class="breadcrumb-item active">
<a href="#" aria-current="page">
[% content | $raw %]
</a>
</li>
[% ELSE %]
<li class="breadcrumb-item">
[% content | $raw %]
</li>
[% END %]
[% END %]