Sha256: 38944dc804bd85d1aabc5a90446b7e4414e923c5a59d8c16826eeecaf4ac35c4

Contents?: true

Size: 887 Bytes

Versions: 37

Compression:

Stored size: 887 Bytes

Contents

# frozen_string_literal: true

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

        def create
          authorize! :reorder, Decidim::ParticipatoryProcessStep
          ReorderParticipatoryProcessSteps.call(collection, params[:items_ids]) do
            on(:invalid) do
              flash.now[:alert] = I18n.t("participatory_process_steps.ordering.error", scope: "decidim.admin")
              redirect_to participatory_process_path(current_participatory_process)
            end
          end
        end

        private

        def collection
          current_participatory_process.steps
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
decidim-participatory_processes-0.11.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.11.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.11.0.pre1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.10.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.10.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.9.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.9.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.9.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.9.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.8.4 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.8.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.8.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.8.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.8.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.7.4 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.7.3 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.7.2 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.7.1 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.7.0 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb
decidim-participatory_processes-0.6.8 app/controllers/decidim/participatory_processes/admin/participatory_process_step_ordering_controller.rb