Opened 7 years ago

Closed 7 years ago

#8172 closed (fixed)

Decruftify contrib templates

Reported by: benspaulding Owned by: adrian
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:

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

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by benspaulding

comment:1 Changed 7 years ago by benspaulding

  • Component changed from Admin interface to Contrib apps
  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Summary changed from Decruftify the admin templates to Decruftify 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 7 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

Changed 7 years ago by benspaulding

Updated patch to work on r8802.

comment:3 Changed 7 years ago by adrian

  • Owner changed from nobody to adrian
  • Status changed from new to assigned

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

comment:4 Changed 7 years ago by adrian

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

(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