Ticket #13782: 13782_errors_display.2.diff
File 13782_errors_display.2.diff, 2.3 KB (added by , 14 years ago) |
---|
-
django/contrib/admin/media/css/base.css
496 496 background: #ffc; 497 497 } 498 498 499 .errors input, .errors select {499 .errors input, .errors select, .errors textarea { 500 500 border: 1px solid red; 501 501 } 502 502 -
django/contrib/admin/helpers.py
127 127 attrs = classes and {'class': u' '.join(classes)} or {} 128 128 return self.field.label_tag(contents=contents, attrs=attrs) 129 129 130 def errors(self): 131 return mark_safe(self.field.errors.as_ul()) 132 130 133 class AdminReadonlyField(object): 131 134 def __init__(self, form, field, is_first, model_admin=None): 132 135 label = label_for_field(field, form._meta.model, model_admin) -
django/contrib/admin/templates/admin/includes/fieldset.html
4 4 <div class="description">{{ fieldset.description|safe }}</div> 5 5 {% endif %} 6 6 {% for line in fieldset %} 7 <div class="form-row{% if line. errors %} errors{% endif %}{% for field in line %} {{ field.field.name }}{% endfor %}">8 { { line.errors }}7 <div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %} {{ field.field.name }}{% endfor %}"> 8 {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %} 9 9 {% for field in line %} 10 <div{% if not line.fields|length_is:"1" %} class="field-box"{% endif %}> 10 <div{% if not line.fields|length_is:'1' %} class="field-box{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}> 11 {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} 11 12 {% if field.is_checkbox %} 12 13 {{ field.field }}{{ field.label_tag }} 13 14 {% else %}