Sha256: 433cd2eff121825b52016f48d1e16537703e8fe2ac8612cb26e0ac703349763d
Contents?: true
Size: 1.42 KB
Versions: 25
Compression:
Stored size: 1.42 KB
Contents
# frozen_string_literal: true module Decidim module Admin module Moderations # This module includes helpers to show moderation reports in admin module ReportsHelper include Decidim::Messaging::ConversationHelper # Public: Returns the reportable's author names separated by commas. def reportable_author_name(reportable) reportable_authors = reportable.try(:authors) || [reportable.try(:normalized_author)] content_tag :ul, class: "reportable-authors" do reportable_authors.select(&:present?).map do |author| if author.is_a? User content_tag :li do link_to current_or_new_conversation_path_with(author), target: "_blank", rel: "noopener" do "#{author.name} #{icon "envelope-closed"}".html_safe end end else content_tag(:li, author.name) end end.join("").html_safe end end # Public: Renders a small preview of the content reported. def reported_content_for(reportable, options = {}) cell "decidim/reported_content", reportable, options end # Public: Whether the resource has some translated attribute or not. def translatable_resource?(reportable) reportable.respond_to?(:content_original_language) end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems