mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
using messages for alerts
This commit is contained in:
parent
888154e30b
commit
f1f75b45cb
@ -21,6 +21,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
from django.contrib.messages import constants as messages
|
||||||
|
|
||||||
|
|
||||||
def _is_true(x):
|
def _is_true(x):
|
||||||
@ -593,3 +594,9 @@ IMPORT_EXPORT_USE_TRANSACTIONS = True
|
|||||||
INTERNAL_IPS = [
|
INTERNAL_IPS = [
|
||||||
'127.0.0.1',
|
'127.0.0.1',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
MESSAGE_TAGS = {
|
||||||
|
messages.SUCCESS: 'alert alert-block alert-success',
|
||||||
|
messages.ERROR: 'alert alert-block alert-danger',
|
||||||
|
messages.INFO: 'alert alert-block alert-info',
|
||||||
|
}
|
||||||
|
@ -8,6 +8,15 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
{% if messages %}
|
||||||
|
{% for message in messages %}
|
||||||
|
<div class='{{ message.tags }}'>
|
||||||
|
{{ message|safe }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<div class='panel panel-default panel-inventree'>
|
<div class='panel panel-default panel-inventree'>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
|
Loading…
Reference in New Issue
Block a user