Bugzilla – Attachment 129195 Details for
Bug 29616
Replace library information popup in the OPAC with a modal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29616: Replace library information popup in the OPAC with a modal
Bug-29616-Replace-library-information-popup-in-the.patch (text/plain), 10.09 KB, created by
The Minh Luong
on 2022-01-07 16:13:32 UTC
(
hide
)
Description:
Bug 29616: Replace library information popup in the OPAC with a modal
Filename:
MIME Type:
Creator:
The Minh Luong
Created:
2022-01-07 16:13:32 UTC
Size:
10.09 KB
patch
obsolete
>From 051df9038a99b49e9987bd940be2cf29111636fb Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 1 Dec 2021 17:47:51 +0000 >Subject: [PATCH] Bug 29616: Replace library information popup in the OPAC with > a modal > >This patch modifies the OPAC bibliographic detail page so that >information stored in libraries' "OPAC info" field can be displayed in a >modal window instead of in a tooltip. This will make it more readable, >especially for libraries with so much info content that the popup can >disappear off the bottom of the page. > >To test, apply the patch and make sure you have at least one library >configured according to each of these: > >A. One with both branches.branchurl and branches.opac_info >B. One with branches.branchurl but not branches.opac_info >C. One with branches.opac_info but not branches.branchurl >D. One with neither branches.branchurl nor branches.opac_info > >View the bibliographic detail page in the OPAC for title(s) which have >holdings from the libraries you configured above. In the holdings table, >check the behavior of the library name in the "Current library" or "Home >library" columns * > >- Case A: The library name appears as a link with an "info" icon. > Clicking it shows the library information in a modal window. In the > modal footer, a "Visit web site" button should take you to the correct > URL. >- Case B: The library name appears as a link without an icon. Clicking > the link takes you to the correct URL. >- Case C: The library name appears as a link with an "info" icon. > Clicking it shows the library information in a modal window. In the > modal footer there is no "Visit web site" button. >- Case D: The library name is plain text. > >* Display of "Current library" and/or "Home library" is controlled by > the OpacLocationBranchToDisplay system preference. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com> >--- > .../bootstrap/en/modules/opac-detail.tt | 108 +++++++++++++----- > 1 file changed, 77 insertions(+), 31 deletions(-) > >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 52a7cec016..731ca2ecdf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1201,17 +1201,21 @@ > </td> > [% END %] > [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] >- <td class="location" property="seller"> >+ <td class="location" property="seller" data-order="[% ITEM_RESULT.branchname| html %]"> > <link property="itemOffered" href="#record" /> > <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut"> >- <span class="[% ITEM_RESULT.holding_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title=""> >- [% IF ( ITEM_RESULT.branchurl ) %] >- <a href="[% ITEM_RESULT.branchurl | url %]">[% ITEM_RESULT.branchname | html %]</a> >- [% ELSE %] >- <span>[% ITEM_RESULT.branchname | html %]</span> >- [% END %] >- </span> >- <div class="branch-info-tooltip">[% ITEM_RESULT.holding_branch_opac_info | $raw %]</div> >+ >+ [% IF ( ITEM_RESULT.holding_branch_opac_info ) %] >+ <a href="[% ITEM_RESULT.branchurl | url %]" class="library_info" data-branchcode="[% ITEM_RESULT.branchcode | html %]"> >+ <i class="fa fa-info-circle" aria-hidden="true"></i> [% ITEM_RESULT.branchname | html %] >+ </a> >+ [% ELSIF ( ITEM_RESULT.branchurl ) %] >+ <a href="[% ITEM_RESULT.branchurl | url %]"> >+ [% ITEM_RESULT.branchname | html %] >+ </a> >+ [% ELSE %] >+ <span>[% ITEM_RESULT.branchname | html %]</span> >+ [% END %] > > [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] > <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span> >@@ -1224,19 +1228,18 @@ > <td class="location" property="seller"> > <link property="itemOffered" href="#record" /> > <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut"> >- <span class="[% ITEM_RESULT.home_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title=""> >- [% IF Branches.GetURL( ITEM_RESULT.homebranch ) %] >- [% home_branch_url = Branches.GetURL( ITEM_RESULT.homebranch ) %] >- [% IF ( home_branch_url ) %] >- <a href="[% home_branch_url | url %]">[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</a> >- [% ELSE %] >- <span>[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</span> >- [% END %] >- [% ELSE %] >- <span>[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</span> >- [% END %] >- </span> >- <div class="branch-info-tooltip">[% ITEM_RESULT.home_branch_opac_info | $raw %]</div> >+ >+ [% IF ( ITEM_RESULT.holding_branch_opac_info ) %] >+ <a href="[% Branches.GetURL( ITEM_RESULT.homebranch ) | url %]" class="library_info" data-branchcode="[% ITEM_RESULT.homebranch | html %]"> >+ <i class="fa fa-info-circle" aria-hidden="true"></i> [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] >+ </a> >+ [% ELSIF ( Branches.GetURL( ITEM_RESULT.homebranch ) ) %] >+ <a href="[% Branches.GetURL( ITEM_RESULT.homebranch ) | url %]"> >+ [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] >+ </a> >+ [% ELSE %] >+ <span>[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</span> >+ [% END %] > > [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] > <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span> >@@ -1357,6 +1360,27 @@ > </table> > [% END %][%# end of items_table block %] > >+<!-- Library Info Modal --> >+<div class="modal" id="libraryInfoModal" tabindex="-1" aria-labelledby="libraryInfoModalLabel" aria-hidden="true"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <h5 class="modal-title" id="libraryInfoModalLabel"></h5> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"> >+ <span aria-hidden="true">×</span> >+ </button> >+ </div> >+ <div class="modal-body"> >+ <div id="libraryInfo"></div> >+ </div> >+ <div class="modal-footer"> >+ <a id="libraryInfoLink" href="" class="btn btn-primary">Visit web site</a> >+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> >+ </div> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+</div> <!-- /.modal --> >+ > [% BLOCK jsinclude %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] >@@ -1602,15 +1626,6 @@ > [% END # /IF OPACDetailQRCode %] > > $('#bibliodescriptions').tabs(); >- $(".branch-info-tooltip-trigger").uitooltip({ >- position: { my: "left+15 center", at: "right center" }, >- show: 50, >- hide: 50, >- content: function(){ >- var element = $(this).next("div"); >- return element.html(); >- } >- }); > > [% IF ( Koha.Preference('OpacBrowseResults') && busc ) %] > $(".l_Results").show(); >@@ -1914,6 +1929,37 @@ > multiSearchRequest(); > }); > } /* if( OPACPopupAuthorsSearch == "1" ) */ >+ >+ $(".library_info").on("click", function(e){ >+ e.preventDefault(); >+ var branchcode = $(this).data("branchcode"); >+ var url = $(this).attr("href"); >+ $.ajax({ >+ url: "/api/v1/libraries/" + branchcode, >+ type: 'GET', >+ dataType: 'json', >+ success: function(result) { >+ $("#libraryInfoModalLabel").html( result.name ); >+ $("#libraryInfo").html( result.opac_info ); >+ if( result.url ){ >+ $("#libraryInfoLink").attr("href", result.url ); >+ $("#libraryInfoLink").show(); >+ } else { >+ $("#libraryInfoLink").hide(); >+ } >+ $("#libraryInfoModal").modal("show"); >+ }, >+ error: function(xhr, status, error) { >+ if( url ){ >+ location.href = url; >+ } >+ } >+ }); >+ }); >+ $("#libraryInfoModal").on("hide.bs.modal", function(){ >+ $("#libraryInfoModalLabel, #libraryInfo").html(""); >+ $("#libraryInfoLink").attr("href", ""); >+ }); > }); > > function multiSearchRequest(){ >-- >2.25.1
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 29616
:
128138
|
128139
|
129096
|
129195
|
129978
|
134638