In the management section, `current_user` is the user impersonated by the manager. We were deciding whether to show the admin menu depending on the privileges of the current user, but this menu should be shown according to the privileges of the manager who is impersonating the user. We're doing a similar (very subtle) change in the login items. We were rendering the `login_items` partial passing `current_user: user`. However, inside this method, we were using `user_signed_in`, which ignored the `current_user` we were passing. The result was always the same expect in tests where we manually sign in users, but we're changing it anyway in order to reduce confusion.
29 lines
854 B
Plaintext
29 lines
854 B
Plaintext
<main>
|
|
<div class="activity row margin-top">
|
|
<div class="small-12 column">
|
|
|
|
<% if @user != current_user %>
|
|
<% if @user.email_on_direct_message? %>
|
|
<%= link_to t("users.show.send_private_message"),
|
|
new_user_direct_message_path(@user),
|
|
class: "button hollow float-right" %>
|
|
<% else %>
|
|
<div class="callout primary float-right">
|
|
<%= t("users.show.no_private_messages") %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<h2 class="inline-block">
|
|
<%= avatar_image(@user, seed: @user.id, size: 60) %>
|
|
<%= @user.name %>
|
|
<% if current_user&.administrator? %>
|
|
<small><%= @user.email %></small>
|
|
<% end %>
|
|
</h2>
|
|
|
|
<%= render Users::PublicActivityComponent.new(@user) %>
|
|
</div>
|
|
</div>
|
|
</main>
|