forked from fixin.me/fixin.me
Only user can delete his profile
This commit is contained in:
@@ -5,21 +5,18 @@
|
||||
<th><%= User.human_attribute_name(:status).capitalize %></th>
|
||||
<th><%= User.human_attribute_name(:created_at).capitalize %> <sup>UTC</sup></th>
|
||||
<th><%= User.human_attribute_name(:confirmed_at).capitalize %></th>
|
||||
<th><%= t :actions %></th>
|
||||
<!-- <th><%#= t :actions %></th> -->
|
||||
</tr>
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<%# TODO: add user edit link %>
|
||||
<%# TODO: add user show link %>
|
||||
<td><%= user.email %></td>
|
||||
<td><%= user.status %></td>
|
||||
<td><%= user.created_at.to_fs(:db_without_sec) %></td>
|
||||
<td class="svg">
|
||||
<%= svg_tag "pictograms/checkbox-marked-outline" if user.confirmed_at.present? %>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<%= image_link_to t(:delete), "account-remove-outline", user_path(user),
|
||||
data: { turbo: true, turbo_method: :delete } %>
|
||||
</td>
|
||||
<!-- <td class="actions"></td> -->
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<% content_for :navigation, flush: true do %>
|
||||
<%= image_link_to t(:back), "arrow-left-bold-outline",
|
||||
request.referer.present? ? :back : root_url %>
|
||||
<div class="left">
|
||||
<%= image_link_to t(".back"), "arrow-left-bold-outline",
|
||||
request.referer.present? ? :back : root_url %>
|
||||
</div>
|
||||
<div class="right">
|
||||
<%= image_link_to t(".delete"), "account-remove-outline", user_registration_path,
|
||||
class: "dangerous",
|
||||
data: { turbo: true, turbo_method: :delete, turbo_confirm: t(".confirm_delete") } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= tabular_form_for resource, url: registration_path(resource), html: {method: :patch} do |f| %>
|
||||
|
||||
Reference in New Issue
Block a user