loading custom css from library setting
authorRogan Hamby <rogan.hamby@gmail.com>
Mon, 21 Oct 2019 16:02:24 +0000 (12:02 -0400)
committerJason Boyer <jboyer@equinoxinitiative.org>
Wed, 23 Oct 2019 16:03:49 +0000 (12:03 -0400)
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Jason Boyer <jboyer@equinoxinitiative.org>

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.data.opac_custom_css.sql [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/base.tt2
docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc [new file with mode: 0644]

index 04ca260..32dcd0f 100644 (file)
@@ -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 (file)
index 0000000..9715d1d
--- /dev/null
@@ -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;
index b28f45c..b6c2876 100644 (file)
         [% IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %]
         <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto-rtl.css[% ctx.cache_key %]" />
         [% 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') %]
+        [% '<style>'; custom_css ; '</style>' %]                                          
+        [% 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 (file)
index 0000000..ab0f2ab
--- /dev/null
@@ -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.  
+
+