2
0

Spec coverage for custom css endpoint (#28706)

This commit is contained in:
Matt Jankowski
2024-01-12 04:19:25 -05:00
committed by GitHub
parent b86083f0dc
commit 7801db7ba4
3 changed files with 76 additions and 3 deletions

View File

@@ -1,8 +1,21 @@
# frozen_string_literal: true
class CustomCssController < ActionController::Base # rubocop:disable Rails/ApplicationController
before_action :set_user_roles
def show
expires_in 3.minutes, public: true
render content_type: 'text/css'
end
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
end