Sha256: 7782ddd848849187ee01e20e66bec4eb87994ae25bf654c7092218f1ae82aba0

Contents?: true

Size: 437 Bytes

Versions: 10

Compression:

Stored size: 437 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    # This cell renders a question (readonly) of a questionnaire
    class QuestionReadonlyCell < Decidim::ViewModel
      def show
        return if model.separator?
        return render :title_and_description if model.title_and_description?

        render :show
      end

      def position
        options[:indexed_items].index(model.id) + 1
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-forms-0.30.0.rc3 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.30.0.rc2 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.30.0.rc1 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.2 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.1 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.0 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.0.rc4 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.0.rc3 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.0.rc2 app/cells/decidim/forms/question_readonly_cell.rb
decidim-forms-0.29.0.rc1 app/cells/decidim/forms/question_readonly_cell.rb