From 6c3064f3ea8c358db1567196baa89462f58c0b05 Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Fri, 10 Apr 2020 15:20:14 -0400 Subject: [PATCH] Add base auth & a17t support --- shynet/a17t/__init__.py | 0 shynet/a17t/apps.py | 5 + shynet/a17t/migrations/__init__.py | 0 shynet/a17t/templates/a17t/head.html | 2 + .../a17t/templates/a17t/includes/field.html | 43 +++++++++ shynet/a17t/templates/a17t/includes/form.html | 15 +++ .../a17t/templates/a17t/includes/formset.html | 4 + shynet/a17t/templatetags/__init__.py | 0 shynet/a17t/templatetags/a17t_tags.py | 96 +++++++++++++++++++ .../templates/account/account_inactive.html | 11 +++ shynet/core/templates/account/base.html | 1 + shynet/core/templates/account/email.html | 80 ++++++++++++++++ .../email/email_confirmation_message.txt | 9 ++ .../email_confirmation_signup_message.txt | 1 + .../email_confirmation_signup_subject.txt | 1 + .../email/email_confirmation_subject.txt | 4 + .../email/password_reset_key_message.txt | 12 +++ .../email/password_reset_key_subject.txt | 4 + .../core/templates/account/email_confirm.html | 34 +++++++ shynet/core/templates/account/login.html | 23 +++++ shynet/core/templates/account/logout.html | 19 ++++ .../messages/cannot_delete_primary_email.txt | 2 + .../messages/email_confirmation_sent.txt | 2 + .../account/messages/email_confirmed.txt | 2 + .../account/messages/email_deleted.txt | 2 + .../templates/account/messages/logged_in.txt | 4 + .../templates/account/messages/logged_out.txt | 2 + .../account/messages/password_changed.txt | 2 + .../account/messages/password_set.txt | 2 + .../account/messages/primary_email_set.txt | 2 + .../messages/unverified_primary_email.txt | 2 + .../templates/account/password_change.html | 15 +++ .../templates/account/password_reset.html | 23 +++++ .../account/password_reset_done.html | 16 ++++ .../account/password_reset_from_key.html | 23 +++++ .../account/password_reset_from_key_done.html | 9 ++ .../core/templates/account/password_set.html | 15 +++ shynet/core/templates/account/signup.html | 21 ++++ .../core/templates/account/signup_closed.html | 11 +++ .../account/snippets/already_logged_in.html | 5 + .../templates/account/verification_sent.html | 12 +++ .../account/verified_email_required.html | 23 +++++ shynet/core/templates/base.html | 7 +- shynet/shynet/settings.py | 10 ++ 44 files changed, 572 insertions(+), 4 deletions(-) create mode 100644 shynet/a17t/__init__.py create mode 100644 shynet/a17t/apps.py create mode 100644 shynet/a17t/migrations/__init__.py create mode 100644 shynet/a17t/templates/a17t/head.html create mode 100644 shynet/a17t/templates/a17t/includes/field.html create mode 100644 shynet/a17t/templates/a17t/includes/form.html create mode 100644 shynet/a17t/templates/a17t/includes/formset.html create mode 100644 shynet/a17t/templatetags/__init__.py create mode 100644 shynet/a17t/templatetags/a17t_tags.py create mode 100644 shynet/core/templates/account/account_inactive.html create mode 100644 shynet/core/templates/account/base.html create mode 100644 shynet/core/templates/account/email.html create mode 100644 shynet/core/templates/account/email/email_confirmation_message.txt create mode 100644 shynet/core/templates/account/email/email_confirmation_signup_message.txt create mode 100644 shynet/core/templates/account/email/email_confirmation_signup_subject.txt create mode 100644 shynet/core/templates/account/email/email_confirmation_subject.txt create mode 100644 shynet/core/templates/account/email/password_reset_key_message.txt create mode 100644 shynet/core/templates/account/email/password_reset_key_subject.txt create mode 100644 shynet/core/templates/account/email_confirm.html create mode 100644 shynet/core/templates/account/login.html create mode 100644 shynet/core/templates/account/logout.html create mode 100644 shynet/core/templates/account/messages/cannot_delete_primary_email.txt create mode 100644 shynet/core/templates/account/messages/email_confirmation_sent.txt create mode 100644 shynet/core/templates/account/messages/email_confirmed.txt create mode 100644 shynet/core/templates/account/messages/email_deleted.txt create mode 100644 shynet/core/templates/account/messages/logged_in.txt create mode 100644 shynet/core/templates/account/messages/logged_out.txt create mode 100644 shynet/core/templates/account/messages/password_changed.txt create mode 100644 shynet/core/templates/account/messages/password_set.txt create mode 100644 shynet/core/templates/account/messages/primary_email_set.txt create mode 100644 shynet/core/templates/account/messages/unverified_primary_email.txt create mode 100644 shynet/core/templates/account/password_change.html create mode 100644 shynet/core/templates/account/password_reset.html create mode 100644 shynet/core/templates/account/password_reset_done.html create mode 100644 shynet/core/templates/account/password_reset_from_key.html create mode 100644 shynet/core/templates/account/password_reset_from_key_done.html create mode 100644 shynet/core/templates/account/password_set.html create mode 100644 shynet/core/templates/account/signup.html create mode 100644 shynet/core/templates/account/signup_closed.html create mode 100644 shynet/core/templates/account/snippets/already_logged_in.html create mode 100644 shynet/core/templates/account/verification_sent.html create mode 100644 shynet/core/templates/account/verified_email_required.html diff --git a/shynet/a17t/__init__.py b/shynet/a17t/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/shynet/a17t/apps.py b/shynet/a17t/apps.py new file mode 100644 index 0000000..5a88f82 --- /dev/null +++ b/shynet/a17t/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class A17TConfig(AppConfig): + name = 'a17t' diff --git a/shynet/a17t/migrations/__init__.py b/shynet/a17t/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/shynet/a17t/templates/a17t/head.html b/shynet/a17t/templates/a17t/head.html new file mode 100644 index 0000000..690893f --- /dev/null +++ b/shynet/a17t/templates/a17t/head.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/shynet/a17t/templates/a17t/includes/field.html b/shynet/a17t/templates/a17t/includes/field.html new file mode 100644 index 0000000..1f57247 --- /dev/null +++ b/shynet/a17t/templates/a17t/includes/field.html @@ -0,0 +1,43 @@ +{% load a17t_tags %} + + + + {% if field|is_checkbox %} + + {% elif field|is_radio %} + {% if field.auto_id %} + + {% endif %} + {% for choice in field %} + + {% endfor %} + {% elif field|is_input %} + + {{field|add_class:"input"}} + {% elif field|is_textarea %} + + {{ field|add_class:'textarea' }} + {% elif field|is_select %} + +
+ {{field}} +
+ {% else %} + + {{field|add_class:"field"}} + {% endif %} + + {% for error in field.errors %} +

{{ error }}

+ {% endfor %} + {% if field.help_text %} +

{{field.help_text|safe}}

+ {% endif %} + +
\ No newline at end of file diff --git a/shynet/a17t/templates/a17t/includes/form.html b/shynet/a17t/templates/a17t/includes/form.html new file mode 100644 index 0000000..c22a808 --- /dev/null +++ b/shynet/a17t/templates/a17t/includes/form.html @@ -0,0 +1,15 @@ +{% if form.non_field_errors %} + +{% endif %} + +{% for field in form.hidden_fields %} + {{ field }} +{% endfor %} + +{% for field in form.visible_fields %} + {% include 'a17t/includes/field.html' %} +{% endfor %} \ No newline at end of file diff --git a/shynet/a17t/templates/a17t/includes/formset.html b/shynet/a17t/templates/a17t/includes/formset.html new file mode 100644 index 0000000..1627c59 --- /dev/null +++ b/shynet/a17t/templates/a17t/includes/formset.html @@ -0,0 +1,4 @@ +{{ formset.management_form }} +{% for form in formset %} + {% include "a17t/includes/form.html" with form=form %} +{% endfor %} diff --git a/shynet/a17t/templatetags/__init__.py b/shynet/a17t/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/shynet/a17t/templatetags/a17t_tags.py b/shynet/a17t/templatetags/a17t_tags.py new file mode 100644 index 0000000..ed6a3b3 --- /dev/null +++ b/shynet/a17t/templatetags/a17t_tags.py @@ -0,0 +1,96 @@ +from django import forms +from django import template +from django.forms import BoundField +from django.template.loader import get_template +from django.utils.safestring import mark_safe + +register = template.Library() + + +@register.filter +def a17t(element): + markup_classes = {"label": "", "value": "", "single_value": ""} + return render(element, markup_classes) + + +@register.filter +def a17t_inline(element): + markup_classes = {"label": "", "value": "", "single_value": ""} + return render(element, markup_classes) + + +def render(element, markup_classes): + if isinstance(element, BoundField): + template = get_template("a17t/includes/field.html") + context = {"field": element, "classes": markup_classes, "form": element.form} + else: + has_management = getattr(element, "management_form", None) + if has_management: + template = get_template("a17t/includes/formset.html") + context = {"formset": element, "classes": markup_classes} + else: + template = get_template("a17t/includes/form.html") + context = {"form": element, "classes": markup_classes} + + return template.render(context) + + +@register.filter +def widget_type(field): + return field.field.widget + + +@register.filter +def is_select(field): + return isinstance(field.field.widget, forms.Select) + + +@register.filter +def is_multiple_select(field): + return isinstance(field.field.widget, forms.SelectMultiple) + + +@register.filter +def is_textarea(field): + return isinstance(field.field.widget, forms.Textarea) + + +@register.filter +def is_input(field): + return isinstance( + field.field.widget, + ( + forms.TextInput, + forms.NumberInput, + forms.EmailInput, + forms.PasswordInput, + forms.URLInput, + ), + ) + + +@register.filter +def is_checkbox(field): + return isinstance(field.field.widget, forms.CheckboxInput) + + +@register.filter +def is_multiple_checkbox(field): + return isinstance(field.field.widget, forms.CheckboxSelectMultiple) + + +@register.filter +def is_radio(field): + return isinstance(field.field.widget, forms.RadioSelect) + + +@register.filter +def is_file(field): + return isinstance(field.field.widget, forms.FileInput) + + +@register.filter +def add_class(field, css_class): + if len(field.errors) > 0: + css_class += " ~critical" + return field.as_widget(attrs={"class": css_class}) diff --git a/shynet/core/templates/account/account_inactive.html b/shynet/core/templates/account/account_inactive.html new file mode 100644 index 0000000..3347f4f --- /dev/null +++ b/shynet/core/templates/account/account_inactive.html @@ -0,0 +1,11 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Account Inactive" %}{% endblock %} + +{% block content %} +

{% trans "Account Inactive" %}

+ +

{% trans "This account is inactive." %}

+{% endblock %} diff --git a/shynet/core/templates/account/base.html b/shynet/core/templates/account/base.html new file mode 100644 index 0000000..94d9808 --- /dev/null +++ b/shynet/core/templates/account/base.html @@ -0,0 +1 @@ +{% extends "base.html" %} diff --git a/shynet/core/templates/account/email.html b/shynet/core/templates/account/email.html new file mode 100644 index 0000000..fa8ce30 --- /dev/null +++ b/shynet/core/templates/account/email.html @@ -0,0 +1,80 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} + +{% block head_title %}{% trans "Email Addresses" %}{% endblock %} + +{% block content %} +

{% trans "Email Addresses" %}

+ +
+ +
+ + {% if user.emailaddress_set.all %} +

{% trans 'The following email addresses are associated with your account:' %}

+ + + {% else %} + + {% endif %} +
+ +
+ +
+ {% csrf_token %} + {{ form|a17t }} + +
+ +{% endblock %} + + +{% block extra_body %} + +{% endblock %} \ No newline at end of file diff --git a/shynet/core/templates/account/email/email_confirmation_message.txt b/shynet/core/templates/account/email/email_confirmation_message.txt new file mode 100644 index 0000000..0588600 --- /dev/null +++ b/shynet/core/templates/account/email/email_confirmation_message.txt @@ -0,0 +1,9 @@ +{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}! + +You're receiving this email because user {{ user_display }} has given yours as an email address to connect their account. + +To confirm this is correct, go to {{ activate_url }} +{% endblocktrans %} +{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you from {{ site_name }}! +{{ site_domain }}{% endblocktrans %} +{% endautoescape %} diff --git a/shynet/core/templates/account/email/email_confirmation_signup_message.txt b/shynet/core/templates/account/email/email_confirmation_signup_message.txt new file mode 100644 index 0000000..9996f7e --- /dev/null +++ b/shynet/core/templates/account/email/email_confirmation_signup_message.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_message.txt" %} diff --git a/shynet/core/templates/account/email/email_confirmation_signup_subject.txt b/shynet/core/templates/account/email/email_confirmation_signup_subject.txt new file mode 100644 index 0000000..4c85ebb --- /dev/null +++ b/shynet/core/templates/account/email/email_confirmation_signup_subject.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_subject.txt" %} diff --git a/shynet/core/templates/account/email/email_confirmation_subject.txt b/shynet/core/templates/account/email/email_confirmation_subject.txt new file mode 100644 index 0000000..2e2c052 --- /dev/null +++ b/shynet/core/templates/account/email/email_confirmation_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Please Confirm Your Email Address{% endblocktrans %} +{% endautoescape %} diff --git a/shynet/core/templates/account/email/password_reset_key_message.txt b/shynet/core/templates/account/email/password_reset_key_message.txt new file mode 100644 index 0000000..2344236 --- /dev/null +++ b/shynet/core/templates/account/email/password_reset_key_message.txt @@ -0,0 +1,12 @@ +{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}! + +You're receiving this email because you or someone else has requested a password for your user account. +It can be safely ignored if you did not request a password reset. Click the link below to reset your password.{% endblocktrans %} + +{{ password_reset_url }} + +{% if username %}{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %} + +{% endif %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}! +{{ site_domain }}{% endblocktrans %} +{% endautoescape %} diff --git a/shynet/core/templates/account/email/password_reset_key_subject.txt b/shynet/core/templates/account/email/password_reset_key_subject.txt new file mode 100644 index 0000000..f0fd6b5 --- /dev/null +++ b/shynet/core/templates/account/email/password_reset_key_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Password Reset Email{% endblocktrans %} +{% endautoescape %} diff --git a/shynet/core/templates/account/email_confirm.html b/shynet/core/templates/account/email_confirm.html new file mode 100644 index 0000000..5b4087b --- /dev/null +++ b/shynet/core/templates/account/email_confirm.html @@ -0,0 +1,34 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Confirm Email Address" %}{% endblock %} + + +{% block content %} +

