Tidy up homepage and navigation

This commit is contained in:
Dan Milne
2025-11-09 20:58:13 +11:00
parent c9e2992fe0
commit 1f4428348d
56 changed files with 2822 additions and 955 deletions

View File

@@ -0,0 +1,33 @@
# frozen_string_literal: true
module NavigationHelper
def nav_link_class(path)
current = request.path == path || (path == root_path && request.path == events_path && !request.path.include?('/network_ranges') && !request.path.include?('/rules'))
if current
"bg-gray-900 text-white px-3 py-2 rounded-md text-sm font-medium"
else
"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium transition-colors"
end
end
def mobile_nav_link_class(path)
current = request.path == path || (path == root_path && request.path == events_path && !request.path.include?('/network_ranges') && !request.path.include?('/rules'))
if current
"bg-gray-900 text-white block px-3 py-2 rounded-md text-base font-medium"
else
"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium transition-colors"
end
end
def time_period_class(period)
base_class = "px-4 py-2 text-sm font-medium border-r last:border-r-0 transition-colors"
if @time_period == period
base_class + " bg-blue-600 text-white"
else
base_class + " bg-white text-gray-700 hover:bg-gray-50"
end
end
end