Files
grecia/app/components/moderation/users/index_component.rb
Javi Martín efb7ad9e42 Differentiate between blocked and hidden users
It was a bit confusing to press the "hide" button and then see the user
listed as "blocked". Some moderators might think they accidentally
pressed the wrong button.
2021-12-30 16:18:26 +01:00

18 lines
370 B
Ruby

class Moderation::Users::IndexComponent < ApplicationComponent
attr_reader :users
def initialize(users)
@users = users
end
private
def status(user)
t("admin.activity.show.actions.#{activity_action(user)}")
end
def activity_action(user)
Activity.where(actionable: user, action: [:hide, :block]).last&.action || "block"
end
end