From ef1aa9916629a1c0d2afa10dd7e81ba4efca3aaa Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Tue, 26 Apr 2022 13:27:17 +0200 Subject: [PATCH] Make use of trimmed attribute on blocktrans to remove extra whitespace. --- .../users/templates/two_factor/core/backup_tokens.html | 2 +- .../two_factor/core/backup_tokens_password.html | 4 ++-- .../users/templates/two_factor/profile/disable.html | 4 ++-- .../users/templates/two_factor/profile/profile.html | 10 +++++----- hypha/apply/users/templates/users/change_password.html | 2 +- .../templates/users/email_change/confirm_password.html | 2 +- hypha/apply/users/templates/users/login.html | 8 ++++---- .../users/templates/users/password_reset/confirm.html | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hypha/apply/users/templates/two_factor/core/backup_tokens.html b/hypha/apply/users/templates/two_factor/core/backup_tokens.html index 545536d01..444074d39 100644 --- a/hypha/apply/users/templates/two_factor/core/backup_tokens.html +++ b/hypha/apply/users/templates/two_factor/core/backup_tokens.html @@ -5,7 +5,7 @@ <p><a href="{% url 'two_factor:profile'%}" class="btn btn-link">{% trans "Back" %}</a></p> <h1>{% block title %}{% trans "Backup Tokens" %}{% endblock %}</h1> - <p>{% blocktrans %}Backup tokens can be used when your primary and backup + <p>{% blocktrans trimmed %}Backup tokens can be used when your primary and backup phone numbers aren't available. The backup tokens below can be used for login verification. If you've used up all your backup tokens, you can generate a new set of backup tokens. Only the backup tokens shown diff --git a/hypha/apply/users/templates/two_factor/core/backup_tokens_password.html b/hypha/apply/users/templates/two_factor/core/backup_tokens_password.html index 12d3028ce..1092b3f7d 100644 --- a/hypha/apply/users/templates/two_factor/core/backup_tokens_password.html +++ b/hypha/apply/users/templates/two_factor/core/backup_tokens_password.html @@ -5,7 +5,7 @@ <p><a href="{% url 'two_factor:profile'%}" class="btn btn-link">{% trans "Back to account" %}</a></p> <h1>{% block title %}{% trans "Backup Tokens" %}{% endblock %}</h1> - <p>{% blocktrans %}Backup tokens can be used when your primary and backup + <p>{% blocktrans trimmed %}Backup tokens can be used when your primary and backup phone numbers aren't available. The backup tokens below can be used for login verification. </br> @@ -24,7 +24,7 @@ {% if form.errors %} <ul class="errorlist"> - {% blocktrans count counter=form.errors.items|length %} + {% blocktrans trimmed count counter=form.errors.items|length %} <li>Please correct the error below.</li> {% plural %} <li>Please correct the errors below.</li> diff --git a/hypha/apply/users/templates/two_factor/profile/disable.html b/hypha/apply/users/templates/two_factor/profile/disable.html index aa47f1654..811098ae1 100644 --- a/hypha/apply/users/templates/two_factor/profile/disable.html +++ b/hypha/apply/users/templates/two_factor/profile/disable.html @@ -5,7 +5,7 @@ <p><a href="{% url 'two_factor:profile'%}" class="btn btn-link">{% trans "Back to account" %}</a></p> <h1>{% block title %}{% trans "Disable Two-factor Authentication" %}{% endblock %}</h1> - <p>{% blocktrans %}Disabling Two-factor authentication weakens your account security. + <p>{% blocktrans trimmed %}Disabling Two-factor authentication weakens your account security. We recommend reenabling it when you can.{% endblocktrans %}</p> <div class="wrapper wrapper--small wrapper--inner-space-medium"> <form class="form" action="" method="POST" novalidate> @@ -19,7 +19,7 @@ {% if form.errors %} <ul class="errorlist"> - {% blocktrans count counter=form.errors.items|length %} + {% blocktrans trimmed count counter=form.errors.items|length %} <li>Please correct the error below.</li> {% plural %} <li>Please correct the errors below.</li> diff --git a/hypha/apply/users/templates/two_factor/profile/profile.html b/hypha/apply/users/templates/two_factor/profile/profile.html index 1ffe8dd38..b419947de 100644 --- a/hypha/apply/users/templates/two_factor/profile/profile.html +++ b/hypha/apply/users/templates/two_factor/profile/profile.html @@ -19,7 +19,7 @@ {% if available_phone_methods %} <h2>{% trans "Backup Phone Numbers" %}</h2> - <p>{% blocktrans %}If your primary method is not available, we are able to + <p>{% blocktrans trimmed %}If your primary method is not available, we are able to send backup tokens to the phone numbers listed below.{% endblocktrans %}</p> <ul> {% for phone in backup_phones %} @@ -40,9 +40,9 @@ <h2>{% trans "Backup Tokens" %}</h2> <p> - {% blocktrans %}If you don't have any device with you, you can access + {% blocktrans trimmed %}If you don't have any device with you, you can access your account using backup tokens.{% endblocktrans %} - {% blocktrans count counter=backup_tokens %} + {% blocktrans trimmed count counter=backup_tokens %} You have only one backup token remaining. {% plural %} You have {{ counter }} backup tokens remaining. @@ -52,12 +52,12 @@ class="btn btn-info">{% trans "Show Codes" %}</a></p> <h2>{% trans "Disable Two-Factor Authentication" %}</h2> - <p>{% blocktrans %}However we strongly discourage you to do so, you can + <p>{% blocktrans trimmed %}However we strongly discourage you to do so, you can also disable two-factor authentication for your account.{% endblocktrans %}</p> <p><a class="btn btn-default" href="{% url 'two_factor:disable' %}"> {% trans "Disable Two-Factor Authentication" %}</a></p> {% else %} - <p>{% blocktrans %}Two-factor authentication is not enabled for your + <p>{% blocktrans trimmed %}Two-factor authentication is not enabled for your account. Enable two-factor authentication for enhanced account security.{% endblocktrans %}</p> <p><a href="{% url 'two_factor:setup' %}" class="btn btn-primary"> diff --git a/hypha/apply/users/templates/users/change_password.html b/hypha/apply/users/templates/users/change_password.html index 5b66a7d42..b671f6e25 100644 --- a/hypha/apply/users/templates/users/change_password.html +++ b/hypha/apply/users/templates/users/change_password.html @@ -17,7 +17,7 @@ {% if form.errors %} <ul class="errorlist"> - {% blocktrans count counter=form.errors.items|length %} + {% blocktrans trimmed count counter=form.errors.items|length %} <li>Please correct the error below.</li> {% plural %} <li>Please correct the errors below.</li> diff --git a/hypha/apply/users/templates/users/email_change/confirm_password.html b/hypha/apply/users/templates/users/email_change/confirm_password.html index 73011a83d..b2527aaa9 100644 --- a/hypha/apply/users/templates/users/email_change/confirm_password.html +++ b/hypha/apply/users/templates/users/email_change/confirm_password.html @@ -18,7 +18,7 @@ {% if form.errors %} <ul class="errorlist"> - {% blocktrans count counter=form.errors.items|length %} + {% blocktrans trimmed count counter=form.errors.items|length %} <li>Please correct the error below.</li> {% plural %} <li>Please correct the errors below.</li> diff --git a/hypha/apply/users/templates/users/login.html b/hypha/apply/users/templates/users/login.html index c2a084a0c..2468c63e8 100644 --- a/hypha/apply/users/templates/users/login.html +++ b/hypha/apply/users/templates/users/login.html @@ -11,17 +11,17 @@ <p>{% blocktrans %}Enter your credentials.{% endblocktrans %}</p> {% elif wizard.steps.current == 'token' %} {% if device.method == 'call' %} - <p>{% blocktrans %}We are calling your phone right now, please enter the + <p>{% blocktrans trimmed %}We are calling your phone right now, please enter the digits you hear.{% endblocktrans %}</p> {% elif device.method == 'sms' %} - <p>{% blocktrans %}We sent you a text message, please enter the tokens we + <p>{% blocktrans trimmed %}We sent you a text message, please enter the tokens we sent.{% endblocktrans %}</p> {% else %} - <p>{% blocktrans %}Please enter the tokens generated by your token + <p>{% blocktrans trimmed %}Please enter the tokens generated by your token generator.{% endblocktrans %}</p> {% endif %} {% elif wizard.steps.current == 'backup' %} - <p>{% blocktrans %}Use this form for entering backup tokens for logging in. + <p>{% blocktrans trimmed %}Use this form for entering backup tokens for logging in. These tokens have been generated for you to print and keep safe. Please enter one of these backup tokens to login to your account.{% endblocktrans %}</p> {% endif %} diff --git a/hypha/apply/users/templates/users/password_reset/confirm.html b/hypha/apply/users/templates/users/password_reset/confirm.html index e5d2940b4..076197a8d 100644 --- a/hypha/apply/users/templates/users/password_reset/confirm.html +++ b/hypha/apply/users/templates/users/password_reset/confirm.html @@ -17,7 +17,7 @@ {% if form.errors %} <ul class="errorlist"> - {% blocktrans count counter=form.errors.items|length %} + {% blocktrans trimmed count counter=form.errors.items|length %} <li>Please correct the error below.</li> {% plural %} <li>Please correct the errors below.</li> -- GitLab