Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#13782 closed (fixed)

Missing css on textarea & errors marking is too broad for multiple fields on same line

Reported by: master Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: sprintdec2010
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Under the Admin, try to add-save an empty object of this example:

models.py:

class Test(models.Model):
    title = models.CharField(max_length=100, blank=True)
    presentation = models.TextField()

admin.py:

class TestAdmin(admin.ModelAdmin):
    fieldsets = (
        (None,   {'fields': (('title', 'presentation'), )}),
    )
admin.site.register(Test, TestAdmin)

The unexpected results are:

  • there is no red border on the offending 'presentation' field
  • the red border on the 'title' field is confusing, this field is not in error, as it can be empty

The proposed patch adds:

  • the missing CSS rule on an erroneous textarea
  • a way (to be cleanedup) to lower the error marking from the 'form-row' to the 'field-box' level, so that only the offending fields are pointed out.

Attachments (3)

errors_css.diff (2.2 KB ) - added by master 14 years ago.
13782_errors_display.diff (2.4 KB ) - added by Julien Phalip 14 years ago.
Improved patch
13782_errors_display.2.diff (2.3 KB ) - added by Julien Phalip 14 years ago.
Improved patch

Download all attachments as: .zip

Change History (8)

by master, 14 years ago

Attachment: errors_css.diff added

comment:1 by Julien Phalip, 14 years ago

Keywords: sprintdec2010 added
milestone: 1.3
Triage Stage: UnreviewedAccepted

This is clearly a usability bug. The patch is good. I've just improved it a little so that the behaviour remains the same if the line contains only one field (i.e. the 'errors' CSS class is applied to the 'form-row' div).

by Julien Phalip, 14 years ago

Attachment: 13782_errors_display.diff added

Improved patch

by Julien Phalip, 14 years ago

Attachment: 13782_errors_display.2.diff added

Improved patch

comment:2 by Simon Meers, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

(In [14999]) Fixed #13782 -- Added CSS for errors in textareas and multiple fields in one line. Thanks, julien.

comment:4 by Jannis Leidel, 14 years ago

(In [15003]) [1.2.X] Fixed #13782 -- Added CSS for errors in textareas and multiple fields in one line. Thanks, julien.

Backport from trunk (r14999).

comment:5 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top