diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-01-20 23:09:10 -0800 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-01-21 02:09:10 -0500 |
| commit | ff05de760cc4ef4c7f188e163c722ec3bc1f0cbf (patch) | |
| tree | ba133d0ecea7521935c98cf1c058df4e6a9ff233 /django | |
| parent | 4b0f39d9fb2033a9597e30ac13af162440b82ebc (diff) | |
Fixed #29038 -- Removed closing slash from HTML void tags.
Diffstat (limited to 'django')
38 files changed, 86 insertions, 86 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 1c27dc400b..268ce012d1 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -809,7 +809,7 @@ class ModelAdmin(BaseModelAdmin): A list_display column containing a checkbox widget. """ return helpers.checkbox.render(helpers.ACTION_CHECKBOX_NAME, str(obj.pk)) - action_checkbox.short_description = mark_safe('<input type="checkbox" id="action-toggle" />') + action_checkbox.short_description = mark_safe('<input type="checkbox" id="action-toggle">') def get_actions(self, request): """ 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 7a47707df9..4b3bfb920c 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -5,7 +5,7 @@ {% block extrahead %}{{ block.super }} <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script> {% endblock %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %} +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %} {% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.model_name }} change-form{% endblock %} {% if not is_popup %} {% block breadcrumbs %} @@ -20,9 +20,9 @@ {% endif %} {% block content %}<div id="content-main"> <form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %} -<input type="text" name="username" value="{{ original.get_username }}" style="display: none" /> +<input type="text" name="username" value="{{ original.get_username }}" style="display: none"> <div> -{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} +{% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} {% if form.errors %} <p class="errornote"> {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %} @@ -52,7 +52,7 @@ </fieldset> <div class="submit-row"> -<input type="submit" value="{% trans 'Change password' %}" class="default" /> +<input type="submit" value="{% trans 'Change password' %}" class="default"> </div> </div> diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html index c4c7ca85c6..2cf5137070 100644 --- a/django/contrib/admin/templates/admin/base.html +++ b/django/contrib/admin/templates/admin/base.html @@ -3,16 +3,16 @@ <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> <head> <title>{% block title %}{% endblock %}</title> -<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" /> +<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}"> {% block extrastyle %}{% endblock %} -{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %} +{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %} {% block extrahead %}{% endblock %} {% block responsive %} <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"> - <link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}" /> - {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}" />{% endif %} + <link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}"> + {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %} {% endblock %} -{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} +{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %} </head> {% load i18n %} @@ -81,7 +81,7 @@ {{ content }} {% endblock %} {% block sidebar %}{% endblock %} - <br class="clear" /> + <br class="clear"> </div> <!-- END Content --> diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index fd0b130b2d..f77e50a130 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -6,7 +6,7 @@ {{ media }} {% endblock %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %} +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %} {% block coltype %}colM{% endblock %} @@ -39,8 +39,8 @@ {% endblock %} <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %} <div> -{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %} -{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %} +{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} +{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} {% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %} {% if errors %} <p class="errornote"> diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index e0af704aa9..34a4031799 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -3,9 +3,9 @@ {% block extrastyle %} {{ block.super }} - <link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" /> + <link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}"> {% if cl.formset %} - <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" /> + <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}"> {% endif %} {% if cl.formset or action_form %} <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script> diff --git a/django/contrib/admin/templates/admin/date_hierarchy.html b/django/contrib/admin/templates/admin/date_hierarchy.html index 005851051c..ecbd2a1a00 100644 --- a/django/contrib/admin/templates/admin/date_hierarchy.html +++ b/django/contrib/admin/templates/admin/date_hierarchy.html @@ -5,6 +5,6 @@ {% for choice in choices %} <li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title }}{% if choice.link %}</a>{% endif %}</li> {% endfor %} -</ul><br class="clear" /> +</ul><br class="clear"> </div> {% endif %} diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html index 2dedc84491..c28a87cd9b 100644 --- a/django/contrib/admin/templates/admin/delete_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_confirmation.html @@ -41,10 +41,10 @@ <ul>{{ deleted_objects|unordered_list }}</ul> <form method="post">{% csrf_token %} <div> - <input type="hidden" name="post" value="yes" /> - {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %} - {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %} - <input type="submit" value="{% trans "Yes, I'm sure" %}" /> + <input type="hidden" name="post" value="yes"> + {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} + {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} + <input type="submit" value="{% trans "Yes, I'm sure" %}"> <a href="#" class="button cancel-link">{% trans "No, take me back" %}</a> </div> </form> diff --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/django/contrib/admin/templates/admin/delete_selected_confirmation.html index 6ae53fecd3..4d77ae33a0 100644 --- a/django/contrib/admin/templates/admin/delete_selected_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_selected_confirmation.html @@ -43,11 +43,11 @@ <form method="post">{% csrf_token %} <div> {% for obj in queryset %} - <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}" /> + <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}"> {% endfor %} - <input type="hidden" name="action" value="delete_selected" /> - <input type="hidden" name="post" value="yes" /> - <input type="submit" value="{% trans "Yes, I'm sure" %}" /> + <input type="hidden" name="action" value="delete_selected"> + <input type="hidden" name="post" value="yes"> + <input type="submit" value="{% trans "Yes, I'm sure" %}"> <a href="#" class="button cancel-link">{% trans "No, take me back" %}</a> </div> </form> diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html index f04faadf2f..2f449d67af 100644 --- a/django/contrib/admin/templates/admin/edit_inline/tabular.html +++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -13,7 +13,7 @@ {% for field in inline_admin_formset.fields %} {% if not field.widget.is_hidden %} <th{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }} - {% if field.help_text %} <img src="{% static "admin/img/icon-unknown.svg" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %} + {% if field.help_text %} <img src="{% static "admin/img/icon-unknown.svg" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}">{% endif %} </th> {% endif %} {% endfor %} diff --git a/django/contrib/admin/templates/admin/index.html b/django/contrib/admin/templates/admin/index.html index 5a4b127178..03383db8ea 100644 --- a/django/contrib/admin/templates/admin/index.html +++ b/django/contrib/admin/templates/admin/index.html @@ -1,7 +1,7 @@ {% extends "admin/base_site.html" %} {% load i18n static %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %} +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}">{% endblock %} {% block coltype %}colMS{% endblock %} @@ -67,7 +67,7 @@ {% else %} <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a> {% endif %} - <br/> + <br> {% if entry.content_type %} <span class="mini quiet">{% filter capfirst %}{{ entry.content_type }}{% endfilter %}</span> {% else %} diff --git a/django/contrib/admin/templates/admin/login.html b/django/contrib/admin/templates/admin/login.html index 397eadf4a2..396be276f9 100644 --- a/django/contrib/admin/templates/admin/login.html +++ b/django/contrib/admin/templates/admin/login.html @@ -1,7 +1,7 @@ {% extends "admin/base_site.html" %} {% load i18n static %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}" /> +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}"> {{ form.media }} {% endblock %} @@ -49,7 +49,7 @@ <div class="form-row"> {{ form.password.errors }} {{ form.password.label_tag }} {{ form.password }} - <input type="hidden" name="next" value="{{ next }}" /> + <input type="hidden" name="next" value="{{ next }}"> </div> {% url 'admin_password_reset' as password_reset_url %} {% if password_reset_url %} @@ -58,7 +58,7 @@ </div> {% endif %} <div class="submit-row"> - <label> </label><input type="submit" value="{% trans 'Log in' %}" /> + <label> </label><input type="submit" value="{% trans 'Log in' %}"> </div> </form> diff --git a/django/contrib/admin/templates/admin/pagination.html b/django/contrib/admin/templates/admin/pagination.html index fc1e600805..bef843a444 100644 --- a/django/contrib/admin/templates/admin/pagination.html +++ b/django/contrib/admin/templates/admin/pagination.html @@ -8,5 +8,5 @@ {% endif %} {{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %} {% if show_all_url %} <a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %} -{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% trans 'Save' %}"/>{% endif %} +{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% trans 'Save' %}">{% endif %} </p> diff --git a/django/contrib/admin/templates/admin/related_widget_wrapper.html b/django/contrib/admin/templates/admin/related_widget_wrapper.html index af17be8111..7b0a809392 100644 --- a/django/contrib/admin/templates/admin/related_widget_wrapper.html +++ b/django/contrib/admin/templates/admin/related_widget_wrapper.html @@ -7,21 +7,21 @@ <a class="related-widget-wrapper-link change-related" id="change_id_{{ name }}" data-href-template="{{ change_related_template_url }}?{{ url_params }}" title="{% blocktrans %}Change selected {{ model }}{% endblocktrans %}"> - <img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% trans 'Change' %}"/> + <img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% trans 'Change' %}"> </a> {% endif %} {% if can_add_related %} <a class="related-widget-wrapper-link add-related" id="add_id_{{ name }}" href="{{ add_related_url }}?{{ url_params }}" title="{% blocktrans %}Add another {{ model }}{% endblocktrans %}"> - <img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% trans 'Add' %}"/> + <img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% trans 'Add' %}"> </a> {% endif %} {% if can_delete_related %} <a class="related-widget-wrapper-link delete-related" id="delete_id_{{ name }}" data-href-template="{{ delete_related_template_url }}?{{ url_params }}" title="{% blocktrans %}Delete selected {{ model }}{% endblocktrans %}"> - <img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% trans 'Delete' %}"/> + <img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% trans 'Delete' %}"> </a> {% endif %} {% endspaceless %} diff --git a/django/contrib/admin/templates/admin/search_form.html b/django/contrib/admin/templates/admin/search_form.html index 1417c1f599..3bb5cba52c 100644 --- a/django/contrib/admin/templates/admin/search_form.html +++ b/django/contrib/admin/templates/admin/search_form.html @@ -2,14 +2,14 @@ {% if cl.search_fields %} <div id="toolbar"><form id="changelist-search" method="get"> <div><!-- DIV needed for valid HTML --> -<label for="searchbar"><img src="{% static "admin/img/search.svg" %}" alt="Search" /></label> -<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" autofocus /> -<input type="submit" value="{% trans 'Search' %}" /> +<label for="searchbar"><img src="{% static "admin/img/search.svg" %}" alt="Search"></label> +<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" autofocus> +<input type="submit" value="{% trans 'Search' %}"> {% if show_result_count %} <span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}{% else %}{% trans "Show all" %}{% endif %}</a>)</span> {% endif %} {% for pair in cl.params.items %} - {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endif %} + {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}">{% endif %} {% endfor %} </div> </form></div> diff --git a/django/contrib/admin/templates/admin/submit_line.html b/django/contrib/admin/templates/admin/submit_line.html index d6db711953..2e6cf057f0 100644 --- a/django/contrib/admin/templates/admin/submit_line.html +++ b/django/contrib/admin/templates/admin/submit_line.html @@ -1,11 +1,11 @@ {% load i18n admin_urls %} <div class="submit-row"> -{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" name="_save" />{% endif %} +{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" name="_save">{% endif %} {% if show_delete_link %} {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %} <p class="deletelink-box"><a href="{% add_preserved_filters delete_url %}" class="deletelink">{% trans "Delete" %}</a></p> {% endif %} -{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" />{% endif %} -{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" />{% endif %} -{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" />{% endif %} +{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew">{% endif %} +{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother">{% endif %} +{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue">{% endif %} </div> diff --git a/django/contrib/admin/templates/admin/widgets/clearable_file_input.html b/django/contrib/admin/templates/admin/widgets/clearable_file_input.html index 71491fca45..80699d1a50 100644 --- a/django/contrib/admin/templates/admin/widgets/clearable_file_input.html +++ b/django/contrib/admin/templates/admin/widgets/clearable_file_input.html @@ -1,6 +1,6 @@ {% if widget.is_initial %}<p class="file-upload">{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %} <span class="clearable-file-input"> -<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}" /> -<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label></span>{% endif %}<br /> +<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"> +<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label></span>{% endif %}<br> {{ widget.input_text }}:{% endif %} -<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %} />{% if widget.is_initial %}</p>{% endif %} +<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% if widget.is_initial %}</p>{% endif %} diff --git a/django/contrib/admin/templates/admin/widgets/related_widget_wrapper.html b/django/contrib/admin/templates/admin/widgets/related_widget_wrapper.html index b84ab14cca..281d331443 100644 --- a/django/contrib/admin/templates/admin/widgets/related_widget_wrapper.html +++ b/django/contrib/admin/templates/admin/widgets/related_widget_wrapper.html @@ -7,21 +7,21 @@ <a class="related-widget-wrapper-link change-related" id="change_id_{{ name }}" data-href-template="{{ change_related_template_url }}?{{ url_params }}" title="{% blocktrans %}Change selected {{ model }}{% endblocktrans %}"> - <img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% trans 'Change' %}"/> + <img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% trans 'Change' %}"> </a> {% endif %} {% if can_add_related %} <a class="related-widget-wrapper-link add-related" id="add_id_{{ name }}" href="{{ add_related_url }}?{{ url_params }}" title="{% blocktrans %}Add another {{ model }}{% endblocktrans %}"> - <img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% trans 'Add' %}"/> + <img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% trans 'Add' %}"> </a> {% endif %} {% if can_delete_related %} <a class="related-widget-wrapper-link delete-related" id="delete_id_{{ name }}" data-href-template="{{ delete_related_template_url }}?{{ url_params }}" title="{% blocktrans %}Delete selected {{ model }}{% endblocktrans %}"> - <img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% trans 'Delete' %}"/> + <img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% trans 'Delete' %}"> </a> {% endif %} {% endspaceless %} diff --git a/django/contrib/admin/templates/admin/widgets/split_datetime.html b/django/contrib/admin/templates/admin/widgets/split_datetime.html index 985f82d0ab..7fc7bf6833 100644 --- a/django/contrib/admin/templates/admin/widgets/split_datetime.html +++ b/django/contrib/admin/templates/admin/widgets/split_datetime.html @@ -1,4 +1,4 @@ <p class="datetime"> - {{ date_label }} {% with widget=widget.subwidgets.0 %}{% include widget.template_name %}{% endwith %}<br /> + {{ date_label }} {% with widget=widget.subwidgets.0 %}{% include widget.template_name %}{% endwith %}<br> {{ time_label }} {% with widget=widget.subwidgets.1 %}{% include widget.template_name %}{% endwith %} </p> diff --git a/django/contrib/admin/templates/admin/widgets/url.html b/django/contrib/admin/templates/admin/widgets/url.html index 554a9343fe..ee1a66a35f 100644 --- a/django/contrib/admin/templates/admin/widgets/url.html +++ b/django/contrib/admin/templates/admin/widgets/url.html @@ -1 +1 @@ -{% if widget.value %}<p class="url">{{ current_label }} <a href="{{ widget.href }}">{{ widget.value }}</a><br />{{ change_label }} {% endif %}{% include "django/forms/widgets/input.html" %}{% if widget.value %}</p>{% endif %} +{% if widget.value %}<p class="url">{{ current_label }} <a href="{{ widget.href }}">{{ widget.value }}</a><br>{{ change_label }} {% endif %}{% include "django/forms/widgets/input.html" %}{% if widget.value %}</p>{% endif %} diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html index a48017700f..8c26108c6e 100644 --- a/django/contrib/admin/templates/registration/password_change_form.html +++ b/django/contrib/admin/templates/registration/password_change_form.html @@ -1,6 +1,6 @@ {% extends "admin/base_site.html" %} {% load i18n static %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %} +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %} {% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>{% endblock %} {% block breadcrumbs %} <div class="breadcrumbs"> @@ -51,7 +51,7 @@ </fieldset> <div class="submit-row"> - <input type="submit" value="{% trans 'Change my password' %}" class="default" /> + <input type="submit" value="{% trans 'Change my password' %}" class="default"> </div> </div> diff --git a/django/contrib/admin/templates/registration/password_reset_confirm.html b/django/contrib/admin/templates/registration/password_reset_confirm.html index 1a24527c1d..8666fa903c 100644 --- a/django/contrib/admin/templates/registration/password_reset_confirm.html +++ b/django/contrib/admin/templates/registration/password_reset_confirm.html @@ -1,7 +1,7 @@ {% extends "admin/base_site.html" %} {% load i18n static %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %} +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %} {% block breadcrumbs %} <div class="breadcrumbs"> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> @@ -29,7 +29,7 @@ <label for="id_new_password2">{% trans 'Confirm password:' %}</label> {{ form.new_password2 }} </div> - <input type="submit" value="{% trans 'Change my password' %}" /> + <input type="submit" value="{% trans 'Change my password' %}"> </fieldset> </form> diff --git a/django/contrib/admin/templates/registration/password_reset_form.html b/django/contrib/admin/templates/registration/password_reset_form.html index 5110d1a995..5c5d761d97 100644 --- a/django/contrib/admin/templates/registration/password_reset_form.html +++ b/django/contrib/admin/templates/registration/password_reset_form.html @@ -1,7 +1,7 @@ {% extends "admin/base_site.html" %} {% load i18n static %} -{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %} +{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %} {% block breadcrumbs %} <div class="breadcrumbs"> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> @@ -22,7 +22,7 @@ <label for="id_email">{% trans 'Email address:' %}</label> {{ form.email }} </div> - <input type="submit" value="{% trans 'Reset my password' %}" /> + <input type="submit" value="{% trans 'Reset my password' %}"> </fieldset> </form> diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py index 7908b0333f..ab0db80301 100644 --- a/django/contrib/admin/templatetags/admin_list.py +++ b/django/contrib/admin/templatetags/admin_list.py @@ -177,7 +177,7 @@ def result_headers(cl): def _boolean_icon(field_val): icon_url = static('admin/img/icon-%s.svg' % {True: 'yes', False: 'no', None: 'unknown'}[field_val]) - return format_html('<img src="{}" alt="{}" />', icon_url, field_val) + return format_html('<img src="{}" alt="{}">', icon_url, field_val) def _coerce_field_name(field_name, field_index): diff --git a/django/contrib/admindocs/templates/admin_doc/template_filter_index.html b/django/contrib/admindocs/templates/admin_doc/template_filter_index.html index 44f0c71aae..caf983ac6d 100644 --- a/django/contrib/admindocs/templates/admin_doc/template_filter_index.html +++ b/django/contrib/admindocs/templates/admin_doc/template_filter_index.html @@ -20,12 +20,12 @@ {% for library in filter_libraries %} <div class="module"> <h2>{% firstof library.grouper _("Built-in filters") %}</h2> - {% if library.grouper %}<p class="small quiet">{% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these filters, put <code>{{ code }}</code> in your template before using the filter.{% endblocktrans %}</p><hr />{% endif %} + {% if library.grouper %}<p class="small quiet">{% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these filters, put <code>{{ code }}</code> in your template before using the filter.{% endblocktrans %}</p><hr>{% endif %} {% for filter in library.list|dictsort:"name" %} <h3 id="{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</h3> {{ filter.title }} {{ filter.body }} - {% if not forloop.last %}<hr />{% endif %} + {% if not forloop.last %}<hr>{% endif %} {% endfor %} </div> {% endfor %} diff --git a/django/contrib/admindocs/templates/admin_doc/template_tag_index.html b/django/contrib/admindocs/templates/admin_doc/template_tag_index.html index 6196985474..bb4f239147 100644 --- a/django/contrib/admindocs/templates/admin_doc/template_tag_index.html +++ b/django/contrib/admindocs/templates/admin_doc/template_tag_index.html @@ -20,12 +20,12 @@ {% for library in tag_libraries %} <div class="module"> <h2>{% firstof library.grouper _("Built-in tags") %}</h2> - {% if library.grouper %}<p class="small quiet">{% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these tags, put <code>{{ code }}</code> in your template before using the tag.{% endblocktrans %}</p><hr />{% endif %} + {% if library.grouper %}<p class="small quiet">{% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these tags, put <code>{{ code }}</code> in your template before using the tag.{% endblocktrans %}</p><hr>{% endif %} {% for tag in library.list|dictsort:"name" %} <h3 id="{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</h3> <h4>{{ tag.title|striptags }}</h4> {{ tag.body }} - {% if not forloop.last %}<hr />{% endif %} + {% if not forloop.last %}<hr>{% endif %} {% endfor %} </div> {% endfor %} diff --git a/django/contrib/admindocs/templates/admin_doc/view_index.html b/django/contrib/admindocs/templates/admin_doc/view_index.html index 16e48ca8dc..77b3e40b1d 100644 --- a/django/contrib/admindocs/templates/admin_doc/view_index.html +++ b/django/contrib/admindocs/templates/admin_doc/view_index.html @@ -50,7 +50,7 @@ View function: <code>{{ full_name }}</code>. Name: <code>{{ url_name }}</code>. {% endblocktrans %}</p> <p>{{ view.title }}</p> -<hr /> +<hr> {% endifchanged %} {% endfor %} </div> diff --git a/django/forms/forms.py b/django/forms/forms.py index 1be7814993..19d5778468 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -274,7 +274,7 @@ class BaseForm: normal_row='<tr%(html_class_attr)s><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>', error_row='<tr><td colspan="2">%s</td></tr>', row_ender='</td></tr>', - help_text_html='<br /><span class="helptext">%s</span>', + help_text_html='<br><span class="helptext">%s</span>', errors_on_separate_row=False) def as_ul(self): diff --git a/django/forms/jinja2/django/forms/widgets/clearable_file_input.html b/django/forms/jinja2/django/forms/widgets/clearable_file_input.html index 7248f32d2a..9e76435216 100644 --- a/django/forms/jinja2/django/forms/widgets/clearable_file_input.html +++ b/django/forms/jinja2/django/forms/widgets/clearable_file_input.html @@ -1,5 +1,5 @@ {% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %} -<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}" /> -<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br /> +<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"> +<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br> {{ widget.input_text }}:{% endif %} -<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %} /> +<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}> diff --git a/django/forms/jinja2/django/forms/widgets/input.html b/django/forms/jinja2/django/forms/widgets/input.html index abbdf6bd26..d5651571f2 100644 --- a/django/forms/jinja2/django/forms/widgets/input.html +++ b/django/forms/jinja2/django/forms/widgets/input.html @@ -1 +1 @@ -<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} /> +<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value }}"{% endif %}{% include "django/forms/widgets/attrs.html" %}> diff --git a/django/forms/templates/django/forms/widgets/clearable_file_input.html b/django/forms/templates/django/forms/widgets/clearable_file_input.html index 7248f32d2a..9e76435216 100644 --- a/django/forms/templates/django/forms/widgets/clearable_file_input.html +++ b/django/forms/templates/django/forms/widgets/clearable_file_input.html @@ -1,5 +1,5 @@ {% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %} -<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}" /> -<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br /> +<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"> +<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br> {{ widget.input_text }}:{% endif %} -<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %} /> +<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}> diff --git a/django/forms/templates/django/forms/widgets/input.html b/django/forms/templates/django/forms/widgets/input.html index 5feef43c55..9010a92145 100644 --- a/django/forms/templates/django/forms/widgets/input.html +++ b/django/forms/templates/django/forms/widgets/input.html @@ -1 +1 @@ -<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} /> +<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %}> diff --git a/django/forms/widgets.py b/django/forms/widgets.py index 6ccbb86274..76c12e2dcb 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -74,7 +74,7 @@ class Media: media = sorted(self._css) return chain.from_iterable([ format_html( - '<link href="{}" type="text/css" media="{}" rel="stylesheet" />', + '<link href="{}" type="text/css" media="{}" rel="stylesheet">', self.absolute_path(path), medium ) for path in self._css[medium] ] for medium in media) diff --git a/django/template/backends/utils.py b/django/template/backends/utils.py index 8147bb4988..8d41213965 100644 --- a/django/template/backends/utils.py +++ b/django/template/backends/utils.py @@ -6,7 +6,7 @@ from django.utils.safestring import SafeText def csrf_input(request): return format_html( - '<input type="hidden" name="csrfmiddlewaretoken" value="{}" />', + '<input type="hidden" name="csrfmiddlewaretoken" value="{}">', get_token(request)) diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index 5d7665d64e..e876c555f3 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -404,7 +404,7 @@ def force_escape(value): def linebreaks_filter(value, autoescape=True): """ Replace line breaks in plain text with appropriate HTML; a single - newline becomes an HTML line break (``<br />``) and a new line + newline becomes an HTML line break (``<br>``) and a new line followed by a blank line becomes a paragraph break (``</p>``). """ autoescape = autoescape and not isinstance(value, SafeData) @@ -416,13 +416,13 @@ def linebreaks_filter(value, autoescape=True): def linebreaksbr(value, autoescape=True): """ Convert all newlines in a piece of plain text to HTML line breaks - (``<br />``). + (``<br>``). """ autoescape = autoescape and not isinstance(value, SafeData) value = normalize_newlines(value) if autoescape: value = escape(value) - return mark_safe(value.replace('\n', '<br />')) + return mark_safe(value.replace('\n', '<br>')) @register.filter(is_safe=True) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 6d8813b2fe..abb72fa13c 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -54,7 +54,7 @@ class CsrfTokenNode(Node): if csrf_token == 'NOTPROVIDED': return format_html("") else: - return format_html("<input type='hidden' name='csrfmiddlewaretoken' value='{}' />", csrf_token) + return format_html("<input type='hidden' name='csrfmiddlewaretoken' value='{}'>", csrf_token) else: # It's very probable that the token is missing because of # misconfiguration, so we raise a warning @@ -1408,7 +1408,7 @@ def widthratio(parser, token): For example:: <img src="bar.png" alt="Bar" - height="10" width="{% widthratio this_value max_value max_width %}" /> + height="10" width="{% widthratio this_value max_value max_width %}"> If ``this_value`` is 175, ``max_value`` is 200, and ``max_width`` is 100, the image in the above example will be 88 pixels wide diff --git a/django/test/html.py b/django/test/html.py index fdedafe76e..c01f73c1fb 100644 --- a/django/test/html.py +++ b/django/test/html.py @@ -118,7 +118,7 @@ class Element: output += ''.join(str(c) for c in self.children) output += '\n</%s>' % self.name else: - output += ' />' + output += '>' return output def __repr__(self): diff --git a/django/utils/html.py b/django/utils/html.py index 9c219ba1c6..e6389d4db5 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -124,13 +124,13 @@ def format_html_join(sep, format_string, args_generator): @keep_lazy_text def linebreaks(value, autoescape=False): - """Convert newlines into <p> and <br />s.""" + """Convert newlines into <p> and <br>s.""" value = normalize_newlines(value) paras = re.split('\n{2,}', str(value)) if autoescape: - paras = ['<p>%s</p>' % escape(p).replace('\n', '<br />') for p in paras] + paras = ['<p>%s</p>' % escape(p).replace('\n', '<br>') for p in paras] else: - paras = ['<p>%s</p>' % p.replace('\n', '<br />') for p in paras] + paras = ['<p>%s</p>' % p.replace('\n', '<br>') for p in paras] return '\n\n'.join(paras) diff --git a/django/views/static.py b/django/views/static.py index c9d4b0317a..c93c136993 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -62,9 +62,9 @@ DEFAULT_DIRECTORY_INDEX_TEMPLATE = """ <!DOCTYPE html> <html lang="en"> <head> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - <meta http-equiv="Content-Language" content="en-us" /> - <meta name="robots" content="NONE,NOARCHIVE" /> + <meta http-equiv="Content-type" content="text/html; charset=utf-8"> + <meta http-equiv="Content-Language" content="en-us"> + <meta name="robots" content="NONE,NOARCHIVE"> <title>{% blocktrans %}Index of {{ directory }}{% endblocktrans %}</title> </head> <body> |
