Make the layout for inventory more pleasant.

This commit is contained in:
Yaro Kasear 2025-07-14 09:59:19 -05:00
parent c2d75ee725
commit 28f541fcb6

View file

@ -21,54 +21,61 @@
<input type="hidden" id="inventoryId" value="{{ item.id }}">
<div class="container">
<div class="row">
<div class="col">
<div class="row align-items-center">
<div class="col">
<label for="timestamp" class="form-label">Date Entered</label>
<input type="date" class="form-control-plaintext" name="timestamp" value="{{ item.timestamp.date().isoformat() }}" readonly>
<input type="date" class="form-control-plaintext" name="timestamp"
value="{{ item.timestamp.date().isoformat() }}" readonly>
</div>
<div class="col">
<label for="identifier" class="form-label">Identifier</label>
<input type="text" class="form-control-plaintext" value="{{ item.identifier }}" readonly>
</div>
<div class="col">
{{ images.render_image(item.id, item.image, enabled = item.condition not in ["Removed", "Disposed"]) }}
</div>
</div>
<div class="row">
<div class="col-4">
<label for="name" class="form-label">Inventory #</label>
<input type="text" class="form-control" name="name" placeholder="-"
value="{{ item.name or '' }}"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<input type="text" class="form-control" name="name" placeholder="-" value="{{ item.name or '' }}" {%
if item.condition in ["Removed", "Disposed" ] %} disabled{% endif %}>
</div>
<div class="col-4">
<label for="serial" class="form-label">Serial #</label>
<input type="text" class="form-control" name="serial" placeholder="-"
value="{{ item.serial if item.serial else '' }}"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
value="{{ item.serial if item.serial else '' }}" {% if item.condition in ["Removed", "Disposed"
] %} disabled{% endif %}>
</div>
<div class="col-4">
<label for="barcode" class="form-label">Bar Code #</label>
<input type="text" class="form-control" name="barcode" placeholder="-"
value="{{ item.barcode if item.barcode else '' }}"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
value="{{ item.barcode if item.barcode else '' }}" {% if item.condition in
["Removed", "Disposed" ] %} disabled{% endif %}>
</div>
</div>
<div class="row">
<div class="col-4">
<label for="brand" class="form-label">Brand</label>
<select class="form-select" id="brand" name="brand"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<select class="form-select" id="brand" name="brand" {% if item.condition in ["Removed", "Disposed" ]
%} disabled{% endif %}>
<option>-</option>
{% for brand in brands %}
<option value="{{ brand.id }}" {% if brand.id==item.brand_id %} selected{% endif %}>{{ brand.name }}
<option value="{{ brand.id }}" {% if brand.id==item.brand_id %} selected{% endif %}>{{
brand.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-4">
<label for="model" class="form-label">Model</label>
<input type="text" class="form-control" name="model" placeholder="-" value="{{ item.model if item.model else '' }}"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<input type="text" class="form-control" name="model" placeholder="-"
value="{{ item.model if item.model else '' }}" {% if item.condition in ["Removed", "Disposed" ]
%} disabled{% endif %}>
</div>
<div class="col-4">
<label for="type" class="form-label">Category</label>
<select name="type" id="type" class="form-select"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<select name="type" id="type" class="form-select" {% if item.condition in ["Removed", "Disposed" ]
%} disabled{% endif %}>
<option>-</option>
{% for t in types %}
<option value="{{ t.id }}" {% if t.id==item.type_id %} selected{% endif %}>{{ t.description }}
@ -85,17 +92,20 @@
{{ links.entry_link('user', item.owner_id) }}
{% endif %}
</label>
<select class="form-select" id="userList"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<select class="form-select" id="userList" {% if item.condition in ["Removed", "Disposed" ] %}
disabled{% endif %}>
<option>-</option>
{% for user in users %}
<option value="{{ user.id }}" {% if user.id==item.owner_id %} selected{% endif %}>{{ user.full_name
<option value="{{ user.id }}" {% if user.id==item.owner_id %} selected{% endif %}>{{
user.full_name
}}</option>
{% endfor %}
</select>
</div>
<div class="col-4">
<label for="location" class="form-label">Location</label>
<select class="form-select" id="room"{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<select class="form-select" id="room" {% if item.condition in ["Removed", "Disposed" ] %} disabled{%
endif %}>
<option>-</option>
{% for room in rooms %}
<option value="{{ room.id }}" {% if room.id==item.location_id %} selected{% endif %}>{{
@ -109,19 +119,27 @@
<option>-</option>
{% for condition in ["Working", "Deployed", "Partially Inoperable", "Inoperable", "Unverified",
"Removed", "Disposed"] %}
<option value="{{ condition }}" {% if item.condition==condition %} selected{% endif %}>{{ condition }}
<option value="{{ condition }}" {% if item.condition==condition %} selected{% endif %}>{{
condition }}
</option>
{% endfor %}
</select>
</div>
<div class="col-2 d-flex align-items-center justify-content-center" style="margin-top: 1.9rem;">
<div class="form-check mb-0">
<input type="checkbox" class="form-check-input" id="shared" name="shared" {% if item.shared %}checked{%
endif %}{% if item.condition in ["Removed", "Disposed"] %} disabled{% endif %}>
<input type="checkbox" class="form-check-input" id="shared" name="shared" {% if item.shared
%}checked{% endif %}{% if item.condition in ["Removed", "Disposed" ] %} disabled{% endif %}>
<label for="shared" class="form-check-label">Shared?</label>
</div>
</div>
</div>
</div>
{% if item.image or item.condition not in ["Removed", "Disposed"] %}
<div class="col">
{{ images.render_image(item.id, item.image, enabled = item.condition not in ["Removed", "Disposed"]) }}
</div>
{% endif %}
</div>
<div class="row">
<div class="col p-3">
{{ editor.render_editor(