From 3bc683f3f7bb13fb7098b159e89a6005725b9c6a Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Thu, 20 Jun 2024 20:50:04 +0000 Subject: [PATCH] Bug 26777: Add barcode generator file and initial styling Signed-off-by: Laura Escamilla Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../opac-tmpl/bootstrap/css/src/opac.scss | 30 +++++++++++++++++++ .../bootstrap/js/barcode-generator.js | 11 +++++++ 2 files changed, 41 insertions(+) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 3f9547175d..43165b7720 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2926,4 +2926,34 @@ $star-selected: #EDB867; display: none; } +#patron-virtual-card { + display: flex; + flex-direction: column; + align-items: flex-start; + + #barcode-container { + flex: 1; + width: 100%; + #patron-barcode { + padding: 1rem 0.25rem 1rem 0.25rem; + width: 100%; + height: auto; + min-height: 25px; + } + } + + #image-and-library-container { + #image-container { + flex: 0; + width: 100%; + #patron-image { + padding: 1rem 0 0.25rem 0.25rem; + display: block; + width: 100%; + height: auto; + } + } + } +} + @import "responsive"; diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js b/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js new file mode 100644 index 0000000000..afd32f8284 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js @@ -0,0 +1,11 @@ +document.addEventListener("DOMContentLoaded", function() { + var barcodeNumber = document.getElementById("patron-barcode").dataset.barcode; + JsBarcode("#patron-barcode", barcodeNumber, { + format: "CODE39", + lineColor: "#000", + width: 2, + height: 100, + displayValue: false, + margin: 0 + }); +}); \ No newline at end of file -- 2.39.5