Opened 9 years ago

Closed 8 years ago

#8172 closed (fixed)

Decruftify contrib templates

Reported by: Ben Spaulding Owned by: Adrian Holovaty
Component: Contrib apps Version: master
Severity: Keywords: templates
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:


The [source:django/trunk/django/contrib/admin/templates/ admin templates] need to have some cruft removed, including the escape filter and overuse of if statements. This patch does not affect the output of the admin templates. It just cleans them up a bit.

Attachments (2)

decruftify_admin_templates.diff (22.5 KB) - added by Ben Spaulding 9 years ago.
decruftify_contrib_templates.diff (39.4 KB) - added by Ben Spaulding 8 years ago.
Updated patch to work on r8802.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by Ben Spaulding

comment:1 Changed 9 years ago by Ben Spaulding

Component: Admin interfaceContrib apps
Needs tests: set
Summary: Decruftify the admin templatesDecruftify contrib templates

Changeset [8264] moved the admin_doc templates, which meant the patch needed updated. Upon doing that I decided to look at the rest of the contrib app templates.

Again, this is nothing big. I am just trying to help out, get rid of cruft, and make things more readable.

I set needs_tests to true because I just want someone to verify that pulling the {% autoescape off %} template tag out of the [source:django/trunk/django/contrib/sitemaps/templates sitemaps XML templates] is the correct thing to do.

comment:2 Changed 9 years ago by Jacob

Triage Stage: UnreviewedAccepted

Changed 8 years ago by Ben Spaulding

Updated patch to work on r8802.

comment:3 Changed 8 years ago by Adrian Holovaty

Owner: changed from nobody to Adrian Holovaty
Status: newassigned

Looks like great stuff...will work on checking it in.

comment:4 Changed 8 years ago by Adrian Holovaty

Resolution: fixed
Status: assignedclosed

(In [8984]) Fixed #8172 -- Improved a whole bunch of contrib templates (admin, databrowse, admindocs, etc.) to remove unnecessary 'escape' filters, given autoescaping. Also removed unnecessary {% if %} tags and shortened some {% if %}/{% else %} tags to use {% firstof %}. Thanks for the patch, benspaulding

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