#36659 closed Bug (fixed)
Re-enable custom height for flatpage content field in admin
| Reported by: | Baptiste Mispelon | Owned by: | Baptiste Mispelon |
|---|---|---|---|
| Component: | contrib.flatpages | Version: | 5.2 |
| Severity: | Normal | Keywords: | |
| Cc: | Antoliny | 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
The admin's forms.css file contains this rule [1]:
.flatpages-flatpage #id_content { height: 40.2em; }
The purpose of this rule (I'm guessing) is to make the FlatPage.content field taller on the add/change form, because this field typically contains a lot of text. This appears to be basically as old as the admin itself, and was added in dd5320d1d56ca7603747dd68871e72eee99d9e67 (where it started as body.core-flatfile #id_content { height: 400px; }).
However this rule doesn't currently do anything, because the .flatpages-flatpage selector doesn't match anything.
This appears to be a regression that was introduced in release 1.6 with commit bb145e2c47d71b7f68280c00ced727442d2effa2 wich effectively changed the body class from flatpages-flatpage to app-flatpages model-flatpage.
[1] https://github.com/django/django/blob/1167cd1d639c3fee69dbdef351d31e8a17d1fedf/django/contrib/admin/static/admin/css/forms.css#L360-L362
Attachments (1)
Change History (13)
by , 4 weeks ago
| Attachment: | ticket-36659.diff added |
|---|
comment:1 by , 4 weeks ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 4 weeks ago
| Cc: | added |
|---|
follow-up: 4 comment:3 by , 4 weeks ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
I will take this task as my first contribution to the django project.
follow-up: 5 comment:4 by , 4 weeks ago
Replying to Khanh Vy Nguyen:
I will take this task as my first contribution to the django project.
Hi 👋🏻,
Thank you for your interest, but this ticket already has a patch attached (see the "Has patch" field).
follow-up: 6 comment:5 by , 4 weeks ago
Replying to Baptiste Mispelon:
Hi 👋🏻,
Thank you for your interest, but this ticket already has a patch attached (see the "Has patch" field).
Hello Baptiste, do you happen to know where this PR is? I couldn’t find it anywhere...
comment:6 by , 4 weeks ago
Replying to Antoliny:
Hello Baptiste, do you happen to know where this PR is? I couldn’t find it anywhere...
It's not a PR, it's attached as a patch to this ticket (see "Attachments" at the top)
follow-up: 8 comment:7 by , 4 weeks ago
| Owner: | changed from to |
|---|
Thanks, a PR would be helpful at this point.
comment:8 by , 4 weeks ago
Replying to Jacob Walls:
Thanks, a PR would be helpful at this point.
Sure thing, here you go: https://github.com/django/django/pull/19958
comment:9 by , 4 weeks ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Tangent: seems a bit odd to be doing this with CSS instead of in flatpages/admin.py via the rows attribute on the <textarea>, but happy to merge this (well spotted!)
comment:10 by , 4 weeks ago
| Component: | contrib.admin → contrib.flatpages |
|---|
Thank you Baptiste!
As you mentioned, it seems that the
#id_contentwas intended to make the Content field larger on the FlatPage model Change/Add form.However, I wasn’t able to find any part of the admin where this CSS is actually being applied.
And thank you for adding detailed information to the ticket, it really helped me understand and verify the issue!