<tbody id="resources-tbody">
  <% if @discipline_teaching_plans.empty? %>
    <tr>
      <td class="no_record_found" colspan="7"><%= t('views.index.no_record_found')%></td>
    </tr>
  <% else %>
    <% @discipline_teaching_plans.each do |discipline_teaching_plan| %>
      <tr>
        <td>
          <% if discipline_teaching_plan.teaching_plan.validated %>
            <i class="fa fa-check-circle-o apply_tooltip_right"
               data-original-title="Plano validado e aprovado"
               style="color: #5A9F58"></i>
          <% end %>
          <%= discipline_teaching_plan.teaching_plan.unity %>
          <% if discipline_teaching_plan.teaching_plan.attachments? %>
            <i class="fa fa-paperclip apply_tooltip" data-original-title="Possui anexos"></i>
          <% end %>
          <% if discipline_teaching_plan.teaching_plan.opinion.present? %>
            <i class="fa fa-comment apply_tooltip" data-original-title="Possui parecer"></i>
          <% end %>
        </td>
        <td><%= discipline_teaching_plan.teaching_plan.grade %></td>
        <td><%= discipline_teaching_plan.discipline %></td>
        <td><%= discipline_teaching_plan.thematic_unit %></td>
        <td><%= discipline_teaching_plan.teaching_plan.school_term_type %></td>
        <td><%= discipline_teaching_plan.teaching_plan.school_term_type_step %></td>
        <td><%= discipline_teaching_plan.teaching_plan.decorator.author(current_teacher) %></td>
        <td class="actions">
          <%= link_to(
                t('helpers.links.show_html'),
                discipline_teaching_plan_path(discipline_teaching_plan),
                class: 'btn btn-info apply_tooltip',
                data: { original_title: t('views.index.tooltips.show') }) %>
          <%= link_to(
                t('helpers.links.print_html'),
                discipline_teaching_plan_path(discipline_teaching_plan, format: :pdf),
                class: 'btn btn-info apply_tooltip',
                target: '_blank',
                data: { original_title: t('views.index.tooltips.print') }) %>
          <% if current_user.can_change?(:copy_discipline_teaching_plan) %>
          <%= link_to(
                t('helpers.links.copy_html'),
                copy_discipline_teaching_plans_path(discipline_teaching_plan),
                class: 'btn btn-info apply_tooltip',
                data: { original_title: t('views.index.tooltips.copy') }) %>
          <% end %>
          <%= link_to(
                t('helpers.links.edit_html'),
                edit_discipline_teaching_plan_path(discipline_teaching_plan),
                class: 'btn btn-success apply_tooltip',
                data: { original_title: t('views.index.tooltips.edit') }) %>
          <%= link_to(
                  t('helpers.links.destroy_html'),
                  discipline_teaching_plan_path(discipline_teaching_plan),
                  class: 'btn btn-danger apply_tooltip',
                  disabled: !teaching_plan_destroy?(discipline_teaching_plan.teaching_plan),
                  method: 'delete',
                  data: {
                    confirm: t('views.index.confirm_deletion'),
                    original_title: t('views.index.tooltips.delete')
                  }
                ) %>
        </td>
      </tr>
    <% end %>
  <% end %>
</tbody>
