Sha256: 9210e50da41d1fa735c52e895e2ef50a62c4254c01ca3a5967e7cf9f529d1ec2

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    # This is the engine that runs on the public interface for polling officers of `decidim-elections`.
    # It mostly handles rendering the polling officers frontend zone.
    class PollingOfficerZoneEngine < ::Rails::Engine
      isolate_namespace Decidim::Votings::PollingOfficerZone

      paths["db/migrate"] = nil
      paths["lib/tasks"] = nil

      routes do
        resource :polling_officers, path: "/", only: [:show] do
          resources :polling_stations, only: [:show]
        end
      end

      def load_seed
        nil
      end

      initializer "decidim_elections.polling_officer_zone.menu" do
        Decidim.menu :user_menu do |menu|
          menu.item I18n.t("menu.polling_officer_zone", scope: "decidim.votings.polling_officer_zone"),
                    decidim.decidim_votings_polling_officer_zone_path,
                    active: :inclusive,
                    if: Decidim::Votings::PollingOfficer.polling_officer?(current_user)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-elections-0.24.3 lib/decidim/votings/polling_officer_zone_engine.rb
decidim-elections-0.24.2 lib/decidim/votings/polling_officer_zone_engine.rb
decidim-elections-0.24.1 lib/decidim/votings/polling_officer_zone_engine.rb
decidim-elections-0.24.0 lib/decidim/votings/polling_officer_zone_engine.rb
decidim-elections-0.24.0.rc2 lib/decidim/votings/polling_officer_zone_engine.rb
decidim-elections-0.24.0.rc1 lib/decidim/votings/polling_officer_zone_engine.rb