Sha256: 51d1bbffbb723e82387fb20cceb22ee7352df43ee14375a5c3aad8770292fc25

Contents?: true

Size: 1.08 KB

Versions: 32

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    module Admin
      # Controller that allows managing participatory process step activations.
      #
      class ParticipatoryProcessStepActivationsController < Decidim::Admin::ApplicationController
        include Concerns::ParticipatoryProcessAdmin

        def create
          authorize! :activate, process_step

          ActivateParticipatoryProcessStep.call(process_step) do
            on(:ok) do
              flash[:notice] = I18n.t("participatory_process_step_activations.create.success", scope: "decidim.admin")
            end

            on(:invalid) do
              flash.now[:alert] = I18n.t("participatory_process_step_activations.create.error", scope: "decidim.admin")
            end

            redirect_to participatory_process_steps_path(current_participatory_process)
          end
        end

        private

        def process_step
          collection.find(params[:step_id])
        end

        def collection
          current_participatory_process.steps
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
decidim-participatory_processes-0.9.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.9.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.9.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.9.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.8.4 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.8.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.8.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.8.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.8.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.7.4 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.7.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.7.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.7.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.7.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.6.8 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-0.6.8 decidim-participatory_processes/app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.6.7 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-0.6.7 decidim-participatory_processes/app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.6.6 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-0.6.6 decidim-participatory_processes/app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb