user login and redirect after registration
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
{% block main %}
|
||||
<p>
|
||||
We know you are eager to start using rowsandall.com, but we must
|
||||
ask you to read and agree with the below first.
|
||||
ask you to read and agree with the below first. At the bottom of this page,
|
||||
you can opt in or delete this user account.
|
||||
</p>
|
||||
|
||||
<h2>GDPR Opt-In</h2>
|
||||
|
||||
@@ -21,14 +21,22 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><a href="/password_reset/">Forgot password?</a></td>
|
||||
<td><p><a href="/password_reset/">Forgot password?</a></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><p><a href="/rowers/register?next={{ next }}">Register New User</a></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="login" /></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<input type="submit" value="login" />
|
||||
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</form>
|
||||
</li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "newbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
{% block title %}Contact Us{% endblock title %}
|
||||
{% block title %}New User Registration{% endblock title %}
|
||||
{% block meta %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -23,7 +23,8 @@
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
<a href="/rowers/legal">Terms of Service</a>
|
||||
<input class="button green" type="submit" value="Submit">
|
||||
<input type="hidden" name="next" value="{{ next }}"/>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -8,11 +8,42 @@
|
||||
{% include "monitorjobs.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block og_title %}{{ race.name }}{% endblock %}
|
||||
{% block description %}Virtual Rowing Race {{ race.name }}{% endblock %}
|
||||
|
||||
{% if racelogo %}
|
||||
{% block og_image %}
|
||||
<meta property="og:image" content="http://rowsandall.com/{{ racelogo.filename|spacetohtml }}" />
|
||||
<meta property="og:image:secure_url" content="https://rowsandall.com/{{ racelogo.filename |spacetohtml }}" />
|
||||
<meta property="og:image:width" content="{{ racelogo.width }}" />
|
||||
<meta property="og:image:height" content="{{ racelogo.height }}" />
|
||||
{% endblock %}
|
||||
{% block image_src %}
|
||||
<link rel="image_src" href="/{{ racelogo.filename |spacetohtml }}" />
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
|
||||
<h1>{{ race.name }}</h1>
|
||||
|
||||
<p>
|
||||
<div class="fb-share-button"
|
||||
data-href="{{ request.build_absolute_uri }}"
|
||||
data-layout="button" data-size="small" data-mobile-iframe="false">
|
||||
<a class="fb-xfbml-parse-ignore" target="_blank"
|
||||
href="https://www.facebook.com/sharer/sharer.php?u={{ request.build_absolute_uri }}">Share</a>
|
||||
</div>
|
||||
</p>
|
||||
<p>
|
||||
<a class="twitter-share-button"
|
||||
href="https://twitter.com/intent/tweet"
|
||||
data-url="{{ request.build_absolute_uri }}"
|
||||
data-text="@rowsandall #rowingdata Participate in Indoor Rowing virtual race '{{ race.name }}'">Tweet</a>
|
||||
</p>
|
||||
|
||||
|
||||
{% if not racelogo and race.manager == request.user %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/image">Add Race Logo</a>
|
||||
{% endif %}
|
||||
@@ -95,9 +126,14 @@
|
||||
</div>
|
||||
<div id="registerbuttons">
|
||||
{% if request.user.is_anonymous %}
|
||||
<p>
|
||||
Registered users of rowsandall.com can participate in this event. Participation is free, unless specified differently in the race comment above.
|
||||
</p>
|
||||
<p>
|
||||
Registered users of rowsandall.com can participate in this event. Participation is free, unless specified differently in the race comment above.
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
|
||||
{% else %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/registerindoor"><h3>Register</h3></a>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
See race rules below. Participation to this race is free,
|
||||
@@ -108,9 +144,9 @@
|
||||
{% if button == 'registerbutton' %}
|
||||
<p>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/register">Register</a>
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
|
||||
{% else %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/registerindoor">Register</a>
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/registerindoor"><h3>Register</h3></a>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
{{ workout.date }} - {{ workout.distance }}m - {{ workout.duration |durationprint:"%H:%M:%S.%f" }}{% endblock %}
|
||||
{% block og_description %}{{ workout.name }}
|
||||
{{ workout.date }} - {{ workout.distance }}m - {{ workout.duration |durationprint:"%H:%M:%S.%f" }}{% endblock %}
|
||||
{% if graphs1 %}
|
||||
{% endif %}
|
||||
{% for graph in graphs1 %}
|
||||
|
||||
{% for graph in graphs %}
|
||||
{% block og_image %}
|
||||
{% if graphs1 %}
|
||||
{% if graphs %}
|
||||
{% for graph in graphs %}
|
||||
<meta property="og:image" content="http://rowsandall.com/{{ graph.filename |spacetohtml }}" />
|
||||
<meta property="og:image:secure_url" content="https://rowsandall.com/{{ graph.filename |spacetohtml }}" />
|
||||
|
||||
@@ -1028,6 +1028,9 @@ def add_defaultfavorites(r):
|
||||
|
||||
# User registration
|
||||
def rower_register_view(request):
|
||||
|
||||
nextpage = request.GET.get('next','/rowers/list-workouts/')
|
||||
|
||||
if request.method == 'POST':
|
||||
#form = RegistrationFormUniqueEmail(request.POST)
|
||||
form = RegistrationFormSex(request.POST)
|
||||
@@ -1040,6 +1043,7 @@ def rower_register_view(request):
|
||||
sex = form.cleaned_data['sex']
|
||||
birthdate = form.cleaned_data['birthdate']
|
||||
weightcategory = form.cleaned_data['weightcategory']
|
||||
nextpage = request.POST['next']
|
||||
theuser = User.objects.create_user(username,password=password)
|
||||
theuser.first_name = first_name
|
||||
theuser.last_name = last_name
|
||||
@@ -1088,17 +1092,23 @@ def rower_register_view(request):
|
||||
'Rowsandall Server <info@rowsandall.com>',
|
||||
['roosendaalsander@gmail.com'])
|
||||
|
||||
return HttpResponseRedirect('/rowers/register/thankyou/')
|
||||
theuser = authenticate(username=username,password=password)
|
||||
login(request,theuser)
|
||||
|
||||
return HttpResponseRedirect(nextpage)
|
||||
# '/rowers/register/thankyou/')
|
||||
|
||||
else:
|
||||
return render(request,
|
||||
"registration_form.html",
|
||||
{'form':form})
|
||||
{'form':form,
|
||||
'next':nextpage,})
|
||||
else:
|
||||
form = RegistrationFormSex()
|
||||
return render(request,
|
||||
"registration_form.html",
|
||||
{'form':form,})
|
||||
{'form':form,
|
||||
'next':nextpage,})
|
||||
|
||||
# Shows analysis page
|
||||
@login_required()
|
||||
|
||||
Reference in New Issue
Block a user