Sha256: 18b786c63f940bf249eca655de47f2723923c552ea3464dc9588cac862df2016

Contents?: true

Size: 1.14 KB

Versions: 72

Compression:

Stored size: 1.14 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
          enforce_permission_to :activate, :process_step, process_step: process_step

          ActivateParticipatoryProcessStep.call(process_step, current_user) 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

72 entries across 72 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.27.9 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.8 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.7 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.6 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.10 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.9 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.5 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.8 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.4 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.7 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.5 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.4 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.0.rc2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.27.0.rc1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb
decidim-participatory_processes-0.26.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb