mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
More fixes:
- Add "back to site" button on logout screen - Add favicon to account pages - Refactor notifications / alerts / caching
This commit is contained in:
@ -480,10 +480,10 @@ function barcodeCheckIn(location_id) {
|
||||
$(modal).modal('hide');
|
||||
if (status == 'success' && 'success' in response) {
|
||||
|
||||
showAlertOrCache('alert-success', response.success, true);
|
||||
showAlertOrCache(response.success, 'success', true);
|
||||
location.reload();
|
||||
} else {
|
||||
showAlertOrCache('alert-success', '{% trans "Error transferring stock" %}', false);
|
||||
showAlertOrCache('{% trans "Error transferring stock" %}', 'danger', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -604,10 +604,10 @@ function scanItemsIntoLocation(item_id_list, options={}) {
|
||||
$(modal).modal('hide');
|
||||
|
||||
if (status == 'success' && 'success' in response) {
|
||||
showAlertOrCache('alert-success', response.success, true);
|
||||
showAlertOrCache(response.success, 'success', true);
|
||||
location.reload();
|
||||
} else {
|
||||
showAlertOrCache('alert-danger', '{% trans "Error transferring stock" %}', false);
|
||||
showAlertOrCache('{% trans "Error transferring stock" %}', 'danger', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -885,19 +885,19 @@ function handleFormSuccess(response, options) {
|
||||
|
||||
// Display any messages
|
||||
if (response && response.success) {
|
||||
showAlertOrCache('alert-success', response.success, cache);
|
||||
showAlertOrCache(response.success, 'success', cache);
|
||||
}
|
||||
|
||||
if (response && response.info) {
|
||||
showAlertOrCache('alert-info', response.info, cache);
|
||||
showAlertOrCache(response.info, 'info', cache);
|
||||
}
|
||||
|
||||
if (response && response.warning) {
|
||||
showAlertOrCache('alert-warning', response.warning, cache);
|
||||
showAlertOrCache(response.warning, 'warning', cache);
|
||||
}
|
||||
|
||||
if (response && response.danger) {
|
||||
showAlertOrCache('alert-danger', response.danger, cache);
|
||||
showAlertOrCache(response.danger, 'dagner', cache);
|
||||
}
|
||||
|
||||
if (options.onSuccess) {
|
||||
|
@ -399,19 +399,19 @@ function afterForm(response, options) {
|
||||
|
||||
// Display any messages
|
||||
if (response.success) {
|
||||
showAlertOrCache('alert-success', response.success, cache);
|
||||
showAlertOrCache(response.success, 'success', cache);
|
||||
}
|
||||
|
||||
if (response.info) {
|
||||
showAlertOrCache('alert-info', response.info, cache);
|
||||
showAlertOrCache(response.info, 'info', cache);
|
||||
}
|
||||
|
||||
if (response.warning) {
|
||||
showAlertOrCache('alert-warning', response.warning, cache);
|
||||
showAlertOrCache(response.warning, 'warning', cache);
|
||||
}
|
||||
|
||||
if (response.danger) {
|
||||
showAlertOrCache('alert-danger', response.danger, cache);
|
||||
showAlertOrCache(response.danger, 'danger', cache);
|
||||
}
|
||||
|
||||
// Was a callback provided?
|
||||
|
Reference in New Issue
Block a user