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

16 lines
748 B
Plaintext

<% if user.active? %>
<%= button_to user_ban_path(user), method: :post,
class: "btn full-width",
data: { turbo_confirm: "Are you sure you want to ban this user? This will log them out, delete their messages, and block their IP addresses." } do %>
<%= image_tag "cancel.svg", aria: { hidden: "true", label: "Ban #{@user.name}" } %>
<span>Ban <%= user.name %></span>
<% end %>
<% else %>
<%= button_to user_ban_path(user), method: :delete,
class: "btn btn--negative full-width",
data: { turbo_confirm: "Are you sure you want to remove the ban on this user?" } do %>
<%= image_tag "cancel.svg", aria: { hidden: "true", label: "Ban #{@user.name}" } %>
<span>Remove ban</span>
<% end %>
<% end %>