Class: Decidim::Forms::StepNavigationCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Forms::StepNavigationCell
- Defined in:
- app/cells/decidim/forms/step_navigation_cell.rb
Overview
This cell renders the navigation of a questionnaire step.
Instance Method Summary collapse
- #button_disabled? ⇒ Boolean
- #confirm_data ⇒ Object
- #current_step_dom_id ⇒ Object
- #current_step_index ⇒ Object
- #first_step? ⇒ Boolean
- #form ⇒ Object
- #last_step? ⇒ Boolean
- #next_step_dom_id ⇒ Object
- #previous_step_dom_id ⇒ Object
- #total_steps ⇒ Object
Instance Method Details
#button_disabled? ⇒ Boolean
27 28 29 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 27 def [:button_disabled] end |
#confirm_data ⇒ Object
43 44 45 46 47 48 49 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 43 def confirm_data { data: { confirm: t("decidim.forms.step_navigation.show.are_you_sure"), disable: true, data: "survey-buttons" } } end |
#current_step_dom_id ⇒ Object
39 40 41 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 39 def current_step_dom_id "step-#{current_step_index}" end |
#current_step_index ⇒ Object
7 8 9 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 7 def current_step_index model end |
#first_step? ⇒ Boolean
11 12 13 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 11 def first_step? current_step_index.zero? end |
#form ⇒ Object
23 24 25 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 23 def form [:form] end |
#last_step? ⇒ Boolean
15 16 17 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 15 def last_step? current_step_index + 1 == total_steps end |
#next_step_dom_id ⇒ Object
35 36 37 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 35 def next_step_dom_id "step-#{current_step_index + 1}" end |
#previous_step_dom_id ⇒ Object
31 32 33 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 31 def previous_step_dom_id "step-#{current_step_index - 1}" end |
#total_steps ⇒ Object
19 20 21 |
# File 'app/cells/decidim/forms/step_navigation_cell.rb', line 19 def total_steps [:total_steps] end |