flask_crud_app/templates/create.html

59 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Add an 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">Add new Item</h2>
<form method = "POST">
<p>
<label for="assettag">Asset Tag:</label>
<input id="assettag" type = "text" name = "assettag" required/>
</p>
<p>
<label for="hostname">Host Name:</label>
<input id="hostname" type = "text" name = "hostname" required/>
</p>
<p>
<label for="warrantyfrom">Warranty From:</label>
<input id="warrantyfrom" type = "text" name = "warrantyfrom" required/>
</p>
<p>
<label for="status">Status:</label>
<input id="status" type = "integer" name = "status" required/>
</p>
<p>
<label for="staffnum">Staff No.:</label>
<input id="staffnum" type = "integer" name = "staffnum" required/>
</p>
<p><input type = "submit" value = "Submit" /></p>
</form>
<p align="center">
{% if exc == 'integrity' %}
Item with the same assettag already exists
{% endif %}
{% if exc == 'status' %}
Data input error. Price must have a numeric value
{% endif %}
{% if exc == 'staffnum' %}
Data input error. Staff number must be an integer
{% endif %}
</p>
</body>
</html>