diff --git a/app/routes.js b/app/routes.js index 84332ec93..baab3a6a8 100755 --- a/app/routes.js +++ b/app/routes.js @@ -152,39 +152,39 @@ module.exports = { }) // Example page: Form validation - app.get('/errors/example-form-validation-single-question-radio', function (req, res) { + app.get('/errors/example-form-validation-single-question-more-text', function (req, res) { var section = 'errors' var sectionName = 'Errors and validation' - var pageName = 'Example: Form validation - single question' - res.render('examples/example_form_validation_single_question_radio', { 'section': section, 'section_name': sectionName, 'page_name': pageName }) + var pageName = 'Example: Form validation - single question with additional guidance' + res.render('examples/example_form_validation_single_question_more_text', { 'section': section, 'section_name': sectionName, 'page_name': pageName }) }) - app.post('/errors/example-form-validation-single-question-radio', function (req, res) { + app.post('/errors/example-form-validation-single-question-more-text', function (req, res) { var section = 'errors' var sectionName = 'Errors and validation' - var pageName = 'Example: Form validation - single question' - var personalDetails = req.body.personalDetails + var pageName = 'Example: Form validation - single question with additional guidance' + var recognisable = req.body.recognisable var error = false - if (!personalDetails) { + if (!recognisable) { error = true } else { error = false } - res.render('examples/example_form_validation_single_question_radio', { 'section': section, 'section_name': sectionName, 'page_name': pageName, 'personal_details': personalDetails, 'error': error }) + res.render('examples/example_form_validation_single_question_more_text', { 'section': section, 'section_name': sectionName, 'page_name': pageName, 'recognisable': recognisable, 'error': error }) }) // Example page: Form validation - app.get('/errors/example-form-validation-single-question-radio-h1-legend', function (req, res) { + app.get('/errors/example-form-validation-single-question-radio', function (req, res) { var section = 'errors' var sectionName = 'Errors and validation' - var pageName = 'Example: Form validation - single question, page heading in legend' - res.render('examples/example_form_validation_single_question_radio_h1_legend', { 'section': section, 'section_name': sectionName, 'page_name': pageName }) + var pageName = 'Example: Form validation - single question, radio button' + res.render('examples/example_form_validation_single_question_radio', { 'section': section, 'section_name': sectionName, 'page_name': pageName }) }) - app.post('/errors/example-form-validation-single-question-radio-h1-legend', function (req, res) { + app.post('/errors/example-form-validation-single-question-radio', function (req, res) { var section = 'errors' var sectionName = 'Errors and validation' - var pageName = 'Example: Form validation - single question, page heading in legend' + var pageName = 'Example: Form validation - single question, radio button' var personalDetails = req.body.personalDetails var error = false if (!personalDetails) { @@ -192,21 +192,21 @@ module.exports = { } else { error = false } - res.render('examples/example_form_validation_single_question_radio_h1_legend', { 'section': section, 'section_name': sectionName, 'page_name': pageName, 'personal_details': personalDetails, 'error': error }) + res.render('examples/example_form_validation_single_question_radio', { 'section': section, 'section_name': sectionName, 'page_name': pageName, 'personal_details': personalDetails, 'error': error }) }) // Example page: Form validation - app.get('/errors/example-form-validation-single-question-text-h1-label', function (req, res) { + app.get('/errors/example-form-validation-single-question-text', function (req, res) { var section = 'errors' var sectionName = 'Errors and validation' - var pageName = 'Example: Form validation - single question, labed in page heading' - res.render('examples/example_form_validation_single_question_text_h1_label', { 'section': section, 'section_name': sectionName, 'page_name': pageName }) + var pageName = 'Example: Form validation - single question, text field' + res.render('examples/example_form_validation_single_question_text', { 'section': section, 'section_name': sectionName, 'page_name': pageName }) }) - app.post('/errors/example-form-validation-single-question-text-h1-label', function (req, res) { + app.post('/errors/example-form-validation-single-question-text', function (req, res) { var section = 'errors' var sectionName = 'Errors and validation' - var pageName = 'Example: Form validation - single question, label in page heading' + var pageName = 'Example: Form validation - single question, text field' var personalDetails = req.body.personalDetails var error = false if (!personalDetails) { @@ -214,7 +214,7 @@ module.exports = { } else { error = false } - res.render('examples/example_form_validation_single_question_text_h1_label', { 'section': section, 'section_name': sectionName, 'page_name': pageName, 'personal_details': personalDetails, 'error': error }) + res.render('examples/example_form_validation_single_question_text', { 'section': section, 'section_name': sectionName, 'page_name': pageName, 'personal_details': personalDetails, 'error': error }) }) // Redirect examples from /examples/ to /section/example-name-of-example diff --git a/app/views/examples/example_form_validation_single_question_radio_h1_legend.html b/app/views/examples/example_form_validation_single_question_more_text.html similarity index 74% rename from app/views/examples/example_form_validation_single_question_radio_h1_legend.html rename to app/views/examples/example_form_validation_single_question_more_text.html index b695ac00f..a72a6acfb 100644 --- a/app/views/examples/example_form_validation_single_question_radio_h1_legend.html +++ b/app/views/examples/example_form_validation_single_question_more_text.html @@ -3,15 +3,15 @@ {% block page_title %}{% if error %}Error: {% endif %}Example: Form validation — Errors — GOV.UK elements{% endblock %} {% block content %} -
+
{% include "includes/breadcrumb.html" %}
-
- {% include "snippets/form_error_radio_h1_legend.html" %} + + {% include "snippets/form_error_radio_more_text.html" %}
{% include "examples/_form_validation_implementation_advice.html" %} diff --git a/app/views/examples/example_form_validation_single_question_radio.html b/app/views/examples/example_form_validation_single_question_radio.html index 9644d4a8b..7373b56bc 100644 --- a/app/views/examples/example_form_validation_single_question_radio.html +++ b/app/views/examples/example_form_validation_single_question_radio.html @@ -3,7 +3,7 @@ {% block page_title %}{% if error %}Error: {% endif %}Example: Form validation — Errors — GOV.UK elements{% endblock %} {% block content %} -
+
{% include "includes/breadcrumb.html" %} diff --git a/app/views/examples/example_form_validation_single_question_text_h1_label.html b/app/views/examples/example_form_validation_single_question_text.html similarity index 85% rename from app/views/examples/example_form_validation_single_question_text_h1_label.html rename to app/views/examples/example_form_validation_single_question_text.html index 816309af7..65dc0fbae 100644 --- a/app/views/examples/example_form_validation_single_question_text_h1_label.html +++ b/app/views/examples/example_form_validation_single_question_text.html @@ -10,8 +10,8 @@
-
- {% include "snippets/form_error_text_h1_label.html" %} + + {% include "snippets/form_error_text.html" %}
{% include "examples/_form_validation_implementation_advice.html" %} diff --git a/app/views/guide_errors.html b/app/views/guide_errors.html index deaa720fa..3157a739e 100755 --- a/app/views/guide_errors.html +++ b/app/views/guide_errors.html @@ -105,18 +105,18 @@

