Skip to content

Commit 71cecc4

Browse files
committed
[1.2.X] Fixed #12803 - Added styling for 'error' and 'warning' messages in admin.
Thanks to bboli and sebastian_noack for the report, DrMeers for the patch. Backport of [13393] from trunk. Considered a bug (and therefore backported) due to error and warning messages being styled with green tick previously. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 8f5236f commit 71cecc4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

django/contrib/admin/media/css/base.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,14 @@ ul.messagelist li {
445445
background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat;
446446
}
447447

448+
ul.messagelist li.warning{
449+
background-image: url(../img/admin/icon_alert.gif);
450+
}
451+
452+
ul.messagelist li.error{
453+
background-image: url(../img/admin/icon_error.gif);
454+
}
455+
448456
.errornote {
449457
font-size: 12px !important;
450458
display: block;

django/contrib/admin/templates/admin/base.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
{% endif %}
5757

5858
{% if messages %}
59-
<ul class="messagelist">{% for message in messages %}<li>{{ message }}</li>{% endfor %}</ul>
59+
<ul class="messagelist">{% for message in messages %}
60+
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
61+
{% endfor %}</ul>
6062
{% endif %}
6163

6264
<!-- Content -->

0 commit comments

Comments
 (0)