Sha256: 4629f52ad3a9f758d3f9d01574152ab5229e6e775820d125961893842e5464fd

Contents?: true

Size: 948 Bytes

Versions: 17

Compression:

Stored size: 948 Bytes

Contents

# frozen_string_literal: true
module Decidim
  module Admin
    module Concerns
      # This concern is meant to be included in all controllers that are scoped
      # into a participatory process' admin panel. It will override the layout
      # so it shows the sidebar, preload the participatory process, etc.
      module ParticipatoryProcessAdmin
        extend ActiveSupport::Concern

        included do
          helper_method :participatory_process
          before_action :ensure_participatory_process

          layout "decidim/admin/participatory_process"
        end

        private

        def participatory_process
          @participatory_process ||=
            current_organization.participatory_processes.find(params[:participatory_process_id])
        end

        def ensure_participatory_process
          raise ActionController::RoutingError, "Not Found" unless participatory_process
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
decidim-admin-0.1.0 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.1.0 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.8.1 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.8.1 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.7 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.7 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.6 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.6 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.5 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.5 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.4 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.3 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.3 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.2 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.2 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-admin-0.0.1 app/controllers/decidim/admin/concerns/participatory_process_admin.rb
decidim-0.0.1 decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb