
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via a59c0fab59e06355a4f0f937588b0b928c17d5ba (commit) via e0078f49d6fd75ae812b67ac5e694a2abdbcb67f (commit) from 301ede08847ea0d04e1795c8559fdb4de408c01a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a59c0fab59e06355a4f0f937588b0b928c17d5ba Author: blake <blake@mobiusconsortium.org> Date: Mon Mar 10 16:07:58 2025 -0500 Stamping upgrade script 1458 Signed-off-by: blake <blake@mobiusconsortium.org> diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 544d0fa61a..3c5363363d 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1457', :eg_version); -- gmcharlt/sandbergja +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1458', :eg_version); -- terranm/blake CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.opac_alert_settings.sql b/Open-ILS/src/sql/Pg/upgrade/1458.schema.opac_alert_settings.sql similarity index 95% rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.opac_alert_settings.sql rename to Open-ILS/src/sql/Pg/upgrade/1458.schema.opac_alert_settings.sql index 1aa3d4e9af..95b9c3ee49 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.opac_alert_settings.sql +++ b/Open-ILS/src/sql/Pg/upgrade/1458.schema.opac_alert_settings.sql @@ -2,7 +2,7 @@ BEGIN; -- Move OPAC alert banner feature from config file to a library setting --- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); +SELECT evergreen.upgrade_deps_block_check('1458', :eg_version); INSERT into config.org_unit_setting_type (name, grp, label, description, datatype) commit e0078f49d6fd75ae812b67ac5e694a2abdbcb67f Author: Terran McCanna <tmccanna@georgialibraries.org> Date: Thu Jan 16 11:43:15 2025 -0500 LP1903873 Move OPAC alert banner to library setting Moves the control of the OPAC alert banner away from the config.tt2 file and into a trio of "OPAC Alert Banner" library settings for ease of use. Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org> Signed-off-by: blake <blake@mobiusconsortium.org> Signed-off-by: Gina Monti <gmonti@biblio.org> diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index a11bf8050f..f9fa215fa7 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -24906,3 +24906,37 @@ VALUES ( 'coust', 'description'), 'string' ); + +INSERT into config.org_unit_setting_type + (name, grp, label, description, datatype) +VALUES ( + 'opac.alert_banner_show', + 'opac', + oils_i18n_gettext('opac.alert_banner_show', + 'OPAC Alert Banner: Display', + 'coust', 'label'), + oils_i18n_gettext('opac.alert_message_show', + 'Show an alert banner in the OPAC. Default is false.', + 'coust', 'description'), + 'bool' +), ( + 'opac.alert_banner_type', + 'opac', + oils_i18n_gettext('opac.alert_banner_type', + 'OPAC Alert Banner: Type', + 'coust', 'label'), + oils_i18n_gettext('opac.alert_message_type', + 'Determine the display of the banner. Options are: success, info, warning, danger.', + 'coust', 'description'), + 'string' +), ( + 'opac.alert_banner_text', + 'opac', + oils_i18n_gettext('opac.alert_banner_text', + 'OPAC Alert Banner: Text', + 'coust', 'label'), + oils_i18n_gettext('opac.alert_message_text', + 'Text that will display in the alert banner.', + 'coust', 'description'), + 'string' +); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.opac_alert_settings.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.opac_alert_settings.sql new file mode 100644 index 0000000000..1aa3d4e9af --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.opac_alert_settings.sql @@ -0,0 +1,49 @@ +BEGIN; + +-- Move OPAC alert banner feature from config file to a library setting + +-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT into config.org_unit_setting_type + (name, grp, label, description, datatype) +VALUES ( + 'opac.alert_banner_show', + 'opac', + oils_i18n_gettext('opac.alert_banner_show', + 'OPAC Alert Banner: Display', + 'coust', 'label'), + oils_i18n_gettext('opac.alert_message_show', + 'Show an alert banner in the OPAC. Default is false.', + 'coust', 'description'), + 'bool' +); + +INSERT into config.org_unit_setting_type + (name, grp, label, description, datatype) +VALUES ( + 'opac.alert_banner_type', + 'opac', + oils_i18n_gettext('opac.alert_banner_type', + 'OPAC Alert Banner: Type', + 'coust', 'label'), + oils_i18n_gettext('opac.alert_message_type', + 'Determine the display of the banner. Options are: success, info, warning, danger.', + 'coust', 'description'), + 'string' +); + +INSERT into config.org_unit_setting_type + (name, grp, label, description, datatype) +VALUES ( + 'opac.alert_banner_text', + 'opac', + oils_i18n_gettext('opac.alert_banner_text', + 'OPAC Alert Banner: Text', + 'coust', 'label'), + oils_i18n_gettext('opac.alert_message_text', + 'Text that will display in the alert banner.', + 'coust', 'description'), + 'string' +); + + COMMIT; \ No newline at end of file diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 index b7b4403b97..29370bca34 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 @@ -192,15 +192,6 @@ search.default_highlight = 1; # Set to 1 or 'true' to enable ctx.google_books_preview = 0; -############################################################################## - -# Set a maintenance message to display in the catalogue -#ctx.maintenance_message = "<b>This OPAC will be unavailable part of March 15, 2019 for planned upgrades.</b>"; -# Maintenance types follow Bootstrap4 alert options as follows -# success = green; info = blue; warning = yellow; danger = red -# Other colors would require re-coding the alert -#ctx.maintenance_type = l('warning'); - ############################################################################## # Depth Button/Checkbox # Recommendation: Do not enable button for basic search without enabling the diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/topnav.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/topnav.tt2 index 6421c9d670..3b6436c6a7 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/topnav.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/topnav.tt2 @@ -1,12 +1,13 @@ <header> -[%- IF ctx.maintenance_message -%] -<div class="alert alert-[% ctx.maintenance_type %] alert-dismissible mb-0 text-center" role="alert"> +[% IF ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'opac.alert_banner_show') %] + <div class="alert alert-[% ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'opac.alert_banner_type') | html %] <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> - </button> -[% ctx.maintenance_message %] + </button> + [% ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'opac.alert_banner_text') | html %] </div> [%- END -%] + [% IF !ctx.is_staff %] <div id="header-wrap"> diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/opac_alert_banner.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/opac_alert_banner.adoc new file mode 100644 index 0000000000..56c6ec2404 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/OPAC/opac_alert_banner.adoc @@ -0,0 +1,9 @@ +== Move the OPAC alert banner to a library setting == + +Moves the Bootstrap OPAC maintenance message alert banner from the config.tt2 file to a trio of new library settings. + +. OPAC Alert Banner: Display (true / false) +. OPAC Alert Banner: Text (the message that will appear) +. OPAC Alert Banner: Type (success, info, warning, danger) + +The alert banner types utilize the existing CSS to determine the color scheme. \ No newline at end of file ----------------------------------------------------------------------- Summary of changes: Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 34 +++++++++++++++ .../Pg/upgrade/1458.schema.opac_alert_settings.sql | 49 ++++++++++++++++++++++ .../src/templates-bootstrap/opac/parts/config.tt2 | 9 ---- .../src/templates-bootstrap/opac/parts/topnav.tt2 | 9 ++-- .../RELEASE_NOTES_NEXT/OPAC/opac_alert_banner.adoc | 9 ++++ 6 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/1458.schema.opac_alert_settings.sql create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/opac_alert_banner.adoc hooks/post-receive -- Evergreen ILS