<% if @courses.blank? %>
  <%= render partial: '/admin/shared/norecords' %>
<% else %>
  <table class="table table-bordered">
    <thead class="thead-dark">
      <tr>
        <th><%= t('course.table.name') %></th>
        <th><%= t('course.table.description') %></th>
        <th class="fit"><%= t('actions') %></th>
      </tr>
    </thead>
    <tbody>
      <% @courses.each do |course| %>
        <tr>
          <td><%= link_to course.name, [:admin, course] %></td>
          <td><%= course.description %></td>
          <td class="fit">
            <%= link_to raw('<i class="fa fa-pencil-alt"></i>'), edit_admin_course_path(course), { remote: true, class: 'btn btn-sm btn-info', title: t('edit') } %>
            <%= link_to raw('<i class="fa fa-times"></i>'), [:admin, course], { remote: true, class: 'btn btn-sm btn-danger', method: :delete, data:{ confirm: t('confirm_delete') }, title: t('delete')} %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <%= paginator @courses %>
<% end %>
