Code

Opened 3 years ago

Closed 3 years ago

#16186 closed Cleanup/optimization (fixed)

Remove inline CSS from admin templates

Reported by: bsimons Owned by: cscheng
Component: contrib.admin Version: master
Severity: Normal Keywords: admin, templates, html, css, javascript
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

The templates in contrib.admin have a lot of inline javascript. Also inline css styling appears at several places. This should be cleaned up so improving or redesigning the admin in the future is more easy. Javascripts could and should also be more based on jQuery, since it has been available in the admin anyway for some time now.

Attachments (2)

16186-inline-css-removed.diff (872 bytes) - added by cscheng 3 years ago.
Patch for removing inline style in change_list_results.html (16186)
16186-inline-css-removed-updated.diff (2.0 KB) - added by nvandijk 3 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 follow-up: Changed 3 years ago by cscheng

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to cscheng
  • Patch needs improvement unset

Changed 3 years ago by cscheng

Patch for removing inline style in change_list_results.html (16186)

comment:2 Changed 3 years ago by julien

  • Triage Stage changed from Unreviewed to Accepted
  • UI/UX set

comment:3 Changed 3 years ago by DHessing

Aren't these two different issues? Cleaning up the admin pages to remove the inline javascript/css. Then as a seperate ticket, you could start converting the javascript to jQuery in a central place, if we even want to do that. Also, like Idan said, we should first create a shitlist of all inline css/js in the admin, maybe on a wiki.

comment:4 in reply to: ↑ 1 Changed 3 years ago by DHessing

  • Patch needs improvement set

Replying to cscheng:
Patch looks ok, but we might need more to close this ticket ;)

comment:5 Changed 3 years ago by julien

  • Triage Stage changed from Accepted to Design decision needed

Yeah, on further reflection, this ticket aims to tackle way too much. There are already a number of tickets suggesting to convert some existing pieces of javascript to using jQuery, for example: #13, #25, #15220, #13883, #15231, #13068. So the jQuery conversion should definitely stay out of this ticket and either be tackled piecemeal by these various tickets or be done all in one go as part of a major revamp of the admin.

Removing the inline CSS seems more reasonable for this ticket. However, a thorough audit of the existing codebase should be done first before deciding on the right approach for tackling this task.

For these reasons, I'm marking this ticket as DDN. I'm going to ask Idan for his view on this, as I assume he's got plans :)

Last edited 3 years ago by julien (previous) (diff)

comment:6 Changed 3 years ago by idangazit

  • Summary changed from The admin templates need some love to Remove inline CSS from admin templates
  • Triage Stage changed from Design decision needed to Accepted

OK, let's limit the scope of this ticket to removing inline CSS in the admin.

Eventually, we can open a separate ticket for inline JS/refactoring which doesn't fall under one of the existing tickets you mentioned already.

Changed 3 years ago by nvandijk

comment:7 Changed 3 years ago by nvandijk

Updated the patch. Removed some more inline styles..

comment:8 Changed 3 years ago by jezdez

  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:9 Changed 3 years ago by idangazit

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

In [16346]:

Fixes #16186 -- remove inline CSS in contrib.admin

Thanks to bsimons for the report and the patches from cscheng, nvandijk!

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.