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:
parent
fa08b5079d
commit
3d3e32befb
4 changed files with 30 additions and 10 deletions
19
app/helpers/style_helper.rb
Executable file
19
app/helpers/style_helper.rb
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue