mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 13:18:15 +00:00
161 lines
4.7 KiB
HTML
161 lines
4.7 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block content %}
|
|
<!-- this overrides the django.contrib.auth default form
|
|
and it must be placed in
|
|
troggle/templates/login/register.html
|
|
because magic
|
|
|
|
This is because Django is Opinionated and does lots of Invisible Defaults
|
|
see
|
|
https://docs.djangoproject.com/en/5.0/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
|
|
-->
|
|
<script>
|
|
function myFunction() {
|
|
var x = document.getElementById("id_password1");
|
|
if (x.type === "password") {
|
|
x.type = "text";
|
|
} else {
|
|
x.type = "password";
|
|
}
|
|
var x = document.getElementById("id_password2");
|
|
if (x.type === "password") {
|
|
x.type = "text";
|
|
} else {
|
|
x.type = "password";
|
|
}
|
|
}
|
|
</script>
|
|
<style>
|
|
input, textarea {font-family: monospace; font-weight: bold; text-align:right; font-size: 100%; padding: 0.5em; }
|
|
textarea {text-align:left }
|
|
input[type="checkbox"] {
|
|
transform: scale(1.7);
|
|
margin: 10px;
|
|
}
|
|
li {color:red}
|
|
</style>
|
|
|
|
<div class='middle'>
|
|
<h2>{% if newuser %}
|
|
New User Registration <br />for someone who has never attended Expo
|
|
{% else %}
|
|
User Registration - for a personal login to Troggle by a known caver
|
|
{%endif %}</h2>
|
|
<!--using template login/register.html -->
|
|
</div>
|
|
<!-- This is really TWO forms, depending on whether the 'new_user' is set or not.
|
|
|
|
ALSO it behaves differently if a username is specified in the URL, when username becomes readonly
|
|
|
|
-->
|
|
<h3>Register your email address</h3>
|
|
|
|
{% if newuser %}
|
|
<p>You need to register before you can fill out the 'signup' form to request to attend Expo.
|
|
{% else %}
|
|
<p>For previous expoers, your username must be your 'troggle id' as listed on the <a href='/people_ids'>past expoers list</a>
|
|
<p>For new people wanting to come to expo for the first time, please use the <a href="/accounts/newregister/">New User</a> registration form
|
|
{%endif %}
|
|
<p>This will eventually sign you up automatically to the
|
|
<a href="https://lists.wookware.org/cgi-bin/mailman/roster/expo">expo email list</a>.
|
|
So type in the same email address that you use there if you have already signed up to that.
|
|
<p>
|
|
<span style="color:red">
|
|
{{ warning }} {{ form.errors }}
|
|
</span>
|
|
|
|
<div style='width: 700px; font-family: monospace; font-weight: bold; font-size: 150%; text-align: right; '>
|
|
<form method="post" accept-charset="utf-8">{% csrf_token %}
|
|
<p>
|
|
{% if email_stored %}
|
|
<label for="id_username">Username <span style="color:blue">(checked)</span>:</label>
|
|
{% else %}
|
|
<label for="id_username">Username:</label>
|
|
{% endif %}
|
|
{{form.username}}
|
|
</p>
|
|
<p>
|
|
{% if email_stored %}
|
|
<label for="id_email">email <span style="color:blue">(stored)</span>:</label>
|
|
{% else %}
|
|
<label for="id_email">email:</label>
|
|
{% endif %}
|
|
{{form.email}}
|
|
</p>
|
|
{% if logged_in %}<!-- one we have initially logged in,
|
|
all later password chnages are done ONLY via email token password re-set-->
|
|
{% else %}
|
|
<p>
|
|
<label for="id_password1">Troggle password:</label>
|
|
{{form.password1}}
|
|
</p>
|
|
<p>
|
|
<label for="id_password2">Re-type your troggle password:</label>
|
|
{{form.password2}}
|
|
</p>
|
|
{%endif %}
|
|
|
|
<div class='align-right'>
|
|
{% if newuser %}
|
|
{% else %}
|
|
{% if logged_in %}
|
|
{% else %}
|
|
<input type="checkbox" checked name="visible-passwords" onclick="myFunction()">Make Passwords visible (on this form only)
|
|
{%endif %}
|
|
{%endif %}
|
|
<br /><br />
|
|
{% if newuser %}
|
|
|
|
<button class="fancybutton" style="padding: 0.5em 25px; font-size: 100%;"
|
|
onclick="window.location.href='/accounts/password_reset/'" value = "Go to" >
|
|
Get login token by email →
|
|
</button>
|
|
{% else %}
|
|
<button class="fancybutton" type="button"
|
|
{% if logged_in or email_stored %}
|
|
style="padding: 0.5em 25px; font-size: 100%;"
|
|
{% else %}
|
|
style="padding: 0.5em 25px; font-size: 100%; background: silver;"
|
|
disabled
|
|
{% endif %}
|
|
onclick="window.location.href='/accounts/password_reset/'" value = "Go to" >
|
|
Confirm email
|
|
</button>
|
|
|
|
|
|
{% if logged_in %}
|
|
<button class="fancybutton" style="padding: 0.5em 25px; font-size: 100%;" type = "submit" >
|
|
Change or confirm email →
|
|
</button>
|
|
{% else %}
|
|
{% if email_stored %}
|
|
{% else %}
|
|
<button class="fancybutton" style="padding: 0.5em 25px; font-size: 100%;" type = "submit" >
|
|
Register →
|
|
</button>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{%endif %}
|
|
{% if email_stored %}
|
|
<button class="fancybutton" type="button"
|
|
style="padding: 0.5em 25px; font-size: 100%;"
|
|
onclick="window.location.href='/accounts/login/'" value = "Go to" >
|
|
Login →
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div style='width: 50em' align="left">
|
|
{% include 'login/register_text.html' %}
|
|
|
|
|
|
<span style="color:red">
|
|
{{ form.non_field_errors }} <!-- form validation errors appear here, and also at the top of the form-->
|
|
</span>
|
|
</div>
|
|
|
|
{% endblock %}
|