{% trans "Confirm Email Address" %}

+ +{% if confirmation %} + +{% user_display confirmation.email_address.user as user_display %} + +

{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is a valid email where we can reach you.{% endblocktrans %} +

+ +
+ {% csrf_token %} + +
+ +{% else %} + +{% url 'account_email' as email_url %} + +

{% blocktrans %}This email confirmation link expired or is invalid. Please issue a new + email confirmation request.{% endblocktrans %}

+ +{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/shynet/core/templates/account/login.html b/shynet/core/templates/account/login.html new file mode 100644 index 0000000..e6b29da --- /dev/null +++ b/shynet/core/templates/account/login.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} +{% load account socialaccount %} + +{% block head_title %}{% trans "Sign In" %}{% endblock %} + +{% block content %} +
+

{% trans "Sign In" %}

+ +
+{% endblock %} \ No newline at end of file diff --git a/shynet/core/templates/account/logout.html b/shynet/core/templates/account/logout.html new file mode 100644 index 0000000..b9d84cd --- /dev/null +++ b/shynet/core/templates/account/logout.html @@ -0,0 +1,19 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} + +{% block head_title %}{% trans "Sign Out" %}{% endblock %} + +{% block content %} +

{% trans "Sign Out" %}

+ +

{% trans 'Are you sure you want to sign out?' %}

