Add 'Delete' button to Valuators index/search views
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<h2><%= t("admin.valuators.index.title") %></h2>
|
||||
|
||||
<%= render 'admin/shared/user_search', url: search_admin_valuators_path %>
|
||||
<%= render "admin/shared/user_search", url: search_admin_valuators_path %>
|
||||
|
||||
<div id="valuators">
|
||||
<% if @valuators.any? %>
|
||||
@@ -11,16 +11,13 @@
|
||||
<th scope="col"><%= t("admin.valuators.index.name") %></th>
|
||||
<th scope="col"><%= t("admin.valuators.index.email") %></th>
|
||||
<th scope="col"><%= t("admin.valuators.index.description") %></th>
|
||||
<th scope="col"><%= t("admin.actions.actions") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @valuators.each do |valuator| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= valuator.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= valuator.email %>
|
||||
</td>
|
||||
<td><%= valuator.name %></td>
|
||||
<td><%= valuator.email %></td>
|
||||
<td>
|
||||
<% if valuator.description.present? %>
|
||||
<%= valuator.description %>
|
||||
@@ -28,6 +25,12 @@
|
||||
<%= t("admin.valuators.index.no_description") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.valuators.valuator.delete"),
|
||||
admin_valuator_path(valuator),
|
||||
method: :delete,
|
||||
class: "button hollow alert expanded" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -29,7 +29,12 @@
|
||||
<%= t("admin.valuators.index.no_description") %>
|
||||
<% end %>
|
||||
<td>
|
||||
<% unless user.valuator? %>
|
||||
<% if user.valuator? %>
|
||||
<%= link_to t("admin.valuators.valuator.delete"),
|
||||
admin_valuator_path(user),
|
||||
method: :delete,
|
||||
class: "button hollow alert expanded" %>
|
||||
<% else %>
|
||||
<%= form_for Valuator.new(user: user), url: admin_valuators_path do |f| %>
|
||||
<%= f.text_field :description,
|
||||
label: false,
|
||||
|
||||
@@ -481,6 +481,7 @@ en:
|
||||
valuator:
|
||||
description_placeholder: 'Description (optional)'
|
||||
add: Add to valuators
|
||||
delete: Delete
|
||||
search:
|
||||
title: 'Valuators: User search'
|
||||
summary:
|
||||
|
||||
@@ -481,6 +481,7 @@ es:
|
||||
valuator:
|
||||
description_placeholder: 'Descripción (opcional)'
|
||||
add: Añadir como evaluador
|
||||
delete: Borrar
|
||||
search:
|
||||
title: 'Evaluadores: Búsqueda de usuarios'
|
||||
summary:
|
||||
|
||||
Reference in New Issue
Block a user