16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/decidim/elections/menu.rb', line 16
def self.register_participatory_space_registry_manifests!
Decidim.participatory_space_registry.manifests.each do |participatory_space|
= :"admin_#{participatory_space.name.to_s.singularize}_menu"
Decidim. do ||
component = current_participatory_space.try(:components)&.find_by(manifest_name: :elections)
next unless component
link = Decidim::EngineRouter.admin_proxy(component).trustees_path(locale: I18n.locale)
has_election_components = current_participatory_space.components.select { |c| c.manifest_name == "elections" }.any?
.add_item :trustees,
I18n.t("trustees", scope: "decidim.elections.admin.menu"),
link,
if: has_election_components && (allowed_to?(:manage, :trustees) || current_user.admin?),
icon_name: "safe-line",
position: 100,
active: is_active_link?(link)
end
end
end
|