Added templates for password_change_form and password_change_done. Added button to profile_detail.

This commit is contained in:
David Taylor
2015-04-19 23:32:05 +01:00
parent 8c135fbc18
commit 30210fe85a
3 changed files with 67 additions and 61 deletions

View File

@@ -3,19 +3,28 @@
{% block title %}RIGS Profile {{object.pk}}{% endblock %}
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
<div class="col-sm-10">
<div class="col-md-10 col-md-offset-1">
<div class="col-sm-12">
<div class="col-sm-6">
<h3>{{object.name}}</h3>
</div>
{% if object.pk == user.pk %}
<div class="col-sm-2">
<div class="pull-right">
<a href="{% url 'profile_update_self' %}" class="btn btn-primary">
Edit <span class="glyphicon glyphicon-pencil"></span>
<div class="col-sm-6 text-right">
<div class="btn-group btn-page">
<a href="{% url 'profile_update_self' %}" class="btn btn-default">
Edit Profile <span class="glyphicon glyphicon-pencil"></span>
</a>
</div>
<a href="{% url 'password_change' %}" class="btn btn-default">
Change Password <span class="glyphicon glyphicon-lock"></span>
</a>
</div>
</div>
{% endif %}
</div>
<div class="col-sm-6">
<dl class="dl-horizontal">
<dt>First Name</dt>

View File

@@ -0,0 +1,20 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password change successful' %}{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>{% trans 'Password change successful' %}</h1>
<p>{% trans "Your password has been changed" %}</p>
</div>
{% endblock %}

View File

@@ -1,56 +1,33 @@
{% extends "admin/base_site.html" %}
{% load i18n static %}
{% extends "base.html" %}
{% load widget_tweaks %}
{% load url from future %}
{% 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">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password change' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password change' %}{% endblock %}
{% block content %}<div id="content-main">
<form action="" method="post">{% csrf_token %}
<div>
{% if form.errors %}
<p class="errornote">
{% blocktrans count counter=form.errors.items|length %}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>
<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>
<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 }}
<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>
<script type="text/javascript">document.getElementById("id_old_password").focus();</script>
</div>
</form></div>
{% block title %}Change Password{% endblock %}
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
<h3>Change Password</h3>
{% if form.errors or supplement_form.errors %}
<div class="alert alert-danger">
Please correct the error(s) below.
{{form.errors}}
{{supplement_form.errors}}
</div>
{% endif %}
<p>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>
<div class="col-sm-8 col-sm-offset-2">
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-4">{{ field.label }}</label>
<div class="controls col-sm-8">
{% render_field field class+="form-control" placeholder=field.label %}
</div>
</div>
{% endfor %}
<p><input type="submit" value="Change Password" class="btn btn-primary pull-right"></p>
</form>
</div>
{% endblock %}