Tidy up inconsistencies in forms

Wherever possible, use the macros.
This commit is contained in:
Chris Hill-Scott
2016-02-01 16:40:04 +00:00
parent b5b13254c7
commit 9cf6dfa6f2
7 changed files with 32 additions and 29 deletions

View File

@@ -31,9 +31,7 @@ GOV.UK Notify | Set up service
<form autocomplete="off" method="post">
{{ textbox(form.name) }}
{{ page_footer(
'Continue'
) }}
{{ page_footer('Continue') }}
</form>
</div>

View File

@@ -13,13 +13,11 @@ GOV.UK Notify
<h1 class="heading-xlarge">Check your email address</h1>
<p>Check your email address is correct and then resend the confirmation code.</p>
<p>
</p>
<form autocomplete="off" method="post">
{{ textbox(form.email_address) }}
<span class="font-xsmall">Your email address must end in .gov.uk</span>
{{ page_footer('Resend confirmation code') }}
</form>
<form autocomplete="off" method="post">
{{ textbox(form.email_address, hint='Your email address must end in .gov.uk') }}
{{ page_footer('Resend confirmation code') }}
</form>
</div>
</div>

View File

@@ -11,16 +11,20 @@ GOV.UK Notify
<div class="grid-row">
<div class="column-two-thirds">
{% if user %}
<h1 class="heading-xlarge">Create a new password</h1>
<p> You can now create a new password for your account.</p>
<form method="post" autocomplete="off">
{{ textbox(form.new_password, hint="Your password must have at least 10 characters") }}
{{ page_footer("Continue") }}
</form>
<h1 class="heading-xlarge">
Create a new password
</h1>
<p>
You can now create a new password for your account.
</p>
<form method="post" autocomplete="off">
{{ textbox(form.new_password, hint="Your password must have at least 10 characters") }}
{{ page_footer("Continue") }}
</form>
{% else %}
Message about email address does not exist. Some one needs to figure out the words here.
<p>
Message about email address does not exist. Some one needs to figure out the words here.
</p>
{% endif %}
</div>
</div>

View File

@@ -14,9 +14,7 @@ GOV.UK Notify | Create an account
<p>If you've used GOV.UK Notify before, <a href="{{ url_for('.sign_in') }}">sign in to your account</a>.</p>
<form autocomplete="off" action="" method="post">
{{ form.hidden_tag() }}
<form autocomplete="off" action="" method="post">
{{ textbox(form.name) }}
{{ textbox(form.email_address, hint="Your email address must end in .gov.uk") }}
{{ textbox(form.mobile_number) }}

View File

@@ -14,11 +14,13 @@ GOV.UK Notify | Text verification
<p>We've sent you a text message with a verification code.</p>
<form autocomplete="off" method="post">
{{ textbox(form.sms_code) }}
<span class="font-xsmall"><a href="{{ url_for('.verification_code_not_received') }}">I haven't received a text</a></span>
{{ page_footer("Continue") }}
{{ page_footer(
"Continue",
back_link=url_for('.verification_code_not_received'),
back_link_text='I havent received a text'
) }}
</form>
</div>
</div>

View File

@@ -16,9 +16,13 @@ GOV.UK Notify | Confirm email address and mobile number
<form autocomplete="off" method="post">
{{ textbox(form.email_code) }}
<span class="font-xsmall"><a href="{{ url_for('.check_and_resend_email_code')}}">I haven't received an email</a></span>
<p>
<a href="{{ url_for('.check_and_resend_email_code')}}">I haven't received an email</a>
</p>
{{ textbox(form.sms_code) }}
<span class="font-xsmall"><a href="{{ url_for('.check_and_resend_text_code') }}">I haven't received a text</a></span>
<p>
<a href="{{ url_for('.check_and_resend_text_code') }}">I haven't received a text</a></span>
</p>
{{ page_footer("Continue") }}
</form>
</div>

View File

@@ -16,9 +16,8 @@ def test_should_render_new_password_template(app_,
with app_.test_client() as client:
token = generate_token(api_user_active.email_address)
response = client.get(url_for('.new_password', token=token))
print(response.location)
assert response.status_code == 200
assert ' You can now create a new password for your account.' in response.get_data(as_text=True)
assert 'You can now create a new password for your account.' in response.get_data(as_text=True)
@pytest.mark.skipif(True, reason='Password reset no implemented')