Sha256: 4d4b24c8ead11cabd9f3443becb11c463efaf7f121111615d2031339fbebe8bc

Contents?: true

Size: 899 Bytes

Versions: 14

Compression:

Stored size: 899 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")}"
      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

14 entries across 14 versions & 1 rubygems

Version Path
decidim-elections-0.24.3 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.6 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.24.2 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.5 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.24.1 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.24.0 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.24.0.rc2 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.4 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.24.0.rc1 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.3 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.2 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.1 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.1.rc1 app/cells/decidim/elections/voting_step_navigation_cell.rb
decidim-elections-0.23.0 app/cells/decidim/elections/voting_step_navigation_cell.rb