Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SDG view with related content #4292

Merged
merged 15 commits into from
Dec 28, 2020
Merged
Next Next commit
Simplify title on navigation links
  • Loading branch information
javierm committed Dec 23, 2020
commit 46e9d2e5a9503a7f38cfc383c0b06e63328161f1
6 changes: 4 additions & 2 deletions app/helpers/layouts_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module LayoutsHelper
def layout_menu_link_to(text, path, is_active, options)
title = t("shared.go_to_page") + text

if is_active
tag.span(t("shared.you_are_in"), class: "show-for-sr") + " " +
link_to(text, path, options.merge(class: "is-active"))
link_to(text, path, options.merge(class: "is-active", title: title))
else
link_to(text, path, options)
link_to(text, path, options.merge(title: title))
end
end
end
15 changes: 5 additions & 10 deletions app/views/shared/_subnavigation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,23 @@
<%= layout_menu_link_to t("layouts.header.debates"),
debates_path,
controller_name == "debates",
accesskey: "1",
title: t("shared.go_to_page") + t("layouts.header.debates") %>
accesskey: "1" %>
</li>
<% end %>
<% if feature?(:proposals) %>
<li>
<%= layout_menu_link_to t("layouts.header.proposals"),
proposals_path,
controller.class == ProposalsController,
accesskey: "2",
title: t("shared.go_to_page") + t("layouts.header.proposals") %>
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.parent == Polls),
accesskey: "3",
title: t("shared.go_to_page") + t("layouts.header.poll_questions") %>
accesskey: "3" %>
</li>
<% end %>
<% if feature?(:legislation) %>
Expand All @@ -42,17 +39,15 @@
<%= layout_menu_link_to t("layouts.header.budgets"),
budgets_path,
controller_name == "budgets" || controller_name == "investments",
accesskey: "5",
title: t("shared.go_to_page") + t("layouts.header.budgets") %>
accesskey: "5" %>
</li>
<% end %>
<% if feature?(:help_page) %>
<li>
<%= layout_menu_link_to t("layouts.header.help"),
help_path,
current_page?(help_path),
accesskey: "6",
title: t("shared.go_to_page") + t("layouts.header.help") %>
accesskey: "6" %>
</li>
<% end %>

Expand Down