Sha256: 4e7881464a83625ce4a63587e0b0f0e6d1ad811d49d23fc1eb5c146f25161706

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true
Decidim::Admin::Engine.routes.draw do
  constraints(->(request) { Decidim::Admin::OrganizationDashboardConstraint.new(request).matches? }) do
    resource :organization, only: [:edit, :update], controller: "organization"
    resources :participatory_processes do
      resource :publish, controller: "participatory_process_publications", only: [:create, :destroy]

      resources :categories

      resources :steps, controller: "participatory_process_steps" do
        resource :activate, controller: "participatory_process_step_activations", only: [:create, :destroy]
        collection do
          post :ordering, to: "participatory_process_step_ordering#create"
        end
      end
      resources :user_roles, controller: "participatory_process_user_roles", only: [:destroy, :create, :index]
      resources :attachments, controller: "participatory_process_attachments"
      resources :features
    end

    scope "/participatory_processes/:participatory_process_id/features/:feature_id/manage" do
      Decidim.feature_manifests.each do |manifest|
        next unless manifest.admin_engine

        constraints Decidim::CurrentFeature.new(manifest) do
          mount manifest.admin_engine, at: "/", as: "decidim_admin_#{manifest.name}"
        end
      end

      get "/" => proc { raise "Feature not found" }, as: :manage_feature
    end

    resources :static_pages
    resources :scopes, except: [:show]

    root to: "dashboard#show"
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
decidim-admin-0.0.1 config/routes.rb
decidim-0.0.1 decidim-admin/config/routes.rb