Skip to content

Commit

Permalink
Restructured the ratio row to display the additional details info for…
Browse files Browse the repository at this point in the history
… the ratios. Fixed unit tests and made minor ui tweaks
  • Loading branch information
sam-c-dfe committed Aug 5, 2024
1 parent dfb436a commit 84cbade
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public Task<string> RenderAsync(IContent content)
{
var heading = content as Heading2;
var headingText = heading!.Content[0] as Text;
return Task.FromResult($"<h2 class='govuk-heading-m'>{headingText!.Value}</h2>");
return Task.FromResult($"<h2 class='govuk-heading-l'>{headingText!.Value}</h2>");
}

public bool SupportsContent(IContent content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
</div>
<div class="govuk-grid-column-two-thirds">
<h1 id="heading" class="govuk-heading-xl mb-8">@Model.Header</h1>
<h2 id="found-heading" class="govuk-!-static-margin-bottom-8">
<h3 id="found-heading" class="govuk-heading-m govuk-!-static-margin-bottom-8">
<strong>
@Model.Qualifications.Count @(Model.Qualifications.Count == 1 ? Model.SingleQualificationFoundText : Model.MultipleQualificationsFoundText)
</strong>
</h2>
</h3>
<div id="pre-search-content">@Html.Raw(Model.PreSearchBoxContent)</div>
<div class="govuk-form-group">
@using (Html.BeginForm("Refine", "QualificationDetails", FormMethod.Post))
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
@model Dfe.EarlyYearsQualification.Web.Models.RatioRowModel


<div class="govuk-summary-list__row ratio-row" id="@{@Model.LevelText}_row">
<dt class="govuk-summary-list__key govuk-!-static-margin-top-6 govuk-!-static-margin-bottom-6">
<div class="govuk-grid-row">
<div class="govuk-!-width-one-half">
<div class="govuk-!-static-margin-top-6 govuk-!-static-margin-bottom-6">
<b class="govuk-!-text-align-left ratio-heading" id="@{@Model.LevelText}_heading">@Model.LevelText</b>
</div>
</dt>
<dd class="govuk-summary-list__value govuk-!-static-margin-top-6 govuk-!-static-margin-bottom-6">
</div>
<div class="govuk-!-width-one-half no-padding-right">
<div class="govuk-!-static-margin-top-6 govuk-!-static-margin-bottom-6">
@{
if (Model.IsApproved)
Expand All @@ -24,13 +23,14 @@
}
}
</div>
</dd>
@if (!string.IsNullOrEmpty(Model.AdditionalInformation.AdditionalInformationBody) && !string.IsNullOrEmpty(Model.AdditionalInformation.AdditionalInformationHeader))
{
/*<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value govuk-!-static-margin-top-6 govuk-!-static-margin-bottom-6">*/
await Html.RenderPartialAsync("Partials/AdditionalInformation", Model.AdditionalInformation);
/*</dd>
</div>*/
}
</div>
</div>
@if (!string.IsNullOrEmpty(Model.AdditionalInformation.AdditionalInformationBody) && !string.IsNullOrEmpty(Model.AdditionalInformation.AdditionalInformationHeader))
{
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
@{ await Html.RenderPartialAsync("Partials/AdditionalInformation", Model.AdditionalInformation); }
</div>
</div>
}
<hr class="mb-0 mt-0"/>
10 changes: 10 additions & 0 deletions src/Dfe.EarlyYearsQualification.Web/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,14 @@ body {
color: #1d70b8;
cursor: pointer;
margin: 0;
}

.govuk-\!-width-one-half {
width: 49% !important;
padding: 0 15px;
display: inline-block;
}

.no-padding-right {
padding-right: 0 !important;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dfe.EarlyYearsQualification.Content.Entities;
using Dfe.EarlyYearsQualification.Content.Renderers.Entities;
using Dfe.EarlyYearsQualification.Content.Services;
using Dfe.EarlyYearsQualification.Mock.Helpers;
using Dfe.EarlyYearsQualification.UnitTests.Extensions;
using Dfe.EarlyYearsQualification.Web.Controllers;
using Dfe.EarlyYearsQualification.Web.Models;
Expand Down Expand Up @@ -450,22 +451,26 @@ public async Task Index_AllRatiosFound_ReturnsView()
new()
{
RatioRequirementName = "Level 2 Ratio Requirements",
FullAndRelevantForLevel2After2014 = true
FullAndRelevantForLevel2After2014 = true,
RequirementForLevel2After2014 = ContentfulContentHelper.Paragraph("Test")
},
new()
{
RatioRequirementName = "Level 3 Ratio Requirements",
FullAndRelevantForLevel2After2014 = true
FullAndRelevantForLevel2After2014 = true,
RequirementForLevel2After2014 = ContentfulContentHelper.Paragraph("Test")
},
new()
{
RatioRequirementName = "Level 6 Ratio Requirements",
FullAndRelevantForLevel2After2014 = true
FullAndRelevantForLevel2After2014 = true,
RequirementForLevel2After2014 = ContentfulContentHelper.Paragraph("Test")
},
new()
{
RatioRequirementName = "Level 6 Ratio Requirements",
FullAndRelevantForLevel2After2014 = true
RatioRequirementName = "Unqualified Ratio Requirements",
FullAndRelevantForLevel2After2014 = true,
RequirementForLevel2After2014 = ContentfulContentHelper.Paragraph("Test")
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public void Heading2Renderer_RendersHeading()

var result = new Heading2Renderer().RenderAsync(heading).Result;

result.Should().Be("<h2 class='govuk-heading-m'>Heading text</h2>");
result.Should().Be("<h2 class='govuk-heading-l'>Heading text</h2>");
}
}

0 comments on commit 84cbade

Please sign in to comment.