1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2008-09-08 05:19:28 +00:00
parent a5e0c5b182
commit 6bdb7b9529
34 changed files with 82 additions and 81 deletions

View File

@@ -34,7 +34,7 @@
<tr>
<td>{{ field.name }}</td>
<td>{{ field.data_type }}</td>
<td>{% if field.verbose %}{{ field.verbose }}{% endif %}{% if field.help_text %} - {{ field.help_text|safe }}{% endif %}</td>
<td>{{ field.verbose }}{% if field.help_text %} - {{ field.help_text|safe }}{% endif %}</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -1,18 +1,18 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; Templates &rsaquo; {{ name|escape }}</div>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; Templates &rsaquo; {{ name }}</div>{% endblock %}
{% block title %}Template: {{ name|escape }}{% endblock %}
{% block title %}Template: {{ name }}{% endblock %}
{% block content %}
<h1>Template: "{{ name|escape }}"</h1>
<h1>Template: "{{ name }}"</h1>
{% regroup templates|dictsort:"site_id" by site as templates_by_site %}
{% for group in templates_by_site %}
<h2>Search path for template "{{ name|escape }}" on {{ group.grouper }}:</h2>
<h2>Search path for template "{{ name }}" on {{ group.grouper }}:</h2>
<ol>
{% for template in group.list|dictsort:"order" %}
<li><code>{{ template.file|escape }}</code>{% if not template.exists %} <em>(does not exist)</em>{% endif %}</li>
<li><code>{{ template.file }}</code>{% if not template.exists %} <em>(does not exist)</em>{% endif %}</li>
{% endfor %}
</ol>
{% endfor %}

View File

@@ -12,7 +12,7 @@
{% regroup filters|dictsort:"library" by library as filter_libraries %}
{% for library in filter_libraries %}
<div class="module">
<h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in filters{% endif %}</h2>
<h2>{% firstof library.grouper "Built-in filters" %}</h2>
{% if library.grouper %}<p class="small quiet">To use these filters, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the filter.</p><hr />{% endif %}
{% for filter in library.list|dictsort:"name" %}
<h3 id="{{ filter.name }}">{{ filter.name }}</h3>
@@ -33,7 +33,7 @@
{% regroup filters|dictsort:"library" by library as filter_libraries %}
{% for library in filter_libraries %}
<div class="module">
<h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in filters{% endif %}</h2>
<h2>{% firstof library.grouper "Built-in filters" %}</h2>
<ul>
{% for filter in library.list|dictsort:"name" %}
<li><a href="#{{ filter.name }}">{{ filter.name }}</a></li>

View File

@@ -12,7 +12,7 @@
{% regroup tags|dictsort:"library" by library as tag_libraries %}
{% for library in tag_libraries %}
<div class="module">
<h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in tags{% endif %}</h2>
<h2>{% firstof library.grouper "Built-in tags" %}</h2>
{% if library.grouper %}<p class="small quiet">To use these tags, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the tag.</p><hr />{% endif %}
{% for tag in library.list|dictsort:"name" %}
<h3 id="{{ tag.name }}">{{ tag.name }}</h3>
@@ -33,7 +33,7 @@
{% regroup tags|dictsort:"library" by library as tag_libraries %}
{% for library in tag_libraries %}
<div class="module">
<h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in tags{% endif %}</h2>
<h2>{% firstof library.grouper "Built-in tags" %}</h2>
<ul>
{% for tag in library.list|dictsort:"name" %}
<li><a href="#{{ tag.name }}">{{ tag.name }}</a></li>

View File

@@ -29,7 +29,7 @@
{% for view in site_views.list|dictsort:"url" %}
{% ifchanged %}
<h3><a href="{{ view.module }}.{{ view.name }}/">{{ view.url|escape }}</a></h3>
<h3><a href="{{ view.module }}.{{ view.name }}/">{{ view.url }}</a></h3>
<p class="small quiet">View function: {{ view.module }}.{{ view.name }}</p>
<p>{{ view.title }}</p>
<hr />