Class: Decidim::ResourceHiddenEvent
- Inherits:
-
Events::SimpleEvent
- Object
- Events::SimpleEvent
- Decidim::ResourceHiddenEvent
- Defined in:
- app/events/decidim/resource_hidden_event.rb
Instance Method Summary collapse
- #report_reasons ⇒ Object
- #resource_content ⇒ Object
- #resource_path ⇒ Object
- #resource_text ⇒ Object
- #resource_title ⇒ Object
- #resource_type ⇒ Object
- #resource_url ⇒ Object
Instance Method Details
#report_reasons ⇒ Object
15 16 17 18 19 |
# File 'app/events/decidim/resource_hidden_event.rb', line 15 def report_reasons extra["report_reasons"].map do |reason| I18n.t("decidim.admin.moderations.report.reasons.#{reason}").downcase end.join(", ") end |
#resource_content ⇒ Object
25 26 27 |
# File 'app/events/decidim/resource_hidden_event.rb', line 25 def resource_content translated_attribute(@resource[@resource.reported_attributes.first]).truncate(100, separator: " ") end |
#resource_path ⇒ Object
7 8 9 |
# File 'app/events/decidim/resource_hidden_event.rb', line 7 def resource_path @resource.reported_content_url end |
#resource_text ⇒ Object
29 30 31 |
# File 'app/events/decidim/resource_hidden_event.rb', line 29 def resource_text "<i>#{resource_content}</i>" end |
#resource_title ⇒ Object
21 22 23 |
# File 'app/events/decidim/resource_hidden_event.rb', line 21 def resource_title nil end |
#resource_type ⇒ Object
33 34 35 |
# File 'app/events/decidim/resource_hidden_event.rb', line 33 def resource_type @resource.model_name.human.downcase end |
#resource_url ⇒ Object
11 12 13 |
# File 'app/events/decidim/resource_hidden_event.rb', line 11 def resource_url @resource.reported_content_url end |