Assign valuators to groups

This commit is contained in:
rgarcia
2018-02-08 20:47:47 +01:00
parent cddfdf4b84
commit 1dbbe331c9
14 changed files with 132 additions and 9 deletions

View File

@@ -1,4 +1,6 @@
<%= form_for [:admin, @group] do |f| %>
<%= f.text_field :name %>
<%= f.submit %>
<% end %>
<% end %>
<%= link_to "Go back", admin_valuator_groups_path %>

View File

@@ -0,0 +1,9 @@
<%= form_for [:admin, @valuator] do |f| %>
<%= f.text_field :description %>
<%= f.select :valuator_group_id,
@valuator_groups.map {|group| [group.name, group.id] },
{ include_blank: true } %>
<%= f.submit %>
<% end %>
<%= link_to "Go back", admin_valuator_path(@valuator) %>

View File

@@ -13,6 +13,7 @@
<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">Grupo</th>
<th scope="col"><%= t("admin.actions.actions") %></th>
</thead>
<tbody>
@@ -28,6 +29,12 @@
<% end %>
</td>
<td>
<%= valuator.valuator_group.try(:name) %>
</td>
<td>
<%= link_to "Edit",
edit_admin_valuator_path(valuator),
class: "button hollow expanded" %>
<%= link_to t("admin.valuators.valuator.delete"),
admin_valuator_path(valuator),
method: :delete,

View File

@@ -0,0 +1,7 @@
<div>Name: <%= @valuator.name %></div>
<div>Description <%= @valuator.description %></div>
<div>Email: <%= @valuator.email %></div>
<div>Group: <%= @valuator.valuator_group.try(:name) %></div>
<%= link_to "See all evaluators", admin_valuators_path %>
<%= link_to "Edit", edit_admin_valuator_path(@valuator) %>