Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make use of new ability to override admin add form templates and remo…
…ved a litle bit of redundancy in the templates. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12218 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
Showing
5 changed files
with
107 additions
and
92 deletions.
There are no files selected for viewing
32 changes: 5 additions & 27 deletions
32
django/contrib/admin/templates/admin/auth/user/add_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,11 @@ | ||
{% extends "admin/change_form.html" %} | ||
{% load i18n %} | ||
|
||
{% block after_field_sets %} | ||
|
||
<p>{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}</p> | ||
|
||
<fieldset class="module aligned"> | ||
|
||
<div class="form-row"> | ||
{{ form.username.errors }} | ||
{# TODO: get required class on label_tag #} | ||
<label for="id_username" class="required">{% trans 'Username' %}:</label> {{ form.username }} | ||
<p class="help">{{ form.username.help_text }}</p> | ||
</div> | ||
|
||
<div class="form-row"> | ||
{{ form.password1.errors }} | ||
{# TODO: get required class on label_tag #} | ||
<label for="id_password1" class="required">{% trans 'Password' %}:</label> {{ form.password1 }} | ||
</div> | ||
|
||
<div class="form-row"> | ||
{{ form.password2.errors }} | ||
{# TODO: get required class on label_tag #} | ||
<label for="id_password2" class="required">{% trans 'Password (again)' %}:</label> {{ form.password2 }} | ||
<p class="help">{% trans 'Enter the same password as above, for verification.' %}</p> | ||
</div> | ||
{% block form_top %} | ||
<p>{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}</p> | ||
<input type="hidden" name="_continue" value="1" /> | ||
{% endblock %} | ||
|
||
{% block after_field_sets %} | ||
<script type="text/javascript">document.getElementById("id_username").focus();</script> | ||
|
||
</fieldset> | ||
{% endblock %} |
44 changes: 34 additions & 10 deletions
44
django/contrib/admin/templates/registration/password_change_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,50 @@ | ||
{% extends "admin/base_site.html" %} | ||
{% load i18n %} | ||
{% load i18n adminmedia %} | ||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}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="../logout/">{% trans 'Log out' %}</a>{% endblock %} | ||
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password change' %}</div>{% endblock %} | ||
|
||
{% block title %}{% trans 'Password change' %}{% endblock %} | ||
|
||
{% block content %} | ||
{% block content %}<div id="content-main"> | ||
|
||
<form action="" method="post">{% csrf_token %} | ||
<div> | ||
{% if form.errors %} | ||
<p class="errornote"> | ||
{% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} | ||
</p> | ||
{% endif %} | ||
|
||
<h1>{% trans 'Password change' %}</h1> | ||
|
||
<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p> | ||
|
||
<form action="" method="post">{% csrf_token %} | ||
<fieldset class="module aligned wide"> | ||
|
||
<div class="form-row"> | ||
{{ form.old_password.errors }} | ||
<label for="id_old_password" class="required">{% trans 'Old password' %}:</label>{{ form.old_password }} | ||
</div> | ||
|
||
{{ form.old_password.errors }} | ||
<p class="aligned wide"><label for="id_old_password">{% trans 'Old password:' %}</label>{{ form.old_password }}</p> | ||
{{ form.new_password1.errors }} | ||
<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> | ||
<div class="form-row"> | ||
{{ form.new_password1.errors }} | ||
<label for="id_new_password1" class="required">{% trans 'New password' %}:</label>{{ form.new_password1 }} | ||
</div> | ||
|
||
<div class="form-row"> | ||
{{ form.new_password2.errors }} | ||
<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> | ||
<label for="id_new_password2" class="required">{% trans 'Password (again)' %}:</label>{{ form.new_password2 }} | ||
</div> | ||
|
||
</fieldset> | ||
|
||
<div class="submit-row"> | ||
<input type="submit" value="{% trans 'Change my password' %}" class="default" /> | ||
</div> | ||
|
||
<p><input type="submit" value="{% trans 'Change my password' %}" /></p> | ||
</form> | ||
<script type="text/javascript">document.getElementById("id_old_password").focus();</script> | ||
</div> | ||
</form></div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters