Refactor templates and utility functions for improved rendering and usability; enhance icon usage and link handling in various templates

This commit is contained in:
Yaro Kasear 2025-06-17 12:51:01 -05:00
parent b68c25a05a
commit 3915b97231
12 changed files with 102 additions and 90 deletions

View file

@ -61,7 +61,8 @@ submit_button=True) }}
<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>
<option value="{{ t.id }}" {% if t.id==item.type_id %} selected{% endif %}>{{ t.description }}
</option>
{% endfor %}
</select>
</div>
@ -70,16 +71,9 @@ submit_button=True) }}
<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>
{% if item.owner %}
{{ links.entry_link('user', item.owner_id) }}
{% endif %}
</label>
<select class="form-select" id="userList">
<option>-</option>
@ -117,14 +111,15 @@ submit_button=True) }}
</div>
</div>
<div class="row">
<div class="col-{% if worklog %}6{% else %}12{% endif %}">
<div class="col">
<label for="notes" class="form-label">Notes &amp; 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(headers=worklog_headers, rows=worklog_rows, id='worklog', entry_route='worklog_entry', title='Work Log') }}
<div class="col">
{{ tables.render_table(headers=worklog_headers, rows=worklog_rows, id='worklog',
entry_route='worklog_entry', title='Work Log') }}
</div>
{% endif %}
</div>