Add Users#disguise/#revert

This commit is contained in:
2023-05-13 23:38:07 +02:00
parent a7fce807c5
commit 459836ca38
8 changed files with 59 additions and 11 deletions

View File

@@ -13,10 +13,15 @@
<body>
<div class="app-menu">
<% if user_signed_in? %>
<%= image_link_to t(:sign_out), "logout", destroy_user_session_path,
data: { turbo: true, turbo_method: :delete } %>
<%= image_link_to t(:profile), "account-wrench-outline", edit_user_registration_path,
current: :hide %>
<% if current_user_disguised? %>
<%= image_link_to t(:revert), "incognito-off", revert_users_path,
data: {turbo: true, turbo_method: :post} %>
<% else %>
<%= image_link_to t(:sign_out), "logout", destroy_user_session_path,
data: {turbo: true, turbo_method: :delete} %>
<% end %>
<%= image_link_to current_user.email, "account-wrench-outline",
edit_user_registration_path, current: :hide %>
<% else %>
<%= image_link_to t(:register), "account-plus-outline", new_user_registration_path,
current: :hide %>