Sha256: 0bdab18fc632f83d872e54fc947907a3ccfb7ab76a6f25259c6562dd5dbea9e9

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

require "decidim/core"

module Decidim
  module Verifications
    # Decidim's core Rails Engine.
    class Engine < ::Rails::Engine
      isolate_namespace Decidim::Verifications

      routes do
        authenticate(:user) do
          resources :authorizations, only: [:new, :create, :index] do
            collection do
              get :first_login
              get :renew_modal
              get :renew
            end
          end

          Decidim.authorization_engines.each do |manifest|
            mount manifest.engine, at: "/#{manifest.name}", as: "decidim_#{manifest.name}"
          end
        end

        namespace :admin do
          # Revocations - Two options: 1) Revoke all (without params) 2) Revoke before date (when date params exist)
          post "verifications_before_date", to: "verifications#destroy_before_date", as: "verifications/destroy_before_date"
          delete "verifications_all", to: "verifications#destroy_all", as: "verifications/destroy_all"
        end
      end

      # Initializer to include cells views paths
      initializer "decidim_verifications.add_cells_view_paths" do
        Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Verifications::Engine.root}/app/cells")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-verifications-0.25.0 lib/decidim/verifications/engine.rb
decidim-verifications-0.25.0.rc4 lib/decidim/verifications/engine.rb
decidim-verifications-0.25.0.rc3 lib/decidim/verifications/engine.rb
decidim-verifications-0.25.0.rc2 lib/decidim/verifications/engine.rb
decidim-verifications-0.25.0.rc1 lib/decidim/verifications/engine.rb