Class: Decidim::VersionsListItemCell

Inherits:
ViewModel
  • Object
show all
Includes:
LayoutHelper, TraceabilityHelper
Defined in:
decidim-core/app/cells/decidim/versions_list_item_cell.rb

Instance Method Summary collapse

Methods included from LayoutHelper

#_icon_classes, #extended_navigation_bar, #external_icon, #favicon, #icon, #organization_colors, #role

Methods included from TraceabilityHelper

#render_resource_editor, #render_resource_last_editor

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, #resource_title

Instance Method Details

#default_i18n_scopeObject


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

def default_i18n_scope
  "decidim.versions_list_item.show"
end

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


28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'decidim-core/app/cells/decidim/versions_list_item_cell.rb', line 28

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

#i18n_scopeObject


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

def i18n_scope
  options[:i18n_scope]
end

#i18n_version_indexObject


24
25
26
# File 'decidim-core/app/cells/decidim/versions_list_item_cell.rb', line 24

def i18n_version_index
  i18n("version_index", index: index)
end

#indexObject


16
17
18
# File 'decidim-core/app/cells/decidim/versions_list_item_cell.rb', line 16

def index
  options[:index] + 1
end

#versionObject


8
9
10
# File 'decidim-core/app/cells/decidim/versions_list_item_cell.rb', line 8

def version
  model
end

#version_pathObject


20
21
22
# File 'decidim-core/app/cells/decidim/versions_list_item_cell.rb', line 20

def version_path
  options[:version_path].call(index)
end

#versioned_resourceObject


12
13
14
# File 'decidim-core/app/cells/decidim/versions_list_item_cell.rb', line 12

def versioned_resource
  options[:versioned_resource]
end