2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 14:58:17 +00:00

New user login/logoff system using standard Dj

This commit is contained in:
Philip Sargent
2021-04-06 00:49:09 +01:00
parent 6d6bec35f2
commit d1cd72c5f8
25 changed files with 348 additions and 197 deletions

View File

@@ -1,25 +0,0 @@
{% extends "base.html" %}
{% block title %}
New troggle account registered
{% endblock %}
{% block header %}
<h1>activate.html</h1>
{% endblock %}
{% block content %}
{% if account %}
<p>
Hello, {{ account }}! Your account is now activated. Now you can <a href="{%url "auth_login"%}">log in</a> with the password you chose. Use the links in the upper right to control this in the future.
</p>
<p>
If you have been on the expedition in the past, you already have a profile in the system; <a href={% url "profiles_select_profile" %}>click here </a> to find it and link it to your account. Otherwise, please <a href={% url "profiles_create_profile" %}> create yourself a new profile</a>.
</p>
{% else %}
The activation key you entered has already been used or was invalid.
{% endif %}
{% endblock %}

View File

@@ -1,10 +0,0 @@
<P>Hello {{ form.user }},</P>
<P>Glad you're joining the CUCC EXPO team! Please go to</P>
<P><a href="{{ site }}{% url "registration_activate" activation_key %}">{{ site }}{% url "registration_activate" activation_key %}</a></P>
<P>to activate your account. Do this within {{ expiration_days }} days, or else you'll have to sign up again.</P>
<P>Yours,<BR>
The magical troggle</P>

View File

@@ -1,10 +0,0 @@
Hello {{ form.user }},
Glad you're joining the CUCC EXPO team! Please go to
{{ site }}{% url "registration_activate" activation_key %}
to activate your account. Do this within {{ expiration_days }} days, or else you'll have to sign up again.
Yours,
The magical troggle

View File

@@ -1 +0,0 @@
[CUCC Expo] Activation email

View File

@@ -0,0 +1,55 @@
{% extends 'base.html' %}
{% block content %}
<!-- this overrides the django.contrib.admin default logout form
and it must be placed in
troggle/templates/registration/
because magic
Note that we need to have TWO DIFFERENT logout templates to make this work,
the other one is in
troggle/templates/login/logout.html
That one is for logging out
of the normal system whereas this one is for logging out of the Django Admin system.
Not forgetting the template in
troggle/templates/login/index
which also has a login form.
This is because Django is Opinionated and does lots of Invisible Defaults
-->
<div class='middle'>
<h2>You have been logged out</h2>
</div>
<!-- Yeah this logon form sometimes fails to appear, and then the Submit button gives a horrible crash.
All because of some CSRF horribleness ? Possibly.
So let's not even attempt to have it here, OK?
-->
<!--
<h3>Troggle user Login</h3>
<p>(using template registration/logged_out.html)
<div style='width: 250px;' class='middle3 login'>
<div class='align-center'>
<div class='space'></div>
<div class='align-center'>
<form action="/login/" method="post" accept-charset="utf-8">{% csrf_token %}
<table class='form'>
{{form.as_table}}
</table>
<div class='space'></div>
<span class='indent'>
<br /><input type="submit" value="Login &rarr;">
</form>
</div>
-->
<form action="/accounts/login/" method="GET" accept-charset="utf-8">
<br /><input type="submit" value="Login &rarr;">
</form>
{% endblock %}

View File

@@ -1,27 +0,0 @@
{% extends "base.html" %}
{% load csrffaker %}
{% block content %}
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
<div align="center">
<pre>This uses the registration/login.html template</pre>
<form method="post" action=".">{% csrf_token %}
<table>
<tr><td>{{ form.username.label_tag }}</td><td>{{ form.username }}</td></tr>
<tr><td>{{ form.password.label_tag }}</td><td>{{ form.password }}</td></tr>
</table>
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
</div>
{% endblock %}

View File

@@ -1,4 +0,0 @@
{% extends "base.html" %}
{% block content %}
You have been logged out.
{% endblock %}

View File

@@ -1,6 +0,0 @@
{% extends “base.html” %}
{% block body %}
Hello {{ account }}!
Check your email to confirm the activation. There are {{ expiration_days }} days left to do it.
{% endblock %}

View File

@@ -1,13 +0,0 @@
{% extends "base.html" %}
{% block title %}
{{ block.super }}: registration complete
{% endblock %}
{% block contentheader %}
<h1>Registration Complete</h1>
{% endblock %}
{% block content %}
<p>Thank you for signing up. An email with the activation code has been sent to your inbox. </p>
{% endblock %}

View File

@@ -1,50 +0,0 @@
{% extends "base.html" %}
{% block title %}
registration_form.html | {{ block.super }}
{% endblock %}
{% block header %}
<h1>registration_form.html</h1>
{% endblock %}
{% block content %}
<form action="{% url "registration_register" %}" method="POST">{% csrf_token %}
{% for error in form.non_field_errors %}
<span style="color:red">{{ error }}</span>
{% endfor %}
<table>
<tr>
<td align="right" valign="top">Username:</td>
<td>
{{ form.username }} <br/>
{% for error in form.username.errors %}
<span style="color:red">{{ error }}</span>
{% endfor %}
</td>
</tr>
<tr>
<td align="right" valign="top">Email:</td>
<td>
{{ form.email }} <br/>
{% for error in form.email.errors %}
<span style="color:red">{{ error }}</span>
{% endfor %}
</td>
</tr>
<tr>
<td align="right" valign="top">Password:</td>
<td>
{{ form.password1 }} <br/>
{% for error in form.password1.errors %}
<span style="color:red">{{ error }}</span>
{% endfor %}
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Register" /></td>
</tr>
</table>
</form>
{% endblock %}