Deploy new dropdown.

This commit is contained in:
Yaro Kasear 2025-08-15 11:52:43 -05:00
parent 75ed0e2639
commit a336442a92
5 changed files with 18 additions and 28 deletions

View file

@ -1,7 +1,7 @@
{% import "fragments/_icon_fragment.html" as icons %}
{% import "fragments/_link_fragment.html" as links %}
{% macro dynamic_dropdown(id, list = none, label = none, current_item = none, entry_link = none, enabled = true, refresh_url = none, select_url = none, record_id = none, field_name = none) %}
{% macro render_dropdown(id, list = none, label = none, current_item = none, entry_link = none, enabled = true, refresh_url = none, select_url = none, record_id = none, field_name = none) %}
<label for="{{ id }}" class="form-label">
{{ label or '' }}
{% if entry_link %}

View file

@ -162,7 +162,7 @@
</div>
<div class="row">
<div class="col-4">
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id='brand',
label='Brand',
current_item=item.brand,
@ -180,7 +180,7 @@
%} disabled{% endif %}>
</div>
<div class="col-4">
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id='type',
label='Category',
current_item=item.device_type,
@ -194,7 +194,7 @@
</div>
<div class="row">
<div class="col-4">
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id='owner',
label='Contact',
current_item=item.owner,
@ -207,7 +207,7 @@
) }}
</div>
<div class="col-4">
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id='room',
label='Location',
current_item=item.location,

View file

@ -7,7 +7,7 @@
refresh_url=url_for('ui.list_items', model_name='brand')
) }}
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id = 'dropdown',
refresh_url=url_for('ui.list_items', model_name='user')
) }}

View file

@ -106,7 +106,7 @@
<div class="row mt-2">
<div class="col-6">
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id='supervisor',
label='Supervisor',
current_item=user.supervisor if user.supervisor else None,
@ -120,7 +120,7 @@
</div>
<div class="col-6">
{{ dropdowns.dynamic_dropdown(
{{ dropdowns.render_dropdown(
id='location',
label='Location',
current_item=user.location if user.location else None,

View file

@ -147,39 +147,29 @@
</div>
<div class="row">
<div class="col-4">
{#
<label for="contact" class="form-label">
Contact
{% if log.contact_id %}
{{ links.entry_link('user', log.contact_id) }}
{% endif %}
</label>
<select class="form-select" name="contact" id="contact"{% if log.complete %} disabled{% endif %}>
<option value="">-</option>
{% for contact in users %}
<option value="{{ contact.id }}" {% if contact.id==log.contact_id %} selected{% endif %}>{{
contact.identifier }}
</option>
{% endfor %}
</select>
#}
{{ dropdowns.render_dropdown(
id='contact',
list=users,
label='Contact',
current_item=log.contact,
entry_link='user',
enabled = not log.complete
enabled = not log.complete,
refresh_url=url_for('ui.list_items', model_name='user'),
select_url=url_for('ui.update_item', model_name='worklog'),
record_id=log.id,
field_name='contact_id'
) }}
</div>
<div class="col-4">
{{ dropdowns.render_dropdown(
id='item',
list=items,
label='Work Item',
current_item=log.work_item,
entry_link='inventory_item',
enabled = not log.complete
enabled = not log.complete,
refresh_url=url_for('ui.list_items', model_name='inventory'),
select_url=url_for('ui.update_item', model_name='worklog'),
record_id=log.id,
field_name='work_item_id'
) }}
</div>
<div class="col-4">