allow foodcoops to add custom css
This commit is contained in:
parent
72709be60a
commit
19630e8607
5 changed files with 37 additions and 0 deletions
18
app/controllers/styles_controller.rb
Normal file
18
app/controllers/styles_controller.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Foodcoop-specific styling
|
||||
class StylesController < ApplicationController
|
||||
skip_before_filter :authenticate
|
||||
|
||||
# renders foodcoop css, or 404 if not configured
|
||||
#
|
||||
# When requested with the parameter +md5+, the result is returned
|
||||
# with an expiry time of a week, to leverage caching.
|
||||
def foodcoop
|
||||
css = FoodsoftConfig[:custom_css]
|
||||
if css.blank?
|
||||
render text: nil, content_type: 'text/css', status: 404
|
||||
else
|
||||
expires_in 1.week, public:true if params[:md5].present?
|
||||
render text: css, content_type: 'text/css'
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue