Skip to content

Commit

Permalink
Merge pull request #251 from DFE-Digital/mvp3-batch-check-updates
Browse files Browse the repository at this point in the history
Update batch checking journey
  • Loading branch information
AndyLongContent authored Nov 28, 2024
2 parents 8dade06 + 7a6e9a7 commit 33ac685
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,88 @@

{% set pageName="Home" %}



{% block content %}

{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% set html %}
<h1 class="govuk-notification-banner__heading">
Checks completed
</h1>
<p class="govuk-body">Now download the checked file to see which parents can claim free school meals for their children.</p>

<p id="file-name-display">Filename will be displayed here.</p>


{%- from "govuk/components/button/macro.njk" import govukButton -%}

<div class="moj-button-action">
<a id="download-button" class="govuk-button" href="/public/csv/free-school-meals-outcomes-YYYYMMDD.csv" download role="button">
Download
</a>
</div>





<script type="text/javascript">
// Function to generate the filename based on today's date
function generateFilename() {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
return `free-school-meals-outcomes-${year}${month}${day}.csv`;
}

// Update the filename display on page load
document.addEventListener('DOMContentLoaded', function () {
const filename = generateFilename();
document.getElementById('file-name-display').innerText = filename; // Display the filename
document.getElementById('download-button').setAttribute('download', filename);
});


</script>





<div class="govuk-grid-row">
<div class="govuk-grid-column-full">

{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% set html %}
<h1 class="govuk-notification-banner__heading">
Checks completed
</h1>
<p class="govuk-body">See below which parents can claim free school meals for their children.</p>

{% endset %}

{{ govukNotificationBanner({
html: html,
type: "success"
}) }}


<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">School</th>
<th scope="col" class="govuk-table__header">Parent name</th>
<th scope="col" class="govuk-table__header">Parent DOB</th>
<th scope="col" class="govuk-table__header">NINO or NASS</th>
<th scope="col" class="govuk-table__header">Email</th>
<th scope="col" class="govuk-table__header">Child name</th>
<th scope="col" class="govuk-table__header">Child DOB</th>
<th scope="col" class="govuk-table__header">Status</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
</table>



{% endset %}

{{ govukNotificationBanner({
html: html,
type: "success"
}) }}

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-m">Result explainer </h1>
<p><strong>Entitled</strong> – The children of this parent or guardian are entitled to free school meals.</p>
<p><strong>May not be entitled</strong> – The children of this parent or guardian may not be entitled to free school meals. To appeal, provide evidence to support your local authority in making a decision. View the list of acceptable evidence. </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,26 @@

<div class="govuk-grid-row">

<div class="govuk-grid-column-full">

<div class="flex-container">

<div class="container">
<h1 class="govuk-heading-l">

Checking
</h1>
<p class="govuk-body-l">Please wait. The check should take less than 30 seconds</p>
<svg role="status" class="spinner animation-spin" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"></path>
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"></path>
</svg>
</div>
<script>setTimeout(function(){document.location = '/mvp3/_school/school-manage/batch-checking/batch-check-success';}, Math.random()*10000);</script>


</div>

<div class="govuk-grid-column-full">

<div class="flex-container">

<div class="container">
<h1 class="govuk-heading-l">

Checking
</h1>
<p class="govuk-body-l">Please wait. This may take a few minutes</p>

<span id="counter">0</span>
<span>/
<script>
var total_count = Math.floor(Math.random() *100);
const intervalId = setInterval(() => {
var countElement = document.getElementById("counter");
var currentCount = parseInt(countElement.textContent);
var newCount = currentCount +1;
if(newCount >= total_count) {
clearInterval(intervalId);
document.location = '/mvp3/_school/school-manage/batch-checking/batch-check-success';
} else {
countElement.innerHTML = newCount;
}
}, 100);
document.write(total_count);
</script>
records processed.
</span>

<div class="govuk-!-padding-bottom-5"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ <h2 class="govuk-heading-l">Errors</h2>
</div>



</div>
{% from "govuk/components/button/macro.njk" import govukButton %}

{{ govukButton({
text: "Check eligibility",
classes: "govuk-button--primary",
href: '../batch-checking/batch-checking-loader'
}) }}

</div>
</div>
Expand Down

0 comments on commit 33ac685

Please sign in to comment.