mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 11:47:41 +00:00
- set up index route to show osyters of a specific result - set up index view, controller method, and route - commented out debug console
223 lines
9.0 KiB
Plaintext
223 lines
9.0 KiB
Plaintext
<%= 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 class="active"><a href="/">Overview <span class="sr-only">(current)</span></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><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">Pearlception Dashboard</h1>
|
|
|
|
<!-- <div class="row placeholders">
|
|
<div class="col-xs-6 col-sm-3 placeholder">
|
|
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
|
|
<h4>Label</h4>
|
|
<span class="text-muted">Something else</span>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 placeholder">
|
|
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
|
|
<h4>Label</h4>
|
|
<span class="text-muted">Something else</span>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 placeholder">
|
|
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
|
|
<h4>Label</h4>
|
|
<span class="text-muted">Something else</span>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 placeholder">
|
|
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
|
|
<h4>Label</h4>
|
|
<span class="text-muted">Something else</span>
|
|
</div>
|
|
</div> -->
|
|
|
|
<% 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">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<%= javascript_include_tag "bootstrap.min" %>_
|
|
</body>
|