flask_crud_app/templates/update.html

59 lines
1.8 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>Update Item</title>
</head>
<style>
form { display: table; margin: 0 auto;}
form p { display: table-row; }
label { display: table-cell; }
input { display: table-cell; }
</style>
<body>
<div align="center">
<a href="/create">Add</a> |
<a href="/view">View</a>
</div>
<h2 align="center">Update Item</h2>
<form action='' method = "POST">
<p>
2025-01-29 10:38:32 +00:00
<label for="assettag">Asset Tag:</label>
2025-01-29 10:05:36 +00:00
<input id="assettag" type = "text" name = "assettag" value="{{item.assettag}}" required/>
2025-01-29 05:27:19 +00:00
</p>
<p>
2025-01-29 10:38:32 +00:00
<label for="hostname">Host Name:</label>
2025-01-29 10:05:36 +00:00
<input id="hostname" type = "text" name = "hostname" value="{{item.hostname}}" required/>
2025-01-29 05:27:19 +00:00
</p>
<p>
2025-01-29 10:38:32 +00:00
<label for="warrantyfrom">Warranty From:</label>
2025-02-04 19:40:56 +00:00
<input id="warrantyfrom" type = "date" name = "warrantyfrom" value="{{item.warrantyfrom}}" required/>
2025-01-29 05:27:19 +00:00
</p>
<p>
2025-01-29 10:38:32 +00:00
<label for="status">Status:</label>
2025-01-29 10:05:36 +00:00
<input id="status" type = "integer" name = "status" value="{{item.status}}" required/>
2025-01-29 05:27:19 +00:00
</p>
<p>
2025-01-29 10:38:32 +00:00
<label for="staffnum">Staff No:</label>
2025-01-29 10:05:36 +00:00
<input id="staffnum" type = "integer" name = "staffnum" value="{{item.staffnum}}" required/>
2025-01-29 05:27:19 +00:00
</p>
<p>
<input type = "submit" value = "Update" />
</p>
</form>
<p align="center">
{% if exc == 'integrity' %}
Item with such SKU already exists
{% endif %}
2025-01-29 10:05:36 +00:00
{% if exc == 'status' %}
2025-02-01 22:15:46 +00:00
Data input error. Invalid value for <b>status</b>.
2025-01-29 05:27:19 +00:00
{% endif %}
2025-01-29 10:05:36 +00:00
{% if exc == 'staffnum' %}
Data input error. Staff number must be an integer
2025-01-29 05:27:19 +00:00
{% endif %}
</p>
</body>
</html>