gamingflexer commited on
Commit
ca2ef86
·
1 Parent(s): 31446a8

Update navigation links and add delete button in product cards

Browse files
src/app/api/templates/catalouge.html CHANGED
@@ -30,7 +30,7 @@
30
  <nav class="navbar navbar-expand-lg navbar-light bg-light">
31
  <div class="container">
32
  <a class="navbar-brand" href="{% url 'index' %}" style="font-weight: bold;">HomePage</a>
33
- <a class="navbar-brand" href="http://34.122.223.224:9003/" style="font-weight: bold;">Database</a>
34
  <a href="{% url 'add_product_by_image' %}" class="btn btn-primary ml-1" style="padding: 0.5rem 1rem; font-size: 1rem;">Add a Product by Image</a>
35
  </div>
36
  </nav>
@@ -58,8 +58,9 @@
58
  <p class="card-text">Description: {{ product.parent_category }}</p>
59
  <p class="card-text">Brand: {{ product.brand }}</p>
60
  <div class="d-flex justify-content-between align-items-center">
61
- <a href="{% url 'product_detail' product.id %}" class="btn btn-primary btn-sm mb-2">View Details</a>
62
  <a href="{% url 'voice_product_detail' product.id %}" class="btn btn-secondary btn-sm mb-2">Voice Edit</a>
 
63
  </div>
64
  </div>
65
  </div>
 
30
  <nav class="navbar navbar-expand-lg navbar-light bg-light">
31
  <div class="container">
32
  <a class="navbar-brand" href="{% url 'index' %}" style="font-weight: bold;">HomePage</a>
33
+ <a href="http://34.122.223.224:9003/" class="btn btn-secondary ml-1" target="_blank" style="font-weight: bold;">Database</a>
34
  <a href="{% url 'add_product_by_image' %}" class="btn btn-primary ml-1" style="padding: 0.5rem 1rem; font-size: 1rem;">Add a Product by Image</a>
35
  </div>
36
  </nav>
 
58
  <p class="card-text">Description: {{ product.parent_category }}</p>
59
  <p class="card-text">Brand: {{ product.brand }}</p>
60
  <div class="d-flex justify-content-between align-items-center">
61
+ <a href="{% url 'product_detail' product.id %}" class="btn btn-primary btn-sm mb-2">View</a>
62
  <a href="{% url 'voice_product_detail' product.id %}" class="btn btn-secondary btn-sm mb-2">Voice Edit</a>
63
+ <a href="{% url 'delete_product_api' product.id %}" class="btn btn-danger btn-sm mb-2">Delete</a>
64
  </div>
65
  </div>
66
  </div>
src/app/api/templates/edit_product.html CHANGED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Edit Product</title>
7
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
8
+ </head>
9
+ <body>
10
+ <header>
11
+ <nav class="navbar navbar-expand-lg navbar-light bg-light">
12
+ <div class="container">
13
+ <a class="navbar-brand" href="{% url 'index' %}">Catalogue</a>
14
+ </div>
15
+ </nav>
16
+ </header>
17
+ <div class="container mt-5">
18
+ <h1 class="text-center">Edit Product</h1>
19
+ <form method="post">
20
+ {% csrf_token %}
21
+ <div class="form-group">
22
+ <label for="barcode">Barcode:</label>
23
+ <input type="text" class="form-control" id="barcode" name="barcode" value="{{ product.barcode }}">
24
+ </div>
25
+ <div class="form-group">
26
+ <label for="brand">Brand:</label>
27
+ <input type="text" class="form-control" id="brand" name="brand" value="{{ product.brand }}">
28
+ </div>
29
+ <div class="form-group">
30
+ <label for="sub_brand">Sub Brand:</label>
31
+ <input type="text" class="form-control" id="sub_brand" name="sub_brand" value="{{ product.sub_brand }}">
32
+ </div>
33
+ <div class="form-group">
34
+ <label for="manufacturer">Manufacturer:</label>
35
+ <input type="text" class="form-control" id="manufacturer" name="manufacturer" value="{{ product.manufacturer }}">
36
+ </div>
37
+ <!-- Add similar form fields for other attributes -->
38
+ <div class="text-center">
39
+ <button type="submit" class="btn btn-primary">Save</button>
40
+ </div>
41
+ </form>
42
+ </div>
43
+ </body>
44
+ </html>