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.26.1 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.26.0 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.26.0.rc2 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.26.0.rc1 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.2 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.1 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.0 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.0.rc4 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.0.rc3 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.0.rc2 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.25.0.rc1 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.24.3 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.23.6 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.24.2 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.23.5 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.24.1 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.24.0 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.24.0.rc2 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.23.4 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb
decidim-participatory_processes-0.24.0.rc1 app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb