akz92/estudeantes

View on GitHub
app/views/periods/index.html.haml

Summary

Maintainability
Test Coverage
=include_gon
= render 'periods/modal'

-if @period && !@period.subjects.empty?
  = render 'periods/modal_edit', period: @period
  .container
    .row
      .col-xs-12
        %br
        /.col-md-7
        #calendar
    = render 'periods/subjectstable', period: @period
-elsif @period
  .container
    = render 'subjects/modal', period: @period
    %div{:style => 'text-align:center;'}
      %h4= 'Agora adicione as disciplinas'
      %button.btn{'data-target' => '#SubjectModalForm', 'data-toggle' => 'modal', :type => 'button'} Adicionar disciplina
-else
  .container
    %div{:style => 'text-align:center;'}
      %h4= 'Comece adicionando um periodo'
      %button.btn{'data-target' => '#PeriodModalForm', 'data-toggle' => 'modal', :type => 'button'} Adicionar periodo