forgotten files for previous commit

This commit is contained in:
Okechi Onyeje 2017-01-20 11:48:10 -05:00
parent 384033bfe6
commit 3f62c9f03c
3 changed files with 173 additions and 162 deletions

View File

@ -89,131 +89,138 @@
<% else %>
<h2 class="sub-header">Recent Results</h2>
<% end %>
<div class="table-responsive">
<div class="table-responsive panel panel-primary">
<table class="table table-striped">
<thead>
<tr>
<% if current_user.admin? %>
<th>Company</th>
<% end %>
<th>Run Date</th>
<th>Location</th>
<th>Harvest Time</th>
<th>Supplier</th>
<th>Distributor</th>
<th>Total Processed</th>
<th>Other</th>
<th>Oyster Info</th>
</tr>
</thead>
<tbody>
<% if current_user.admin? %>
<% @results.each_slice(1) do |row| %>
<tr>
<% row.each do |result|
run = Run.find(result.id)
#company = Company.find(run.company_id)
%>
<!-- company name -->
<td>
<%= #company.company_name
"Fake Industries" %>
</td>
<!-- run date -->
<td>
<%= run.runDate %>
</td>
<!-- location -->
<td>
<%= run.location ? run.location : "" %>
</td>
<!-- harvest time -->
<td>
<%= "" %>
</td>
<!-- supplier -->
<td>
<%= run.supplier ? run.supplier : "" %>
</td>
<!-- distributor -->
<td>
<%= run.distributor ? run.distributor : "" %>
</td>
<!-- total processed -->
<td>
<%= result.total %>
</td>
<!-- other -->
<td>
<%= run.other ? run.other : "" %>
</td>
<% end %>
</tr>
<% end %>
<% else %>
<% @results.each_slice(1) do |row| %>
<tr>
<% row.each do |result|
run = Run.find(result.id) %>
<!-- run date -->
<td>
<%= run.runDate %>
</td>
<!-- location -->
<td>
<%= run.location ? run.location : "" %>
</td>
<!-- harvest time -->
<td>
<%= "" %>
</td>
<!-- supplier -->
<td>
<%= run.supplier ? run.supplier : "" %>
</td>
<!-- distributor -->
<td>
<%= run.distributor ? run.distributor : "" %>
</td>
<!-- total processed -->
<td>
<%= result.total %>
</td>
<!-- other -->
<td>
<%= run.other ? run.other : "" %>
</td>
<td>
<%= link_to "Show", oysters_index_path( :result_id => result.id, :page_num => params[:page]), :class => "btn btn-primary" %>
</td>
<% end %>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<div class="center-block">
<div class="col-sm-6 panel panel-primary" align="center">
<%= paginate @results %><br>
<%= page_entries_info @results %>
<div class="panel-heading">
<thead>
<tr>
<% if current_user.admin? %>
<th>Company</th>
<% end %>
<th>Run Date</th>
<th>Location</th>
<th>Harvest Time</th>
<th>Supplier</th>
<th>Distributor</th>
<th>Total Processed</th>
<th>Other</th>
<th>Oyster Info</th>
</tr>
</thead>
</div>
</div>
<div class="panel-body">
<tbody>
<% if current_user.admin? %>
<% @results.each_slice(1) do |row| %>
<tr>
<% row.each do |result|
run = Run.find(result.id)
#company = Company.find(run.company_id)
%>
<!-- company name -->
<td>
<%= #company.company_name
"Fake Industries" %>
</td>
<!-- run date -->
<td>
<%= run.runDate %>
</td>
<!-- location -->
<td>
<%= run.location ? run.location : "" %>
</td>
<!-- harvest time -->
<td>
<%= "" %>
</td>
<!-- supplier -->
<td>
<%= run.supplier ? run.supplier : "" %>
</td>
<!-- distributor -->
<td>
<%= run.distributor ? run.distributor : "" %>
</td>
<!-- total processed -->
<td>
<%= result.total %>
</td>
<!-- other -->
<td>
<%= run.other ? run.other : "" %>
</td>
<td>
<%= link_to "Show", oysters_index_path( :result_id => result.id, :page_num => params[:page]), :class => "btn btn-primary" %>
</td>
<% end %>
</tr>
<% end %>
<% else %>
<% @results.each_slice(1) do |row| %>
<tr>
<% row.each do |result|
run = Run.find(result.id) %>
<!-- run date -->
<td>
<%= run.runDate %>
</td>
<!-- location -->
<td>
<%= run.location ? run.location : "" %>
</td>
<!-- harvest time -->
<td>
<%= "" %>
</td>
<!-- supplier -->
<td>
<%= run.supplier ? run.supplier : "" %>
</td>
<!-- distributor -->
<td>
<%= run.distributor ? run.distributor : "" %>
</td>
<!-- total processed -->
<td>
<%= result.total %>
</td>
<!-- other -->
<td>
<%= run.other ? run.other : "" %>
</td>
<td>
<%= link_to "Show", oysters_index_path( :result_id => result.id, :page_num => params[:page]), :class => "btn btn-primary" %>
</td>
<% end %>
</tr>
<% end %>
<% end %>
</tbody>
</div>
</table>
</div>
<div class="center-block">
<div class="col-sm-6 col-sm-offset-3 panel panel-primary" align="center">
<%= paginate @results %></br>
<%= page_entries_info @results %>
</div>
</div>
</div>
</div>

View File

@ -16,7 +16,7 @@
<body>
<%= yield %>
<%= debug(params) if Rails.env.development? %>
<!-- <%= debug(params) if Rails.env.development? %> -->
</body>
</html>

View File

@ -68,54 +68,58 @@
<% else %>
<div class="panel panel-primary table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Oyster Grade</th>
<th>Volume</th>
<th>Length</th>
<th>Width</th>
<th>Height</th>
</tr>
</thead>
<tbody>
<% @oysters.each_slice(1) do |row| %>
<tr>
<% row.each do |oyster|%>
<div class="panel-heading">
<thead>
<tr>
<th>Oyster Grade</th>
<th>Volume</th>
<th>Length</th>
<th>Width</th>
<th>Height</th>
</tr>
</thead>
</div>
<div class="panel-body">
<tbody>
<% @oysters.each_slice(1) do |row| %>
<tr>
<% row.each do |oyster|%>
<!-- grade -->
<td>
<%= oyster.grade %>
</td>
<!-- grade -->
<td>
<%= oyster.grade %>
</td>
<!-- volume -->
<td>
<%= oyster.volume %>
</td>
<!-- volume -->
<td>
<%= oyster.volume %>
</td>
<!-- length -->
<td>
<%= oyster.length %>
</td>
<!-- length -->
<td>
<%= oyster.length %>
</td>
<!-- width -->
<td>
<%= oyster.width %>
</td>
<!-- width -->
<td>
<%= oyster.width %>
</td>
<!-- height -->
<td>
<%= oyster.height %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
<!-- height -->
<td>
<%= oyster.height %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</div>
</table>
</div>
<% end %>
<% if !@oysters.empty? %>
<div class="center-block">
<div class="col-sm-6 panel panel-primary" align="center">
<div class="col-sm-6 col-sm-offset-3 panel panel-primary" align="center">
<%= paginate @oysters %><br>
<%= page_entries_info @oysters %>
</div>