2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Improvements for alert notifications

- Dismissable
- Delete after a certain amount of time
This commit is contained in:
Oliver
2021-11-03 17:55:30 +11:00
parent 85adf842f6
commit e7f6268640
6 changed files with 99 additions and 53 deletions

View File

@ -399,8 +399,18 @@ function toggleStar(options) {
success: function(response) {
if (response.starred) {
$(options.button).removeClass('fa fa-bell-slash').addClass('fas fa-bell icon-green');
$(options.button).attr('title', '{% trans "You are subscribed to notifications for this part" %}');
showMessage('{% trans "You have subscribed to notifications for this part" %}', {
style: 'success',
});
} else {
$(options.button).removeClass('fas fa-bell icon-green').addClass('fa fa-bell-slash');
$(options.button).attr('title', '{% trans "Subscribe to notifications for this part" %}');
showMessage('{% trans "You have unsubscribed to notifications for this part" %}', {
style: 'warning',
});
}
}
}