2025-01-29 05:27:19 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>View Inventory</title>
|
|
|
|
</head>
|
|
|
|
<body align="center">
|
|
|
|
<h2>Item Inventory</h2>
|
|
|
|
|
|
|
|
<table border="1" align="center">
|
|
|
|
<tr>
|
2025-02-11 07:47:57 +00:00
|
|
|
<!-- Table headers -->
|
2025-02-11 05:38:27 +00:00
|
|
|
{% for attrib, config in item_attributes.items() %}
|
|
|
|
<th>{{ config.display_name }}</th>
|
|
|
|
{% endfor %}
|
|
|
|
<th colspan="2">Actions</th>
|
2025-01-29 05:27:19 +00:00
|
|
|
</tr>
|
2025-02-11 05:38:27 +00:00
|
|
|
|
2025-02-11 07:47:57 +00:00
|
|
|
<!-- Table rows -->
|
2025-02-11 05:38:27 +00:00
|
|
|
{% for item in items %}
|
2025-01-29 05:27:19 +00:00
|
|
|
<tr>
|
2025-02-11 05:38:27 +00:00
|
|
|
{% for attrib, config in item_attributes.items() %}
|
|
|
|
<td>{{ item[attrib] }}</td>
|
|
|
|
{% endfor %}
|
2025-01-29 05:27:19 +00:00
|
|
|
<td>
|
2025-02-11 05:38:27 +00:00
|
|
|
<form action="/update/{{ item[primary_attrib] }}" method="get">
|
2025-01-29 05:27:19 +00:00
|
|
|
<button type="submit">Edit</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
<td>
|
2025-02-11 05:38:27 +00:00
|
|
|
<form action="/delete/{{ item[primary_attrib] }}" method="get">
|
2025-01-29 05:27:19 +00:00
|
|
|
<button type="submit">Delete</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2025-02-11 05:38:27 +00:00
|
|
|
{% endfor %}
|
2025-01-29 05:27:19 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<form action="/create" method="get">
|
|
|
|
<button type="submit">Add new Item</button>
|
|
|
|
</form>
|
2025-01-30 07:37:21 +00:00
|
|
|
<form action="/uploadcsv" method="get">
|
|
|
|
<button type="submit">Import from CSV</button>
|
|
|
|
</form>
|
2025-02-11 07:47:57 +00:00
|
|
|
<form action="/export_csv" method="POST">
|
2025-01-29 05:27:19 +00:00
|
|
|
<button type="submit">Export Data</button>
|
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|