generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#166] Add change passord and add email
Add redirect modification for password change allauth url modified: django_string_rota/urls.py Add links for Change assword and Add Email, Make various validation corrections modified: templates/base.html Customise Allauth templates to unify site style modified: templates/account/email.html modified: templates/account/email/base_message.txt modified: templates/account/email_confirm.html modified: templates/account/logout.html modified: templates/account/password_change.html modified: templates/account/password_reset.html modified: templates/account/password_reset_done.html modified: templates/account/password_reset_from_key.html modified: templates/account/password_reset_from_key_done.html Make minor validation corrections to home.html modified: string_rota/templates/string_rota/home.html Add backend email server to settings.py modified: django_string_rota/settings.py Add testing of change passord and add email to readme modified: README.md new file: readme_assets/images/testing-issue166-1.png new file: readme_assets/images/testing-issue166-2.png
- Loading branch information
Showing
16 changed files
with
278 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
"""django_string_rota URL Configuration | ||
""" | ||
from django.contrib import admin | ||
from django.urls import path, include | ||
from django.urls import path, include, re_path | ||
from allauth.account.views import PasswordChangeView | ||
|
||
from string_rota.views import login | ||
|
||
|
||
class CustomPasswordChangeView(PasswordChangeView): | ||
"""Redirect url for successfull password change""" | ||
|
||
success_url = "/string_rota" | ||
|
||
|
||
urlpatterns = [ | ||
path("admin/", admin.site.urls, name="admin"), | ||
path("summernote/", include("django_summernote.urls")), | ||
path("string_rota/", include("string_rota.urls")), | ||
path("", login, name="login"), | ||
re_path( | ||
r"^accounts/password/change/$", | ||
CustomPasswordChangeView.as_view(), | ||
name="account_password_change", | ||
), | ||
path("accounts/", include("allauth.urls")), | ||
path("player_info/", include("player_info.urls")), | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name %}Hello from {{ site_name }}!{% endblocktrans %} | ||
{% load i18n %}{% autoescape off %}Hello from the RSNO String Rota Team! | ||
|
||
{% block content %}{% endblock %} | ||
|
||
{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}! | ||
{{ site_domain }}{% endblocktrans %} | ||
Thank you for using the RSNO String Rota! | ||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,50 @@ | ||
{% extends "account/base.html" %} | ||
{% extends "string_rota/index.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% load crispy_forms_tags %} | ||
|
||
{% load account %} | ||
|
||
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} | ||
|
||
|
||
{% block content %} | ||
<h1>{% trans "Confirm E-mail Address" %}</h1> | ||
<div class="row"></div> | ||
<div class="col 12"> | ||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
{% if confirmation %} | ||
|
||
{% user_display confirmation.email_address.user as user_display %} | ||
|
||
{% if confirmation %} | ||
<div class=" pt-4 pb-2"> | ||
<h1 class="card-title text-center pb-0 fs-4">{% trans "Confirm Email" %}</h1> | ||
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a | ||
href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user | ||
{{ user_display }}.{% endblocktrans %}</p> | ||
</div> | ||
|
||
{% user_display confirmation.email_address.user as user_display %} | ||
|
||
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p> | ||
|
||
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}"> | ||
{% csrf_token %} | ||
<button type="submit">{% trans 'Confirm' %}</button> | ||
</form> | ||
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}"> | ||
{% csrf_token %} | ||
<div class="text-center"> | ||
<button class="btn btn-success" type="submit">{% trans 'Confirm' %}</button> | ||
</div> | ||
</form> | ||
|
||
{% else %} | ||
{% else %} | ||
|
||
{% url 'account_email' as email_url %} | ||
{% url 'account_email' as email_url %} | ||
|
||
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p> | ||
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a | ||
href="{{ email_url }}">issue a | ||
new e-mail confirmation request</a>.{% endblocktrans %}</p> | ||
|
||
{% endif %} | ||
{% endif %} | ||
|
||
{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
{% extends "string_rota/index.html" %} | ||
{% extends "string_rota/home.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% block head_title %}{% trans "Sign Out" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
|
||
<div class="pt-4 pb-2"> | ||
<h5 class="card-title text-center pb-0 fs-4">{% trans "Sign Out" %}</h5> | ||
<p class="text-center small">{% trans 'Are you sure you want to sign out?' %}</p> | ||
</div> | ||
|
||
<form method="post" action="{% url 'account_logout' %}"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<main id="main" class="main"> | ||
<div class="row"></div> | ||
<div class="col-lg-4"> | ||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
|
||
<div class=" pt-4 pb-2"> | ||
<h1 class="card-title text-center pb-0 fs-4">{% trans "Sign Out" %}</h1> | ||
<p class="text-center small">{% trans 'Are you sure you want to sign out?' %}</p> | ||
</div> | ||
|
||
<form method="post" action="{% url 'account_logout' %}"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
{% if redirect_field_value %} | ||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"> | ||
{% endif %} | ||
<button class="btn btn-primary w-100" type="submit">{% trans 'Sign Out' %}</button> | ||
</form> | ||
|
||
<input type="hidden" name="redirect_field_name" value="{{ redirect_field_value }}"> | ||
{% endif %} | ||
<div class="text-center"> | ||
<button class="btn btn-primary" type="submit">{% trans 'Sign Out' %}</button> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</main> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.