Class: Decidim::Amendable::PromoteButtonCardCell
- Inherits:
-
ViewModel
- Object
- Cell::ViewModel
- ViewModel
- Decidim::Amendable::PromoteButtonCardCell
show all
- Defined in:
- app/cells/decidim/amendable/promote_button_card_cell.rb
Overview
This cell renders the button to amend the given resource.
Instance Method Summary
collapse
Methods inherited from ViewModel
#call, #current_user
#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, #resource_title
Instance Method Details
46
47
48
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 46
def button_classes
"amend_button_card_cell button expanded button--icon button--sc"
end
|
#current_component ⇒ Object
17
18
19
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 17
def current_component
model.component
end
|
#decidim ⇒ Object
42
43
44
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 42
def decidim
Decidim::Core::Engine.routes.url_helpers
end
|
#emendation ⇒ Object
9
10
11
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 9
def emendation
@emendation ||= model
end
|
#model_name ⇒ Object
13
14
15
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 13
def model_name
model.model_name.human
end
|
25
26
27
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 25
def promote_amend_button_label
t("promote_button", scope: "decidim.amendments.amendable", model_name: model_name)
end
|
#promote_amend_help_text ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 33
def promote_amend_help_text
content_tag :small do
t("promote_help_text",
scope: "decidim.amendments.amendable",
model_name: model_name.downcase,
amendable_fields: model.amendable_fields.to_sentence)
end
end
|
21
22
23
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 21
def promote_amend_path
decidim.promote_amend_path(model.amendment)
end
|
#promote_confirm_text ⇒ Object
29
30
31
|
# File 'app/cells/decidim/amendable/promote_button_card_cell.rb', line 29
def promote_confirm_text
t("promote_confirm_text", scope: "decidim.amendments.amendable")
end
|