Sha256: 8b8d55a17126708bbf3e7bdbe17bd6d71d574c5808a6e5a171281da82442ef40

Contents?: true

Size: 1.28 KB

Versions: 10

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module IdDocuments
      module Admin
        #
        # Handles confirmations for offline verification by identity document.
        #
        class OfflineConfirmationsController < Decidim::Admin::ApplicationController
          layout "decidim/admin/users"

          include Decidim::Admin::WorkflowsBreadcrumb

          add_breadcrumb_item_from_menu :workflows_menu

          def new
            enforce_permission_to :update, :authorization

            @form = form(OfflineConfirmationForm).instance
          end

          def create
            enforce_permission_to :update, :authorization

            @form = form(OfflineConfirmationForm).from_params(params)

            ConfirmUserOfflineAuthorization.call(@form) do
              on(:ok) do
                flash[:notice] = t("offline_confirmations.create.success", scope: "decidim.verifications.id_documents.admin")
                redirect_to pending_authorizations_path
              end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-verifications-0.29.1 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.28.4 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.29.0 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.28.3 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.29.0.rc4 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.29.0.rc3 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.29.0.rc2 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.29.0.rc1 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.28.2 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
decidim-verifications-0.28.1 app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb