From a43aba1cc1501d5c847b5ba83adc75e612fefac8 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 21 Jun 2024 17:13:38 +0000 Subject: [PATCH] Bug 26777: (follow-up) Adjust script, template, and CSS --- .../opac-tmpl/bootstrap/css/src/opac.scss | 10 ++++------ .../bootstrap/en/modules/opac-virtual-card.tt | 13 +++++++------ opac/opac-virtual-card.pl | 18 ++---------------- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index f265937c9b..821805bfbe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -3005,6 +3005,9 @@ $star-selected: #EDB867; } #patron-virtual-card { + width: 400px; + border-radius: 15px; + box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; align-items: flex-start; @@ -3013,10 +3016,8 @@ $star-selected: #EDB867; flex: 1; width: 100%; #patron-barcode { - padding: 1rem 0.25rem 1rem 0.25rem; + padding: .5rem; width: 100%; - height: auto; - min-height: 25px; } } @@ -3026,9 +3027,6 @@ $star-selected: #EDB867; width: 100%; #patron-image { padding: 1rem 0 0.25rem 0.25rem; - display: block; - width: 100%; - height: auto; } } } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-virtual-card.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-virtual-card.tt index b21dcf98b2..85a727d947 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-virtual-card.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-virtual-card.tt @@ -2,6 +2,7 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% USE Branches %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% INCLUDE 'doc-head-open.inc' %] @@ -32,22 +33,22 @@
+

My virtual card

-

My virtual card

-
- -
[% IF ( display_patron_image ) %]
[% END %] +
+ +
-

Library: [% library | html %]

+

Library: [% Branches.GetName( patron.branchcode ) | html %]

-
+
diff --git a/opac/opac-virtual-card.pl b/opac/opac-virtual-card.pl index 26cd722d85..423de58dcb 100644 --- a/opac/opac-virtual-card.pl +++ b/opac/opac-virtual-card.pl @@ -19,18 +19,12 @@ use Modern::Perl; -#need use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; - -#unsure -use C4::Biblio; -use C4::External::BakerTaylor qw( image_url link_url ); -use MARC::Record; use Koha::Patrons; -use Koha::ItemTypes; + my $query = CGI->new; @@ -54,17 +48,9 @@ if (C4::Context->preference('OPACpatronimages')) { $template->param( display_patron_image => 1 ) if $patron->image; } -my $branchcode = $patron->branchcode; -# Fetch the library object using the branchcode -my $library = Koha::Libraries->find($branchcode); - -# Get the library name -my $library_name = $library ? $library->branchname : 'Unknown Library'; - $template->param( virtualcardview => 1, - cardnumber => $patron->cardnumber, - library => $library_name, + patron => $patron, ); -- 2.39.2