Remove role color highlighting from custom css (#33493)

This commit is contained in:
Matt Jankowski 2025-01-07 11:28:35 -05:00 committed by GitHub
parent bbe9dcfade
commit 7ad44e22ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 2 additions and 46 deletions

View file

@ -1,8 +1,6 @@
# 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'
@ -14,8 +12,4 @@ class CustomCssController < ActionController::Base # rubocop:disable Rails/Appli
Setting.custom_css
end
helper_method :custom_css_styles
def set_user_roles
@user_roles = UserRole.providing_styles
end
end

View file

@ -101,9 +101,6 @@ class UserRole < ApplicationRecord
before_validation :set_position
scope :assignable, -> { where.not(id: EVERYONE_ROLE_ID).order(position: :asc) }
scope :highlighted, -> { where(highlighted: true) }
scope :with_color, -> { where.not(color: [nil, '']) }
scope :providing_styles, -> { highlighted.with_color }
has_many :users, inverse_of: :role, foreign_key: 'role_id', dependent: :nullify

View file

@ -1,7 +1,7 @@
.announcements-list__item
- if can?(:update, role)
= link_to edit_admin_role_path(role), class: 'announcements-list__item__title' do
%span.user-role{ class: "user-role-#{role.id}" }
%span.user-role
= material_symbol 'group'
- if role.everyone?
@ -10,7 +10,7 @@
= role.name
- else
%span.announcements-list__item__title
%span.user-role{ class: "user-role-#{role.id}" }
%span.user-role
= material_symbol 'group'
- if role.everyone?

View file

@ -2,9 +2,3 @@
<%= raw custom_css_styles %>
<%- end %>
<%- @user_roles.each do |role| %>
.user-role-<%= role.id %> {
--user-role-accent: <%= role.color %>;
}
<%- end %>