Class: Decidim::Amendable::AmendButtonCardCell
- Inherits:
-
ViewModel
- Object
- Cell::ViewModel
- ViewModel
- Decidim::Amendable::AmendButtonCardCell
show all
- Defined in:
- app/cells/decidim/amendable/amend_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
34
35
36
|
# File 'app/cells/decidim/amendable/amend_button_card_cell.rb', line 34
def button_classes
"amend_button_card_cell button hollow expanded button--icon button--sc"
end
|
#current_component ⇒ Object
13
14
15
|
# File 'app/cells/decidim/amendable/amend_button_card_cell.rb', line 13
def current_component
model.component
end
|
#model_name ⇒ Object
9
10
11
|
# File 'app/cells/decidim/amendable/amend_button_card_cell.rb', line 9
def model_name
model.model_name.human
end
|
21
22
23
|
# File 'app/cells/decidim/amendable/amend_button_card_cell.rb', line 21
def new_amend_button_label
t("button", scope: "decidim.amendments.amendable", model_name: model_name)
end
|
#new_amend_help_text ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'app/cells/decidim/amendable/amend_button_card_cell.rb', line 25
def new_amend_help_text
content_tag :small do
t("help_text",
scope: "decidim.amendments.amendable",
model_name: model_name.downcase,
amendable_fields: model.amendable_fields.to_sentence)
end
end
|
#new_amend_path ⇒ Object
17
18
19
|
# File 'app/cells/decidim/amendable/amend_button_card_cell.rb', line 17
def new_amend_path
decidim.new_amend_path(amendable_gid: model.to_sgid.to_s)
end
|