Enhance button functionality in inventory, user, and worklog templates to include dynamic 'new' buttons and improve save button styling for better UI consistency

This commit is contained in:
Yaro Kasear 2025-07-21 08:30:29 -05:00
parent dab23009c1
commit a4bfb9838c
3 changed files with 44 additions and 15 deletions

View file

@ -89,11 +89,19 @@
{% endset %}
{% set buttonBar %}
<div class="btn-group">
{% if item.id != None %}
{{ buttons.render_button(
id='new',
icon='plus-lg',
style='outline-primary rounded-start',
logic="window.location.href = '" + url_for('main.new_inventory_item') + "';"
)}}
{% endif %}
{{ buttons.render_button(
id='save',
icon='floppy',
logic=saveLogic,
style="outline-primary rounded-start"
style="outline-primary" + (' rounded-end' if not item.id else '')
) }}
{% if item.id != None %}
{{ buttons.render_button(

View file

@ -46,6 +46,24 @@
console.error(err);
}
{% endset %}
{% set iconBar %}
<div class="btn-group">
{% if user.id != None %}
{{ buttons.render_button(
id = 'new',
icon = 'plus-lg',
style = 'outline-secondary rounded-start',
logic = "window.location.href = '" + url_for('main.new_user') + "';"
)}}
{% endif %}
{{ buttons.render_button(
id = 'save',
icon = 'floppy',
logic = saveLogic,
style = 'outline-primary rounded-end'
) }}
</div>
{% endset %}
{{ toolbars.render_toolbar(
id = 'newUser',
left = breadcrumbs.breadcrumb_header(
@ -54,12 +72,7 @@
{'label': 'Users', 'url': url_for('main.list_users')}
]
),
right = buttons.render_button(
id = 'save',
icon = 'floppy',
logic = saveLogic,
style = 'outline-primary'
)
right = iconBar
) }}
{% if not user.active %}
<div class="alert alert-danger">This user is inactive. You will not be able to make any changes to this record.</div>

View file

@ -95,11 +95,19 @@
{% endset %}
{% set iconBar %}
<div class="btn-group">
{% if log.id != None %}
{{ buttons.render_button(
id='new',
icon='plus-lg',
style='outline-primary rounded-start',
logic="window.location.href = '" + url_for('main.new_worklog') + "';"
) }}
{% endif %}
{{ buttons.render_button(
id='save',
icon='floppy',
logic=saveLogic,
style='outline-primary rounded-start'
style='outline-primary'
) }}
{% if log.id != None %}
{{ buttons.render_button(