26 lines
927 B
Ruby
26 lines
927 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ApplicationController < ActionController::Base
|
|
include Pagy::Backend
|
|
|
|
# allow_browser versions: :modern
|
|
|
|
before_action :initialize_navbar
|
|
|
|
private
|
|
|
|
def initialize_navbar
|
|
return unless request.get?
|
|
|
|
@navbar_items = [
|
|
{ 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 }
|
|
]
|
|
@nav_path = controller_name
|
|
@search_url = nil
|
|
end
|
|
end
|