Files
grecia/app/views/admin/poll/polls/_search_officers_results.html.erb
2016-12-27 17:47:15 +01:00

30 lines
956 B
Plaintext

<table>
<thead>
<tr>
<th colspan="3"><%= @officers.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %></th>
</tr>
</thead>
<tbody>
<% @officers.each do |user| %>
<tr>
<td>
<%= user.name %>
</td>
<td>
<%= user.email %>
</td>
<td class="text-right">
<% if @poll.officer_ids.include?(user.poll_officer.id) %>
<%= link_to t("admin.polls.show.edit_officer_assignments"),
admin_officer_assignments_path(poll: @poll, officer: user.poll_officer),
class: "button hollow alert" %>
<% else %>
<%= link_to t("admin.polls.show.add_officer_assignments"),
admin_officer_assignments_path(poll: @poll, officer: user.poll_officer),
class: "button hollow" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>