-
Notifications
You must be signed in to change notification settings - Fork 1
/
products.html
54 lines (53 loc) · 1.79 KB
/
products.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
{% extends 'partials/base.html' %}
{% block title %}Products Page{% endblock %}
{% load crispy_forms_tags %}
{% block content %}
{% include 'partials/topside.html' %}
<div class="row my-4">
<div class="col-md-4">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">
{{ message }}
</div>
{% endfor %}
{% endif %}
<div class="card card-body">
<h5>Add New Products</h5>
<hr>
<form method="POST">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-success btn-block" type="submit" value="Add">
</form>
</div>
</div>
<div class="col-md-8">
<table class="table bg-white">
<thead class="bg-info text-white">
<tr>
<th scope="col">Name</th>
<th scope="col">Category</th>
<th scope="col">Quantity</th>
<th scope="col">Activity</th>
</tr>
</thead>
<tbody>
{% for product in product %}
<tr>
<td>{{ product.name }}</td>
<td>{{ product.category }}</td>
<td>{{ product.quantity }}</td>
<td>
<a class="btn btn-info btn-sm mr-2"
href="{% url 'dashboard-products-edit' product.id %}">Edit</a>
<a class="btn btn-danger btn-sm ml-2"
href="{% url 'dashboard-products-delete' product.id %}">Delete</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}