144 lines
No EOL
6.9 KiB
HTML
144 lines
No EOL
6.9 KiB
HTML
<!-- templates/inventory.html -->
|
|
{% extends "layout.html" %}
|
|
|
|
{% block title %}{{ title }}{% endblock %}
|
|
|
|
{% block content %}
|
|
{{ breadcrumbs.breadcrumb_header(
|
|
breadcrumbs=[
|
|
{'label': "Inventory", 'url': url_for('main.list_inventory')}
|
|
],
|
|
title=title,
|
|
submit_button=True) }}
|
|
|
|
<div class="container">
|
|
<form action="POST">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<label for="timestamp" class="form-label">Date Entered</label>
|
|
<input type="date" class="form-control" name="timestamp"
|
|
value="{{ item.timestamp.date().isoformat() }}">
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="identifier" class="form-label">Identifier</label>
|
|
<input type="text" class="form-control-plaintext" value="{{ item.identifier }}" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-4">
|
|
<label for="inventory_name" class="form-label">Inventory #</label>
|
|
<input type="text" class="form-control" name="inventory_name" placeholder="-"
|
|
value="{{ item.inventory_name if item.inventory_name else '' }}">
|
|
</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 '' }}">
|
|
</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 '' }}">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-4">
|
|
<label for="brand" class="form-label">Brand</label>
|
|
<select class="form-select" id="brand">
|
|
<option>-</option>
|
|
{% for brand in brands %}
|
|
<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 }}">
|
|
</div>
|
|
<div class="col-4">
|
|
<label for="type" class="form-label">Category</label>
|
|
<select name="type" id="type" class="form-select">
|
|
<option>-</option>
|
|
{% for t in types %}
|
|
<option value="{{ t.id }}"{% if t.id == item.type_id %} selected{% endif %}>{{ t.description }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-4">
|
|
<label for="owner" class="form-label">
|
|
Contact
|
|
<a href="{{ url_for('main.user', id=item.owner_id) }}"
|
|
class="link-success link-underline-opacity-0">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor"
|
|
class="bi bi-box-arrow-up-right" viewBox="0 0 16 16">
|
|
<path fill-rule="evenodd"
|
|
d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5" />
|
|
<path fill-rule="evenodd"
|
|
d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z" />
|
|
</svg>
|
|
</a>
|
|
</label>
|
|
<select class="form-select" id="userList">
|
|
<option>-</option>
|
|
{% for user in users %}
|
|
<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">
|
|
<option>-</option>
|
|
{% for room in rooms %}
|
|
<option value="{{ room.id }}" {% if room.id==item.location_id %} selected{% endif %}>{{
|
|
room.full_name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-2">
|
|
<label for="condition" class="form-label">Condition</label>
|
|
<select name="condition" id="" class="form-select" value="{{ item.condition }}">
|
|
{% for condition in ["Working", "Deployed", "Partially Inoperable", "Inoperable", "Unverified",
|
|
"Removed", "Disposed"] %}
|
|
<option value="{{ condition }}">{{ 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 %}>
|
|
<label for="shared" class="form-check-label">Shared?</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-{% if worklog %}6{% else %}12{% endif %}">
|
|
<label for="notes" class="form-label">Notes & Comments</label>
|
|
<textarea name="notes" id="notes" class="form-control"
|
|
rows="10">{{ item.notes if item.notes else '' }}</textarea>
|
|
</div>
|
|
{% if worklog %}
|
|
<div class="col-6">
|
|
{{ tables.render_table(worklog_headers, worklog_rows, 'worklog_entry', 'Work Log') }}
|
|
{% if worklog_pagination['total_pages'] > 1 %}
|
|
{{ tables.render_pagination(
|
|
page=worklog_pagination['page'],
|
|
has_prev=worklog_pagination['has_prev'],
|
|
has_next=worklog_pagination['has_next'],
|
|
total_pages=worklog_pagination['total_pages'],
|
|
endpoint='main.inventory_item',
|
|
page_variable='worklog_page',
|
|
extra_args={'id': item.id, 'worklog_page': worklog_page, 'filter_by': filter_by, 'id': id}
|
|
) }}
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %} |