Improve allauth messages and pages

This commit is contained in:
R. Miles McCain 2020-04-14 08:53:36 -04:00
parent 568e08c0ec
commit e486397c9d
No known key found for this signature in database
GPG Key ID: 91CB47BDDF2671A5
26 changed files with 359 additions and 108 deletions

11
.vscode/settings.json vendored
View File

@ -1,3 +1,12 @@
{
"python.pythonPath": "/home/miles/.local/share/virtualenvs/shynet-L7oRCOdf/bin/python"
"python.pythonPath": "/home/miles/.local/share/virtualenvs/shynet-L7oRCOdf/bin/python",
"spellright.language": [
"en_US",
"ru_RU"
],
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
]
}

View File

@ -0,0 +1,247 @@
#: account/adapter.py:51
msgid "A user is already registered with this e-mail address."
msgstr "A user is already registered with this email address."
#: account/adapter.py:294
#, python-brace-format
msgid "Password must be a minimum of {0} characters."
msgstr ""
#: account/forms.py:92
msgid "Remember Me"
msgstr "Remember me"
#: account/forms.py:101
msgid "The e-mail address and/or password you specified are not correct."
msgstr "The email address and/or password are not correct."
#: account/forms.py:113 account/forms.py:268 account/forms.py:426
#: account/forms.py:495
msgid "E-mail address"
msgstr "Email address"
#: account/forms.py:115 account/forms.py:301 account/forms.py:421
#: account/forms.py:490
msgid "E-mail"
msgstr "Email"
#: account/forms.py:130
msgid "Username or e-mail"
msgstr "Username or email"
#: account/forms.py:292
msgid "E-mail (again)"
msgstr "Email (again)"
#: account/forms.py:296
msgid "E-mail address confirmation"
msgstr "Email address confirmation"
#: account/forms.py:304
msgid "E-mail (optional)"
msgstr "Email (optional)"
#: account/forms.py:432
msgid "This e-mail address is already associated with this account."
msgstr "This email address is already associated with this account."
#: account/forms.py:434
msgid "This e-mail address is already associated with another account."
msgstr "This email address is already associated with another account."
#: account/forms.py:504
msgid "The e-mail address is not assigned to any user account"
msgstr "The email address is not assigned to any user account."
#: account/models.py:25 account/models.py:78
msgid "e-mail address"
msgstr "email address"
#: socialaccount/adapter.py:26
#, python-format
msgid ""
"An account already exists with this e-mail address. Please sign in to that "
"account first, then connect your %s account."
msgstr ""
"An account already exists with this email address. Please sign in to that "
"account first, then connect your %s account."
#: socialaccount/adapter.py:138
msgid "Your account has no verified e-mail address."
msgstr "Your account has no verified email address."
#: templates/account/email.html:8
msgid "E-mail Addresses"
msgstr "Email Addresses"
#: templates/account/email.html:10
msgid "The following e-mail addresses are associated with your account:"
msgstr "The following email addresses are associated with your account:"
#: templates/account/email.html:43
msgid ""
"You currently do not have any e-mail address set up. You should really add "
"an e-mail address so you can receive notifications, reset your password, etc."
msgstr ""
"You currently do not have any email address set up. You should really add "
"an email address so you can receive notifications, reset your password, etc."
#: templates/account/email.html:48
msgid "Add E-mail Address"
msgstr "Add Email Address"
#: templates/account/email.html:53
msgid "Add E-mail"
msgstr "Add Email"
#: templates/account/email.html:62
msgid "Do you really want to remove the selected e-mail address?"
msgstr "Do you really want to remove the selected email address?"
#: templates/account/email/email_confirmation_message.txt:1
#, python-format
msgid ""
"Hello from %(site_name)s!\n"
"\n"
"You're receiving this e-mail because user %(user_display)s has given yours "
"as an e-mail address to connect their account.\n"
"\n"
"To confirm this is correct, go to %(activate_url)s\n"
msgstr ""
"Hello from %(site_name)s!\n"
"\n"
"You're receiving this email because user %(user_display)s has given yours "
"as an email address to connect their account.\n"
"\n"
"To confirm this is correct, go to %(activate_url)s\n"
#: templates/account/email/email_confirmation_message.txt:7
#, python-format
msgid ""
"Thank you from %(site_name)s!\n"
"%(site_domain)s"
msgstr ""
#: templates/account/email/email_confirmation_subject.txt:3
msgid "Please Confirm Your E-mail Address"
msgstr "Please Confirm Your Email Address"
#: templates/account/email/password_reset_key_message.txt:1
#, python-format
msgid ""
"Hello from %(site_name)s!\n"
"\n"
"You're receiving this e-mail because you or someone else has requested a "
"password for your user account.\n"
"It can be safely ignored if you did not request a password reset. Click the "
"link below to reset your password."
msgstr ""
"Hello from %(site_name)s!\n"
"\n"
"You're receiving this email because you or someone else has requested a "
"password for your user account.\n"
"It can be safely ignored if you did not request a password reset. Click the "
"link below to reset your password."
#: templates/account/email/password_reset_key_subject.txt:3
msgid "Password Reset E-mail"
msgstr "Password Reset Email"
#: templates/account/email_confirm.html:6
#: templates/account/email_confirm.html:10
msgid "Confirm E-mail Address"
msgstr "Confirm Email Address"
#: templates/account/email_confirm.html:16
#, python-format
msgid ""
"Please confirm that <a href=\"mailto:%(email)s\">%(email)s</a> is an e-mail "
"address for user %(user_display)s."
msgstr ""
"Please confirm that <a href=\"mailto:%(email)s\">%(email)s</a> is an email "
"address for user %(user_display)s."
#: templates/account/email_confirm.html:27
#, python-format
msgid ""
"This e-mail confirmation link expired or is invalid. Please <a href="
"\"%(email_url)s\">issue a new e-mail confirmation request</a>."
msgstr ""
"This email confirmation link expired or is invalid. Please <a href="
"\"%(email_url)s\">issue a new email confirmation request</a>."
#: templates/account/messages/cannot_delete_primary_email.txt:2
#, python-format
msgid "You cannot remove your primary e-mail address (%(email)s)."
msgstr "You cannot remove your primary email address (%(email)s)."
#: templates/account/messages/email_confirmation_sent.txt:2
#, python-format
msgid "Confirmation e-mail sent to %(email)s."
msgstr "Confirmation email sent to %(email)s."
#: templates/account/messages/email_deleted.txt:2
#, python-format
msgid "Removed e-mail address %(email)s."
msgstr "Removed email address %(email)s."
#: templates/account/messages/primary_email_set.txt:2
msgid "Primary e-mail address set."
msgstr "Primary email address set."
#: templates/account/messages/unverified_primary_email.txt:2
msgid "Your primary e-mail address must be verified."
msgstr "Your primary email address must be verified."
#: templates/account/password_reset.html:15
msgid ""
"Forgotten your password? Enter your e-mail address below, and we'll send you "
"an e-mail allowing you to reset it."
msgstr ""
"Forgotten your password? Enter your email address below, and we'll send you "
"an email allowing you to reset it."
#: templates/account/password_reset_done.html:15
msgid ""
"We have sent you an e-mail. Please contact us if you do not receive it "
"within a few minutes."
msgstr ""
"We have sent you an email. Please contact us if you do not receive it "
"within a few minutes."
#: templates/account/verification_sent.html:5
#: templates/account/verification_sent.html:8
#: templates/account/verified_email_required.html:5
#: templates/account/verified_email_required.html:8
msgid "Verify Your E-mail Address"
msgstr "Verify Your Email Address"
#: templates/account/verification_sent.html:10
msgid ""
"We have sent an e-mail 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."
msgstr ""
"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."
#: templates/account/verified_email_required.html:12
msgid ""
"This part of the site requires us to verify that\n"
"you are who you claim to be. For this purpose, we require that you\n"
"verify ownership of your e-mail address. "
msgstr ""
"This part of the site requires us to verify that\n"
"you are who you claim to be. For this purpose, we require that you\n"
"verify ownership of your email address. "
#: templates/account/verified_email_required.html:16
msgid ""
"We have sent an e-mail to you for\n"
"verification. Please click on the link inside this e-mail. Please\n"
"contact us if you do not receive it within a few minutes."
msgstr ""
"We have sent an email to you for\n"
"verification. Please click on the link inside this email. Please\n"
"contact us if you do not receive it within a few minutes."

View File

@ -3,9 +3,8 @@
{% load i18n %}
{% block head_title %}{% trans "Account Inactive" %}{% endblock %}
{% block page_title %}{% trans "Account Inactive" %}{% endblock %}
{% block content %}
<h1>{% trans "Account Inactive" %}</h1>
{% block card %}
<p>{% trans "This account is inactive." %}</p>
{% endblock %}

View File

@ -1 +1,14 @@
{% extends "base.html" %}
{% block content %}
<div>
<h4 class="heading">{% block page_title %}{% endblock %}</h4>
</div>
<hr class="sep">
{% block main %}
<div class="card ~neutral !low max-w-lg content">
{% block card %}
{% endblock %}
</div>
{% endblock %}
{% endblock %}

View File

@ -3,12 +3,9 @@
{% load i18n a17t_tags %}
{% block head_title %}{% trans "Email Addresses" %}{% endblock %}
{% block page_title %}{% trans "Email Addresses" %}{% endblock %}
{% block content %}
<h1 class="heading">{% trans "Email Addresses" %}</h1>
<hr class="sep">
{% block main %}
<div class="card ~neutral !low max-w-lg">
{% if user.emailaddress_set.all %}

View File

@ -1,9 +1,10 @@
{% 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 }}!
{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hi there,
You're receiving this email because user {{ user_display }} has given yours as an email address to connect their account.
You're receiving this email because {{ user_display }} has listed this email as a valid contact address for 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 %}
{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you,
{{ site_name }}
{% endblocktrans %}
{% endautoescape %}

View File

@ -1,4 +1,4 @@
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Please Confirm Your Email Address{% endblocktrans %}
{% blocktrans %}Confirm Email Address{% endblocktrans %}
{% endautoescape %}

View File

@ -1,12 +1,12 @@
{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}!
{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hi there,
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 %}
You're receiving this email because you or someone else has requested a password for your account.
This message 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 %}
{% endif %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you,
{{ site_name }}
{% endblocktrans %}
{% endautoescape %}

View File

@ -4,11 +4,10 @@
{% load account %}
{% block head_title %}{% trans "Confirm Email Address" %}{% endblock %}
{% block page_title %}{% trans "Confirm Email Address" %}{% endblock %}
{% block content %}
<h1>{% trans "Confirm Email Address" %}</h1>
{% block card %}
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}

View File

@ -4,20 +4,17 @@
{% load account socialaccount %}
{% block head_title %}{% trans "Sign In" %}{% endblock %}
{% block page_title %}{% trans "Sign In" %}{% endblock %}
{% block content %}
<div class="card ~neutral !low max-w-lg">
<h1 class="heading mb-3">{% trans "Sign In" %}</h1>
<form class="login" method="POST" action="{% url 'account_login' %}">
{% block card %}
<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
{{ form|a17t }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<br>
<button class="button ~urge !high mr-2" type="submit">{% trans "Sign In" %}</button>
<a href="{% url 'account_reset_password' %}" class="button ~neutral mr-2">{% trans "Reset Password" %}</a>
<a href="{{ signup_url }}" class="button ~neutral">Sign Up</a>
</form>
</div>
</form>
{% endblock %}

View File

@ -3,10 +3,9 @@
{% load i18n a17t_tags %}
{% block head_title %}{% trans "Sign Out" %}{% endblock %}
{% block page_title %}{% trans "Sign Out" %}{% endblock %}
{% block content %}
<h1>{% trans "Sign Out" %}</h1>
{% block card %}
<p>{% trans 'Are you sure you want to sign out?' %}</p>
<form method="post" action="{% url 'account_logout' %}" class="max-w-lg">
@ -14,6 +13,6 @@
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<button type="submit" class="button ~urge !high">{% trans 'Sign Out' %}</button>
<button type="submit" class="button ~neutral !high">{% trans 'Sign Out' %}</button>
</form>
{% endblock %}

View File

@ -1,2 +1,2 @@
{% load i18n %}
{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %}
{% blocktrans %}Confirmed {{email}}.{% endblocktrans %}

View File

@ -1,2 +1,2 @@
{% load i18n %}
{% blocktrans %}Primary email address set.{% endblocktrans %}
{% blocktrans %}New primary email address set.{% endblocktrans %}

View File

@ -3,13 +3,12 @@
{% load i18n a17t_tags %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block page_title %}{% trans "Change Password" %}{% endblock %}
{% block content %}
<h1>{% trans "Change Password" %}</h1>
<form method="POST" action="{% url 'account_change_password' %}" class="password_change max-w-lg">
{% block card %}
<form method="POST" action="{% url 'account_change_password' %}" class="password_change max-w-lg">
{% csrf_token %}
{{ form|a17t }}
<button type="submit" name="action">{% trans "Change Password" %}</button>
</form>
<button type="submit" name="action" class="button ~urge !high">{% trans "Change Password" %}</button>
</form>
{% endblock %}

View File

@ -4,9 +4,9 @@
{% load account %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block page_title %}{% trans "Password Reset" %}{% endblock %}
{% block content %}
<h1>{% trans "Password Reset" %}</h1>
{% block card %}
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}

View File

@ -4,13 +4,12 @@
{% load account %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block page_title %}{% trans "Password Reset" %}{% endblock %}
{% block content %}
<h1>{% trans "Password Reset" %}</h1>
{% block card %}
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>{% blocktrans %}We have sent you an email. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
<p>{% blocktrans %}We have sent you an email with a password reset link. Please try again if you do not receive it within a few minutes.{% endblocktrans %}</p>
{% endblock %}

View File

@ -2,22 +2,21 @@
{% load i18n a17t_tags %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block page_title %}{% trans "Change Password" %}{% endblock %}
{% block content %}
<h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
{% else %}
{% if form %}
<form method="POST" action="{{ action_url }}" class="max-w-lg">
{% block card %}
{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
{% else %}
{% if form %}
<form method="POST" action="{{ action_url }}" class="max-w-lg">
{% csrf_token %}
{{ form|a17t }}
<button type="submit" name="action" class="button ~urge !high">{% trans 'Change Password'}</button>
</form>
{% else %}
<p>{% trans 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
</form>
{% else %}
<p>{% trans 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
{% endblock %}

View File

@ -2,8 +2,8 @@
{% load i18n %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block page_title %}{% trans "Change Password" %}{% endblock %}
{% block content %}
<h1>{% trans "Change Password" %}</h1>
{% block card %}
<p>{% trans 'Your password is now changed.' %}</p>
{% endblock %}

View File

@ -3,11 +3,10 @@
{% load i18n a17t_tags %}
{% block head_title %}{% trans "Set Password" %}{% endblock %}
{% block page_title %}{% trans "Set Password" %}{% endblock %}
{% block content %}
<h1>{% trans "Set Password" %}</h1>
<form method="POST" action="{% url 'account_set_password' %}" class="password_set max-w-lg">
{% block card %}
<form method="POST" action="{% url 'account_set_password' %}" class="password_set">
{% csrf_token %}
{{ form|a17t }}
<button type="submit" name="action" class="button ~urge !high">{% trans 'Set Password' %}</button>

View File

@ -2,12 +2,11 @@
{% load i18n a17t_tags %}
{% block head_title %}{% trans "Signup" %}{% endblock %}
{% block head_title %}{% trans "Sign Up" %}{% endblock %}
{% block page_title %}{% trans "Sign Up" %}{% endblock %}
{% block content %}
<h1>{% trans "Sign Up" %}</h1>
<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>
{% block card %}
<aside class="aside ~info">{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a> instead.{% endblocktrans %}</aside>
<form class="signup max-w-lg" id="signup_form" method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
@ -15,7 +14,7 @@
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button type="submit" class="button ~urge !high">{% trans "Sign Up" %} &raquo;</button>
<button type="submit" class="button ~urge !high">{% trans "Sign Up" %}</button>
</form>
{% endblock %}

View File

@ -3,9 +3,8 @@
{% load i18n %}
{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %}
{% block page_title %}{% trans "Sign Up Closed" %}{% endblock %}
{% block content %}
<h1>{% trans "Sign Up Closed" %}</h1>
{% block card %}
<p>{% trans "Public sign-ups are not allowed at this time." %}</p>
{% endblock %}

View File

@ -2,4 +2,6 @@
{% load account %}
{% user_display user as user_display %}
<p><strong>{% trans "Note" %}:</strong> {% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}</p>
<aside class="aside ~info">
<p><strong>{% trans "Note" %}:</strong> {% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}</p>
</aside>

View File

@ -2,11 +2,9 @@
{% load i18n %}
{% block head_title %}{% trans "Verify Your Email Address" %}{% endblock %}
{% block content %}
<h1>{% trans "Verify Your Email Address" %}</h1>
<p>{% 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 %}</p>
{% block head_title %}{% trans "Verify Email Address" %}{% endblock %}
{% block page_title %}{% trans "Verify Email Address" %}{% endblock %}
{% block card %}
<p>{% blocktrans %}We have sent an email to you for verification. Follow the link provided to finalize the signup process. Please try to log in again if you do not receive it within a few minutes.{% endblocktrans %}</p>
{% endblock %}

View File

@ -2,11 +2,10 @@
{% load i18n %}
{% block head_title %}{% trans "Verify Your Email Address" %}{% endblock %}
{% block content %}
<h1>{% trans "Verify Your Email Address" %}</h1>
{% block head_title %}{% trans "Verify Email Address" %}{% endblock %}
{% block page_title %}{% trans "Verify Email Address" %}{% endblock %}
{% block card %}
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This part of the site requires us to verify that
@ -15,9 +14,7 @@ verify ownership of your email address. {% endblocktrans %}</p>
<p>{% 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 %}</p>
<p>{% blocktrans %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your email address</a>.{% endblocktrans %}</p>
try again if you do not receive it within a few minutes.{% endblocktrans %}</p>
<aside class="aside ~info">{% blocktrans %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your email address</a>.{% endblocktrans %}</aside>
{% endblock %}

View File

@ -71,7 +71,7 @@
{% include 'core/includes/sidebar_portal.html' with label="Security" url=url %}
{% url 'account_logout' as url %}
{% include 'core/includes/sidebar_portal.html' with label="Log Out" url=url %}
{% include 'core/includes/sidebar_portal.html' with label="Sign Out" url=url %}
{% else %}

View File

@ -119,7 +119,6 @@ USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/