We're choosing the default `with_first_argument` style because it's the one we use the most.
39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
<%= tag.table(**options) do %>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("admin.poll_officers.officer.name") %></th>
|
|
<th><%= t("admin.poll_officers.officer.email") %></th>
|
|
<th><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% officers.each do |officer| %>
|
|
<tr>
|
|
<td>
|
|
<%= officer.name %>
|
|
</td>
|
|
<td>
|
|
<%= officer.email %>
|
|
</td>
|
|
<td>
|
|
<% if officer.persisted? %>
|
|
<%= render Admin::TableActionsComponent.new(
|
|
officer,
|
|
actions: [:destroy],
|
|
destroy_text: t("admin.poll_officers.officer.delete"),
|
|
destroy_options: { class: "destroy-officer-link" }
|
|
) %>
|
|
<% else %>
|
|
<%= render Admin::TableActionsComponent.new(officer, actions: []) do |actions| %>
|
|
<%= actions.action(:create_officer,
|
|
text: t("admin.poll_officers.officer.add"),
|
|
path: add_user_path(officer),
|
|
method: :post) %>
|
|
<% end %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
<% end %>
|