Highlight errors in forms

Examples

{% endif %} -

- Check your personal details -

- -

- Look at your name, signature and other details. -

- - -
-
+
+
- - +

Are your personal details correct and up-to-date? - +

+ + {% if error %}
{% endif %} + Look at your name, signature and other details. + {% if error %} Error message about personal details goes here +
{% endif %}
+ {% if error %}
{% endif %}
@@ -50,6 +46,7 @@

+ {% if error %}
{% endif %}
diff --git a/app/views/snippets/form_error_radio_h1_legend.html b/app/views/snippets/form_error_radio_h1_legend.html deleted file mode 100644 index 4f0cf849e..000000000 --- a/app/views/snippets/form_error_radio_h1_legend.html +++ /dev/null @@ -1,54 +0,0 @@ -{% if error %} - -{% endif %} - -
-
- - -

- Are your personal details correct and up-to-date? -

- - {% if error %}
{% endif %} - Look at your name, signature and other details. - - {% if error %} - - Error message about personal details goes here - -
- {% endif %} - -
- - {% if error %}
{% endif %} -
- - -
- -
- - -
- {% if error %}
{% endif %} - -
-
- - diff --git a/app/views/snippets/form_error_radio_more_text.html b/app/views/snippets/form_error_radio_more_text.html new file mode 100644 index 000000000..4f58f7b97 --- /dev/null +++ b/app/views/snippets/form_error_radio_more_text.html @@ -0,0 +1,71 @@ +{% if error %} + +{% endif %} + +

+ Compare your old and new photos +

+ +

+ To prevent fraud, an examiner will compare your new photo with the photo from your old passport. +

+ +

+ If the examiner can't recognise you, someone else will have to complete a form to verify that it's really you (a 'countersignature'). +

+ +

+ To save time, look at the photo in your current passport and tell us now if you look very different. +

+ +
+

+ Don't worry about normal signs of ageing, or your hairstyle or facial hair changing a lot - the examiners are used to that +

+
+ + +
+
+ + + + + Can you be recognised as the same person? + + {% if error %} + + Error message about recognisable goes here + + {% endif %} + + + +
+ + +
+ +
+ + +
+ +
+
+ + diff --git a/app/views/snippets/form_error_text_h1_label.html b/app/views/snippets/form_error_text.html similarity index 100% rename from app/views/snippets/form_error_text_h1_label.html rename to app/views/snippets/form_error_text.html