Files
once-campfire/app/views/accounts/users/_user.html.erb
2025-11-26 13:08:35 -06:00

35 lines
1.7 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 != Current.user && 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) }, "administrator", "member" %>
</label>
<% end %>
<% end %>
<%= 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 %>
<% elsif 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>