Class: Decidim::VersionsListCell
Instance Method Summary
collapse
#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_newsletter, #decidim_url_escape, included
Methods inherited from ViewModel
#call, #current_user
#filter_link_params
#element_id
#button_to, #submit_tag
#action_authorized_button_to, #action_authorized_link_to, #logged_button_to, #logged_link_to
#has_visible_scopes?, #scope_name_for_picker, #scopes_picker_field, #scopes_picker_filter, #scopes_picker_tag
#default_locale?
#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
#linked_classes_filter_values_for, #linked_classes_for, #linked_resources_for, #resource_locator
Instance Method Details
#default_i18n_scope ⇒ Object
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_resource ⇒ Object
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_title ⇒ Object
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_scope ⇒ Object
50
51
52
|
# File 'app/cells/decidim/versions_list_cell.rb', line 50
def i18n_scope
options[:i18n_scope]
end
|
#i18n_versions_count ⇒ Object
27
28
29
|
# File 'app/cells/decidim/versions_list_cell.rb', line 27
def i18n_versions_count
i18n("number_of_versions")
end
|
#i18n_versions_title ⇒ Object
23
24
25
|
# File 'app/cells/decidim/versions_list_cell.rb', line 23
def i18n_versions_title
i18n("title")
end
|
#resource_path ⇒ Object
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_title ⇒ Object
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_path ⇒ Object
58
59
60
|
# File 'app/cells/decidim/versions_list_cell.rb', line 58
def version_path
options[:version_path]
end
|
#versioned_resource ⇒ Object
7
8
9
|
# File 'app/cells/decidim/versions_list_cell.rb', line 7
def versioned_resource
model
end
|