Class: Decidim::VersionsListCell

Inherits:
ViewModel
  • Object
show all
Includes:
SanitizeHelper
Defined in:
decidim-core/app/cells/decidim/versions_list_cell.rb

Instance Method Summary collapse

Methods included from SanitizeHelper

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

Methods inherited from ViewModel

#call, #current_user

Methods included from MarkupHelper

#element_id

Methods included from ReplaceButtonsHelper

#button_to, #submit_tag

Methods included from ActionAuthorizationHelper

#action_authorized_button_to, #action_authorized_link_to, #logged_button_to, #logged_link_to

Methods included from ScopesHelper

#has_visible_scopes?, #scope_name_for_picker, #scopes_picker_field, #scopes_picker_filter, #scopes_picker_tag

Methods included from TranslatableAttributes

#default_locale?

Methods included from DecidimFormHelper

#areas_for_select, #base_error_messages, #decidim_form_for, #decidim_form_slug_url, #editor_field_tag, #form_field_has_error?, #form_required_explanation, #name_with_locale, #scopes_picker_field_tag, #tab_element_class_for, #translated_field_tag

Methods included from ResourceHelper

#linked_classes_filter_values_for, #linked_classes_for, #linked_resources_for, #resource_locator

Instance Method Details

#default_i18n_scopeObject


43
44
45
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 43

def default_i18n_scope
  "decidim.versions_list.show"
end

#i18n(string, **params) ⇒ Object


35
36
37
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 35

def i18n(string, **params)
  t(string, **params, scope: i18n_scope, default: t(string, **params, scope: default_i18n_scope))
end

#i18n_back_to_resourceObject


31
32
33
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 31

def i18n_back_to_resource
  i18n("back_to_resource")
end

#i18n_changes_titleObject


19
20
21
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 19

def i18n_changes_title
  i18n("changes_at_title", title: resource_title)
end

#i18n_scopeObject


39
40
41
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 39

def i18n_scope
  options[:i18n_scope]
end

#i18n_versions_countObject


27
28
29
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 27

def i18n_versions_count
  i18n("number_of_versions")
end

#i18n_versions_titleObject


23
24
25
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 23

def i18n_versions_title
  i18n("title")
end

#resource_pathObject


15
16
17
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 15

def resource_path
  resource_locator(versioned_resource).path
end

#resource_titleObject


11
12
13
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 11

def resource_title
  decidim_html_escape(translated_attribute(versioned_resource.title))
end

#version_pathObject


47
48
49
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 47

def version_path
  options[:version_path]
end

#versioned_resourceObject


7
8
9
# File 'decidim-core/app/cells/decidim/versions_list_cell.rb', line 7

def versioned_resource
  model
end