Sha256: b52a848dcf91adffc1a0211747567dc6311f5f6436719112bd286e940bbd8a2b

Contents?: true

Size: 936 Bytes

Versions: 19

Compression:

Stored size: 936 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  module Consultations
    module Admin
      # This concern is meant to be included in all controllers that are scoped
      # into an question's admin panel. It will override the layout so it shows
      # the sidebar, preload the consultation, etc.
      module QuestionAdmin
        extend ActiveSupport::Concern

        included do
          include NeedsQuestion

          include Decidim::Admin::ParticipatorySpaceAdminContext
          participatory_space_admin_layout

          def current_participatory_space
            return current_consultation if params.has_key? :consultation_slug
            current_question
          end

          def permission_class_chain
            [
              Decidim::Consultations::Permissions,
              Decidim::Admin::Permissions
            ]
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-consultations-0.17.2 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.17.1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.16.1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.17.0 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.16.0 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.15.2 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.15.1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.15.0 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.14.4 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.14.3 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.14.2 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.14.1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.13.1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.12.2 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.13.0 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.12.1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.13.0.pre1 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.12.0 app/controllers/concerns/decidim/consultations/admin/question_admin.rb
decidim-consultations-0.12.0.pre app/controllers/concerns/decidim/consultations/admin/question_admin.rb