Ticket #3579: 3579_4.patch

File 3579_4.patch, 2.5 KB (added by Yuri Baburov, 16 years ago)

Added template conditionals for sometimes-non-existing variables in admin, r8445.

  • django/contrib/admin/templates/admin/auth/user/change_password.html

    diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html
    index f1c4a8d..4653934 100644
    a b  
    1414</div>
    1515{% endif %}{% endblock %}
    1616{% block content %}<div id="content-main">
    17 <form action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
     17<form method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
    1818<div>
    1919{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
    2020{% if form.errors %}
  • django/contrib/admin/templates/admin/change_form.html

    diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html
    index e8df6b9..b94e5fa 100644
    a b  
    33
    44{% block extrahead %}{{ block.super }}
    55<script type="text/javascript" src="../../../jsi18n/"></script>
    6 {{ media }}
     6{% if media %}{{ media }}{% endif %}
    77{% endblock %}
    88
    99{% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %}
     
    2828  </ul>
    2929{% endif %}{% endif %}
    3030{% endblock %}
    31 <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
     31<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
    3232<div>
    3333{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
    3434{% if save_on_top %}{% submit_row %}{% endif %}
  • django/contrib/admin/templates/admin/change_list_results.html

    diff --git a/django/contrib/admin/templates/admin/change_list_results.html b/django/contrib/admin/templates/admin/change_list_results.html
    index 381dcb5..321a02c 100644
    a b  
    22<table cellspacing="0">
    33<thead>
    44<tr>
    5 {% for header in result_headers %}<th{{ header.class_attrib }}>
    6 {% if header.sortable %}<a href="{{ header.url }}">{% endif %}
     5{% for header in result_headers %}{% if not header.sortable %}<th>{% endif %}
     6{% if header.sortable %}<th{{ header.class_attrib }}><a href="{{ header.url }}">{% endif %}
    77{{ header.text|capfirst }}
    88{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
    99</tr>
Back to Top