Files
once-campfire/app/views/accounts/users/_user.html.erb
T
Jason Zimdars 88f3f942f7 Ensure edit (not trash) is displayed
Fix conditional
2025-12-08 22:57:38 -06:00

38 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<li class="flex align-center gap margin-none <%= "banned" if user.banned? %>">
<figure class="avatar flex-item-no-shrink" style="--avatar-size: 3.75ch;">
<%= avatar_tag user, loading: :lazy %>
</figure>
<div class="min-width">
<div class="overflow-ellipsis fill-shade"><strong><%= user.name %></strong></div>
</div>
<hr class="separator" aria-hidden="true">
<% if Current.user.can_administer? && user.active? %>
<% unless user.bot? %>
<%= form_with model: user, url: account_user_path(user), data: { controller: "form" }, method: :patch do | form | %>
<label class="btn txt-small flex-item-no-shrink" for="<%= dom_id(user, :role) %>">
<span class="for-screen-reader">Role: <%= user.administrator? ? "Administrator" : "Member" %></span>
<%= image_tag "crown.svg", size: 20, aria: { hidden: "true" } %>
<%= form.check_box :role, { data: { action: "form#submit" }, hidden: true, id: dom_id(user, :role), disabled: user == Current.user }, "administrator", "member" %>
</label>
<% end %>
<% end %>
<% unless user == Current.user %>
<%= button_to account_user_path(user), method: :delete, class: "btn txt-small flex-item-no-shrink btn--negative", data: {
turbo_confirm: "Are you sure you want to permanently remove this person from the account? This cant be undone."} do %>
<%= image_tag "minus.svg", size: 20, aria: { hidden: "true" } %>
<span class="for-screen-reader">Delete <%= user.name %></span>
<% end %>
<% end %>
<% end %>
<% if user == Current.user %>
<%= link_to user_profile_path, class: "btn txt-small flex-item-no-shrink", target: "_top" do %>
<%= image_tag "pencil.svg", size: 20, aria: { hidden: "true" } %>
<span class="for-screen-reader">My settings</span>
<% end %>
<% end %>
</li>