generated from dwp-ucd/blank-prototype-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
186 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,178 @@ | ||
{% extends "layouts/main.html" %} | ||
|
||
{% set evidenceTypeCapitalFirstLetter = data.evidenceType %} | ||
{% if data.evidenceType !== "P60" %} | ||
{% set evidenceType = data.evidenceType.toLowerCase() %} | ||
{% else %} | ||
{% set evidenceType = data.evidenceType %} | ||
{% endif %} | ||
|
||
{% set remainingUploadBalance = data.uploadLimit - data.benefits[0].files.length * 9 %} | ||
|
||
{% set warningText = "You have gone over your 100MB limit. You must remove at least " + remainingUploadBalance * -1 + "MB to continue."%} | ||
|
||
{% block pageTitle %} | ||
Content page template – {{ serviceName }} – GOV.UK Prototype Kit | ||
{% endblock %} | ||
|
||
{% block beforeContent %} | ||
|
||
<div class="govuk-!-padding-bottom-4"></div> | ||
|
||
{# {{ data | dump }} #} | ||
|
||
{{ govukBackLink({ | ||
text: "Back", | ||
href: "javascript:window.history.back()" | ||
}) }} | ||
|
||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
{% for item in data.benefits %} | ||
|
||
<h1 class="govuk-heading-xl">Check your files</h1> | ||
|
||
{% if data.benefits[0].files.length > 0 %} | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h2 class="govuk-heading-m">{{ evidenceTypeCapitalFirstLetter }} files added</h2> | ||
|
||
<dl class="govuk-summary-list"> | ||
{% for item in data.benefits %} | ||
{% if item.name === data.yourBenefits %} | ||
{% for item in item.files %} | ||
<div class="govuk-summary-list__row"> | ||
|
||
<dt class="govuk-summary-list__key"> | ||
File {{ loop.index }} | ||
</dt> | ||
<dd class="govuk-summary-list__value"> | ||
<p><a download href="/" class="govuk-link">{{item}}</a> (9MB)</p> | ||
</dd> | ||
<dd class="govuk-summary-list__actions"> | ||
|
||
<a class="govuk-link" href="/evidence/are-you-sure?file={{ loop.index }}" name="file-to-delete">Remove</a> | ||
|
||
</dd> | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
</dl> | ||
</div> | ||
</div> | ||
|
||
{% if remainingUploadBalance > 0 %} | ||
|
||
<p> | ||
You have {{ remainingUploadBalance }}MB remaining of your upload limit. | ||
</p> | ||
|
||
<div class="govuk-!-padding-bottom-4"></div> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
|
||
<div class="govuk-form-group"> | ||
|
||
<div class="govuk-button-group"> | ||
<button class="govuk-button" value= "true" data-module="govuk-button" onclick="check()">Continue</button> | ||
<button type="submit" class="govuk-button govuk-button--secondary" data-module="govuk-button"> | ||
Add another file | ||
</button> | ||
</div> | ||
|
||
</div> | ||
|
||
{% else %} | ||
{{ govukWarningText({ | ||
text: warningText, | ||
iconFallbackText: "Warning" | ||
}) }} | ||
|
||
|
||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h3 class="govuk-heading-s">How do I send more files?</h3> | ||
<p>You will need to send your files in 2 parts if they are too big to send all together. You can send some now, and then start again to send the rest.</p> | ||
<p>Follow these 3 steps:</p> | ||
<ol class="govuk-list govuk-list--number"> | ||
<li>Remove some files so you are not over the 100MB limit</li> | ||
<li>Send the files you did not remove</li> | ||
<li>Start the process again to add and send the files you removed</li> | ||
</ol> | ||
<p>You can also post your evidence instead. To find details on where to post your evidence, you need to contact the benefit that you wish to send evidence to directly.</p> | ||
</div> | ||
</div> | ||
|
||
{% endif %} | ||
|
||
|
||
{% else %} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h2 class="govuk-heading-m">No {{ evidenceType }} files added</h2> | ||
<p>You will need to upload a file to send your evidence.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="govuk-button-group"> | ||
<button class="govuk-button" value= "true" data-module="govuk-button" type="button" onclick="location.href='/evidence/upload-evidence'">Continue to upload</button> | ||
<a class="govuk-link" href="/evidence/abandon-journey">Cancel upload</a> | ||
</div> | ||
|
||
|
||
{% endif %} | ||
|
||
{% endfor %} | ||
|
||
<script> | ||
const url = window.location.origin + window.location.pathname; | ||
window.history.replaceState(null, null, url); | ||
function check() { | ||
let yesNoRadio = document.getElementsByName("another"); | ||
let hasSelection = false | ||
for (var i = 0; i < yesNoRadio.length; i++) { | ||
if (yesNoRadio[i].checked) { | ||
hasSelection = true; | ||
} | ||
} | ||
if (!hasSelection) { | ||
//window.location.href = "/error/upload-table.njk"; | ||
return; | ||
} else { | ||
if (document.getElementById("another-yes").checked) { | ||
window.location.href = "upload-another-page" | ||
} else { | ||
window.location.href = "upload-summary" | ||
} | ||
} | ||
} | ||
{# function removeFile(fileName) { | ||
req.session = { | ||
...req.session, | ||
"selectedFile": fileName | ||
} | ||
window.location.href = "are-you-sure" | ||
} | ||
function test(itemName) { | ||
const dataTest = {{ data | dump }}; | ||
// data["fileToDelete"] = itemName; | ||
console.log(dataTest); | ||
window.location.href="/evidence/are-you-sure" | ||
} #} | ||
</script> | ||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
{% 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
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
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