<% if @dotations.blank? %>
  <div class="alert alert-info alert-dismissible">
    <h5><i class="icon fas fa-info"></i> Informacja</h5>
      Brak elementów na liście
  </div>
<% else %>
<div class="row">
  <div class="col-md-6">
    <%= paginate @dotations, theme: 'twitter-bootstrap-4' %>
  </div>
</div>
<table class="table table-bordered">
  <thead>
    <tr>
      <th>Nazwa</th>
      <th>Nazwa formalna</th>
      <th>Punkty</th>
      <th>Data od</th>
      <th>Data do</th>
      <th>Publiczne</th>
      <th style="width: 200px">Akcje</th>
    </tr>
  </thead>

  <tbody>
    <% @dotations.each do |dotation| %>
      <tr>
        <td><%= link_to dotation.name, grant_path(dotation) %></td>
        <td><%= dotation.formal_name %></td>
        <td><%= dotation.points %></td>
        <td><%= dotation.date_from %></td>
        <td><%= dotation.date_to %></td>
        <td id="dot_act_<%= dotation.id %>">
          <%= render 'activate', dotation: dotation %>
        </td>
        <td>
          <%= link_to raw('<i class="fas fa-edit"></i> Edycja'), edit_grant_path(dotation), class: 'btn-sm btn-info' %>
          <%= link_to raw('<i class="fas fa-trash-can"></i> Usuń'), grant_path(dotation), class: 'btn-sm btn-danger', method: :delete, data: { confirm: 'Czy na pewno?' } %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<% end %>
