Module: Decidim::TraceabilityHelper

Includes:
SanitizeHelper
Included in:
VersionCell, VersionsListItemCell
Defined in:
app/helpers/decidim/traceability_helper.rb

Overview

A Helper to find and render the author of a version.

Instance Method Summary collapse

Methods included from SanitizeHelper

#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_admin, #decidim_sanitize_editor, #decidim_sanitize_editor_admin, #decidim_sanitize_newsletter, #decidim_url_escape, included

Instance Method Details

#render_resource_editor(version) ⇒ Object

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.



22
23
24
# File 'app/helpers/decidim/traceability_helper.rb', line 22

def render_resource_editor(version)
  cell "decidim/version_author", Decidim.traceability.version_editor(version)
end

#render_resource_last_editor(resource) ⇒ Object

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.



13
14
15
# File 'app/helpers/decidim/traceability_helper.rb', line 13

def render_resource_last_editor(resource)
  cell "decidim/version_author", Decidim.traceability.last_editor(resource)
end