diff --git a/src/controllers/identifyController.ts b/src/controllers/identifyController.ts new file mode 100644 index 0000000..fc463c9 --- /dev/null +++ b/src/controllers/identifyController.ts @@ -0,0 +1,5 @@ +import { type Request, type Response } from 'express' + +export const identifyPage = (req: Request, res: Response): void => { + res.render('identifyPage') +} diff --git a/src/routes/index.ts b/src/routes/index.ts index 7774c60..5926d62 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -1,6 +1,7 @@ import express, { type Request, type Response, type NextFunction } from 'express' import { HealthchecksController } from '../controllers/healthchecksController' +import { identifyPage } from '../controllers/identifyController' const router = express.Router() const healthchecksController = new HealthchecksController() @@ -12,3 +13,5 @@ router.get('/confirmation', (req, res) => { res.render('confirmation') }) export default router.get('/', (_req: Request, res: Response, _next: NextFunction) => { res.render('index') }) + +router.get('/identifyPage', identifyPage) diff --git a/views/identifyPage.njk b/views/identifyPage.njk new file mode 100644 index 0000000..5bee389 --- /dev/null +++ b/views/identifyPage.njk @@ -0,0 +1,60 @@ +{% extends "layout.njk" %} +{% from "govuk/components/button/macro.njk" import govukButton %} +{% from "govuk/components/radios/macro.njk" import govukRadios %} +{% from "govuk/components/inset-text/macro.njk" import govukInsetText %} +{% block title %}Identify Page{% endblock %} +{% block content %} +
+
+

Commodi-tea ☕

+

Can you identify

+

"Bland and tasteless microwave meals"

+

The tool identifies it as a commodity code: 21069098

+ {{ govukInsetText({ + text: "MISCELLANEOUS EDIBLE PREPARATIONS + - Food preparations not elsewhere specified or included + - Other" + }) }} +

+ Look it up on the Online Trade Tariff +

+ {{ govukRadios({ + name: "correctCNCode", + fieldset: { + legend: { + text: "Is this the correct 8 digit CN Code?", + isPageHeading: true, + classes: "govuk-fieldset__legend--l" + } + }, + items: [ + { + value: "yes", + text: "Yes - it's defintely correct", + hint: { + text: "There is enough information in the description that I'm confident it's the right code" + } + }, + { + value: "maybe", + text: "Maybe", + hint: { + text: "It might be the right code, but there's not really enough information to be sure" + } + }, + { + value: "no", + text: "No", + hint: { + text: "It's got it completely wrong!" + } + } + ] + }) }} + {{ govukButton({ + text: "Continue", + href: "/confirmation" + }) }} +
+
+{% endblock %} diff --git a/views/index.njk b/views/index.njk index b1c1d83..b0eeefc 100644 --- a/views/index.njk +++ b/views/index.njk @@ -18,7 +18,7 @@ }) }} {{ govukButton({ text: "☕ Let's get cracking", - href: "/", + href: "/identifyPage", isStartButton: true }) }}