2014-12-22 19:46:10 -06:00
|
|
|
class SiteCustomizationsController < ApplicationController
|
2015-05-20 02:12:16 -05:00
|
|
|
skip_before_filter :preload_json, :check_xhr, :redirect_to_login_if_required
|
2014-12-22 19:46:10 -06:00
|
|
|
|
|
|
|
def show
|
2015-05-21 01:09:23 -05:00
|
|
|
version = params["v"]
|
|
|
|
|
|
|
|
if version && version == request.headers['If-None-Match']
|
|
|
|
return render nothing: true, status: 304
|
|
|
|
end
|
|
|
|
|
|
|
|
response.headers["ETag"] = version if version
|
2014-12-22 19:46:10 -06:00
|
|
|
expires_in 1.year, public: true
|
|
|
|
render text: SiteCustomization.stylesheet_contents(params[:key], params[:target] == "mobile" ? :mobile : :desktop),
|
|
|
|
content_type: "text/css"
|
|
|
|
end
|
|
|
|
end
|