Ticket #13782: errors_css.diff

File errors_css.diff, 2.2 KB (added by master, 14 years ago)
  • django/contrib/admin/helpers.py

     
    128128        attrs = classes and {'class': u' '.join(classes)} or {}
    129129        return self.field.label_tag(contents=contents, attrs=attrs)
    130130
     131    def errors(self):
     132        return mark_safe(self.field.errors.as_ul())
     133
    131134class AdminReadonlyField(object):
    132135    def __init__(self, form, field, is_first, model_admin=None):
    133136        label = label_for_field(field, form._meta.model, model_admin)
  • django/contrib/admin/media/css/base.css

     
    483483    background: #ffc;
    484484}
    485485
    486 .errors input, .errors select {
     486.errors input, .errors select, .errors textarea {
    487487    border: 1px solid red;
    488488}
    489489
  • django/contrib/admin/templates/admin/includes/fieldset.html

     
    44        <div class="description">{{ fieldset.description|safe }}</div>
    55    {% endif %}
    66    {% 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.errors %} errors{% endif %#}{% for field in line %} {{ field.field.name }}{% endfor %}">
     8            {#{ line.errors }#}
    99            {% for field in line %}
    10                 <div{% if not line.fields|length_is:"1" %} class="field-box"{% endif %}>
     10                <div class="{% if not line.fields|length_is:'1' %}field-box{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}">
     11                    {% if not field.is_readonly %}{{ field.errors }}{% endif %}
    1112                    {% if field.is_checkbox %}
    1213                        {{ field.field }}{{ field.label_tag }}
    1314                    {% else %}
Back to Top