flask_crud_app/templates/viewList.html

50 lines
1.4 KiB
HTML
Raw Normal View History

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 -->
{% 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 07:47:57 +00:00
<!-- Table rows -->
{% for item in items %}
2025-01-29 05:27:19 +00:00
<tr>
{% for attrib, config in item_attributes.items() %}
<td>{{ item[attrib] }}</td>
{% endfor %}
2025-01-29 05:27:19 +00:00
<td>
<form action="/update/{{ item[primary_attrib] }}" method="get">
2025-01-29 05:27:19 +00:00
<button type="submit">Edit</button>
</form>
</td>
<td>
<form action="/delete/{{ item[primary_attrib] }}" method="get">
2025-01-29 05:27:19 +00:00
<button type="submit">Delete</button>
</form>
</td>
</tr>
{% 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>