diff --git a/app/prototype_v4_1/controllers/authentication.js b/app/prototype_v4_1/controllers/authentication.js index 7aa43b8..1ec3f2c 100644 --- a/app/prototype_v4_1/controllers/authentication.js +++ b/app/prototype_v4_1/controllers/authentication.js @@ -1,15 +1,12 @@ -const version = 'v4_1' -const view = (template) => { - return `prototype_${version}/views/${template}` -} +const { path: prototypePath, view } = require('../lib/settings') exports.signIn_get = (req, res) => { delete req.session.data res.render(view('authentication/sign-in'), { actions: { - back: `/prototype_${version}`, - next: `/prototype_${version}/sign-in` + back: prototypePath, + next: `${prototypePath}/sign-in` } }) } @@ -21,20 +18,20 @@ exports.signIn_post = (req, res) => { res.render(view('authentication/sign-in'), { errors, actions: { - back: `/prototype_${version}`, - next: `/prototype_${version}/sign-in` + back: prototypePath, + next: `${prototypePath}/sign-in` } }) } else { - res.redirect(`/prototype_${version}/security-code`) + res.redirect(`${prototypePath}/security-code`) } } exports.securityCode_get = (req, res) => { res.render(view('authentication/security-code'), { actions: { - back: `/prototype_${version}/sign-in`, - next: `/prototype_${version}/security-code` + back: `${prototypePath}/sign-in`, + next: `${prototypePath}/security-code` } }) } @@ -46,21 +43,21 @@ exports.securityCode_post = (req, res) => { res.render(view('authentication/security-code'), { errors, actions: { - back: `/prototype_${version}/sign-in`, - next: `/prototype_${version}/security-code` + back: `${prototypePath}/sign-in`, + next: `${prototypePath}/security-code` } }) } else { - res.redirect(`/prototype_${version}/sign-in-agreement`) + res.redirect(`${prototypePath}/sign-in-agreement`) } } exports.signInAgreement_get = (req, res) => { res.render(view('authentication/sign-in-agreement'), { actions: { - back: `/prototype_${version}/security-code`, - accept: `/prototype_${version}/sign-in-agreement`, - decline: `/prototype_${version}/sign-in-agreement-declined` + back: `${prototypePath}/security-code`, + accept: `${prototypePath}/sign-in-agreement`, + decline: `${prototypePath}/sign-in-agreement-declined` } }) } @@ -72,20 +69,20 @@ exports.signInAgreement_post = (req, res) => { res.render(view('authentication/sign-in-agreement'), { errors, actions: { - back: `/prototype_${version}/security-code`, - accept: `/prototype_${version}/sign-in-agreement`, - decline: `/prototype_${version}/sign-in-agreement-declined` + back: `${prototypePath}/security-code`, + accept: `${prototypePath}/sign-in-agreement`, + decline: `${prototypePath}/sign-in-agreement-declined` } }) } else { - res.redirect(`/prototype_${version}/accept-terms`) + res.redirect(`${prototypePath}/accept-terms`) } } exports.signInAgreementDeclined_get = (req, res) => { res.render(view('authentication/sign-in-agreement-declined'), { actions: { - back: `/prototype_${version}` + back: prototypePath } }) } diff --git a/app/prototype_v4_1/controllers/content.js b/app/prototype_v4_1/controllers/content.js index a2f2067..2e0212d 100644 --- a/app/prototype_v4_1/controllers/content.js +++ b/app/prototype_v4_1/controllers/content.js @@ -1,8 +1,7 @@ const fs = require('fs') const path = require('path') const matter = require('gray-matter') - -const version = 'v4_1' +const { view } = require('../lib/settings') const contentDirectory = path.join(__dirname, '..', 'content') @@ -60,7 +59,7 @@ const renderContent = (fileName) => (req, res, next) => { return next(error) } - res.render(`prototype_${version}/views/content/show`, { + res.render(view('content/show'), { content: renderedMarkdown, contentData }) diff --git a/app/prototype_v4_1/controllers/error.js b/app/prototype_v4_1/controllers/error.js index 81f4bda..f8dd496 100644 --- a/app/prototype_v4_1/controllers/error.js +++ b/app/prototype_v4_1/controllers/error.js @@ -1,13 +1,13 @@ -const version = 'v4_1' +const { view } = require('../lib/settings') exports.pageNotFound = (req, res) => { - res.status(404).render(`prototype_${version}/views/errors/404`) + res.status(404).render(view('errors/404')) } exports.unexpectedError = (req, res) => { - res.status(500).render(`prototype_${version}/views/errors/500`) + res.status(500).render(view('errors/500')) } exports.serviceUnavailable = (req, res) => { - res.status(503).render(`prototype_${version}/views/errors/503`) + res.status(503).render(view('errors/503')) } diff --git a/app/prototype_v4_1/data/questions.yaml b/app/prototype_v4_1/data/questions.yaml index 97e33ee..40fcc0c 100644 --- a/app/prototype_v4_1/data/questions.yaml +++ b/app/prototype_v4_1/data/questions.yaml @@ -6,7 +6,7 @@ questions: heading: title: Terms of use description: | - To continue, confirm that you have read and agree to the [NHS Check if you need a lung scan terms of use](/prototype_v4_1/terms-of-use). + To continue, confirm that you have read and agree to the [NHS Check if you need a lung scan terms of use](terms-of-use). input: label: Confirm you agree to the terms of use options: diff --git a/app/prototype_v4_1/lib/page-index.js b/app/prototype_v4_1/lib/page-index.js new file mode 100644 index 0000000..c37a28c --- /dev/null +++ b/app/prototype_v4_1/lib/page-index.js @@ -0,0 +1,94 @@ +const defaultAnswers = { + acceptTerms: ['yes'], + phoneQuestionnaire: 'no', + smoker: 'yes_current', + dateOfBirth: { + day: '15', + month: '3', + year: '1964' + }, + faceToFaceAppointment: 'no', + height: { + metric: '170' + }, + weight: { + metric: '70' + }, + gender: 'female', + sex: 'female', + ethnicity: 'white', + education: 'further_education', + respiratoryConditions: ['no'], + asbestosAtWork: 'no', + asbestosAtHome: 'no', + cancerDiagnosis: 'no', + cancerDiagnosisRelatives: 'yes', + cancerDiagnosisRelativesAge: 'no', + ageStartedSmoking: '18', + periodsStoppedSmoking: 'no', + smokingType: ['cigarettes'], + cigarettes: { + smokingStatus: 'yes', + smokingFrequency: 'daily', + smokingQuantity: '10', + smokingChange: ['greater'], + smokingChangeIncrease: { + frequency: 'weekly', + quantity: '5', + years: '10' + } + } +} + +const cloneAnswers = () => JSON.parse(JSON.stringify(defaultAnswers)) + +const getDefaultAnswerProfile = (profile) => { + const answers = cloneAnswers() + + if (profile === 'former') { + answers.smoker = 'yes_previous' + answers.ageStoppedSmoking = '55' + answers.cigarettes = { + smokingFrequency: 'daily', + smokingQuantity: '10', + smokingChange: ['greater'], + smokingChangeIncrease: { + frequency: 'weekly', + quantity: '5', + years: '10' + } + } + } + + if (profile === 'shisha') { + answers.smokingType = ['shisha'] + delete answers.cigarettes + answers.shisha = { + smokingStatus: 'yes', + smokingSetting: ['group'], + group: { + smokingFrequency: 'weekly', + smokingQuantity: '30_minutes_to_1_hour' + } + } + } + + return answers +} + +const getIndexRedirect = (returnUrl, prototypePath) => { + if (!returnUrl || typeof returnUrl !== 'string') { + return `${prototypePath}/check-your-answers` + } + + if (!returnUrl.startsWith(`${prototypePath}/`) || returnUrl.includes('//')) { + return `${prototypePath}/page-index` + } + + return returnUrl +} + +module.exports = { + getDefaultAnswerProfile, + getIndexRedirect +} diff --git a/app/prototype_v4_1/lib/question-renderer.js b/app/prototype_v4_1/lib/question-renderer.js index 7098012..6f079a7 100644 --- a/app/prototype_v4_1/lib/question-renderer.js +++ b/app/prototype_v4_1/lib/question-renderer.js @@ -1,16 +1,7 @@ const { getQuestion } = require('./questions') +const settings = require('./settings') -const version = 'v4_1' - -/** - * Build a prototype v4_1 view path. - * - * @param {string} template - Template path below the prototype views folder. - * @returns {string} Nunjucks template path. - */ -const view = (template) => { - return `prototype_${version}/views/${template}` -} +const { version, view } = settings /** * Render a YAML-backed question using optional runtime overrides. diff --git a/app/prototype_v4_1/lib/settings.js b/app/prototype_v4_1/lib/settings.js new file mode 100644 index 0000000..6648aa7 --- /dev/null +++ b/app/prototype_v4_1/lib/settings.js @@ -0,0 +1,24 @@ +const version = 'v4_1' +const name = `prototype_${version}` +const path = `/${name}` +const viewPath = `${name}/views` + +const view = (template) => { + return `${viewPath}/${template}` +} + +const locals = { + version, + name, + path, + viewPath +} + +module.exports = { + locals, + name, + path, + version, + view, + viewPath +} diff --git a/app/prototype_v4_1/routes.js b/app/prototype_v4_1/routes.js index fc35e74..7a74075 100644 --- a/app/prototype_v4_1/routes.js +++ b/app/prototype_v4_1/routes.js @@ -2,14 +2,11 @@ const express = require('express') const fs = require('fs') const path = require('path') const router = express.Router() +const settings = require('./lib/settings') -const version = 'v4_1' +const { path: prototypePath, version, view } = settings const viewsDirectory = path.join(__dirname, 'views') -const view = (template) => { - return `prototype_${version}/views/${template}` -} - const hasView = (template) => { if (!template || template.includes('..')) { return false @@ -26,20 +23,26 @@ const hasView = (template) => { const authenticationController = require('./controllers/authentication') const contentController = require('./controllers/content') const errorController = require('./controllers/error') +const { getDefaultAnswerProfile, getIndexRedirect } = require('./lib/page-index') const questionController = require('./controllers/question') +router.use((req, res, next) => { + res.locals.prototype = settings.locals + next() +}) + /// ------------------------------------------------------------------------ /// /// Start page /// ------------------------------------------------------------------------ /// -router.get(`/prototype_${version}`, (req, res) => { - res.redirect(`/prototype_${version}/start-page`) +router.get(prototypePath, (req, res) => { + res.redirect(`${prototypePath}/start-page`) }) -router.get(`/prototype_${version}/start-page`, (req, res) => { - res.render(view('index'), { +router.get(`${prototypePath}/start-page`, (req, res) => { + res.render(view('start'), { actions: { - start: `/prototype_${version}/sign-in` + start: `${prototypePath}/sign-in` } }) }) @@ -218,6 +221,33 @@ router.get(`/prototype_${version}/server-error`, errorController.unexpectedError router.get(`/prototype_${version}/503`, errorController.serviceUnavailable) router.get(`/prototype_${version}/service-unavailable`, errorController.serviceUnavailable) +/// ------------------------------------------------------------------------ /// +/// Page index +/// ------------------------------------------------------------------------ /// + +router.get(`/prototype_${version}/set-default-answers`, (req, res) => { + req.session.data = req.session.data || {} + req.session.data.answers = getDefaultAnswerProfile(req.query.profile) + + res.redirect(getIndexRedirect(req.query.returnUrl, prototypePath)) +}) + +router.get(`/prototype_${version}/page-index`, (req, res) => { + res.render(view('index'), { + actions: { + setDefaultAnswers: `/prototype_${version}/set-default-answers` + } + }) +}) + +router.get(`/prototype_${version}/index`, (req, res) => { + res.redirect(`/prototype_${version}/page-index`) +}) + +router.get(`/prototype_${version}/index-allpages`, (req, res) => { + res.redirect(`/prototype_${version}/page-index`) +}) + /// ------------------------------------------------------------------------ /// /// Add your routes above /// ------------------------------------------------------------------------ /// diff --git a/app/prototype_v4_1/views/authentication/security-code.html b/app/prototype_v4_1/views/authentication/security-code.html index 5f77bc5..bc6062e 100644 --- a/app/prototype_v4_1/views/authentication/security-code.html +++ b/app/prototype_v4_1/views/authentication/security-code.html @@ -1,14 +1,14 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Enter the security code" %} {% block content %} - {% include "prototype_v4/views/includes/error-summary.html" %} + {% include prototype.viewPath + "/includes/error-summary.html" %}
- {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %}

We have sent a 6-digit security code to your phone number ending in 0887. diff --git a/app/prototype_v4_1/views/authentication/sign-in-agreement-declined.html b/app/prototype_v4_1/views/authentication/sign-in-agreement-declined.html index aacf829..2ab24b7 100644 --- a/app/prototype_v4_1/views/authentication/sign-in-agreement-declined.html +++ b/app/prototype_v4_1/views/authentication/sign-in-agreement-declined.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Sorry, you cannot test the online service" %} @@ -18,7 +18,7 @@

- {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {{ bodyTextMarkdown | markdownToHtml | safe }} diff --git a/app/prototype_v4_1/views/authentication/sign-in-agreement.html b/app/prototype_v4_1/views/authentication/sign-in-agreement.html index 5612273..ce92baa 100644 --- a/app/prototype_v4_1/views/authentication/sign-in-agreement.html +++ b/app/prototype_v4_1/views/authentication/sign-in-agreement.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Agree to share your NHS login information" %} @@ -22,7 +22,7 @@
- {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %}
diff --git a/app/prototype_v4_1/views/authentication/sign-in.html b/app/prototype_v4_1/views/authentication/sign-in.html index e00b7b3..dfc5d48 100644 --- a/app/prototype_v4_1/views/authentication/sign-in.html +++ b/app/prototype_v4_1/views/authentication/sign-in.html @@ -1,14 +1,14 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Log in to your NHS account" %} {% block content %} - {% include "prototype_v4/views/includes/error-summary.html" %} + {% include prototype.viewPath + "/includes/error-summary.html" %}
- {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} diff --git a/app/prototype_v4_1/views/check-your-answers.html b/app/prototype_v4_1/views/check-your-answers.html index a3ae17c..f541116 100644 --- a/app/prototype_v4_1/views/check-your-answers.html +++ b/app/prototype_v4_1/views/check-your-answers.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Check your answers" %} @@ -10,12 +10,12 @@ {% endblock %} {% block content %} - {% include "prototype_v4/views/includes/error-summary.html" %} + {% include prototype.viewPath + "/includes/error-summary.html" %}
- {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %}

Check the information you have given us. If any of the details are wrong, you can change them. diff --git a/app/prototype_v4_1/views/confirmation.html b/app/prototype_v4_1/views/confirmation.html index baf8385..8daeff5 100644 --- a/app/prototype_v4_1/views/confirmation.html +++ b/app/prototype_v4_1/views/confirmation.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Thank you for testing the online service" %} @@ -66,23 +66,23 @@ {% endif %} - {% include "prototype_v4/views/includes/speak-to-a-gp.html" %} + {% include prototype.viewPath + "/includes/speak-to-a-gp.html" %} - {% include "prototype_v4/views/includes/find-your-local-stop-smoking-service.html" %} + {% include prototype.viewPath + "/includes/find-your-local-stop-smoking-service.html" %} - {% include "prototype_v4/views/includes/benefits-of-stopping-smoking.html" %} + {% include prototype.viewPath + "/includes/benefits-of-stopping-smoking.html" %} - {% include "prototype_v4/views/includes/help-stop-smoking.html" %} + {% include prototype.viewPath + "/includes/help-stop-smoking.html" %} {% if query.risk and query.risk == "high" %} - {% include "prototype_v4/views/includes/vaping-to-quit-smoking.html" %} + {% include prototype.viewPath + "/includes/vaping-to-quit-smoking.html" %} {% endif %} - {% include "prototype_v4/views/includes/smoking-anxiety-and-mood.html" %} + {% include prototype.viewPath + "/includes/smoking-anxiety-and-mood.html" %} - {% include "prototype_v4/views/includes/help-and-support.html" %} + {% include prototype.viewPath + "/includes/help-and-support.html" %} - {% include "prototype_v4/views/includes/give-feedback.html" %} + {% include prototype.viewPath + "/includes/give-feedback.html" %}

diff --git a/app/prototype_v4_1/views/content/show.html b/app/prototype_v4_1/views/content/show.html index 1ad529b..7adb370 100644 --- a/app/prototype_v4_1/views/content/show.html +++ b/app/prototype_v4_1/views/content/show.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = contentData.title %} diff --git a/app/prototype_v4_1/views/errors/404.html b/app/prototype_v4_1/views/errors/404.html index e4e20d8..749dffa 100644 --- a/app/prototype_v4_1/views/errors/404.html +++ b/app/prototype_v4_1/views/errors/404.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Page not found" %} diff --git a/app/prototype_v4_1/views/errors/500.html b/app/prototype_v4_1/views/errors/500.html index 1ea9afe..324cc38 100644 --- a/app/prototype_v4_1/views/errors/500.html +++ b/app/prototype_v4_1/views/errors/500.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set hidePhaseBanner = true %} {% set hideFooterLinks = true %} diff --git a/app/prototype_v4_1/views/errors/503.html b/app/prototype_v4_1/views/errors/503.html index b7c78da..6f8b22d 100644 --- a/app/prototype_v4_1/views/errors/503.html +++ b/app/prototype_v4_1/views/errors/503.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set hidePhaseBanner = true %} {% set hideFooterLinks = true %} diff --git a/app/prototype_v4_1/views/index.html b/app/prototype_v4_1/views/index.html index 4a0b20c..fbac5e9 100644 --- a/app/prototype_v4_1/views/index.html +++ b/app/prototype_v4_1/views/index.html @@ -1,56 +1,126 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} -{% set title = "Help us test a new online service" %} +{% set title = "Page index" %} +{% set prototypePath = prototype.path %} -{% block content %} -
-
- - {% include "prototype_v4/views/includes/page-heading.html" %} - -

We are testing a new online questionnaire for lung cancer screening. This service will ask you some questions about your medical history and lifestyle.

+{% macro pageLink(href, text) %} +
  • + {{ text }} +
  • +{% endmacro %} -

    This online service cannot currently recommend if you need a lung scan. Once you have completed the online service you will need to call us to repeat the questionnaire by phone.

    +{% macro seededPageLink(returnUrl, text) %} +
  • + {{ text }} +
  • +{% endmacro %} -

    The answers you submit will not be shared with your patient care advisor during your phone appointment, or with your GP.

    +{% macro seededProfilePageLink(returnUrl, profile, text) %} +
  • + {{ text }} +
  • +{% endmacro %} -

    As a thank you for testing the online service, we will offer you a £10 voucher once you have completed both the online service and your phone appointment.

    - -

    The benefits of lung cancer screening

    - -

    Your risk of lung cancer increases as you get older. Screening aims to find lung cancer early, sometimes before you have symptoms. Early diagnosis can make lung cancer more treatable and make treatment more successful.

    +{% block content %} +
    +
    +

    {{ title }}

    +

    Quick navigation to all pages in prototype v4.1.

    +

    Some links set default answers before opening the page, so conditional pages and check your answers have enough data to render.

    + +

    Start and sign in

    +
      + {{ pageLink("/start-page", "Help us test a new online service") }} + {{ pageLink("/sign-in", "Log in to your NHS account") }} + {{ pageLink("/security-code", "Enter the security code") }} + {{ pageLink("/sign-in-agreement", "Agree to share NHS login information") }} + {{ pageLink("/sign-in-agreement-declined", "You cannot use this service") }} + {{ pageLink("/accept-terms", "Terms of use") }} + {{ pageLink("/phone-questionnaire", "Confirm if you have completed a lung cancer risk questionnaire by phone") }} + {{ pageLink("/phone-questionnaire-exit", "You do not need to test the online service") }} +
    -

    You are eligible for lung cancer screening if you are:

    +

    Eligibility

    +
      + {{ pageLink("/smoker", "Tobacco smoking") }} + {{ pageLink("/date-of-birth", "What is your date of birth?") }} + {{ pageLink("/face-to-face-appointment", "Check if you need a face-to-face appointment") }} + {{ pageLink("/not-eligible-for-screening", "You are not eligible for lung cancer screening") }} + {{ pageLink("/not-eligible-for-scan", "You are not eligible for an NHS lung scan") }} + {{ pageLink("/book-appointment", "Call us to book an appointment") }} +
    -
      -
    • aged between 55 and 74
    • -
    • registered with a GP surgery
    • -
    • someone who smokes or used to smoke
    • +

      About you

      +
        + {{ pageLink("/height-metric", "Your height - metric") }} + {{ pageLink("/height-imperial", "Your height - imperial") }} + {{ pageLink("/weight-metric", "Your weight - metric") }} + {{ pageLink("/weight-imperial", "Your weight - imperial") }} + {{ pageLink("/gender", "Your gender identity") }} + {{ pageLink("/sex", "Your sex at birth") }} + {{ pageLink("/ethnicity", "Your ethnic background") }} + {{ pageLink("/education", "Your education") }}
      -

      What to expect in the online service

      +

      Your health

      +
        + {{ pageLink("/respiratory-conditions", "Respiratory conditions") }} + {{ pageLink("/asbestos-at-work", "Asbestos at work") }} + {{ pageLink("/asbestos-at-home", "Asbestos at home") }} + {{ pageLink("/cancer-diagnosis", "Cancer diagnosis") }} +
      -

      We will ask you questions about:

      +

      Your family history

      +
        + {{ pageLink("/cancer-diagnosis-relatives", "Relatives with lung cancer") }} + {{ seededPageLink("/cancer-diagnosis-relatives-age", "Relatives under 60 when diagnosed") }} +
      -
        -
      • your height and weight
      • -
      • your ethnicity
      • -
      • your education
      • -
      • if you have ever had a cancer diagnosis
      • -
      • if your parents, siblings, or children have ever had a lung cancer diagnosis
      • -
      • your smoking habits
      • +

        Your smoking habits

        +
          + {{ pageLink("/age-started-smoking", "Age you started smoking") }} + {{ seededProfilePageLink("/age-stopped-smoking", "former", "Former smoker - age you stopped smoking") }} + {{ pageLink("/periods-stopped-smoking", "Periods when you stopped smoking") }} + {{ pageLink("/smoking-type", "The type of tobacco you smoke or used to smoke") }} + {{ pageLink("/smoking-type-exit", "You are not eligible for lung cancer screening") }}
        - {{ button({ - text: "Continue", - href: actions.start, - classes: "nhsuk-button--login" - }) }} +

        Tobacco smoking

        +
          + {{ seededPageLink("/smoking-status?type=cigarettes", "Cigarettes - currently smoke") }} + {{ seededPageLink("/smoking-frequency?type=cigarettes", "Cigarettes - frequency") }} + {{ seededPageLink("/smoking-quantity?type=cigarettes", "Cigarettes - quantity") }} + {{ seededPageLink("/smoking-change?type=cigarettes", "Cigarettes - has quantity changed") }} + {{ seededPageLink("/smoking-frequency-change?type=cigarettes%26change=greater", "Cigarettes - more frequency") }} + {{ seededPageLink("/smoking-quantity-change?type=cigarettes%26change=greater", "Cigarettes - more quantity") }} + {{ seededPageLink("/smoking-years-change?type=cigarettes%26change=greater", "Cigarettes - more duration") }} + {{ seededProfilePageLink("/smoking-setting?type=shisha", "shisha", "Shisha - smoking setting") }} + {{ seededProfilePageLink("/smoking-frequency?type=shisha%26setting=group", "shisha", "Shisha in a group - frequency") }} + {{ seededProfilePageLink("/smoking-quantity?type=shisha%26setting=group", "shisha", "Shisha in a group - quantity") }} +
        -

        If you do not want to test the online service

        +

        Check and confirmation

        +
          + {{ seededPageLink("/check-your-answers", "Check your answers - with default answers") }} + {{ pageLink("/confirmation", "Confirmation") }} + {{ pageLink("/confirmation?risk=high", "Confirmation - High risk") }} +
        -

        You should call us on {{ serviceTelephone }} to complete the questionnaire by phone.

        +

        Static pages

        +
          + {{ pageLink("/accessibility-statement", "Accessibility statement") }} + {{ pageLink("/contact-us", "Contact us") }} + {{ pageLink("/cookies", "Cookies") }} + {{ pageLink("/privacy-policy", "Privacy policy") }} + {{ pageLink("/terms-of-use", "Terms of use") }} +
        +

        Error pages

        +
          + {{ pageLink("/404", "Page not found") }} + {{ pageLink("/500", "Unexpected error") }} + {{ pageLink("/503", "Service unavailable") }} +
    {% endblock %} diff --git a/app/prototype_v4_1/views/layouts/main.html b/app/prototype_v4_1/views/layouts/main.html index 8e4853a..37d40ff 100755 --- a/app/prototype_v4_1/views/layouts/main.html +++ b/app/prototype_v4_1/views/layouts/main.html @@ -37,7 +37,7 @@ }, { text: "Log out", - href: "/prototype_v4/" + href: prototype.path + "/" } ] } if data['logged-in'] @@ -68,45 +68,45 @@ meta: { items: [ { - href: "/prototype_v4/accessibility-statement", + href: prototype.path + "/accessibility-statement", text: "Accessibility statement" }, { - href: "/prototype_v4/contact-us", + href: prototype.path + "/contact-us", text: "Contact us" }, { - href: "/prototype_v4/cookies", + href: prototype.path + "/cookies", text: "Cookies" }, { - href: "/prototype_v4/privacy-policy", + href: prototype.path + "/privacy-policy", text: "Privacy policy" }, { - href: "/prototype_v4/terms-of-use", + href: prototype.path + "/terms-of-use", text: "Terms of use" } ] } }) if not hideFooterLinks }} -{# {% endblock %} {% block bodyEnd %} diff --git a/app/prototype_v4_1/views/questions/_question.html b/app/prototype_v4_1/views/questions/_question.html index c4364e8..51674f4 100644 --- a/app/prototype_v4_1/views/questions/_question.html +++ b/app/prototype_v4_1/views/questions/_question.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4_1/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = question.heading.title %} {% set caption = question.heading.caption %} @@ -11,13 +11,13 @@ {% endblock %} {% block content %} - {% include "prototype_v4_1/views/includes/error-summary.html" %} + {% include prototype.viewPath + "/includes/error-summary.html" %}
    {% if not question.input.isPageHeading %} - {% include "prototype_v4_1/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {% endif %} {% if question.description %} @@ -35,7 +35,7 @@ {% if question.input.isPageHeading %} {% set headingHtml %} - {% include "prototype_v4_1/views/includes/page-heading-legend.html" %} + {% include prototype.viewPath + "/includes/page-heading-legend.html" %} {% endset %} {% set legend = { html: headingHtml, diff --git a/app/prototype_v4_1/views/questions/book-appointment.html b/app/prototype_v4_1/views/questions/book-appointment.html index ddbaedf..3ee553c 100644 --- a/app/prototype_v4_1/views/questions/book-appointment.html +++ b/app/prototype_v4_1/views/questions/book-appointment.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "Call us to book an appointment" %} @@ -23,11 +23,11 @@
    - {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {{ bodyTextMarkdown | markdownToHtml | safe }} - {% include "prototype_v4/views/includes/speak-to-a-gp.html" %} + {% include prototype.viewPath + "/includes/speak-to-a-gp.html" %}
    diff --git a/app/prototype_v4_1/views/questions/not-eligible-for-scan.html b/app/prototype_v4_1/views/questions/not-eligible-for-scan.html index b4b24b1..699fb2a 100644 --- a/app/prototype_v4_1/views/questions/not-eligible-for-scan.html +++ b/app/prototype_v4_1/views/questions/not-eligible-for-scan.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "You are not eligible for an NHS lung scan" %} @@ -19,11 +19,11 @@
    - {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {{ bodyTextMarkdown | markdownToHtml | safe }} - {% include "prototype_v4/views/includes/speak-to-a-gp.html" %} + {% include prototype.viewPath + "/includes/speak-to-a-gp.html" %}
    diff --git a/app/prototype_v4_1/views/questions/not-eligible-for-screening.html b/app/prototype_v4_1/views/questions/not-eligible-for-screening.html index 35b4a85..ad4947b 100644 --- a/app/prototype_v4_1/views/questions/not-eligible-for-screening.html +++ b/app/prototype_v4_1/views/questions/not-eligible-for-screening.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "You are not eligible for lung cancer screening" %} @@ -17,11 +17,11 @@
    - {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {{ bodyTextMarkdown | markdownToHtml | safe }} - {% include "prototype_v4/views/includes/speak-to-a-gp.html" %} + {% include prototype.viewPath + "/includes/speak-to-a-gp.html" %}
    diff --git a/app/prototype_v4_1/views/questions/phone-questionnaire-exit.html b/app/prototype_v4_1/views/questions/phone-questionnaire-exit.html index 05bcc09..5c3a77a 100644 --- a/app/prototype_v4_1/views/questions/phone-questionnaire-exit.html +++ b/app/prototype_v4_1/views/questions/phone-questionnaire-exit.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "You do not need to test the online service" %} @@ -16,16 +16,16 @@ {% endblock %} {% block content %} - {% include "prototype_v4/views/includes/error-summary.html" %} + {% include prototype.viewPath + "/includes/error-summary.html" %}
    - {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {{ bodyTextMarkdown | markdownToHtml | safe }} - {% include "prototype_v4/views/includes/speak-to-a-gp.html" %} + {% include prototype.viewPath + "/includes/speak-to-a-gp.html" %}
    diff --git a/app/prototype_v4_1/views/questions/smoking-type-exit.html b/app/prototype_v4_1/views/questions/smoking-type-exit.html index 9630dbf..924cbcf 100644 --- a/app/prototype_v4_1/views/questions/smoking-type-exit.html +++ b/app/prototype_v4_1/views/questions/smoking-type-exit.html @@ -1,4 +1,4 @@ -{% extends "prototype_v4/views/layouts/main.html" %} +{% extends prototype.viewPath + "/layouts/main.html" %} {% set title = "You are not eligible for lung cancer screening" %} @@ -17,11 +17,11 @@
    - {% include "prototype_v4/views/includes/page-heading.html" %} + {% include prototype.viewPath + "/includes/page-heading.html" %} {{ bodyTextMarkdown | markdownToHtml | safe }} - {% include "prototype_v4/views/includes/speak-to-a-gp.html" %} + {% include prototype.viewPath + "/includes/speak-to-a-gp.html" %}
    diff --git a/app/prototype_v4_1/views/start.html b/app/prototype_v4_1/views/start.html new file mode 100644 index 0000000..95b3248 --- /dev/null +++ b/app/prototype_v4_1/views/start.html @@ -0,0 +1,56 @@ +{% extends prototype.viewPath + "/layouts/main.html" %} + +{% set title = "Help us test a new online service" %} + +{% block content %} +
    +
    + + {% include prototype.viewPath + "/includes/page-heading.html" %} + +

    We are testing a new online questionnaire for lung cancer screening. This service will ask you some questions about your medical history and lifestyle.

    + +

    This online service cannot currently recommend if you need a lung scan. Once you have completed the online service you will need to call us to repeat the questionnaire by phone.

    + +

    The answers you submit will not be shared with your patient care advisor during your phone appointment, or with your GP.

    + +

    As a thank you for testing the online service, we will offer you a £10 voucher once you have completed both the online service and your phone appointment.

    + +

    The benefits of lung cancer screening

    + +

    Your risk of lung cancer increases as you get older. Screening aims to find lung cancer early, sometimes before you have symptoms. Early diagnosis can make lung cancer more treatable and make treatment more successful.

    + +

    You are eligible for lung cancer screening if you are:

    + +
      +
    • aged between 55 and 74
    • +
    • registered with a GP surgery
    • +
    • someone who smokes or used to smoke
    • +
    + +

    What to expect in the online service

    + +

    We will ask you questions about:

    + +
      +
    • your height and weight
    • +
    • your ethnicity
    • +
    • your education
    • +
    • if you have ever had a cancer diagnosis
    • +
    • if your parents, siblings, or children have ever had a lung cancer diagnosis
    • +
    • your smoking habits
    • +
    + + {{ button({ + text: "Continue", + href: actions.start, + classes: "nhsuk-button--login" + }) }} + +

    If you do not want to test the online service

    + +

    You should call us on {{ serviceTelephone }} to complete the questionnaire by phone.

    + +
    +
    +{% endblock %}