-
-
Notifications
You must be signed in to change notification settings - Fork 527
/
Copy pathindex.html.erb
101 lines (99 loc) · 3.59 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<% content_for :title, "Audits - Inventory - #{current_organization.name}" %>
<h1>
Inventory Audits
<small>for <%= current_organization.name %></small>
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><%= link_to(dashboard_path) do %>
<i class="fa fa-dashboard"></i> Home
<% end %>
</li>
<li class="breadcrumb-item"><a href="#">Audits</a></li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- jquery validation -->
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Audit Filters</h3>
</div>
<!-- /.card-header -->
<!-- form start -->
<div class="card-body">
<%= form_tag(audits_path, method: :get) do |f| %>
<div class="row">
<div class="form-group col-lg-3 col-md-4 col-sm-6 col-xs-12">
<%= filter_select(label: "Filter by Storage Location", scope: :at_location, collection: @storage_locations, key: :id, value: :name, selected: @selected_location) %>
</div>
</div>
</div>
<div class="card-footer">
<%= filter_button %>
<%= clear_filter_button %>
<div class="btn-group pull-right">
<%= new_button_to new_audit_path, {text: "New Audit"} %>
</div>
<% end # form %>
</div>
</div>
<!-- /.card -->
</div>
<!--/.col (left) -->
<!-- right column -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
<div class="container-fluid">
<div class="row">
<div class="col-12">
<!-- Default box -->
<div class="card">
<div class="card-body p-0">
<table class="table">
<thead>
<tr>
<th class="text-left">Created</th>
<th class="text-left">Organization</th>
<th class="text-left">Storage location</th>
<th class="text-left">Summary</th>
<th class="text-left">Status</th>
<th class="text-center">Actions</th>
</tr>
</thead>
<tbody>
<% @audits.each do |audit| %>
<tr class="<%= (audit.finalized?) ? 'positive' : (audit.in_progress?) ? 'negative' : 'highlight' %>">
<td class="text-left">
<time datetime="<%= audit.created_at %>"><%= audit.created_at.strftime("%B %e, %Y") %></time>
</td>
<td class="text-left"><%= audit.organization.name %></td>
<td class="text-left"><%= audit.storage_location.name %></td>
<td class="text-left"><%= pluralize(audit.line_items.count, 'item') %></td>
<td class="text-left"><%= audit.status.titleize %></td>
<td class="text-center"><%= view_button_to audit %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<!-- /.card -->
</div>
</div>
</div>
</section>