diff options
author | Matthew Lemon <y@yulqen.org> | 2024-04-23 11:16:38 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-04-23 11:16:38 +0100 |
commit | 0f951dcf029d4af284467543a3afdf5bf6581a20 (patch) | |
tree | a48384210cdc168e3bd3ccff6d6d516eeed9e748 /core/templates/registration | |
parent | 8b084e9fe7a5f3a04c32daf9a24f7f2cf67300f9 (diff) |
switched to Django
Diffstat (limited to 'core/templates/registration')
-rw-r--r-- | core/templates/registration/logged_out.html | 9 | ||||
-rw-r--r-- | core/templates/registration/login.html | 43 | ||||
-rw-r--r-- | core/templates/registration/password_change_done.html | 15 | ||||
-rw-r--r-- | core/templates/registration/password_change_form.html | 59 | ||||
-rw-r--r-- | core/templates/registration/password_reset_complete.html | 20 | ||||
-rw-r--r-- | core/templates/registration/password_reset_confirm.html | 42 | ||||
-rw-r--r-- | core/templates/registration/password_reset_done.html | 19 | ||||
-rw-r--r-- | core/templates/registration/password_reset_email.html | 14 | ||||
-rw-r--r-- | core/templates/registration/password_reset_form.html | 29 | ||||
-rw-r--r-- | core/templates/registration/register.html | 22 |
10 files changed, 272 insertions, 0 deletions
diff --git a/core/templates/registration/logged_out.html b/core/templates/registration/logged_out.html new file mode 100644 index 0000000..61e6831 --- /dev/null +++ b/core/templates/registration/logged_out.html @@ -0,0 +1,9 @@ +{% extends "core/base.html" %} + +{% block title %}Logged out{% endblock title %} + +{% block content %} + + <p>You've logged out. Bye.</p> + +{% endblock content %} diff --git a/core/templates/registration/login.html b/core/templates/registration/login.html new file mode 100644 index 0000000..9e00087 --- /dev/null +++ b/core/templates/registration/login.html @@ -0,0 +1,43 @@ +{% extends "core/base.html" %} + +{% block content %} + +<div class="w3-container"> + {% if form.errors %} + <p>Your username and password didn't match. Please try again.</p> + {% endif %} + + {% if next %} + {% if user.is_authenticated %} + <p>Your account doesn't have access to this page. To proceed, + please login with an account that has access.</p> + {% else %} + <p>Please login to see this page.</p> + {% endif %} + {% endif %} + + <form method="post" action="{% url 'login' %}"> + {% csrf_token %} + <div class="form-group"> + {{ form.username.label_tag }} + {{ form.username }} + </div> + + <div class="form-group"> + {{ form.password.label_tag }} + {{ form.password }} + </div> + + <div class="form-group"> + <button type="submit" class="btn btn-primary" value="login">Log In</button> + </div> + <input type="hidden" name="next" value="{{ next }}"> + </form> + + <div class="form-group"> + {# Assumes you set up the password_reset view in your URLconf #} + <a href="{% url 'password_reset' %}">Lost password?</a> + </div> + + {% endblock content %} +</div> diff --git a/core/templates/registration/password_change_done.html b/core/templates/registration/password_change_done.html new file mode 100644 index 0000000..20fac71 --- /dev/null +++ b/core/templates/registration/password_change_done.html @@ -0,0 +1,15 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% 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 userlinks %} +{% block breadcrumbs %} +<div class="breadcrumbs"> +<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> +› {% trans "Password change" %} +</div> +{% endblock breadcrumbs %} + +{% block title %}{{ title }}{% endblock title %} +{% block content_title %}<h1>{{ title }}</h1>{% endblock content_title %} +{% block content %} +<p>{% trans "Your password was changed." %}</p> +{% endblock content %} diff --git a/core/templates/registration/password_change_form.html b/core/templates/registration/password_change_form.html new file mode 100644 index 0000000..4ed12d4 --- /dev/null +++ b/core/templates/registration/password_change_form.html @@ -0,0 +1,59 @@ +{% 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 extrastyle %} +{% 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 userlinks %} +{% block breadcrumbs %} +<div class="breadcrumbs"> +<a href="{% url "admin:index" %}">{% trans "Home" %}</a> +› {% trans "Password change" %} +</div> +{% endblock breadcrumbs %} + +{% block title %}{{ title }}{% endblock title %} +{% block content_title %}<h1>{{ title }}</h1>{% endblock content_title %} + +{% block content %}<div id="content-main"> + +<form method="post">{% csrf_token %} +<div> +{% 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 %} + </p> +{% endif %} + +<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 }} + {{ form.old_password.label_tag }} {{ form.old_password }} +</div> + +<div class="form-row"> + {{ form.new_password1.errors }} + {{ form.new_password1.label_tag }} {{ form.new_password1 }} + {% if form.new_password1.help_text %} + <div class="help">{{ form.new_password1.help_text|safe }}</div> + {% endif %} +</div> + +<div class="form-row"> +{{ form.new_password2.errors }} + {{ form.new_password2.label_tag }} {{ form.new_password2 }} + {% if form.new_password2.help_text %} + <div class="help">{{ form.new_password2.help_text|safe }}</div> + {% endif %} +</div> + +</fieldset> + +<div class="submit-row"> + <input type="submit" value="{% trans "Change my password" %}" class="default" /> +</div> + +</div> +</form></div> + +{% endblock content %} diff --git a/core/templates/registration/password_reset_complete.html b/core/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..0e60645 --- /dev/null +++ b/core/templates/registration/password_reset_complete.html @@ -0,0 +1,20 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block breadcrumbs %} +<div class="breadcrumbs"> +<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> +› {% trans "Password reset" %} +</div> +{% endblock breadcrumbs %} + +{% block title %}{{ title }}{% endblock title %} +{% block content_title %}<h1>{{ title }}</h1>{% endblock content_title %} + +{% block content %} + +<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p> + +<p><a href="{{ login_url }}">{% trans "Log in" %}</a></p> + +{% endblock content %} diff --git a/core/templates/registration/password_reset_confirm.html b/core/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..e493f5a --- /dev/null +++ b/core/templates/registration/password_reset_confirm.html @@ -0,0 +1,42 @@ +{% 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 extrastyle %} +{% block breadcrumbs %} +<div class="breadcrumbs"> +<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> +› {% trans "Password reset confirmation" %} +</div> +{% endblock breadcrumbs %} + +{% block title %}{{ title }}{% endblock title %} +{% block content_title %}<h1>{{ title }}</h1>{% endblock content_title %} +{% block content %} + +{% if validlink %} + +<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p> + +<form method="post">{% csrf_token %} +<fieldset class="module aligned"> + <div class="form-row field-password1"> + {{ form.new_password1.errors }} + <label for="id_new_password1">{% trans "New password:" %}</label> + {{ form.new_password1 }} + </div> + <div class="form-row field-password2"> + {{ form.new_password2.errors }} + <label for="id_new_password2">{% trans "Confirm password:" %}</label> + {{ form.new_password2 }} + </div> + <input type="submit" value="{% trans "Change my password" %}" /> +</fieldset> +</form> + +{% else %} + +<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p> + +{% endif %} + +{% endblock content %} diff --git a/core/templates/registration/password_reset_done.html b/core/templates/registration/password_reset_done.html new file mode 100644 index 0000000..a29461d --- /dev/null +++ b/core/templates/registration/password_reset_done.html @@ -0,0 +1,19 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block breadcrumbs %} +<div class="breadcrumbs"> +<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> +› {% trans "Password reset" %} +</div> +{% endblock breadcrumbs %} + +{% block title %}{{ title }}{% endblock title %} +{% block content_title %}<h1>{{ title }}</h1>{% endblock content_title %} +{% block content %} + +<p>{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}</p> + +<p>{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}</p> + +{% endblock content %} diff --git a/core/templates/registration/password_reset_email.html b/core/templates/registration/password_reset_email.html new file mode 100644 index 0000000..0cd2e51 --- /dev/null +++ b/core/templates/registration/password_reset_email.html @@ -0,0 +1,14 @@ +{% load i18n %}{% autoescape off %} +{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} + +{% trans "Please go to the following page and choose a new password:" %} +{% block reset_link %} +{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} +{% endblock reset_link %} +{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }} + +{% trans "Thanks for using our site!" %} + +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} + +{% endautoescape %} diff --git a/core/templates/registration/password_reset_form.html b/core/templates/registration/password_reset_form.html new file mode 100644 index 0000000..921fb8e --- /dev/null +++ b/core/templates/registration/password_reset_form.html @@ -0,0 +1,29 @@ +{% 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 extrastyle %} +{% block breadcrumbs %} +<div class="breadcrumbs"> +<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> +› {% trans "Password reset" %} +</div> +{% endblock breadcrumbs %} + +{% block title %}{{ title }}{% endblock title %} +{% block content_title %}<h1>{{ title }}</h1>{% endblock content_title %} +{% block content %} + +<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p> + +<form method="post">{% csrf_token %} +<fieldset class="module aligned"> + <div class="form-row field-email"> + {{ form.email.errors }} + <label for="id_email">{% trans "Email address:" %}</label> + {{ form.email }} + </div> + <input type="submit" value="{% trans "Reset my password" %}" /> +</fieldset> +</form> + +{% endblock content %} diff --git a/core/templates/registration/register.html b/core/templates/registration/register.html new file mode 100644 index 0000000..98615fd --- /dev/null +++ b/core/templates/registration/register.html @@ -0,0 +1,22 @@ +{% extends "core/base.html" %} + +{% block title %}Register new user{% endblock title %} + +{% block content %} + <h1>Register a new user</h1> + <form action="{% url 'register' %}" method="post" accept-charset="utf-8"> + {% csrf_token %} + {% if messages %} + <ul> + {% for message in messages %} + <li>{{ message }}</li> + {% endfor %} + </ul> + {% endif %} + {{ form }} + + <input type="submit" name="submit" id="submit" value="Register" /> + + </form> + +{% endblock content %} |