mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 06:39:39 +02:00
Let super admins toggle admin bar
This commit is contained in:
parent
c309c8abf8
commit
c8302a6d49
2 changed files with 9 additions and 1 deletions
|
@ -158,4 +158,12 @@ module ApplicationHelper
|
||||||
.map { |_currency, money| format_money(money) }
|
.map { |_currency, money| format_money(money) }
|
||||||
.join(separator)
|
.join(separator)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show_super_admin_bar?
|
||||||
|
if params[:admin].present?
|
||||||
|
cookies.permanent[:admin] = params[:admin]
|
||||||
|
end
|
||||||
|
|
||||||
|
cookies[:admin] == "true"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="h-full">
|
<body class="h-full">
|
||||||
<%= render "impersonation_sessions/super_admin_bar" if Current.true_user&.super_admin? %>
|
<%= render "impersonation_sessions/super_admin_bar" if Current.true_user&.super_admin? && show_super_admin_bar? %>
|
||||||
<%= render "impersonation_sessions/approval_bar" if Current.true_user&.impersonated_support_sessions&.initiated&.any? %>
|
<%= render "impersonation_sessions/approval_bar" if Current.true_user&.impersonated_support_sessions&.initiated&.any? %>
|
||||||
|
|
||||||
<div class="fixed z-50 bottom-6 left-6">
|
<div class="fixed z-50 bottom-6 left-6">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue