<%= stylesheet_link_tag "dashboard" %>_
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/">Pearlception</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <!-- <li><a href="#">Dashboard</a></li> -->
            <!-- <li><a href="#">Settings</a></li>
            <li><a href="#">Profile</a></li>
            <li><a href="#">Help</a></li> -->
            <li>
                <%= link_to(destroy_user_session_path, class: 'logout-link', :method => :delete) do %>
                <i class="fa fa-external-link"></i> Logout
                <% end %>
            </li>
          </ul>
          <!-- <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form> -->
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li><a href="/">Overview</a></li>
            <!-- This will be removed and placed with correct logic in corresponding controller -->
            <% if current_user.admin? %>
                <li><a href="companies#index">Companies</a></li>
            <% else %>
                <li class="active"><a href="grades#index">Grades <span class="sr-only">(current)</span></a></li>
              <!-- <li><a>Reports</a></li>
              <li><a>Analytics</a></li>
              <li><a>Export</a></li> -->
            <% end %>
          </ul>
          <!-- <ul class="nav nav-sidebar">
            <li><a href="">Nav item</a></li>
            <li><a href="">Nav item again</a></li>
            <li><a href="">One more nav</a></li>
            <li><a href="">Another nav item</a></li>
            <li><a href="">More navigation</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="">Nav item again</a></li>
            <li><a href="">One more nav</a></li>
            <li><a href="">Another nav item</a></li>
          </ul> -->
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h1 class="page-header">Grades</h1>
          <h2 class="sub-header">Total Grades: <%= @grades.count %> </h2>
          <div class="panel panel-primary table-responsive">
              <%= link_to(new_grade_path, :method => :get) do %>
              <i class="fa fa-external-link"></i> Add a New Grade
              <% end %>
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>Grade Name</th>
                  <th>Min Volume</th>
                  <th>Max Volume</th>
                  <th>Min Length</th>
                  <th>Max Length</th>
                  <th>Min Width</th>
                  <th>Max Width</th>
                  <th>Min Height</th>
                  <th>Max Height</th>
                </tr>
              </thead>
                  <% if @grades.empty? %>
                    </table>
                    <div class="panel panel-primary">
                        <p>No Grades Recorded.</p>
                    </div>
                    <% else %>
                        <tbody>
                          <% @grades.each_slice(1) do |row| %>
                                     <tr>
                                         <% row.each do |grade|%>

                                             <!-- grade_name -->
                                             <td>
                                                 <%= grade.Full_name %>
                                             </td>

                                             <!-- volume min -->
                                             <td>
                                                 <%= grade.Volume_min %>
                                             </td>

                                             <!-- volume max -->
                                             <td>
                                                 <%= grade.Volume_max %>
                                             </td>

                                             <!-- length min -->
                                             <td>
                                                 <%= grade.Length_min %>
                                             </td>

                                             <!-- length max -->
                                             <td>
                                                 <%= grade.Length_max %>
                                             </td>

                                             <!-- width min -->
                                             <td>
                                                 <%= grade.Width_min %>
                                             </td>

                                             <!-- width max -->
                                             <td>
                                                 <%= grade.Width_max %>
                                             </td>

                                             <!-- height min -->
                                             <td>
                                                 <%= grade.Height_min %>
                                             </td>

                                             <!-- height max -->
                                             <td>
                                                 <%= grade.Height_max %>
                                             </td>
                                         <% end %>
                                     </tr>
                                   <% end %>
                        </tbody>
                    </table>
                  <% end %>
          </div>
        </div>
      </div>
    </div>
    <%= javascript_include_tag "bootstrap.min" %>_
</body>
