Add user status update

This commit is contained in:
2023-05-17 23:40:09 +02:00
parent 9ecdd10b2d
commit 9d97eb3f6f
5 changed files with 45 additions and 16 deletions

View File

@@ -12,16 +12,24 @@
<% @users.each do |user| %>
<tr>
<td><%= link_to user.email, user_path(user) %></td>
<td><%= user.status %></td>
<td class="svg">
<%= svg_tag "pictograms/checkbox-marked-outline" if user.confirmed_at.present? %>
</td>
<td><%= user.created_at.to_fs(:db_without_sec) %></td>
<td class="actions">
<% if allow_disguise?(user) %>
<%= image_button_to t(".disguise"), "incognito", disguise_user_path(user) %>
<td>
<% if user == current_user %>
<%= user.status %>
<% else %>
<%= form_for user do |u| %>
<%= u.select :status, User.statuses.keys, {}, onchange: "this.form.submit();" %>
<% end %>
<% end %>
</td>
<td class="svg">
<%= svg_tag "pictograms/checkbox-marked-outline" if user.confirmed_at.present? %>
</td>
<td><%= user.created_at.to_fs(:db_without_sec) %></td>
<td class="actions">
<% if allow_disguise?(user) %>
<%= image_button_to t(".disguise"), "incognito", disguise_user_path(user) %>
<% end %>
</td>
</tr>
<% end %>
</tbody>