From b72b88a8d896d34ebac06c22d2379c1b162ec152 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Thu, 19 Feb 2026 02:38:06 +0000 Subject: [PATCH] Move secondary navigation item configutation to helper --- app/helpers/application_helper.rb | 23 ++++++++++++++++++-- app/views/layouts/_header.html.erb | 34 ++---------------------------- 2 files changed, 23 insertions(+), 34 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ea0e02650..fc9fcf81f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -39,8 +39,27 @@ module ApplicationHelper end end - def header_nav_link_class(path) - ["nav-link", current_page?(path) ? "active text-secondary-emphasis" : "text-secondary"] + def secondary_nav_items + items = [ + [history_path, t("layouts.history")], + [export_path, t("layouts.export")], + [traces_path, t("layouts.gps_traces")], + [diary_entries_path, t("layouts.user_diaries")], + [communities_path, t("layouts.communities")], + [copyright_path, t("layouts.copyright")], + [help_path, t("layouts.help")], + [Settings.donation_url, t("layouts.donate_link"), { :target => :new }], + [about_path, t("layouts.about")] + ] + + if Settings.status != "database_offline" && can?(:index, Issue) + items.prepend([ + issues_path(:status => "open"), + safe_join([t("layouts.issues"), open_issues_count], " ") + ]) + end + + items end def application_data diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 0963e523b..a3a70d3ce 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -32,41 +32,11 @@