a11yist/app/controllers/application_controller.rb

27 lines
927 B
Ruby
Raw Normal View History

2024-07-15 14:31:54 +02:00
# frozen_string_literal: true
class ApplicationController < ActionController::Base
2024-07-21 00:33:38 +02:00
include Pagy::Backend
2024-09-05 22:54:38 +02:00
# allow_browser versions: :modern
2024-07-15 14:31:54 +02:00
before_action :initialize_navbar
private
def initialize_navbar
2024-09-05 22:54:38 +02:00
return unless request.get?
2024-07-15 14:31:54 +02:00
@navbar_items = [
2024-09-05 22:54:38 +02:00
{ label: "Dashboard", icon: :speedometer2, path: :root },
{ label: Report.model_name.human(count: 2), icon: :'journal-text', path: :reports },
{ label: Checklist.model_name.human(count: 2), icon: :'list-check', path: :checklists },
{ label: Check.model_name.human(count: 2), icon: :check2, path: :checks },
{ label: Link.model_name.human(count: 2), icon: :link, path: :links },
{ label: LinkCategory.model_name.human(count: 2), icon: :folder, path: :link_categories }
2024-07-15 14:31:54 +02:00
]
2024-09-05 22:54:38 +02:00
@nav_path = controller_name
@search_url = nil
2024-07-15 14:31:54 +02:00
end
end