AyuntamientoMadrid/participacion

View on GitHub
app/views/admin/poll/polls/booth_assignments.html.erb

Summary

Maintainability
Test Coverage
<h2 class="inline-block"><%= t("admin.polls.index.title") %></h2>

<% if @polls.any? %>
  <table>
    <thead>
      <th class="medium-6"><%= t("admin.polls.index.name") %></th>
      <th><%= t("admin.polls.index.dates") %></th>
      <th><%= t("admin.actions.actions") %></th>
    </thead>
    <tbody>
      <% @polls.each do |poll| %>
        <tr id="<%= dom_id(poll) %>" class="poll">
          <td><%= poll.name %></td>
          <td>
            <%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>
          </td>
          <td>
            <%= render Admin::TableActionsComponent.new(poll, actions: []) do |actions| %>
              <%= actions.action(:manage,
                                 text: t("admin.booth_assignments.manage_assignments"),
                                 path: manage_admin_poll_booth_assignments_path(poll)) %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <div class="callout primary">
    <%= t("admin.polls.index.no_polls") %>
  </div>
<% end %>