-
Notifications
You must be signed in to change notification settings - Fork 0
/
locations.html
85 lines (79 loc) · 3.56 KB
/
locations.html
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
{% extends 'base.html' %}
{% block title %}
<title>Inventory Managment App</title>
{% endblock %}
{% block content %}
<main>
<div class="container-fluid">
<h1 class="mt-4">Dashboard</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Dashboard</a></li>
<li class="breadcrumb-item active">Locations</li>
</ol>
<div class="card mb-4">
<div class="card-header">Locations</div>
<div class="card-body">
<div class="card mb-4">
<div class="card-header">New Location</div>
<div class="card-body">
<form action="/locations/" method="POST" id="location_form">
<label for="location_id" class="col-form-label">Location Name</label>
<input type="text" name="location_id" id="location_id">
<label for="location_area" class="col-form-label">Area in sqft</label>
<input type="number" name="location_area" id="location_area">
<input id="submitLocation" value="Add Location" class="btn btn-primary">
</form>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table mr-1"></i>
Locations Table
</div>
<div class="card-body">
<div class="table-responsive">
{% if locations|length < 1 %}
<h4>There are no Locations, add one above</h4>
{% else %}
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Location Name</th>
<th>Area</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
{% for location in locations %}
<tr>
<td>{{ location.location_id }}</td>
<td>{{ location.location_area }}</td>
<td>{{ location.date_created.date() }}</td>
<td>
<a href="/delete-location/{{ location.location_id }}" onclick="return confirmDelete();">Delete</a>
<script>
function confirmDelete() {
if (confirm("Are you sure you want to delete this location?")) {
return true;
} else {
return false;
}
}
</script>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</main>
{% endblock %}