Sha256: bb48424193823e6aa0a1c5f043719094b362668f8fac3d153aaebaec58d4d536

Contents?: true

Size: 941 Bytes

Versions: 46

Compression:

Stored size: 941 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A Helper to find and render the author of a version.
  module TraceabilityHelper
    include Decidim::SanitizeHelper
    # Renders the avatar and author name of the author of the last version of the given
    # resource.
    #
    # resource - an object implementing `Decidim::Traceable`
    #
    # Returns an HTML-safe String representing the HTML to render the author.
    def render_resource_last_editor(resource)
      cell "decidim/version_author", Decidim.traceability.last_editor(resource)
    end

    # Renders the avatar and author name of the author of the given version.
    #
    # version - an object that responds to `whodunnit` and returns a String.
    #
    # Returns an HTML-safe String representing the HTML to render the author.
    def render_resource_editor(version)
      cell "decidim/version_author", Decidim.traceability.version_editor(version)
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.8 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.7 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.6 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.10 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.9 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.5 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.8 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.4 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.3 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.7 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.5 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.2 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.1 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.4 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.0 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.3 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.0.rc2 app/helpers/decidim/traceability_helper.rb
decidim-core-0.27.0.rc1 app/helpers/decidim/traceability_helper.rb
decidim-core-0.26.2 app/helpers/decidim/traceability_helper.rb