Minor fixes.
This commit is contained in:
parent
a87dbc6b81
commit
50573df8d7
6 changed files with 24 additions and 19 deletions
|
@ -2,7 +2,6 @@ import hashlib
|
|||
import os
|
||||
|
||||
from flask import url_for
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
from ..models import Inventory
|
||||
|
||||
|
@ -11,17 +10,16 @@ from ..models.image import ImageAttachable
|
|||
inventory_headers = {
|
||||
"Date Entered": lambda i: {"text": i.timestamp.strftime("%Y-%m-%d") if i.timestamp else None},
|
||||
"Identifier": lambda i: {"text": i.identifier},
|
||||
"Inventory #": lambda i: {"text": i.name},
|
||||
"Serial #": lambda i: {"text": i.serial},
|
||||
"Bar Code #": lambda i: {"text": i.barcode},
|
||||
"Name": lambda i: {"text": i.name},
|
||||
"Serial Number": lambda i: {"text": i.serial},
|
||||
"Bar Code": lambda i: {"text": i.barcode},
|
||||
"Brand": lambda i: {"text": i.brand.name} if i.brand else {"text": None},
|
||||
"Model": lambda i: {"text": i.model},
|
||||
"Item Type": lambda i: {"text": i.item.description} if i.item else {"text": None},
|
||||
"Shared?": lambda i: {"text": i.shared, "type": "bool", "html": checked_box if i.shared else unchecked_box},
|
||||
"Owner": lambda i: {"text": i.owner.full_name, "url": url_for("main.user", id=i.owner.id)} if i.owner else {"text": None},
|
||||
"Location": lambda i: {"text": i.location.full_name} if i.location else {"Text": None},
|
||||
"Condition": lambda i: {"text": i.condition},
|
||||
# "Notes": lambda i: {"text": i.notes}
|
||||
"Condition": lambda i: {"text": i.condition}
|
||||
}
|
||||
|
||||
checked_box = '''
|
||||
|
|
|
@ -37,8 +37,8 @@ def user(id):
|
|||
)
|
||||
|
||||
inventory = inventory_query.all()
|
||||
filtered_inventory_headers = {k: v for k, v in inventory_headers.items() if k not in ['Date Entered', 'Inventory #', 'Serial #',
|
||||
'Bar Code #', 'Condition', 'Owner', 'Notes',
|
||||
filtered_inventory_headers = {k: v for k, v in inventory_headers.items() if k not in ['Date Entered', 'Name', 'Serial Number',
|
||||
'Bar Code', 'Condition', 'Owner', 'Notes',
|
||||
'Brand', 'Model', 'Shared?', 'Location']}
|
||||
worklog_query = eager_load_worklog_relationships(db.session.query(WorkLog)).filter(WorkLog.contact_id == id)
|
||||
worklog = worklog_query.order_by(WorkLog.start_time.desc()).all()
|
||||
|
|
|
@ -36,18 +36,18 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<label for="name" class="form-label">Inventory #</label>
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<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>
|
||||
<label for="serial" class="form-label">Serial Number</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 %}>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label for="barcode" class="form-label">Bar Code #</label>
|
||||
<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 %}>
|
||||
|
@ -161,6 +161,7 @@
|
|||
id = 'updates' + (note.id | string),
|
||||
title = title,
|
||||
content = note.content,
|
||||
mode = 'view',
|
||||
enabled = false
|
||||
) }}
|
||||
</div>
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
|
||||
<link
|
||||
href="https://cdn.datatables.net/v/bs5/jq-3.7.0/moment-2.29.4/dt-2.3.2/b-3.2.3/b-colvis-3.2.3/b-print-3.2.3/cr-2.1.1/cc-1.0.4/r-3.0.4/rg-1.5.1/rr-1.5.0/sc-2.4.3/sr-1.4.1/datatables.min.css"
|
||||
rel="stylesheet" integrity="sha384-gdnBcErvPbrURVoR9w3NhVMliw+ZmcTCmq+64xj2Ksx21nRJFX3qW0zFvBotL5rm"
|
||||
href="https://cdn.datatables.net/v/bs5/jq-3.7.0/moment-2.29.4/jszip-3.10.1/dt-2.3.2/b-3.2.4/b-html5-3.2.4/fh-4.0.3/r-3.0.5/datatables.min.css"
|
||||
rel="stylesheet" integrity="sha384-hSj3bXMT805MYGWJ+03fwhNIuAiFbC0OFMeKgQeB0ndGAdPMSutk5qr9WHSXzHU/"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet"
|
||||
|
@ -27,8 +27,7 @@
|
|||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/widget.css') }}">
|
||||
<style>
|
||||
{% block style %}
|
||||
{% endblock %}
|
||||
{% block style %}{% endblock %}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -68,8 +67,8 @@
|
|||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdn.plot.ly/plotly-3.0.1.min.js" charset="utf-8"></script>
|
||||
<script
|
||||
src="https://cdn.datatables.net/v/bs5/jq-3.7.0/moment-2.29.4/dt-2.3.2/b-3.2.3/b-colvis-3.2.3/b-print-3.2.3/cr-2.1.1/cc-1.0.4/r-3.0.4/rg-1.5.1/rr-1.5.0/sc-2.4.3/sr-1.4.1/datatables.min.js"
|
||||
integrity="sha384-tNYRX2RiDDDRKCJgPF8Pw3rTxC1GUe1pt5qH1SBmwcazrEUj7Ii4C1Tz9wCCRUI4"
|
||||
src="https://cdn.datatables.net/v/bs5/jq-3.7.0/moment-2.29.4/dt-2.3.2/b-3.2.4/r-3.0.5/sc-2.4.3/sp-2.3.3/datatables.min.js"
|
||||
integrity="sha384-zqgMe4cx+N3TuuqXt4kWWDluM5g1CiRwqWBm3vpvY0GcDoXTwU8d17inavaLy3p3"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
|
||||
<script src="{{ url_for('static', filename='js/widget.js') }}"></script>
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
create_button=True
|
||||
) }}
|
||||
|
||||
{#
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-primary">{{ icons.render_icon('box-arrow-in-up', 16) }}</button>
|
||||
<button class="btn btn-primary">{{ icons.render_icon('box-arrow-up', 16) }}</button>
|
||||
</div>
|
||||
#}
|
||||
|
||||
{{ tables.render_table(headers=header, rows=rows, id='table', entry_route=entry_route) }}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -164,8 +164,8 @@
|
|||
complete: document.querySelector("input[name='complete']").checked,
|
||||
analysis: document.querySelector("input[name='analysis']").checked,
|
||||
followup: document.querySelector("input[name='followup']").checked,
|
||||
contact_id: document.querySelector("select[name='contact']").value || null,
|
||||
work_item_id: document.querySelector("select[name='item']").value || null,
|
||||
contact_id: parseInt(document.querySelector("select[name='contact']").value) || null,
|
||||
work_item_id: parseInt(document.querySelector("select[name='item']").value) || null,
|
||||
updates: updates
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue