Class: Decidim::Elections::VotingStepNavigationCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Elections::VotingStepNavigationCell
- Includes:
- LayoutHelper
- Defined in:
- app/cells/decidim/elections/voting_step_navigation_cell.rb
Overview
This cell renders the navigation of a questionnaire step.
Instance Method Summary collapse
- #button_continue_text ⇒ Object
- #current_step_dom_id ⇒ Object
- #current_step_index ⇒ Object
- #first_step? ⇒ Boolean
- #last_step? ⇒ Boolean
- #next_step_dom_id ⇒ Object
- #previous_step_dom_id ⇒ Object
- #total_steps ⇒ Object
Instance Method Details
#button_continue_text ⇒ Object
25 26 27 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 25 def t("decidim.elections.votes.voting_step.continue") end |
#current_step_dom_id ⇒ Object
37 38 39 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 37 def current_step_dom_id "step-#{current_step_index}" end |
#current_step_index ⇒ Object
9 10 11 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 9 def current_step_index model end |
#first_step? ⇒ Boolean
13 14 15 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 13 def first_step? current_step_index.zero? end |
#last_step? ⇒ Boolean
17 18 19 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 17 def last_step? current_step_index + 1 == total_steps end |
#next_step_dom_id ⇒ Object
33 34 35 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 33 def next_step_dom_id last_step? ? "step-confirm" : "step-#{current_step_index + 1}" end |
#previous_step_dom_id ⇒ Object
29 30 31 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 29 def previous_step_dom_id "step-#{current_step_index - 1}" end |
#total_steps ⇒ Object
21 22 23 |
# File 'app/cells/decidim/elections/voting_step_navigation_cell.rb', line 21 def total_steps [:total_steps] end |