Class: Decidim::VersionCell
Instance Method Summary
collapse
#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_newsletter, #decidim_url_escape, included
#render_resource_editor, #render_resource_last_editor
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
#current_version ⇒ Object
12
13
14
|
# File 'app/cells/decidim/version_cell.rb', line 12
def current_version
model
end
|
#default_i18n_scope ⇒ Object
71
72
73
|
# File 'app/cells/decidim/version_cell.rb', line 71
def default_i18n_scope
"decidim.version.show"
end
|
#i18n(string, params = {}) ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'app/cells/decidim/version_cell.rb', line 52
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
32
33
34
|
# File 'app/cells/decidim/version_cell.rb', line 32
def i18n_back_to_resource
i18n("back_to_resource")
end
|
#i18n_changes_title ⇒ Object
24
25
26
|
# File 'app/cells/decidim/version_cell.rb', line 24
def i18n_changes_title
i18n("changes_at_title", title: resource_title)
end
|
#i18n_scope ⇒ Object
67
68
69
|
# File 'app/cells/decidim/version_cell.rb', line 67
def i18n_scope
options[:i18n_scope]
end
|
#i18n_show_all_versions ⇒ Object
40
41
42
|
# File 'app/cells/decidim/version_cell.rb', line 40
def i18n_show_all_versions
i18n("show_all_versions")
end
|
#i18n_version_author ⇒ Object
44
45
46
|
# File 'app/cells/decidim/version_cell.rb', line 44
def i18n_version_author
i18n("version_author")
end
|
#i18n_version_created_at ⇒ Object
48
49
50
|
# File 'app/cells/decidim/version_cell.rb', line 48
def i18n_version_created_at
i18n("version_created_at")
end
|
#i18n_version_number ⇒ Object
28
29
30
|
# File 'app/cells/decidim/version_cell.rb', line 28
def i18n_version_number
i18n("version_number")
end
|
#i18n_version_number_out_of_total ⇒ Object
36
37
38
|
# File 'app/cells/decidim/version_cell.rb', line 36
def i18n_version_number_out_of_total
i18n("version_number_out_of_total", current_version: index, total_count: versioned_resource.versions.count)
end
|
#index ⇒ Object
75
76
77
|
# File 'app/cells/decidim/version_cell.rb', line 75
def index
options[:index]
end
|
#resource_path ⇒ Object
79
80
81
|
# File 'app/cells/decidim/version_cell.rb', line 79
def resource_path
resource_locator(versioned_resource).path(filter_link_params)
end
|
#resource_title ⇒ Object
8
9
10
|
# File 'app/cells/decidim/version_cell.rb', line 8
def resource_title
decidim_html_escape(translated_attribute(versioned_resource.title))
end
|
#versioned_resource ⇒ Object
16
17
18
|
# File 'app/cells/decidim/version_cell.rb', line 16
def versioned_resource
options[:versioned_resource]
end
|
#versions_path ⇒ Object
20
21
22
|
# File 'app/cells/decidim/version_cell.rb', line 20
def versions_path
options[:versions_path].call
end
|