Skip to content

Commit

Permalink
Show attachment menu as active only when subitem is active (#7774)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlera authored and entantoencuanto committed Apr 7, 2021
1 parent 076f2f3 commit 033ce27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions decidim-elections/lib/decidim/votings/admin_engine.rb
Expand Up @@ -131,6 +131,8 @@ class AdminEngine < ::Rails::Engine
menu.add_item :attachments,
I18n.t("attachments", scope: "decidim.votings.admin.menu.votings_submenu"),
"#",
active: is_active_link?(decidim_admin_votings.voting_attachment_collections_path(current_participatory_space)) ||
is_active_link?(decidim_admin_votings.voting_attachments_path(current_participatory_space)),
if: allowed_to?(:read, :attachment_collection) || allowed_to?(:read, :attachment),
submenu: { target_menu: :decidim_votings_attachments_menu }

Expand Down
Expand Up @@ -190,6 +190,8 @@ class AdminEngine < ::Rails::Engine
menu.add_item :attachments,
I18n.t("attachments", scope: "decidim.admin.menu.participatory_processes_submenu"),
"#",
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_attachment_collections_path(current_participatory_space)) ||
is_active_link?(decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space)),
if: allowed_to?(:read, :attachment_collection) || allowed_to?(:read, :attachment),
submenu: { target_menu: :admin_participatory_process_attachments_menu }

Expand Down

0 comments on commit 033ce27

Please sign in to comment.