Opened 16 years ago

Closed 16 years ago

#8172 closed (fixed)

Decruftify contrib templates

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

Description

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 16 years ago.
decruftify_contrib_templates.diff (39.4 KB ) - added by Ben Spaulding 16 years ago.
Updated patch to work on r8802.

Download all attachments as: .zip

Change History (6)

by Ben Spaulding, 16 years ago

comment:1 by Ben Spaulding, 16 years ago

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 by Jacob, 16 years ago

Triage Stage: UnreviewedAccepted

by Ben Spaulding, 16 years ago

Updated patch to work on r8802.

comment:3 by Adrian Holovaty, 16 years ago

Owner: changed from nobody to Adrian Holovaty
Status: newassigned

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

comment:4 by Adrian Holovaty, 16 years ago

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