<tbody id="resources-tbody">
  <% if @discipline_lesson_plans.empty? %>
    <tr>
      <td class="no_record_found" colspan="7"><%= t('views.index.no_record_found')%></td>
    </tr>
  <% else %>
    <% @discipline_lesson_plans.each do |discipline_lesson_plan| %>
      <tr>
        <td>
          <% if discipline_lesson_plan.lesson_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_lesson_plan.lesson_plan.unity %>
          <% if discipline_lesson_plan.lesson_plan.attachments? %>
            <i class="fa fa-paperclip apply_tooltip" data-original-title="Possui anexos"></i>
          <% end %>
          <% if discipline_lesson_plan.lesson_plan.opinion.present? %>
            <i class="fa fa-comment apply_tooltip" data-original-title="Possui parecer"></i>
          <% end %>
        </td>
        <td class="classroom"><%= discipline_lesson_plan.lesson_plan.classroom %></td>
        <td class="discipline"><%= discipline_lesson_plan.discipline %></td>
        <td class="start_at"><%= l(discipline_lesson_plan.lesson_plan.start_at) %></td>
        <td class="end_at" ><%= l(discipline_lesson_plan.lesson_plan.end_at) %></td>
        <td><%= discipline_lesson_plan.lesson_plan.decorator.author(current_teacher) %></td>
        <td class="actions">
          <%= link_to(
                t('helpers.links.copy_html'),
                '#',
                class: 'btn btn-primary apply_tooltip open_copy_modal',
                data: { original_title: t('views.index.tooltips.copy'),
                        discipline_lesson_plan_id: discipline_lesson_plan.id,
                        discipline_id: discipline_lesson_plan.discipline_id,
                        classroom_id: discipline_lesson_plan.classroom.id,
                        grade_id: (
                          unless GeneralConfiguration.current.allows_copy_lesson_plans_to_other_grades
                            discipline_lesson_plan.classroom.grade_ids
                          end
                        )
                      }) %>
          <%= link_to(
                t('helpers.links.show_html'),
                discipline_lesson_plan_path(discipline_lesson_plan),
                class: 'btn btn-info apply_tooltip',
                data: { original_title: t('views.index.tooltips.show') }) %>
          <%= link_to(
                t('helpers.links.print_html'),
                print_discipline_lesson_plans_path(id: discipline_lesson_plan),
                class: 'btn btn-info apply_tooltip',
                target: '_blank',
                data: { original_title: t('views.index.tooltips.print') }) %>
          <%= link_to(
                t('helpers.links.edit_html'),
                edit_discipline_lesson_plan_path(discipline_lesson_plan),
                class: 'btn btn-success apply_tooltip',
                data: { original_title: t('views.index.tooltips.edit') }
              ) %>
          <%= link_to(
                  t('helpers.links.destroy_html'),
                  discipline_lesson_plan_path(discipline_lesson_plan),
                  class: 'btn btn-danger apply_tooltip',
                  disabled: !lesson_plan_destroy?(discipline_lesson_plan.lesson_plan),
                  method: 'delete',
                  data: {
                    confirm: t('views.index.confirm'),
                    original_title: t('views.index.tooltips.delete')
                  }
                ) %>
        </td>
      </tr>
    <% end %>
  <% end %>
</tbody>
