0
0
Fork 0

Check for a custom css file to help customization of instances (#1368)

* User can create a custom.scss to customize their instance without modifying gitted files.

* Add documentation for customization.

* Forgot the helper file

* Fix Style to pass codeclimate

* Requests from maintainer.
This commit is contained in:
Naouak 2017-04-15 22:47:48 +02:00 committed by Eugen
parent fa08b5079d
commit 3d3e32befb
4 changed files with 30 additions and 10 deletions

19
app/helpers/style_helper.rb Executable file
View file

@ -0,0 +1,19 @@
# frozen_string_literal: true
module StyleHelper
def stylesheet_for_layout
if asset_exist? 'custom.css'
'custom'
else
'application'
end
end
def asset_exist?(path)
if Rails.configuration.assets.compile
Rails.application.precompiled_assets.include? path
else
Rails.application.assets_manifest.assets[path].present?
end
end
end