Sha256: 5e9d80da526c53114e21e1533e600dcc68bac7c826706ed98438aafbc1bdc391

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    # This is the engine that runs on the public interface of `decidim-proposals`.
    class AdminEngine < ::Rails::Engine
      isolate_namespace Decidim::Proposals::Admin

      paths["db/migrate"] = nil
      paths["lib/tasks"] = nil

      routes do
        resources :proposals, only: [:index, :new, :create, :edit, :update] do
          post :update_category, on: :collection
          collection do
            resource :proposals_import, only: [:new, :create]
            resource :proposals_merge, only: [:create]
            resource :proposals_split, only: [:create]
          end
          resources :proposal_answers, only: [:edit, :update]
          resources :proposal_notes, only: [:index, :create]
        end
        scope "/proposal_components/:component_id" do
          resources :participatory_texts, only: :index do
            collection do
              get :new_import
              post :import
              post :publish
            end
          end
        end

        root to: "proposals#index"
      end

      initializer "decidim_proposals.admin_assets" do |app|
        app.config.assets.precompile += %w(admin/decidim_proposals_manifest.js)
      end

      def load_seed
        nil
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-proposals-0.16.0 lib/decidim/proposals/admin_engine.rb
decidim-proposals-0.15.2 lib/decidim/proposals/admin_engine.rb
decidim-proposals-0.15.1 lib/decidim/proposals/admin_engine.rb
decidim-proposals-0.15.0 lib/decidim/proposals/admin_engine.rb