Files
grecia/app/views/shared/_subnavigation.html.erb
Javi Martín 7c8e3788ec Use new module_parent and module_parents methods
We were getting some deprecation warnings:

DEPRECATION WARNING: `Module#parent` has been renamed to
`module_parent`. `parent` is deprecated and will be removed in Rails
6.1.

DEPRECATION WARNING: `Module#parents` has been renamed to
`module_parents`. `parents` is deprecated and will be removed in Rails
6.1.
2022-08-24 14:36:49 +02:00

65 lines
2.3 KiB
Plaintext

<nav>
<ul>
<%= raw content_block("subnavigation_left") %>
<% if feature?(:debates) %>
<li>
<%= layout_menu_link_to t("layouts.header.debates"),
debates_path,
controller_name == "debates",
accesskey: "1" %>
</li>
<% end %>
<% if feature?(:proposals) %>
<li>
<%= layout_menu_link_to t("layouts.header.proposals"),
proposals_path,
controller.class == ProposalsController,
accesskey: "2" %>
</li>
<% end %>
<% if feature?(:polls) %>
<li>
<%= layout_menu_link_to t("layouts.header.poll_questions"),
polls_path,
controller_name == "polls" || (controller_name == "questions" && controller.class.module_parent == Polls),
accesskey: "3" %>
</li>
<% end %>
<% if feature?(:legislation) %>
<li>
<%= layout_menu_link_to t("layouts.header.collaborative_legislation"),
legislation_processes_path,
controller.class.module_parent == Legislation,
accesskey: "4" %>
</li>
<% end %>
<% if feature?(:budgets) %>
<li>
<%= layout_menu_link_to t("layouts.header.budgets"),
budgets_path,
controller_name == "budgets" || controller_name == "investments",
accesskey: "5" %>
</li>
<% end %>
<% if feature?(:sdg) %>
<li>
<%= layout_menu_link_to t("layouts.header.sdg"),
sdg_goals_path,
controller_path == "sdg/goals" && action_name != "help",
accesskey: "6" %>
</li>
<% end %>
<% if feature?(:help_page) %>
<li>
<%= layout_menu_link_to t("layouts.header.help"),
help_path,
current_page?(help_path),
accesskey: "7" %>
</li>
<% end %>
<%= raw content_block("subnavigation_right") %>
</ul>
</nav>