Code

Opened 4 years ago

Closed 3 years ago

Last modified 3 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: master
Severity: Keywords: sprintdec2010
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 4 years ago.
13782_errors_display.diff (2.4 KB) - added by julien 3 years ago.
Improved patch
13782_errors_display.2.diff (2.3 KB) - added by julien 3 years ago.
Improved patch

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by master

comment:1 Changed 3 years ago by julien

  • Keywords sprintdec2010 added
  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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).

Changed 3 years ago by julien

Improved patch

Changed 3 years ago by julien

Improved patch

comment:2 Changed 3 years ago by DrMeers

  • Triage Stage changed from Accepted to Ready for checkin

comment:3 Changed 3 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 3 years ago by jezdez

(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 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.