Sha256: 999bb6255b4bb2c4284eba06f316fc50c2290cd6a650a57c89ed0d23b4b3a6b3

Contents?: true

Size: 920 Bytes

Versions: 31

Compression:

Stored size: 920 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    # This cell renders the navigation of a questionnaire step.
    class VotingStepNavigationCell < Decidim::ViewModel
      include Decidim::LayoutHelper

      def current_step_index
        model
      end

      def first_step?
        current_step_index.zero?
      end

      def last_step?
        current_step_index + 1 == total_steps
      end

      def total_steps
        options[:total_steps]
      end

      def button_continue_text
        "#{t("decidim.elections.votes.voting_step.continue")}  #{icon("chevron-right", class: "icon", role: "img", "aria-hidden": true)}"
      end

      def previous_step_dom_id
        "step-#{current_step_index - 1}"
      end

      def next_step_dom_id
        "step-#{current_step_index + 1}"
      end

      def current_step_dom_id
        "step-#{current_step_index}"
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-elections-0.27.9 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.8 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.7 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.6 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.10 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.9 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.5 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.8 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.4 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.3 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.7 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.5 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.2 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.1 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.4 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.0 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.3 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.0.rc2 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.27.0.rc1 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.26.2 app/cells/decidim/elections/voting_step_navigation_cell.rb