-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from timpaul/v2-alpha
V2 alpha
- Loading branch information
Showing
25 changed files
with
1,357 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ node_modules | |
.env | ||
.DS_Store | ||
.icloud | ||
*.icloud | ||
*.icloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
<div class="govuk-breadcrumbs"> | ||
<ol class="govuk-breadcrumbs__list"> | ||
{% if fileData.filename %} | ||
|
||
<li class="govuk-breadcrumbs__list-item"> | ||
<a class="govuk-breadcrumbs__link" href="/">Home</a> | ||
</li> | ||
|
||
<li class="govuk-breadcrumbs__list-item" aria-current="page">{{fileData.filename}} | ||
<a class="govuk-link govuk-link--no-visited-state" href="/delete/{{ formId }}">Delete file</a> | ||
</li> | ||
|
||
{% else %} | ||
|
||
<li class="govuk-breadcrumbs__list-item">Home</li> | ||
|
||
{% endif %} | ||
</ol> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{% extends "govuk/template.njk" %} | ||
{% import "answer-types.njk" as answerType %} | ||
|
||
{% block head %} | ||
<link href="/assets/style.css" rel="stylesheet"> | ||
{% endblock %} | ||
|
||
{% block header %} | ||
{{ govukHeader({ | ||
useTudorCrown: true | ||
}) }} | ||
{% endblock %} | ||
|
||
{% from "govuk/components/back-link/macro.njk" import govukBackLink %} | ||
{% from "govuk/components/button/macro.njk" import govukButton %} | ||
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} | ||
|
||
|
||
|
||
{% block beforeContent %} | ||
{{ govukBackLink({ | ||
text: "Back", | ||
href: "/form-popup/" + formId + "/" + question | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds-from-desktop"> | ||
|
||
<h1 class="govuk-heading-l">Check your answers before sending your application</h1> | ||
|
||
<dl class="govuk-summary-list govuk-!-margin-bottom-9"> | ||
{% for question in fileData.pages %} | ||
<div class="govuk-summary-list__row"> | ||
<dt class="govuk-summary-list__key"> | ||
{{question.question_text}} | ||
</dt> | ||
<dd class="govuk-summary-list__value"> | ||
|
||
</dd> | ||
<dd class="govuk-summary-list__actions"> | ||
<a class="govuk-link" href="#">Change</a> | ||
</dd> | ||
</div> | ||
{% endfor %} | ||
</dl> | ||
|
||
<h2 class="govuk-heading-m">Now send your application</h2> | ||
|
||
<p class="govuk-body">By submitting this application you are confirming that, to the best of your knowledge, the details you are providing are correct.</p> | ||
|
||
<form action="/form-handler" method="post" novalidate> | ||
|
||
<input type="hidden" name="answers-checked" value="true"> | ||
|
||
{{ govukButton({ | ||
text: "Accept and send" | ||
}) }} | ||
|
||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
{% endblock %} | ||
|
||
{% block footer %} | ||
{% endblock %} | ||
|
||
{% block bodyEnd %} | ||
{# Run JavaScript at end of the <body>, to avoid blocking the initial render. #} | ||
<script type="module" src="/assets/govuk-frontend.min.js"></script> | ||
<script type="module"> | ||
import { initAll } from '/assets/govuk-frontend.min.js' | ||
initAll() | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<nav class="govuk-pagination form-pagination govuk-!-margin-bottom-2" aria-label="Pagination"> | ||
|
||
<div class="govuk-pagination__prev"> | ||
{% if pageNum | float > 1 %} | ||
<a class="govuk-link govuk-pagination__link govuk-link--no-visited-state" href="/results/form-{{formId}}/{{ pageNum | float - 1 }}" rel="prev"> | ||
<svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13"> | ||
<path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"></path> | ||
</svg> | ||
<span class="govuk-pagination__link-title"> | ||
Previous<span class="govuk-visually-hidden"> page</span> | ||
</span> | ||
</a> | ||
{% endif %} | ||
</div> | ||
|
||
<ul class="govuk-pagination__list"> | ||
<li class="govuk-pagination__item govuk-pagination__item--current"> | ||
Page {{ pageNum }} | ||
</li> | ||
</ul> | ||
|
||
<div class="govuk-pagination__next"> | ||
{% if pageNum | float < filePages %} | ||
<a class="govuk-link govuk-pagination__link govuk-link--no-visited-state" href="/results/form-{{formId}}/{{ pageNum | float + 1 }}" rel="next"> | ||
<span class="govuk-pagination__link-title"> | ||
Next<span class="govuk-visually-hidden"> page</span> | ||
</span> | ||
<svg class="govuk-pagination__icon govuk-pagination__icon--next" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13"> | ||
<path d="m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"></path> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
</div> | ||
|
||
</nav> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{% extends "govuk/template.njk" %} | ||
{% import "answer-types.njk" as answerType %} | ||
|
||
{% set questionJson = fileData.pages[question-1] %} | ||
|
||
{% block head %} | ||
<link href="/assets/style.css" rel="stylesheet"> | ||
{% endblock %} | ||
|
||
{% block header %} | ||
|
||
{{ govukHeader({ | ||
useTudorCrown: true | ||
}) }} | ||
|
||
{% endblock %} | ||
|
||
{% from "govuk/components/back-link/macro.njk" import govukBackLink %} | ||
{% from "govuk/components/button/macro.njk" import govukButton %} | ||
|
||
|
||
{% block beforeContent %} | ||
|
||
{% if question > 1 %} | ||
|
||
{{ govukBackLink({ | ||
text: "Back", | ||
href: question-1 | ||
}) }} | ||
|
||
{% endif %} | ||
|
||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
|
||
<span class="govuk-caption-m">Question {{question}}</span> | ||
|
||
|
||
{% if questionJson.answer_type == "date" and questionJson.answer_settings.input_type == "date_of_birth" %} | ||
{{ answerType.date_of_birth(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "date" %} | ||
{{ answerType.other_date(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "name" %} | ||
{{ answerType.name(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "number" %} | ||
{{ answerType.number(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "email" %} | ||
{{ answerType.email(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "text" %} | ||
{{ answerType.text(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "national_insurance_number" %} | ||
{{ answerType.national_insurance_number(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "phone_number" %} | ||
{{ answerType.phone_number(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "organisation_name" %} | ||
{{ answerType.organisation_name(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "address" %} | ||
{{ answerType.address(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "yes_no_question" %} | ||
{{ answerType.yes_no(questionJson.question_text, questionJson.hint_text) }} | ||
|
||
{% elif questionJson.answer_type == "single_choice" %} | ||
{{ answerType.single_choice(questionJson.question_text, questionJson.hint_text, questionJson.options) }} | ||
|
||
{% elif questionJson.answer_type == "multiple_choice" %} | ||
{{ answerType.multiple_choice(questionJson.question_text, questionJson.hint_text, questionJson.options) }} | ||
|
||
{% else %} | ||
<h1 class="govuk-heading-l"> | ||
{{questionJson.question_text}} | ||
</h1> | ||
<p class="govuk-body">{{questionJson.hint_text}}</p> | ||
{% endif %} | ||
|
||
|
||
{% if fileData.pages.length == question %} | ||
{{ govukButton({ | ||
text: "Continue", | ||
href: "/form-popup/" + formId + "/" + question + "/check-answers" | ||
}) }} | ||
{% else %} | ||
{{ govukButton({ | ||
text: "Continue", | ||
href: question + 1 | ||
}) }} | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
{% endblock %} | ||
|
||
{% block bodyEnd %} | ||
{# Run JavaScript at end of the <body>, to avoid blocking the initial render. #} | ||
<script type="module" src="/assets/govuk-frontend.min.js"></script> | ||
<script type="module"> | ||
import { initAll } from '/assets/govuk-frontend.min.js' | ||
initAll() | ||
</script> | ||
<script src="/assets/scripts.js"></script> | ||
{% endblock %} |
Oops, something went wrong.