Bugzilla – Attachment 171804 Details for
Bug 37362
Do not show the lists button if there are no public lists and opacuserlogin is off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37362: Do not show the lists button if there are no public lists and opacuserlogin is off
Bug-37362-Do-not-show-the-lists-button-if-there-ar.patch (text/plain), 10.83 KB, created by
Laura Escamilla
on 2024-09-19 20:09:18 UTC
(
hide
)
Description:
Bug 37362: Do not show the lists button if there are no public lists and opacuserlogin is off
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-09-19 20:09:18 UTC
Size:
10.83 KB
patch
obsolete
>From b7e85e207666c0fda3c55c3bbdfb2a786a98d743 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 4 Sep 2024 13:32:27 +0000 >Subject: [PATCH] Bug 37362: Do not show the lists button if there are no > public lists and opacuserlogin is off > >This patch updates the OPAC header so that if opacuserlogin is off and >there are no public shelves, the Lists button does not appear. If >opacuserlogin is turned off the only kind of lists the user can interact >with are public ones, and without public lists there's nothing to do. > >To test, apply the patch and test the arrangement of the OPAC header in >these cases: > >- opacuserlogin is on, user is logged in, and there are no public lists: > - The Lists button appears and contains only "Your lists" menu items. >- opacuserlogin is on, user is logged in, and there are public lists: > - The Lists button appears and the menu contains controls for both > public and private lists. >- opacuserlogin is off and there are public lists: > - The Lists button appears and shows only controls for public lists. >- opacuserlogin is off and there are no public lists: > - The Lists button does not appear. > >Sponsored-by: Athens County Public Libraries >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > .../bootstrap/en/includes/masthead.inc | 80 ++++++++++--------- > 1 file changed, 41 insertions(+), 39 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 266309c1ef..b9fcf6fb02 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -44,49 +44,51 @@ > [% END %] > <li class="divider-vertical"></li> > [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %] >- <li class="nav-item dropdown"> >- <a href="/cgi-bin/koha/opac-shelves.pl" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-bs-toggle="dropdown" role="button" aria-label="Lists" aria-haspopup="true" aria-expanded="false" >- ><i class="fa fa-list fa-fw fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span> >- </a> >- <div aria-labelledby="listsmenu" role="menu" class="dropdown-menu"> >- [% IF some_public_shelves.count %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem"><strong>Public lists</strong></a> >- [% SET number_of_public_shelves = 0 %] >- [% FOREACH s IN some_public_shelves %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >- [% SET number_of_public_shelves = number_of_public_shelves + 1 %] >- [% IF number_of_public_shelves >= 10 %][% LAST %][% END %] >+ [% IF Koha.Preference( 'opacuserlogin' ) == 1 || some_public_shelves.count > 0 %] >+ <li class="nav-item dropdown"> >+ <a href="/cgi-bin/koha/opac-shelves.pl" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-bs-toggle="dropdown" role="button" aria-label="Show dropdown with detailed list information" aria-haspopup="true" aria-expanded="false" >+ ><i class="fa fa-list fa-fw fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span> >+ </a> >+ <div aria-labelledby="listsmenu" role="menu" class="dropdown-menu"> >+ [% IF some_public_shelves.count %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem"><strong>Public lists</strong></a> >+ [% SET number_of_public_shelves = 0 %] >+ [% FOREACH s IN some_public_shelves %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >+ [% SET number_of_public_shelves = number_of_public_shelves + 1 %] >+ [% IF number_of_public_shelves >= 10 %][% LAST %][% END %] >+ [% END %] >+ [% IF some_public_shelves > 10 %] >+ <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem">View all</a> >+ [% END %] > [% END %] >- [% IF some_public_shelves > 10 %] >- <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem">View all</a> >+ [% IF Koha.Preference( 'opacuserlogin' ) == 1 && some_public_shelves.count > 0 %] >+ <div class="dropdown-divider"></div> > [% END %] >- [% END %] >- [% IF some_public_shelves.count > 0 %] >- <div class="dropdown-divider"></div> >- [% END %] >- [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem"><strong>Your lists</strong></a> >- [% IF loggedinusername %] >- [% IF some_private_shelves.count %] >- [% SET number_of_private_shelves = 0 %] >- [% FOREACH s IN some_private_shelves %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >- [% SET number_of_private_shelves = number_of_private_shelves + 1 %] >- [% IF number_of_private_shelves >= 10 %][% LAST %][% END %] >- [% END %] >- [% IF some_private_shelves > 10 %] >- <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem">View all</a> >+ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem"><strong>Your lists</strong></a> >+ [% IF loggedinusername %] >+ [% IF some_private_shelves.count %] >+ [% SET number_of_private_shelves = 0 %] >+ [% FOREACH s IN some_private_shelves %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >+ [% SET number_of_private_shelves = number_of_private_shelves + 1 %] >+ [% IF number_of_private_shelves >= 10 %][% LAST %][% END %] >+ [% END %] >+ [% IF some_private_shelves > 10 %] >+ <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem">View all</a> >+ [% END %] >+ [% ELSE %] >+ <a class="dropdown-item disabled" aria-disabled="true" href="#" tabindex="-1" role="menuitem">No private lists</a> > [% END %] >+ <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">New list</a> > [% ELSE %] >- <a class="dropdown-item disabled" aria-disabled="true" href="#" tabindex="-1" role="menuitem">No private lists</a> >- [% END %] >- <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">New list</a> >- [% ELSE %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">Log in to create your own lists</a> >- [% END # / IF loggedinusername %] >- [% END # / IF opacuserlogin %] >- </div> <!-- / .dropdown-menu --> >- </li> <!-- / .nav-item.dropdown --> >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">Log in to create your own lists</a> >+ [% END # / IF loggedinusername %] >+ [% END # / IF opacuserlogin %] >+ </div> <!-- / .dropdown-menu --> >+ </li> <!-- / .nav-item.dropdown --> >+ [% END # / IF opacuserlogin || some_public_shelves < 1 %] > [% END # / IF virtualshelves %] > [% IF Koha.Preference( 'OpacTrustedCheckout' ) %] > <li class="nav-item"> >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37362
:
168996
|
169012
|
171027
| 171804