Class: Decidim::VersionsListCell

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

Instance Method Summary collapse

Methods included from SanitizeHelper

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

Methods inherited from ViewModel

#call, #current_user

Methods included from FilterParamsHelper

#filter_link_params

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



54
55
56
# File 'app/cells/decidim/versions_list_cell.rb', line 54

def default_i18n_scope
  "decidim.versions_list.show"
end

#i18n(string, params = {}) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'app/cells/decidim/versions_list_cell.rb', line 35

def i18n(string, params = {})
  t(
    string,
    params.merge(
      scope: i18n_scope,
      default: t(
        string,
        params.merge(
          scope: default_i18n_scope
        )
      )
    )
  )
end

#i18n_back_to_resourceObject



31
32
33
# File '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 'app/cells/decidim/versions_list_cell.rb', line 19

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

#i18n_scopeObject



50
51
52
# File 'app/cells/decidim/versions_list_cell.rb', line 50

def i18n_scope
  options[:i18n_scope]
end

#i18n_versions_countObject



27
28
29
# File '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 'app/cells/decidim/versions_list_cell.rb', line 23

def i18n_versions_title
  i18n("title")
end

#resource_pathObject



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

def resource_path
  resource_locator(versioned_resource).path(filter_link_params)
end

#resource_titleObject



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

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

#version_pathObject



58
59
60
# File 'app/cells/decidim/versions_list_cell.rb', line 58

def version_path
  options[:version_path]
end

#versioned_resourceObject



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

def versioned_resource
  model
end