@@ -, +, @@ a modal - 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. the OpacLocationBranchToDisplay system preference. --- .../bootstrap/en/modules/opac-detail.tt | 108 +++++++++++++----- 1 file changed, 77 insertions(+), 31 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1201,17 +1201,21 @@ [% END %] [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] - + - - [% IF ( ITEM_RESULT.branchurl ) %] - [% ITEM_RESULT.branchname | html %] - [% ELSE %] - [% ITEM_RESULT.branchname | html %] - [% END %] - -
[% ITEM_RESULT.holding_branch_opac_info | $raw %]
+ + [% IF ( ITEM_RESULT.holding_branch_opac_info ) %] + + [% ITEM_RESULT.branchname | html %] + + [% ELSIF ( ITEM_RESULT.branchurl ) %] + + [% ITEM_RESULT.branchname | html %] + + [% ELSE %] + [% ITEM_RESULT.branchname | html %] + [% END %] [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] [% ITEM_RESULT.location_description | html %] @@ -1224,19 +1228,18 @@ - - [% IF Branches.GetURL( ITEM_RESULT.homebranch ) %] - [% home_branch_url = Branches.GetURL( ITEM_RESULT.homebranch ) %] - [% IF ( home_branch_url ) %] - [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] - [% ELSE %] - [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] - [% END %] - [% ELSE %] - [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] - [% END %] - -
[% ITEM_RESULT.home_branch_opac_info | $raw %]
+ + [% IF ( ITEM_RESULT.holding_branch_opac_info ) %] + + [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] + + [% ELSIF ( Branches.GetURL( ITEM_RESULT.homebranch ) ) %] + + [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] + + [% ELSE %] + [% Branches.GetName( ITEM_RESULT.homebranch ) | html %] + [% END %] [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] [% ITEM_RESULT.location_description | html %] @@ -1357,6 +1360,27 @@ [% END %][%# end of items_table block %] + + + [% 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(){ --