edti dashboard

This commit is contained in:
Sunandar
2017-01-31 11:33:00 +06:30
parent 8085d311ab
commit 58dcf588df
6 changed files with 93 additions and 8 deletions

View File

@@ -14,7 +14,7 @@
<thead>
<tr>
<th>Order Ref</th>
<th>Created By</th>
<th>Created By</th>
<th>Qty Processing</th>
<th>Qty Success</th>
<th>Qty Fail</th>
@@ -26,7 +26,7 @@
<% @batches.each do |batch| %>
<tr>
<td><%= batch.order_ref rescue '' %></td>
<td><%= batch.created_by rescue '' %></td>
<td><%= batch.user_name rescue '' %></td>
<td><%= batch.qty_processing rescue '' %></td>
<td><%= batch.qty_success rescue '' %></td>
<td><%= batch.qty_fail rescue '' %></td>

View File

@@ -1,6 +1,6 @@
<div class="row content">
<div class="card">
<div class="card-header">
<div class="card-header">
<strong>User List</strong>
</div>
<div class="card-block">
@@ -30,5 +30,81 @@
</tbody>
</table>
</div>
</div>
</div>
<div class="row content">
<div class="card">
<div class="card-header"><strong>Latest Batch</strong> </div>
<div class="card-block">
<% if @batches.empty? %>
<p class="center"> <strong>There is no batch created for today.</strong></p>
<% else %>
<table class="table" style="border-top:none">
<thead>
<tr>
<th>Order Ref</th>
<th>Created By</th>
<th>Qty Processing</th>
<th>Qty Success</th>
<th>Qty Fail</th>
<th>Export Count</th>
<th>Creatd At</th>
</tr>
</thead>
<tbody>
<% @batches.each do |batch| %>
<tr>
<td><%= batch.order_ref rescue '' %></td>
<td><%= batch.user_name rescue '' %></td>
<td><%= batch.qty_processing rescue '' %></td>
<td><%= batch.qty_success rescue '' %></td>
<td><%= batch.qty_fail rescue '' %></td>
<td><%= batch.export_count %></td>
<td><%= batch.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</div>
</div>
</div>
<div class="row content">
<div class="card">
<div class="card-header"><strong>Latest Batch Line Item</strong> </div>
<div class="card-block">
<% if @batchLineItems.empty? %>
<p class="center"> <strong>There is no batch line item for today.</strong></p>
<% else %>
<table class="table">
<thead>
<tr>
<th>Serail No</th>
<th>Wristband Code</th>
<th>Manufacture UID</th>
<th>Batch No</th>
<th>Card Type</th>
<th>Created At </th>
<th>Update At </th>
</tr>
</thead>
<tbody>
<% @batchLineItems.each do |item| %>
<tr>
<td><%= item.serial_no rescue '' %></td>
<td><%= item.wristband_code rescue '' %></td>
<td><%= item.manufacture_uid rescue '' %></td>
<td><%= item.batch_name rescue '' %></td>
<td><%= item.card_type rescue '' %></td>
<td><%= item.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
<td><%= item.updated_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<%=paginate @batchLineItems %>
</div>
</div>
</div>

View File

@@ -39,8 +39,8 @@
<td><%= user.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
<td>
<%= link_to 'Detail',
user_path(user), :class => 'btn btn-primary btn-sm ' %>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
user_path(user), :class => 'btn btn-primary btn-sm' %>
<%= link_to 'Edit',
edit_user_path(user), :class => 'btn btn-primary btn-sm' %>
<%= link_to 'Delete', user_path(user), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-primary btn-sm' %>
</td>