Add additional account app templates

This works around use block "body" when we need block "content".
This commit is contained in:
Ben Sturmfels 2023-04-20 15:07:37 +10:00
parent ceda6dce0a
commit 71805cc66e
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
12 changed files with 234 additions and 0 deletions

View file

@ -0,0 +1,19 @@
{% extends "account/base.html" %}
{% load i18n %}
{% block body_class %}account account-delete{% endblock %}
{% block head_title %}{% trans "Delete Account" %}{% endblock %}
{% block content %}
<h1>{% trans "Delete Account" %}</h1>
<p>{% blocktrans %}If you go ahead and delete your account, your information will be <b>expunged within {{ ACCOUNT_DELETION_EXPUNGE_HOURS }} hours</b>.{% endblocktrans %}</p>
<form method="post" action="{% url "account_delete" %}" autocapitalize="off">
{% csrf_token %}
<button type="submit" class="btn btn-danger">{% trans "Delete My Account" %}</button>
</form>
{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends "site_base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Confirm Email" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-5">
<form method="post" action="{% url "account_confirm_email" key=confirmation.key %}">
<legend>{% trans "Confirm Email" %}</legend>
<fieldset>
{% csrf_token %}
<p>{% blocktrans with email=confirmation.email_address.email %}Confirm email address <b>{{ email }}</b>?{% endblocktrans %}</p>
<button type="submit" class="btn btn-primary">{% trans "Confirm" %}</button>
</fieldset>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends "site_base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Confirm your email address" %}{% endblock %}
{% block content %}
<h2>{% trans "Confirm your email address" %}</h2>
<p>{% blocktrans %}We have sent you an email to <b>{{ email }}</b> for verification. Follow the link provided to finalize the signup process. If you do not receive it within a few minutes, contact us at <a href="mailto:{{ THEME_CONTACT_EMAIL }}">{{ THEME_CONTACT_EMAIL }}</a>.{% endblocktrans %}</p>
<p><a href="{{ success_url }}">{% trans "Go back" %}</a></p>
{% endblock %}

View file

@ -0,0 +1,10 @@
{% extends "site_base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Email confirmed" %}{% endblock %}
{% block content %}
<h1>{% trans "Email confirmed" %}</h1>
<p>{% blocktrans with email=confirmation.email_address.email %}You have confirmed <b>{{ email }}</b>{% endblocktrans %}</p>
{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends "site_base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Log out" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-5">
<form method="POST" action="{% url "account_logout" %}">
<legend>{% trans "Log out" %}</legend>
<fieldset>
{% csrf_token %}
<p>{% trans "Are you sure you want to log out?" %}</p>
<button type="submit" class="btn btn-primary">{% trans "Log out" %}</button>
</fieldset>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,23 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap %}
{% block body_class %}account account-password{% endblock %}
{% block head_title %}{% trans "Change password" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-5">
<form method="POST" action="">
<legend>{% trans "Change password" %}</legend>
<fieldset>
{% csrf_token %}
{{ form|bootstrap }}
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
</fieldset>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,36 @@
{% extends "site_base.html" %}
{% load i18n %}
{% load bootstrap %}
{% load account_tags %}
{% block head_title %}{% trans "Password reset" %}{% endblock %}
{% user_display request.user as user_display %}
{% block content %}
<div class="row">
<div class="col-md-8">
<form method="POST" action="">
<legend>{% trans "Password reset" %}</legend>
<p class="lead">{% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %}</p>
<fieldset class="row">
<div class="col-md-5">
{% csrf_token %}
{{ form|bootstrap }}
<button type="submit" class="btn btn-primary">
{% trans "Reset my password" %}
</button>
</div>
</fieldset>
</form>
</div>
</div>
<p>{% blocktrans %}If you have any trouble resetting your password, contact us at <a href="mailto:{{ THEME_CONTACT_EMAIL }}">{{ THEME_CONTACT_EMAIL }}</a>.{% endblocktrans %}</p>
{% endblock %}
{% block extra_body %}
<script>
$("#id_email").focus();
</script>
{% endblock %}

View file

@ -0,0 +1,27 @@
{% extends "site_base.html" %}
{% load i18n %}
{% load account_tags %}
{% block head_title %}{% trans "Password reset sent" %}{% endblock %}
{% block content %}
<h1>{% trans "Password reset sent" %}</h1>
{% if not resend %}
<p>{% blocktrans %}We have sent you an email. If you do not receive it within a few minutes, try resending or contact us at <a href="mailto:{{ THEME_CONTACT_EMAIL }}">{{ THEME_CONTACT_EMAIL }}</a>.{% endblocktrans %}</p>
<div class="row">
<div class="col-md-5">
<form method="POST" action="{% url "account_password_reset" %}">
{% csrf_token %}
{% for field in form %}
{{ field.as_hidden }}
{% endfor %}
<button type="submit" name="resend" class="btn btn-primary">{% trans "Resend" %}</button>
</form>
</div>
</div>
{% else %}
<p>{% blocktrans %}We have resent the password email. If you do not receive it within a few minutes, contact us at <a href="mailto:{{ THEME_CONTACT_EMAIL }}">{{ THEME_CONTACT_EMAIL }}</a>.{% endblocktrans %}</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "site_base.html" %}
{% load i18n %}
{% load bootstrap %}
{% block head_title %}{% trans "Set your new password" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-5">
<form method="POST" action="{% url "account_password_reset_token" uidb36=uidb36 token=token %}">
<legend>{% trans "Set your new password" %}</legend>
<fieldset>
{% csrf_token %}
{{ form|bootstrap }}
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
</fieldset>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends "site_base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Bad token" %}{% endblock %}
{% block content %}
<h1>{% trans "Bad token" %}</h1>
{% url "account_password_reset" as url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ url }}">new password reset</a>.{% endblocktrans %}</p>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap %}
{% block body_class %}account account-settings{% endblock %}
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-5">
<form method="POST" action="{% url "account_settings" %}">
<legend>{% trans "Account" %}</legend>
{% csrf_token %}
{{ form|bootstrap }}
<button class="btn btn-primary" type="submit">{% trans "Save" %}</button>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,14 @@
{% extends "site_base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Sign up" %}{% endblock %}
{% block content %}
<h1>{% trans "This site is in private beta" %}</h1>
<p>{% blocktrans %}If you have signup code you can enter it below.{% endblocktrans %}</p>
<form method="get" action="">
<div><input type="text" name="code" placeholder="{% trans 'Your signup code...' %}" /></div>
<div><input type="submit" class="btn btn-primary"></div>
</form>
{% endblock %}