mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 19:57:41 +00:00
Changed Index title of dashboard for admins
This commit is contained in:
parent
82876d7e4d
commit
ace1290a76
@ -84,11 +84,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<h2 class="sub-header">Recent Results</h2>
|
<% if current_user.admin? %>
|
||||||
|
<h2 class="sub-header">Recent Results From All Companies</h2>
|
||||||
|
<% else %>
|
||||||
|
<h2 class="sub-header">Recent Results</h2>
|
||||||
|
<% end %>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<% if current_user.admin? %>
|
||||||
|
<th>Company</th>
|
||||||
|
<% end %>
|
||||||
<th>Run Date</th>
|
<th>Run Date</th>
|
||||||
<th>Location</th>
|
<th>Location</th>
|
||||||
<th>Harvest Time</th>
|
<th>Harvest Time</th>
|
||||||
@ -99,6 +106,59 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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| %>
|
<% @results.each_slice(1) do |row| %>
|
||||||
<tr>
|
<tr>
|
||||||
<% row.each do |result|
|
<% row.each do |result|
|
||||||
@ -141,6 +201,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="center-block">
|
<div class="center-block">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user