fga-gpp-mds/2017.1-Escola-X

View on GitHub
app/views/principal/edit.html.erb

Summary

Maintainability
Test Coverage
<nav class="navbar navbar-default navbar-fixed-top navbar-style">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#coll-nav" aria-expanded="false">
        <span class="fa fa-angle-down"></span>
      </button>
      <% if is_alumn? %>
        <%= link_to image_tag("Logo_Escola_X_50x50.png", :alt => "logo"), alumn_path(@current_user) %>
      <% elsif is_parent? %>
        <%= link_to image_tag("Logo_Escola_X_50x50.png", :alt => "logo"), alumns_path %>
      <% elsif is_teacher? %>
        <%= link_to image_tag("Logo_Escola_X_50x50.png", :alt => "logo"), teacher_path(@current_user) %>
      <% else %>
        <%= link_to image_tag("Logo_Escola_X_50x50.png", :alt => "logo"), users_path %>
      <% end %>
    </div>
    <div class="collapse navbar-collapse" id="coll-nav">
      <ul class="nav navbar-nav">
          <% if is_teacher? %>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-hospopup="true" aria-expanded="false">
                <span class="fa fa-plus"></span> Criar
              </a>
              <ul class="dropdown-menu">
                <li><%= link_to '<span class="fa fa-paper-plane-o"></span> Criar Notificação'.html_safe, new_notification_path %></li>
              </ul>
            </li>
          <%end%>
          <% if is_principal? %>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-hospopup="true" aria-expanded="false">
                <span class="fa fa-plus"></span> Criar
              </a>
              <ul class="dropdown-menu">
                <li><%=link_to '<span class="fa fa-book"></span> Criar Matéria'.html_safe, subjects_path %></li>
                <%if is_principal? %>
                  <li><%= link_to '<span class="fa fa-user-plus"></span> Criar Responsável e Aluno'.html_safe, new_parent_path %></li>
                  <li><%= link_to '<span class="fa fa-user-circle-o"></span> Criar Secretário'.html_safe, new_secretary_path %></li>
                  <li><%= link_to '<span class="fa fa-user-plus"></span> Criar Professor'.html_safe, new_teacher_path %></li>
                  <li><%= link_to '<span class="fa fa-users"></span> Criar Turma'.html_safe, new_classroom_path %></li>
                  <li><%= link_to '<span class="fa fa-paper-plane-o"></span> Criar Notificação'.html_safe, new_notification_path %></li>
                <% end %>
              </ul>
            </li>
          <% end %>
        <%if is_principal? or is_secretary? %>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-hospopup="true" aria-expanded="false">
              <span class="fa fa-search"></span> Visualizar
            </a>
            <ul class="dropdown-menu">
              <% if is_principal? %>
                <li><%= link_to '<span class="fa fa-user-circle-o"></span> Secretários'.html_safe, secretaries_path %></li>
                <li><%=link_to '<span class="fa fa-book"></span> Matéria'.html_safe, subjects_path %></li>
              <% end %>
              <li><%= link_to '<span class="fa fa-users"></span> Turmas'.html_safe, classrooms_path %></li>
              <li><%= link_to '<span class="fa fa-user"></span> Alunos'.html_safe, alumns_path %></li>
              <li><%= link_to '<span class="fa fa-user-circle"></span> Responsáveis'.html_safe, parents_path %></li>
            </ul>
          </li>
        <% end %>
        <li><%=link_to '<span class="fa fa-sticky-note-o"></span> Avisos'.html_safe, notifications_path %></li>
        <li><%=link_to '<span class="fa fa-sign-out"></span> Sair'.html_safe, logout_path %></li>
      </ul>
    </div>
  </div>
</nav>

<section class="content-section" id="create">
  <div class="container">
    <div class="row">
      <div class="col-xs-12">
        <h1 class="text-uppercase text-center">
          <span class="fa fa-edit"></span> editar diretor
        </h1>
        <%= render 'principal/form' %>
      </div>
    </div>
  </div>
</section>