about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-24 04:33:27 +0200
committerGitHub <noreply@github.com>2018-08-24 04:33:27 +0200
commita2cabf3f4af9271d8bfdb13c1ae2b7a8b4e6fb88 (patch)
treeb47c76434e800374b628a1dfeff7b8475dbbc006 /app/views
parent23752639b20abd26eefb199172da9fc3ceae172e (diff)
Add admin custom CSS setting (#8399)
Fix #3894
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin/settings/edit.html.haml2
-rwxr-xr-xapp/views/layouts/application.html.haml3
2 files changed, 4 insertions, 1 deletions
diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml
index b5aa176a2..f40edc35a 100644
--- a/app/views/admin/settings/edit.html.haml
+++ b/app/views/admin/settings/edit.html.haml
@@ -49,7 +49,7 @@
   .fields-group
     = f.input :site_extended_description, wrapper: :with_block_label, as: :text, label: t('admin.settings.site_description_extended.title'), hint: t('admin.settings.site_description_extended.desc_html'), input_html: { rows: 8 }
     = f.input :site_terms, wrapper: :with_block_label, as: :text, label: t('admin.settings.site_terms.title'), hint: t('admin.settings.site_terms.desc_html'), input_html: { rows: 8 }
-
+    = f.input :custom_css, wrapper: :with_block_label, as: :text, input_html: { rows: 8 }, label: t('admin.settings.custom_css.title'), hint: t('admin.settings.custom_css.desc_html')
   %hr/
 
   .fields-group
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index df898d5a2..68a903197 100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -19,6 +19,9 @@
     = javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
     = csrf_meta_tags
 
+    - if Setting.custom_css.present?
+      = stylesheet_link_tag custom_css_path, media: 'all'
+
     = yield :header_tags
 
   - body_classes ||= @body_classes || ''