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:
parent
dab23009c1
commit
a4bfb9838c
3 changed files with 44 additions and 15 deletions
|
@ -89,11 +89,19 @@
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% set buttonBar %}
|
{% set buttonBar %}
|
||||||
<div class="btn-group">
|
<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(
|
{{ buttons.render_button(
|
||||||
id='save',
|
id='save',
|
||||||
icon='floppy',
|
icon='floppy',
|
||||||
logic=saveLogic,
|
logic=saveLogic,
|
||||||
style="outline-primary rounded-start"
|
style="outline-primary" + (' rounded-end' if not item.id else '')
|
||||||
) }}
|
) }}
|
||||||
{% if item.id != None %}
|
{% if item.id != None %}
|
||||||
{{ buttons.render_button(
|
{{ buttons.render_button(
|
||||||
|
|
|
@ -46,6 +46,24 @@
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
{% endset %}
|
{% 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(
|
{{ toolbars.render_toolbar(
|
||||||
id = 'newUser',
|
id = 'newUser',
|
||||||
left = breadcrumbs.breadcrumb_header(
|
left = breadcrumbs.breadcrumb_header(
|
||||||
|
@ -54,12 +72,7 @@
|
||||||
{'label': 'Users', 'url': url_for('main.list_users')}
|
{'label': 'Users', 'url': url_for('main.list_users')}
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
right = buttons.render_button(
|
right = iconBar
|
||||||
id = 'save',
|
|
||||||
icon = 'floppy',
|
|
||||||
logic = saveLogic,
|
|
||||||
style = 'outline-primary'
|
|
||||||
)
|
|
||||||
) }}
|
) }}
|
||||||
{% if not user.active %}
|
{% 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>
|
<div class="alert alert-danger">This user is inactive. You will not be able to make any changes to this record.</div>
|
||||||
|
|
|
@ -95,11 +95,19 @@
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% set iconBar %}
|
{% set iconBar %}
|
||||||
<div class="btn-group">
|
<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(
|
{{ buttons.render_button(
|
||||||
id='save',
|
id='save',
|
||||||
icon='floppy',
|
icon='floppy',
|
||||||
logic=saveLogic,
|
logic=saveLogic,
|
||||||
style='outline-primary rounded-start'
|
style='outline-primary'
|
||||||
) }}
|
) }}
|
||||||
{% if log.id != None %}
|
{% if log.id != None %}
|
||||||
{{ buttons.render_button(
|
{{ buttons.render_button(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue