Add worklog form fields and enhance templates for better data handling
- Introduced worklog form fields for start and end timestamps, contact, work item, completion status, follow-up, analysis, and notes. - Updated worklog.html to include a save button and improved layout. - Enhanced datalist.js for dynamic data binding between input fields and datalists. - Refactored inventory.html and user.html for consistency and readability. - Added form.html template for future use.
This commit is contained in:
parent
189f73b7c2
commit
795b23fbae
8 changed files with 265 additions and 172 deletions
|
@ -7,54 +7,102 @@
|
|||
|
||||
{% block content %}
|
||||
<nav>
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ url_for('index') }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-house" viewBox="0 0 16 16">
|
||||
<path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z"/>
|
||||
</svg>
|
||||
</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ url_for('main.list_worklog') }}">Work Log</a></li>
|
||||
<li class="breadcrumb-item active">{{ title }}</li>
|
||||
</ol>
|
||||
<form action="POST">
|
||||
<div class="row d-flex mb-3 justify-content-between">
|
||||
<div class="col">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ url_for('index') }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-house" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z" />
|
||||
</svg>
|
||||
</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ url_for('main.list_worklog') }}">Work Log</a></li>
|
||||
<li class="breadcrumb-item active">{{ title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<form action="POST">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<label for="start" class="form-label">Start Timestamp</label>
|
||||
<input type="date" class="form-control" name="start" placeholder="-" value="{{ log.start_time.date().isoformat() if log.start_time }}">
|
||||
<input type="date" class="form-control" name="start" placeholder="-"
|
||||
value="{{ log.start_time.date().isoformat() if log.start_time }}">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label for="end" class="form-label">End Timestamp</label>
|
||||
<input type="date" class="form-control" name="end" placeholder="-" value="{{ log.end_time.date().isoformat() if log.end_time }}">
|
||||
<input type="date" class="form-control" name="end" placeholder="-"
|
||||
value="{{ log.end_time.date().isoformat() if log.end_time }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<label for="contact" class="form-label">Contact</label>
|
||||
<input list="contactList" class="form-control" id="contact" value="{{ log.contact.full_name }}">
|
||||
<input list="contactList" class="form-control" id="contact" value="{{ log.contact.full_name }}"
|
||||
data-datalist-bind="#contactList" data-hidden-target="#contactId">
|
||||
<input type="hidden" id="contactId">
|
||||
<datalist id="contactList">
|
||||
{% for contact in users %}
|
||||
<option data-id="{{ contact.id }}" value="{{ contact.full_name }}">{{ contact.full_name }}</option>
|
||||
<option data-id="{{ contact.id }}" value="{{ contact.full_name }}">{{ contact.full_name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label for="item" class="form-label">Work Item</label>
|
||||
<input list="itemList" class="form-control" id="item" placeholder="-" value="{{ log.work_item.identifier }}">
|
||||
<input list="itemList" class="form-control" id="item" placeholder="-"
|
||||
value="{{ log.work_item.identifier }}" data-datalist-bind="#itemList"
|
||||
data-hidden-target="#itemId">
|
||||
<input type="hidden" id="itemId">
|
||||
<datalist id="itemList">
|
||||
{% for item in items %}
|
||||
<option data-id="{{ item.id }}" value="{{ item.identifier }}">{{ item.identifier }}</option>
|
||||
<option data-id="{{ item.id }}" value="{{ item.identifier }}">{{ item.identifier }}</option>
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="checkbox" id="complete" class="form-check-input" {% if log.complete %}checked{%
|
||||
endif %}>
|
||||
<label for="complete" class="form-check-label">
|
||||
Complete?
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="checkbox" id="followup" class="form-check-input" {% if log.followup %}checked{%
|
||||
endif %}>
|
||||
<label for="followup" class="form-check-label">
|
||||
Follow Up?
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="checkbox" id="analysis" class="form-check-input" {% if log.analysis %}checked{%
|
||||
endif %}>
|
||||
<label for="analysis" class="form-check-label">
|
||||
Quick Analysis?
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<label for="notes" class="form-label">Notes</label>
|
||||
<textarea name="notes" id="notes" class="form-control"
|
||||
rows="15">{{ log.notes if log.notes else '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
</form>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue