2025-01-29 05:27:19 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Add an Item</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h2 align="center">Add new Item</h2>
|
|
|
|
|
2025-02-22 18:58:10 +00:00
|
|
|
<form method="POST">
|
|
|
|
{% for attrib in item_attributes -%}
|
2025-01-29 05:27:19 +00:00
|
|
|
<p>
|
2025-02-22 18:58:10 +00:00
|
|
|
<label for="{{ attrib.attrib_name }}">{{ attrib.display_name }}:</label>
|
|
|
|
{%- if isinstance(attrib, selectAttribute) %}
|
2025-02-06 08:33:13 +00:00
|
|
|
<select
|
2025-02-22 18:58:10 +00:00
|
|
|
id="{{ attrib.attrib_name }}"
|
|
|
|
name="{{ attrib.attrib_name }}"
|
|
|
|
{%- if attrib.required %} required {% endif -%}
|
2025-02-06 08:33:13 +00:00
|
|
|
>
|
2025-02-22 18:58:10 +00:00
|
|
|
{% for option in attrib.options -%}
|
2025-02-06 08:33:13 +00:00
|
|
|
<option value="{{ option }}">{{ option }}</option>
|
|
|
|
{% endfor -%}
|
|
|
|
</select>
|
|
|
|
{% else %}
|
|
|
|
<input
|
2025-02-22 18:58:10 +00:00
|
|
|
id="{{ attrib.attrib_name }}"
|
|
|
|
type="{{ attrib.html_input_type }}"
|
|
|
|
name="{{ attrib.attrib_name }}"
|
|
|
|
{%- if attrib.required %} required {% endif -%}
|
|
|
|
{%- if hasattr(attrib, 'min_val') and attrib.min_val is not none %} min="{{ attrib.min_val }}" {% endif -%}
|
|
|
|
{%- if hasattr(attrib, 'max_val') and attrib.max_val is not none %} max="{{ attrib.max_val }}" {% endif -%}
|
|
|
|
{%- if attrib.default_val is not none %} value="{{ attrib.default_val }}" {% endif -%}
|
2025-02-06 08:33:13 +00:00
|
|
|
/>
|
|
|
|
{% endif -%}
|
2025-01-29 05:27:19 +00:00
|
|
|
</p>
|
2025-02-06 08:33:13 +00:00
|
|
|
{% endfor %}
|
2025-02-22 18:58:10 +00:00
|
|
|
<p><input type="submit" value="Submit" /></p>
|
2025-01-29 05:27:19 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<p align="center">
|
2025-02-06 08:33:13 +00:00
|
|
|
{%- if exc == 'integrity' -%}
|
2025-01-29 10:05:36 +00:00
|
|
|
Item with the same assettag already exists
|
2025-02-06 08:33:13 +00:00
|
|
|
{%- endif -%}
|
|
|
|
{%- if exc == 'status' -%}
|
|
|
|
Data input error. Invalid status value
|
|
|
|
{%- endif -%}
|
|
|
|
{%- if exc == 'staffnum' -%}
|
2025-01-29 10:05:36 +00:00
|
|
|
Data input error. Staff number must be an integer
|
2025-02-06 08:33:13 +00:00
|
|
|
{%- endif -%}
|
2025-01-29 05:27:19 +00:00
|
|
|
</p>
|
|
|
|
</body>
|
2025-02-22 18:58:10 +00:00
|
|
|
</html>
|