Sha256: a45f5c6e60227fa95e1859e98507361d9b453ea6a28027e477d074fc7fd0e1ba

Contents?: true

Size: 989 Bytes

Versions: 49

Compression:

Stored size: 989 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    module Admin
      class ParticipatoryProcessImportsController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
        def new
          enforce_permission_to :import, :process
          @form = form(ParticipatoryProcessImportForm).instance
        end

        def create
          enforce_permission_to :import, :process
          @form = form(ParticipatoryProcessImportForm).from_params(params)

          ImportParticipatoryProcess.call(@form) do
            on(:ok) do
              flash[:notice] = I18n.t("participatory_process_imports.create.success", scope: "decidim.admin")
              redirect_to participatory_processes_path
            end

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

Version data entries

49 entries across 49 versions & 1 rubygems

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