From 485624d4a7bc8d44843857060b72a813e47573ab Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 21 Oct 2019 12:02:24 -0400 Subject: [PATCH] loading custom css from library setting Signed-off-by: Rogan Hamby Signed-off-by: Garry Collum Signed-off-by: Jason Boyer --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 9 +++++++++ .../src/sql/Pg/upgrade/xxxx.data.opac_custom_css.sql | 16 ++++++++++++++++ Open-ILS/src/templates/opac/parts/base.tt2 | 7 ++++++- docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc | 6 ++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.data.opac_custom_css.sql create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc 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 04ca260c36..32dcd0fffa 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -4408,6 +4408,15 @@ INSERT into config.org_unit_setting_type 'coust', 'description'), 'integer', null) +,( 'opac.patron.custom_css', 'opac', + oils_i18n_gettext('opac.patron.custom_css', + 'Custom CSS for the OPAC', + 'coust', 'label'), + oils_i18n_gettext('opac.patron.custom_css', + 'Custom CSS for the OPAC', + 'coust', 'description'), + 'string', NULL) + ,( 'opac.payment_history_age_limit', 'opac', oils_i18n_gettext('opac.payment_history_age_limit', 'Payment History Age Limit', diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.opac_custom_css.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.opac_custom_css.sql new file mode 100644 index 0000000000..9715d1d276 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.opac_custom_css.sql @@ -0,0 +1,16 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype, fm_class ) VALUES +( 'opac.patron.custom_css', 'opac', + oils_i18n_gettext('opac.patron.custom_css', + 'Custom CSS for the OPAC', + 'coust', 'label'), + oils_i18n_gettext('opac.patron.custom_css', + 'Custom CSS for the OPAC', + 'coust', 'description'), + 'string', NULL); + +COMMIT; diff --git a/Open-ILS/src/templates/opac/parts/base.tt2 b/Open-ILS/src/templates/opac/parts/base.tt2 index b28f45ceb8..b6c2876a8a 100644 --- a/Open-ILS/src/templates/opac/parts/base.tt2 +++ b/Open-ILS/src/templates/opac/parts/base.tt2 @@ -16,7 +16,12 @@ [% IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %] [% END %] - + + [% IF ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_css') %] + [% custom_css = ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_css') %] + [% '' %] + [% END %] + [%- libname = ctx.get_aou(ctx.search_ou).name; libname = libname | html; libsname = ctx.get_aou(ctx.search_ou).shortname; %] diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc new file mode 100644 index 0000000000..ab0f2abb1e --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc @@ -0,0 +1,6 @@ +Custom CSS in OPAC +^^^^^^^^^^^^^^^^^^ + +There is now a library setting called opac.patron.custom_css. This can be populated with CSS that will load in the OPAC after the stylesheets and allow for custom CSS without editing server side templates. + + -- 2.11.0