2018-08-24 04:33:27 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-04-19 16:07:29 +02:00
|
|
|
class CustomCssController < ActionController::Base # rubocop:disable Rails/ApplicationController
|
2024-01-12 10:19:25 +01:00
|
|
|
before_action :set_user_roles
|
|
|
|
|
2018-08-24 04:33:27 +02:00
|
|
|
def show
|
2019-07-17 17:14:25 +02:00
|
|
|
expires_in 3.minutes, public: true
|
2022-07-05 02:41:40 +02:00
|
|
|
render content_type: 'text/css'
|
2018-08-24 04:33:27 +02:00
|
|
|
end
|
2024-01-12 10:19:25 +01:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def custom_css_styles
|
|
|
|
Setting.custom_css
|
|
|
|
end
|
|
|
|
helper_method :custom_css_styles
|
|
|
|
|
|
|
|
def set_user_roles
|
|
|
|
@user_roles = UserRole.where(highlighted: true).where.not(color: [nil, ''])
|
|
|
|
end
|
2018-08-24 04:33:27 +02:00
|
|
|
end
|