Migrate to Rais 8.0
- Remove all Rodauth stuff and implement simple custom auth - Migrate from sprockets to propshaft, hack some bootstrap stuff
This commit is contained in:
parent
0198a22278
commit
c35c7da6e0
66 changed files with 518 additions and 684 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
include Authentication
|
||||
include Pagy::Backend
|
||||
|
||||
# allow_browser versions: :modern
|
||||
|
|
@ -13,15 +14,29 @@ class ApplicationController < ActionController::Base
|
|||
def initialize_navbar
|
||||
return unless request.get?
|
||||
|
||||
@navbar_items = if rodauth.logged_in?
|
||||
@navbar_items = if authenticated?
|
||||
[
|
||||
{ label: "Dashboard", icon: :speedometer2, path: :root },
|
||||
{ label: Report.model_name.human(count: 2), icon: :'journal-text', path: :reports },
|
||||
{ label: I18n.t("backoffice"), icon: :gear, path: :backoffice, active: %w[backoffice checklists checks links link_categories].include?(controller_name) },
|
||||
{ label: Account.model_name.human, icon: :person, path: profile_path }
|
||||
{
|
||||
label: "Dashboard",
|
||||
icon: :speedometer2,
|
||||
path: :root
|
||||
},
|
||||
{
|
||||
label: Report.model_name.human(count: 2),
|
||||
icon: :'journal-text',
|
||||
path: :reports },
|
||||
{
|
||||
label: I18n.t("backoffice"),
|
||||
icon: :gear,
|
||||
path: :backoffice,
|
||||
active: %w[backoffice checklists checks links link_categories].include?(controller_name) },
|
||||
{
|
||||
label: "Konto",
|
||||
path: profile_path
|
||||
}
|
||||
]
|
||||
else
|
||||
[ { label: "Login", icon: :'door-closed', path: rodauth.login_path, label_class: "text-info" } ]
|
||||
[ { label: "Login", icon: :'door-closed', path: new_session_path, label_class: "text-info" } ]
|
||||
end
|
||||
@nav_path = controller_name
|
||||
@search_url = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue