fga-gpp-mds/2017.1-Escola-X

View on GitHub
app/views/suspensions/_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_for (@suspension) do |f| %>
<% if @suspension.errors.any? %>
  <div class="container">
    <div class="text-danger text-justify">
      <div id="error_explanation">
        <h2 class=""><%= pluralize(@suspension.errors.count, "erro") %> proibiram este formulario de ser salvo:</h2>
        <ul>
        <% @suspension.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    </div>
  </div>
<% end %>
  <div class="form-group">
    <%= f.label :title, class:"sr-only" %>
    <div class="input-group">
      <span class="input-group-addon">
        <span class="fa fa-user"></span>
         Motivo da Suspensão
      </span>
      <%= f.text_field :title, class:"form-control", placeholder:"Motivo da Suspensão" %>
    </div>
  </div>

  <div class="form-group">
    <%= f.label :quantity_days, class:"sr-only" %>
    <div class="input-group">
      <span class="input-group-addon">
        <span class="fa fa-id-card"></span>
        Quantidade de Dias
      </span>
      <%= f.number_field :quantity_days, class:"form-control"%>
    </div>
  </div>

  <div class="form-group">
    <%= f.label :description, class:"sr-only" %>
    <div class="input-group">
      <span class="input-group-addon">
        <span class="fa fa-sticky-note"></span>
         Descrição da Suspensão
      </span>
      <%= f.text_area :description, class:"form-control", placeholder:"Descrição da Suspensão" %>
    </div>
  </div>

  <div class="form-group">
    <%= f.label :date_suspension, class:"sr-only" %>
    <div class="input-group">
      <span class="input-group-addon">
        <span class="fa fa-calendar"></span>
         Data da Suspensão
      </span>
      <%= f.date_field :date_suspension, class:"form-control", placeholder:"Ex.: dd/mm/aaaa" %>
    </div>
  </div>

  <%= f.button '<span class="fa fa-check"></span> Salvar'.html_safe, type:"submit", class:'btn btn-lg btn-success' %>
<% end %>