+ +
+ {% csrf_token %} + {% if redirect_field_value %} + + {% endif %} + +
+{% endblock %} diff --git a/shynet/core/templates/account/messages/cannot_delete_primary_email.txt b/shynet/core/templates/account/messages/cannot_delete_primary_email.txt new file mode 100644 index 0000000..9c17574 --- /dev/null +++ b/shynet/core/templates/account/messages/cannot_delete_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You cannot remove your primary email address ({{email}}).{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/email_confirmation_sent.txt b/shynet/core/templates/account/messages/email_confirmation_sent.txt new file mode 100644 index 0000000..fb30b31 --- /dev/null +++ b/shynet/core/templates/account/messages/email_confirmation_sent.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Confirmation email sent to {{email}}.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/email_confirmed.txt b/shynet/core/templates/account/messages/email_confirmed.txt new file mode 100644 index 0000000..3427a4d --- /dev/null +++ b/shynet/core/templates/account/messages/email_confirmed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/email_deleted.txt b/shynet/core/templates/account/messages/email_deleted.txt new file mode 100644 index 0000000..27bb630 --- /dev/null +++ b/shynet/core/templates/account/messages/email_deleted.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Removed email address {{email}}.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/logged_in.txt b/shynet/core/templates/account/messages/logged_in.txt new file mode 100644 index 0000000..f49248a --- /dev/null +++ b/shynet/core/templates/account/messages/logged_in.txt @@ -0,0 +1,4 @@ +{% load account %} +{% load i18n %} +{% user_display user as name %} +{% blocktrans %}Successfully signed in as {{name}}.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/logged_out.txt b/shynet/core/templates/account/messages/logged_out.txt new file mode 100644 index 0000000..2cd4627 --- /dev/null +++ b/shynet/core/templates/account/messages/logged_out.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have signed out.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/password_changed.txt b/shynet/core/templates/account/messages/password_changed.txt new file mode 100644 index 0000000..bd5801c --- /dev/null +++ b/shynet/core/templates/account/messages/password_changed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Password successfully changed.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/password_set.txt b/shynet/core/templates/account/messages/password_set.txt new file mode 100644 index 0000000..9d224ee --- /dev/null +++ b/shynet/core/templates/account/messages/password_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Password successfully set.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/primary_email_set.txt b/shynet/core/templates/account/messages/primary_email_set.txt new file mode 100644 index 0000000..3ef8561 --- /dev/null +++ b/shynet/core/templates/account/messages/primary_email_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Primary email address set.{% endblocktrans %} diff --git a/shynet/core/templates/account/messages/unverified_primary_email.txt b/shynet/core/templates/account/messages/unverified_primary_email.txt new file mode 100644 index 0000000..7d0ef9c --- /dev/null +++ b/shynet/core/templates/account/messages/unverified_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Your primary email address must be verified.{% endblocktrans %} diff --git a/shynet/core/templates/account/password_change.html b/shynet/core/templates/account/password_change.html new file mode 100644 index 0000000..72d7672 --- /dev/null +++ b/shynet/core/templates/account/password_change.html @@ -0,0 +1,15 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} + +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% trans "Change Password" %}

+ +
+ {% csrf_token %} + {{ form|a17t }} + +
+{% endblock %} diff --git a/shynet/core/templates/account/password_reset.html b/shynet/core/templates/account/password_reset.html new file mode 100644 index 0000000..75af52e --- /dev/null +++ b/shynet/core/templates/account/password_reset.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} +{% load account %} + +{% block head_title %}{% trans "Password Reset" %}{% endblock %} + +{% block content %} +

{% trans "Password Reset" %}

+{% if user.is_authenticated %} +{% include "account/snippets/already_logged_in.html" %} +{% endif %} + +

+ {% trans "Forgotten your password? Enter your email address below, and we'll send you an email to reset it." %} +

+ +
+ {% csrf_token %} + {{ form|a17t }} + +
+{% endblock %} \ No newline at end of file diff --git a/shynet/core/templates/account/password_reset_done.html b/shynet/core/templates/account/password_reset_done.html new file mode 100644 index 0000000..5d15a9a --- /dev/null +++ b/shynet/core/templates/account/password_reset_done.html @@ -0,0 +1,16 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Password Reset" %}{% endblock %} + +{% block content %} +

{% trans "Password Reset" %}

+ + {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} + +

{% blocktrans %}We have sent you an email. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}

+{% endblock %} diff --git a/shynet/core/templates/account/password_reset_from_key.html b/shynet/core/templates/account/password_reset_from_key.html new file mode 100644 index 0000000..26a5fc2 --- /dev/null +++ b/shynet/core/templates/account/password_reset_from_key.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}

+ + {% if token_fail %} + {% url 'account_reset_password' as passwd_reset_url %} +

{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}

+ {% else %} + {% if form %} +
+ {% csrf_token %} + {{ form|a17t }} + +
+ {% else %} +

{% trans 'Your password is now changed.' %}

+ {% endif %} + {% endif %} +{% endblock %} diff --git a/shynet/core/templates/account/password_reset_from_key_done.html b/shynet/core/templates/account/password_reset_from_key_done.html new file mode 100644 index 0000000..85641c2 --- /dev/null +++ b/shynet/core/templates/account/password_reset_from_key_done.html @@ -0,0 +1,9 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% trans "Change Password" %}

+

{% trans 'Your password is now changed.' %}

+{% endblock %} diff --git a/shynet/core/templates/account/password_set.html b/shynet/core/templates/account/password_set.html new file mode 100644 index 0000000..0632c47 --- /dev/null +++ b/shynet/core/templates/account/password_set.html @@ -0,0 +1,15 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} + +{% block head_title %}{% trans "Set Password" %}{% endblock %} + +{% block content %} +

{% trans "Set Password" %}

+ +
+ {% csrf_token %} + {{ form|a17t }} + +
+{% endblock %} \ No newline at end of file diff --git a/shynet/core/templates/account/signup.html b/shynet/core/templates/account/signup.html new file mode 100644 index 0000000..bca3017 --- /dev/null +++ b/shynet/core/templates/account/signup.html @@ -0,0 +1,21 @@ +{% extends "account/base.html" %} + +{% load i18n a17t_tags %} + +{% block head_title %}{% trans "Signup" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up" %}

+ +

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}

+ +
+ {% csrf_token %} + {{ form|a17t }} + {% if redirect_field_value %} + + {% endif %} + +
+ +{% endblock %} diff --git a/shynet/core/templates/account/signup_closed.html b/shynet/core/templates/account/signup_closed.html new file mode 100644 index 0000000..c71ca8d --- /dev/null +++ b/shynet/core/templates/account/signup_closed.html @@ -0,0 +1,11 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up Closed" %}

+ +

{% trans "Public sign-ups are not allowed at this time." %}

+{% endblock %} diff --git a/shynet/core/templates/account/snippets/already_logged_in.html b/shynet/core/templates/account/snippets/already_logged_in.html new file mode 100644 index 0000000..00799f0 --- /dev/null +++ b/shynet/core/templates/account/snippets/already_logged_in.html @@ -0,0 +1,5 @@ +{% load i18n %} +{% load account %} + +{% user_display user as user_display %} +

{% trans "Note" %}: {% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}

diff --git a/shynet/core/templates/account/verification_sent.html b/shynet/core/templates/account/verification_sent.html new file mode 100644 index 0000000..ebbe5c1 --- /dev/null +++ b/shynet/core/templates/account/verification_sent.html @@ -0,0 +1,12 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Verify Your Email Address" %}{% endblock %} + +{% block content %} +

{% trans "Verify Your Email Address" %}

+ +

{% blocktrans %}We have sent an email to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}

+ +{% endblock %} diff --git a/shynet/core/templates/account/verified_email_required.html b/shynet/core/templates/account/verified_email_required.html new file mode 100644 index 0000000..b2244d8 --- /dev/null +++ b/shynet/core/templates/account/verified_email_required.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Verify Your Email Address" %}{% endblock %} + +{% block content %} +

{% trans "Verify Your Email Address" %}

+ +{% url 'account_email' as email_url %} + +

{% blocktrans %}This part of the site requires us to verify that +you are who you claim to be. For this purpose, we require that you +verify ownership of your email address. {% endblocktrans %}

+ +

{% blocktrans %}We have sent an email to you for +verification. Please click on the link inside this email. Please +contact us if you do not receive it within a few minutes.{% endblocktrans %}

+ +

{% blocktrans %}Note: you can still change your email address.{% endblocktrans %}

+ + +{% endblock %} diff --git a/shynet/core/templates/base.html b/shynet/core/templates/base.html index b551b37..30f99d8 100644 --- a/shynet/core/templates/base.html +++ b/shynet/core/templates/base.html @@ -6,8 +6,7 @@ {% block head_title %}Privacy-oriented analytics{% endblock %} | Shynet - - + {% include 'a17t/head.html' %} {% block extra_head %} {% endblock %} @@ -19,7 +18,7 @@ {% if messages %}
{% for message in messages %} -
{{message}}
+
{{message}}
{% endfor %}
@@ -29,7 +28,7 @@ Menu: