Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #793 from DFE-Digital/feature/transfer-dates-and-h…
Browse files Browse the repository at this point in the history
…istory

Fix ids to ensure reasons correctly show
  • Loading branch information
dneed-nimble authored Jul 8, 2024
2 parents 1f0d37b + 475c607 commit 12bb3b5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@foreach (var reason in Model.ReasonOptions)
{
var checkboxId = reason.Heading.ToLower().Replace(" ", "-");
var textareaName = $"Details{reason.Heading.Replace(" ", "")}";
var textareaName = $"Details[{checkboxId}]";
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="@checkboxId" name="Reasons" type="checkbox" value="@checkboxId" data-aria-controls="conditional-@checkboxId">
<label class="govuk-label govuk-checkboxes__label" for="@checkboxId">@reason.Heading</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("/Projects/TransferDates/Index", new { Urn });
}


private List<ReasonChange> GetReasonOptions(bool isDateSooner)
{
var soonerReasons = new List<string> { "faster-progress", "error-correction" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@using Dfe.PrepareTransfers.Data.Models
@using Dfe.PrepareTransfers.Data.Models.AdvisoryBoardDecision
@using Dfe.PrepareTransfers.Data.TRAMS
@using Dfe.PrepareTransfers.Web.ExtensionMethods
@model Dfe.PrepareTransfers.Web.Pages.TaskList.DateHistory.DateHistory

@{
Expand All @@ -18,15 +19,22 @@
<partial name="_SubMenu" />
</div>
<div class="govuk-!-margin-bottom-12">
<h2 class="govuk-heading-l govuk-!-margin-bottom govuk-!-font-size-36">Transfer date history</h2>


@if (Model.OpeningDateHistory == null || !Model.OpeningDateHistory.Any())
@if ((Model.OpeningDateHistory == null || !Model.OpeningDateHistory.Any()) && Model.Project.Dates.Target is not null)
{
<h2 class="govuk-heading-l govuk-!-margin-bottom-12 govuk-!-font-size-36">Current proposed transfer date</h2>
<p class="govuk-body">The current proposed transfer date is <strong>@Model.Project.Dates.Target.ToFormattedDate()</strong>.</p>
}
else if ((Model.OpeningDateHistory == null || !Model.OpeningDateHistory.Any()) && Model.Project.Dates.Target is null)
{
<h2 class="govuk-heading-l govuk-!-margin-bottom govuk-!-font-size-36">Transfer date history</h2>
<p class="govuk-body">The proposed transfer date has not been entered yet. When it has been it will be displayed here.</p>
<p class="govuk-body">Any future changes to the proposed transfer date will also be shown here.</p>
}
else
{
<h2 class="govuk-heading-l govuk-!-margin-bottom govuk-!-font-size-36">Current proposed transfer date</h2>
<p class="govuk-body">The current proposed transfer date is <strong>@Model.OpeningDateHistory.OrderByDescending(h => h.ChangedAt).FirstOrDefault()?.NewDate?.ToString("d MMMM yyyy")</strong>.</p>

<h3 class="govuk-heading-m">Transfer date changes</h3>
Expand Down

0 comments on commit 12bb3b5

Please sign in to comment.