fga-gpp-mds/2017.1-Escola-X

View on GitHub
app/views/alumns/report.html.erb

Summary

Maintainability
Test Coverage
<div class="container">
  <h1 class="text-uppercase"><%= @alumn.name %></h1>
  <h2>Responsável: <%= @alumn.parent.name %></h2>
  <h3>Matrícula: <%= @alumn.registry %></h3>
  <h3>Ano e turma: <%= @alumn.classroom.classroom_grade.name_classroom_grade %> <%= @alumn.classroom.name_classroom %></h3>
  <div class="table-responsive">
    <table class="table table-striped table-hover table-bordered">
      <thead>
        <tr class="active">
          <th class="text-center">
            Matéria
          </th>
          <th class="text-center">
            1º Bi
          </th>
          <th class="text-center">
            2º Bi
          </th>
          <th class="text-center">
            3º Bi
          </th>
          <th class="text-center">
            4º Bi
          </th>
          <th class="text-center">
            Nota Final
          </th>
        </tr>
      </thead>
      <tbody>

        <%@alumn.subjects.each do |subject|%>
        <tr><td class="text-center"><%=subject.name_subject%></td>
            <%subject.grades.where(alumn_id: @alumn.id).each do |grade|%>
            <td class="text-center"><%=grade.grade_01%></td>
            <td class="text-center"><%=grade.grade_02%></td>
            <td class="text-center"><%=grade.grade_03%></td>
            <td class="text-center"><%=grade.grade_04%></td>
            <td class="text-center"><%=grade.grade_final%></td>
            <%end%>
        </tr>
        <%end%>
      </tbody>
    </table>

  </div>
  <div>
    <hr>
    <h4>Faltas no período: <%= @alumn.school_misses.count %></h4>
    <hr>
    <h4>Advertência(s):</h4>
    <% @alumn.strikes.each do |adv| %>
      <ul>
        <li><%=adv.date_strike.day %>/<%=adv.date_strike.month %>/<%=adv.date_strike.year%> - <%=adv.description_strike %></li>
      </ul>
    <% end %>
    <hr>
      <h4>Suspensões:</h4>
    <% @alumn.suspensions.each do |sus| %>
      <ul>
        <li><%=sus.date_suspension.day %>/<%=sus.date_suspension.month %>/<%=sus.date_suspension.year%> - <%=sus.title %></li>
      </ul>
    <% end %>
    <hr>
    <h4>Data: <%=DateTime.now.day %>/<%=DateTime.now.month %>/<%=DateTime.now.year%></h4>
  </div>
  <h6 class="text-muted text-right">Obs.: Este relatório não é um documento oficial.</h6>
</div>