Files
grecia/app/components/shared/moderation_actions_component.rb
Javi Martín 3b2b09be2b Use CSS to show separators in moderation actions
This is useful for people using screen readers, since the character used
as a separator won't be read aloud.

Since many screen readers also read content generated via CSS
pseudoelements, we aren't using `content: "|";` or similar but using
elements with a very small width instead.
2021-12-30 15:50:03 +01:00

23 lines
385 B
Ruby

class Shared::ModerationActionsComponent < ApplicationComponent
attr_reader :record
delegate :can?, to: :helpers
def initialize(record)
@record = record
end
def render?
can?(:hide, record) || can?(:hide, author)
end
private
def author
record.author
end
def hide_path
polymorphic_path([:moderation, record], action: :hide)
end
end