Add 'Delete' button to Valuators index/search views

This commit is contained in:
Angel Perez
2017-10-26 16:03:39 -04:00
committed by Angel Perez
parent bb1e5e4608
commit 4e086de493
4 changed files with 18 additions and 8 deletions

View File

@@ -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>

View File

@@ -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,

View File

@@ -481,6 +481,7 @@ en:
valuator:
description_placeholder: 'Description (optional)'
add: Add to valuators
delete: Delete
search:
title: 'Valuators: User search'
summary:

View File

@@ -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: