templates: Add CSS formatting to invalid email redirect page.

Adds CSS formatting for `invalid_email.html`.

Uses the `white-box` style because this page is a redirect when
there is an error with the email the user provided during
registration.

Also, updates the text of this page for some grammar errors and
to clarify the language between an invalid email and an email that
is not allowed by the Zulip organization in question.

Finally, makes any references to the `realm_name` also link to
the Zulip organization with the `realm_uri`.
This commit is contained in:
Lauryn Menard 2023-04-19 16:24:22 +02:00 committed by Tim Abbott
parent 601d8101f5
commit a22168d8b3
2 changed files with 39 additions and 47 deletions

View File

@ -5,46 +5,38 @@
{% endblock %} {% endblock %}
{% block portico_content %} {% block portico_content %}
<div class="app portico-page">
<h3>{{ _('Invalid email') }}</h3> <div class="app-main portico-page-container center-block flex full-page account-creation new-style">
<div class="inline-block">
<p>{{ _('Hi there! Thank you for your interest in Zulip.') }}</p> <div class="get-started">
{% if invalid_email %}
{% if invalid_email %} <h1>{{ _("Invalid email") }}</h1>
<p> {% else %}
{% trans %} <h1>{{ _("Email not allowed") }}</h1>
The email address you are trying to sign up with is not valid. {% endif %}
Please sign up using a valid email address. </div>
{% endtrans %} <div class="white-box">
</p> <p>
{% endif %} {% if invalid_email %}
{{ _("The email address you are trying to sign up with is not valid.") }}
{% if closed_domain %} {% endif %}
<p> {% if closed_domain %}
{% trans %} {% trans %}The organization you are trying to join, <a href="{{ realm_uri }}">{{ realm_name }}</a>, does not allow signups using emails with your email domain.{% endtrans %}
The organization you are trying to join, {{ realm_name }}, {% endif %}
only allows users with email addresses within the {% if disposable_emails_not_allowed %}
organization. Please sign up using appropriate email address. {% trans %}The organization you are trying to join, <a href="{{ realm_uri }}">{{ realm_name }}</a>, does not allow signups using disposable email addresses.{% endtrans %}
{% endtrans %} {% endif %}
</p> {% if email_contains_plus %}
{% endif %} {% trans %}The organization you are trying to join, <a href="{{ realm_uri }}">{{ realm_name }}</a>, does not allow signups using emails that contain "+".{% endtrans %}
{% endif %}
{% if disposable_emails_not_allowed %} {% if invalid_email %}
<p> {{ _("Please sign up using a valid email address.") }}
{% trans %}The organization you are trying to join, {% else %}
{{realm_name}}, does not allow signups using disposable email {{ _("Please sign up using an allowed email address.") }}
addresses. Please sign up using a real email address. {% endif %}
{% endtrans %} </p>
</p> </div>
{% endif %} </div>
</div>
{% if email_contains_plus %} </div>
<p>
{% trans %}The organization you are trying to join,
{{realm_name}}, does not allow signups using emails
that contains +. Please sign up using appropriate email address.
{% endtrans %}
</p>
{% endif %}
{% endblock %} {% endblock %}

View File

@ -1094,7 +1094,9 @@ so we didn't send them an invitation. We did send invitations to everyone else!"
result = self.submit_reg_form_for_user("foo@example.com", "password") result = self.submit_reg_form_for_user("foo@example.com", "password")
self.assertEqual(result.status_code, 200) self.assertEqual(result.status_code, 200)
self.assert_in_response("only allows users with email addresses", result) self.assert_in_response(
"does not allow signups using emails with your email domain", result
)
def test_disposable_emails_before_closing(self) -> None: def test_disposable_emails_before_closing(self) -> None:
""" """
@ -1119,7 +1121,7 @@ so we didn't send them an invitation. We did send invitations to everyone else!"
result = self.submit_reg_form_for_user("foo@mailnator.com", "password") result = self.submit_reg_form_for_user("foo@mailnator.com", "password")
self.assertEqual(result.status_code, 200) self.assertEqual(result.status_code, 200)
self.assert_in_response("Please sign up using a real email address.", result) self.assert_in_response("does not allow signups using disposable email addresses.", result)
def test_invite_with_email_containing_plus_before_closing(self) -> None: def test_invite_with_email_containing_plus_before_closing(self) -> None:
""" """
@ -1145,9 +1147,7 @@ so we didn't send them an invitation. We did send invitations to everyone else!"
result = self.submit_reg_form_for_user(external_address, "password") result = self.submit_reg_form_for_user(external_address, "password")
self.assertEqual(result.status_code, 200) self.assertEqual(result.status_code, 200)
self.assert_in_response( self.assert_in_response('does not allow signups using emails that contain "+".', result)
"Zulip Dev, does not allow signups using emails\n that contains +", result
)
def test_invalid_email_check_after_confirming_email(self) -> None: def test_invalid_email_check_after_confirming_email(self) -> None:
self.login("hamlet") self.login("hamlet")