From 4fccc5ea0dfca1372342861f4309f424e67fed61 Mon Sep 17 00:00:00 2001 From: "jack.coggin" Date: Fri, 19 Jul 2024 15:09:01 +0100 Subject: [PATCH 01/10] add download last updated date and update styling --- .../Models/Mapped/Custom/CustomAttachment.cs | 4 +- .../Shared/RichText/Custom/_Attachment.cshtml | 91 +++++++++++-------- .../wwwroot/css/site.css | 14 +-- 3 files changed, 61 insertions(+), 48 deletions(-) diff --git a/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAttachment.cs b/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAttachment.cs index 7151e3d..d5c1af5 100644 --- a/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAttachment.cs +++ b/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAttachment.cs @@ -1,4 +1,5 @@ -using Dfe.ContentSupport.Web.Models.Mapped.Types; +using System; +using Dfe.ContentSupport.Web.Models.Mapped.Types; namespace Dfe.ContentSupport.Web.Models.Mapped.Custom; @@ -8,4 +9,5 @@ public class CustomAttachment(Target target) : CustomComponent(CustomComponentTy public readonly long Size = target.Asset.File.Details.Size; public readonly string Title = target.Title; public readonly string Uri = target.Asset.File.Url; + public readonly DateTime? UpdatedAt = target.Asset.SystemProperties.UpdatedAt; } \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml index 6b74d22..1ae43c5 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml @@ -1,49 +1,60 @@ +@using System @model CustomAttachment -
-
\ No newline at end of file + \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/wwwroot/css/site.css b/src/Dfe.ContentSupport.Web/wwwroot/css/site.css index a27aff5..bad52c4 100644 --- a/src/Dfe.ContentSupport.Web/wwwroot/css/site.css +++ b/src/Dfe.ContentSupport.Web/wwwroot/css/site.css @@ -20,7 +20,6 @@ video { font-weight: 400; font-size: 1.6875rem; line-height: 1.1111111111; - margin: 0 0 15px; } .attachment .attachment-title .attachment-link { @@ -36,14 +35,13 @@ video { float: left; width: auto; margin-right: 25px; - margin-bottom: 15px; padding: 5px; } .attachment .attachment-thumbnail { display: block; max-width: 280px; - width: 140px; + width: 110px; height: auto; border: #e6e6e6; outline: 5px solid #e6e6e6; @@ -54,11 +52,8 @@ video { } .attachment .attachment-metadata { - font-weight: 400; - font-size: 1.1875rem; line-height: 1.25; - margin: 0 0 15px; - color: #505a5f; + margin-bottom: 0; } .attachment .attachment-metadata:last-of-type { @@ -91,3 +86,8 @@ video { .dfe-page-header { background-color: #ebf2f6; } + +.guidance-container { + border: 1px solid #b1b4b6; + padding: 50px; +} From a17b612c3551a87edde1f19ec26ffd842b00b37b Mon Sep 17 00:00:00 2001 From: simonjfirth Date: Wed, 31 Jul 2024 14:00:30 +0100 Subject: [PATCH 02/10] Added default page to handle base route (#116) --- .../Controllers/SitemapController.cs | 26 ++++++++++++++++++- src/Dfe.ContentSupport.Web/Program.cs | 5 +--- .../Views/Sitemap/Index.cshtml | 2 ++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 src/Dfe.ContentSupport.Web/Views/Sitemap/Index.cshtml diff --git a/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs b/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs index fe6530d..d57b001 100644 --- a/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs +++ b/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs @@ -1,11 +1,35 @@ -using Dfe.ContentSupport.Web.Services; +using Dfe.ContentSupport.Web.Models.Mapped; +using Dfe.ContentSupport.Web.Services; +using Dfe.ContentSupport.Web.ViewModels; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Dfe.ContentSupport.Web.Controllers; +[Route("/sitemap")] +[AllowAnonymous] public class SitemapController(IContentService contentfulService) : Controller { + [HttpGet] + [Route("/")] public async Task Index() + { + var defaultModel = new CsPage + { + Heading = new Models.Heading + { + Title = "Department for Education", + Subtitle = "Content and Support" + } + }; + + + return View(defaultModel); + } + + [HttpGet] + [Route("/sitemap.xml")] + public async Task Sitemap() { var baseUrl = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host}/"; var sitemap = await contentfulService.GenerateSitemap(baseUrl); diff --git a/src/Dfe.ContentSupport.Web/Program.cs b/src/Dfe.ContentSupport.Web/Program.cs index f2d3870..62b2e40 100644 --- a/src/Dfe.ContentSupport.Web/Program.cs +++ b/src/Dfe.ContentSupport.Web/Program.cs @@ -41,7 +41,7 @@ public static void Main(string[] args) app.UseCookiePolicy(); app.MapControllerRoute( - "sitemap", + "Default", "sitemap.xml", new { controller = "Sitemap", action = "Index" } ); @@ -52,9 +52,6 @@ public static void Main(string[] args) pattern: "{controller=Cache}/{action=Clear}" ); - app.MapControllerRoute( - name: "home", - pattern: "{controller=Home}/{action=Home}"); app.MapControllerRoute( name: "slug", diff --git a/src/Dfe.ContentSupport.Web/Views/Sitemap/Index.cshtml b/src/Dfe.ContentSupport.Web/Views/Sitemap/Index.cshtml new file mode 100644 index 0000000..33c6f37 --- /dev/null +++ b/src/Dfe.ContentSupport.Web/Views/Sitemap/Index.cshtml @@ -0,0 +1,2 @@ +@model CsPage + From 68bf0cceb2129ff4cd5ccfddcac23b36e39b1f1b Mon Sep 17 00:00:00 2001 From: ThomasWhittington <46750921+ThomasWhittington@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:42:11 +0100 Subject: [PATCH 03/10] feat: removed header text (#117) Co-authored-by: Tom Whittington --- src/Dfe.ContentSupport.Web/Views/Shared/_CsHeader.cshtml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/_CsHeader.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/_CsHeader.cshtml index 750993c..94f8019 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/_CsHeader.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/_CsHeader.cshtml @@ -5,11 +5,6 @@ DfE Homepage - \ No newline at end of file From 9a648c0fadcd8cc441f82aa57263a7892633ed51 Mon Sep 17 00:00:00 2001 From: ThomasWhittington <46750921+ThomasWhittington@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:49:40 +0100 Subject: [PATCH 04/10] feat: allowed accordions to display richtext (#118) Co-authored-by: Tom Whittington --- src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs | 3 +-- .../Models/Mapped/Custom/CustomAccordion.cs | 2 +- src/Dfe.ContentSupport.Web/Services/ModelMapper.cs | 2 +- .../Views/Shared/RichText/Custom/_Accordion.cshtml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs b/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs index 475a159..a33cad6 100644 --- a/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs +++ b/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs @@ -3,9 +3,8 @@ namespace Dfe.ContentSupport.Web.Models; [ExcludeFromCodeCoverage] -public class ContentItemBase +public class ContentItemBase:ContentBase { - public string InternalName { get; set; } = null!; public string NodeType { get; set; } = null!; public Data Data { get; set; } = null!; public List Content { get; set; } = []; diff --git a/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAccordion.cs b/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAccordion.cs index e7def64..3846d31 100644 --- a/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAccordion.cs +++ b/src/Dfe.ContentSupport.Web/Models/Mapped/Custom/CustomAccordion.cs @@ -12,7 +12,7 @@ public CustomAccordion() } public List Accordions { get; set; } = null!; - public string Body { get; set; } = null!; + public RichTextContentItem? Body { get; set; } public string SummaryLine { get; set; } = null!; public string Title { get; set; } = null!; } \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs b/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs index 1341d97..b167f9c 100644 --- a/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs +++ b/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs @@ -150,7 +150,7 @@ private CustomAccordion GenerateCustomAccordion(Target target) return new CustomAccordion { InternalName = target.InternalName, - Body = target.Body, + Body = MapRichTextContent(target.RichText), SummaryLine = target.SummaryLine, Title = target.Title, Accordions = target.Content.Select(GenerateCustomAccordion).ToList() diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Accordion.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Accordion.cshtml index df01048..b918313 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Accordion.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Accordion.cshtml @@ -16,7 +16,7 @@
-

@accordion.Body

+
} From 39b881dbe6c7a0fd5904c99677b2ebe9216136b6 Mon Sep 17 00:00:00 2001 From: ThomasWhittington <46750921+ThomasWhittington@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:02:00 +0100 Subject: [PATCH 05/10] feat: added support for excel sheets (#119) Co-authored-by: Tom Whittington --- .../Views/Shared/RichText/Custom/_Attachment.cshtml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml index 6b74d22..677a5ad 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml @@ -1,10 +1,17 @@ @model CustomAttachment
+ @{ + var fileExtension = Model.ContentType.Split('/').Last().ToLower(); + if (fileExtension == "vnd.openxmlformats-officedocument.spreadsheetml.sheet") + { + fileExtension = "xlsx"; + } + } +
@{ - var fileExtension = Model.ContentType.Split('/').Last().ToLower(); switch (fileExtension) { case "pdf": @@ -40,7 +47,7 @@
+
-

- @Model.Title -

- +

+ + @Model.Title + +

- Last updated @(((DateTime)Model.UpdatedAt).ToString("d MMMM yyyy")) -

- + @if (Model.UpdatedAt.HasValue) + { + + }
- - - +
\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/wwwroot/assets/images/generic-file-icon.svg b/src/Dfe.ContentSupport.Web/wwwroot/assets/images/generic-file-icon.svg index 44eade0..78e30f8 100644 --- a/src/Dfe.ContentSupport.Web/wwwroot/assets/images/generic-file-icon.svg +++ b/src/Dfe.ContentSupport.Web/wwwroot/assets/images/generic-file-icon.svg @@ -1,4 +1,4 @@ -
+ Back to top - \ No newline at end of file + +
\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/_Citation.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/_Citation.cshtml new file mode 100644 index 0000000..a465c88 --- /dev/null +++ b/src/Dfe.ContentSupport.Web/Views/Shared/_Citation.cshtml @@ -0,0 +1,15 @@ +@using Dfe.ContentSupport.Web.Extensions +@model CsPage + +
+ +
\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css b/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css index c7e80c4..f66be84 100644 --- a/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css +++ b/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css @@ -86,5 +86,148 @@ video { .guidance-container { border: 1px solid #b1b4b6; - +} + +#backtotop-button { + margin-top: 2rem; +} + +.gem-c-metadata { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-weight: 400; + font-size: 14px; + font-size: 0.875rem; + line-height: 1.1429; +} + +@media (min-width: 40.0625em) { + .gem-c-metadata { + font-size: 16px; + font-size: 1rem; + line-height: 1.25; + } + + .gem-c-metadata a { + font-family: sans-serif; + } + + .gem-c-metadata--inverse-padded .gem-c-metadata__list { + margin: 15px; + } + + .gem-c-metadata__term { + box-sizing: border-box; + float: left; + clear: left; + padding-right: 5px; + margin-top: 0; + } + + .gem-c-metadata__term .gem-c-metadata__definition { + line-height: 1.4; + } + + .gem-c-metadata__definition:not(:last-of-type) { + margin-bottom: 5px; + } +} + +.gem-c-metadata a { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-decoration: underline; + font-weight: bold; + color: #0b0c0c; +} + +.gem-c-metadata .gem-c-metadata::after { + content: ""; + display: block; + clear: both; +} + +.gem-c-metadata .direction-rtl { + direction: rtl; + text-align: start; +} + +.gem-c-metadata-inverse { + color: #ffffff; +} + +.gem-c-metadata-inverse a:link, +.gem-c-metadata-inverse a:hover, +.gem-c-metadata-inverse a:visited, +.gem-c-metadata-inverse a:active { + color: #ffffff; +} + +.gem-c-metadata-inverse a:focus { + color: #0b0c0c; +} + +.gem-c-metadata-inverse-padded { + padding: 10px; +} + +.gem-c-metadata-inverse-padded .gem-c-metadata-inverse.gem-c-metadata__list { + margin: 10px; +} + +.gem-c-metadata__definition { + margin: 0; +} + +.gem-c-metadata__toggle-wrap { + display: none; +} + +.gem-c-metadata .gem-c-metadata__definition-link { + font-weight: normal; +} + +.gem-c-metadata.direction-rtl .gem-c-metadata__definition { + float: right; +} + +@media (min-width: 40.0625em) { + .gem-c-metadata--inverse-padded .gem-c-metadata__list { + margin: 15px; + } +} + +@media (min-width: 40.0625em) { + .gem-c-metadata.direction-rtl .gem-c-metadata__term { + padding-left: 5px; + padding-right: 0; + } +} + +@media print { + .gem-c-metadata { + color: #000000; + font-family: sans-serif; + font-size: 14pt; + line-height: 1.2; + } +} + +.js-enabled .gem-c-metadata__toggle-wrap { + display: block; +} + +.js-enabled .gem-c-metadata__toggle-items .js-hidden { + display: none; +} + +dl.gem-c-metadata__list { + margin: 0; +} + +.citation { + background: rgba(238, 238, 238, 0.4588235294); + padding: 15px 10px 15px 20px; + margin-top: 60px; + border-left: 5px solid #347ca9; } \ No newline at end of file diff --git a/tests/Dfe.ContentSupport.Web.Tests/Controllers/SitemapControllerTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Controllers/SitemapControllerTests.cs index 22d54cb..63225b9 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Controllers/SitemapControllerTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Controllers/SitemapControllerTests.cs @@ -14,19 +14,19 @@ private SitemapController GetController() } [Fact] - public async Task Index_Calls_Service_GenerateSitemap() + public async Task Sitemap_Calls_Service_GenerateSitemap() { var sut = GetController(); sut.ControllerContext.HttpContext = new DefaultHttpContext(); var baseUrl = $"{sut.ControllerContext.HttpContext.Request.Scheme}://{sut.ControllerContext.HttpContext.Request.Host}/"; - await sut.Index(); + await sut.Sitemap(); _contentServiceMock.Verify(o => o.GenerateSitemap(baseUrl), Times.Once); } [Fact] - public async Task Index_Calls_Returns_ContentResult_XmlModel() + public async Task Sitemap_Calls_Returns_ContentResult_XmlModel() { const string sitemap = "dummy"; _contentServiceMock.Setup(o => o.GenerateSitemap(It.IsAny())) @@ -41,7 +41,7 @@ public async Task Index_Calls_Returns_ContentResult_XmlModel() var sut = GetController(); sut.ControllerContext.HttpContext = new DefaultHttpContext(); - var result = await sut.Index(); + var result = await sut.Sitemap(); result.Should().BeEquivalentTo(expected); } diff --git a/tests/Dfe.ContentSupport.Web.Tests/Extensions/DateTimeExtensionsTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Extensions/DateTimeExtensionsTests.cs new file mode 100644 index 0000000..72324c7 --- /dev/null +++ b/tests/Dfe.ContentSupport.Web.Tests/Extensions/DateTimeExtensionsTests.cs @@ -0,0 +1,17 @@ +using Dfe.ContentSupport.Web.Extensions; + +namespace Dfe.ContentSupport.Web.Tests.Extensions; + +public class DateTimeExtensionsTests +{ + [Fact] + public void ToLongString_Formats_Returns_Expected() + { + var testValue = new DateTime(2024, 2, 1, 0, 0, 0, DateTimeKind.Local); + const string expected = "01 February 2024"; + + var result = testValue.ToLongString(); + + result.Should().Be(expected); + } +} \ No newline at end of file diff --git a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs index bfe4401..d34d40f 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs @@ -1,6 +1,7 @@ using Dfe.ContentSupport.Web.Common; using Dfe.ContentSupport.Web.Configuration; using Dfe.ContentSupport.Web.Models; +using Dfe.ContentSupport.Web.Models.Mapped; using Dfe.ContentSupport.Web.Models.Mapped.Custom; using Dfe.ContentSupport.Web.Models.Mapped.Standard; using Dfe.ContentSupport.Web.Models.Mapped.Types; @@ -15,7 +16,7 @@ public class CustomAccordionTests private const string InternalName = "Internal Name"; private const string Title = "Title"; private const string SummaryLine = "Summary Line"; - private const string Body = "Body"; + private const string ContentInternalName = "Content Internal Name"; private static ContentItem DummyContentItem() => new() { @@ -27,7 +28,6 @@ public class CustomAccordionTests InternalName = InternalName, Title = Title, SummaryLine = SummaryLine, - Body = Body, Sys = new Sys { ContentType = new ContentType @@ -43,7 +43,12 @@ public class CustomAccordionTests new Target(), new Target(), new Target() - ] + ], + RichText = new ContentItem + { + InternalName = ContentInternalName, + NodeType = "paragraph" + } } } }; @@ -61,18 +66,25 @@ public void MapCorrectly() entry.NodeType.Should().Be(RichTextNodeType.EmbeddedEntry); entry.InternalName.Should().Be(InternalName); - entry.RichText.Should().BeNull(); + entry.RichText.Should().NotBeNull(); entry.CustomComponent.Should().NotBeNull(); var customComponent = entry.CustomComponent; customComponent.Should().BeAssignableTo(); var accordion = (customComponent as CustomAccordion)!; + var expectedBody= new RichTextContentItem + { + InternalName = ContentInternalName, + NodeType = RichTextNodeType.Paragraph, + Content = [] + }; + accordion.Type.Should().Be(CustomComponentType.Accordion); accordion.InternalName.Should().Be(InternalName); accordion.Title.Should().Be(Title); accordion.SummaryLine.Should().Be(SummaryLine); - accordion.Body.Should().Be(Body); + accordion.Body.Should().BeEquivalentTo(expectedBody); accordion.Accordions.Count.Should().Be(3); } } \ No newline at end of file diff --git a/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs index fc80bc1..704f487 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs @@ -3,6 +3,7 @@ using Contentful.Core.Models; using Contentful.Core.Search; using Dfe.ContentSupport.Web.Http; +using Dfe.ContentSupport.Web.Models; using Dfe.ContentSupport.Web.Models.Mapped; namespace Dfe.ContentSupport.Web.Tests.Services; @@ -18,9 +19,9 @@ public class ContentServiceTests { Items = new List { - new() { Slug = "slug1", IsSitemap = true }, - new() { Slug = "slug2", IsSitemap = false }, - new() { Slug = "slug3", IsSitemap = true } + new() { Slug = "slug1", IsSitemap = true, Sys = new Sys() }, + new() { Slug = "slug2", IsSitemap = false, Sys = new Sys() }, + new() { Slug = "slug3", IsSitemap = true, Sys = new Sys() } } }; @@ -37,7 +38,9 @@ private void SetupResponse(ContentfulCollection? response = _mapperMock.Setup(o => o.MapToCsPages(res)) - .Returns(res.Items.Select(page => new ModelMapper(new SupportedAssetTypes()).MapToCsPage(page)).ToList()); + .Returns(res.Items + .Select(page => new ModelMapper(new SupportedAssetTypes()).MapToCsPage(page)) + .ToList()); } [Fact] @@ -74,7 +77,8 @@ public async Task GetContent_Returns_First_Result() var sut = GetService(); var result = await sut.GetContent(It.IsAny()); - var expected = new ModelMapper(new SupportedAssetTypes()).MapToCsPage(_response.Items.First()); + var expected = + new ModelMapper(new SupportedAssetTypes()).MapToCsPage(_response.Items.First()); result.Should().BeEquivalentTo(expected); } diff --git a/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs index c9d2cfe..9f6b38b 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs @@ -20,9 +20,18 @@ public void MapToCsPages_Return_Correct_Amount() { var supportPages = new List { - new(), - new(), new() + { + Sys = new Sys() + }, + new() + { + Sys = new Sys() + }, + new() + { + Sys = new Sys() + } }; var sut = GetService(); From 54fde582cef11940971a7d76b5fe96a5b9a0ceae Mon Sep 17 00:00:00 2001 From: ThomasWhittington <46750921+ThomasWhittington@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:43:43 +0100 Subject: [PATCH 09/10] feat: use current tab (#122) Co-authored-by: Tom Whittington --- .../Views/Shared/RichText/_HyperLink.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml index 37c6ffd..e0a5040 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml @@ -6,7 +6,7 @@ } else { - + } \ No newline at end of file From 8b49d3e7ff04e8e989879269e66162f40b0aeb00 Mon Sep 17 00:00:00 2001 From: simonjfirth Date: Wed, 7 Aug 2024 15:09:43 +0100 Subject: [PATCH 10/10] Updated styling to elements and added missing classes (#123) --- .../Views/Content/CsIndex.cshtml | 29 +++++++++++-------- .../Views/Content/Home.cshtml | 4 +-- .../Views/Content/Privacy.cshtml | 2 +- .../Views/Shared/Error.cshtml | 4 +-- .../Views/Shared/RichText/_H.cshtml | 4 +-- .../Views/Shared/RichText/_HyperLink.cshtml | 2 +- .../Views/Shared/RichText/_Paragraph.cshtml | 2 +- .../Shared/RichText/_UnorderedList.cshtml | 2 +- .../Views/Shared/_Hero.cshtml | 2 +- .../Views/Shared/_UnsupportedElement.cshtml | 2 +- 10 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml b/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml index 25f99c7..940966e 100644 --- a/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml @@ -4,17 +4,22 @@ Layout = "_CsLayout"; } -@foreach (var content in Model.Content) -{ - -} +
+
-@if (Model.HasCitation) -{ - -} + @foreach (var content in Model.Content) + { + + } + + @if (Model.HasCitation) + { + + } -@if (Model.HasBackToTop) -{ - -} \ No newline at end of file + @if (Model.HasBackToTop) + { + + } +
+
\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Content/Home.cshtml b/src/Dfe.ContentSupport.Web/Views/Content/Home.cshtml index 459a1e7..3a047f9 100644 --- a/src/Dfe.ContentSupport.Web/Views/Content/Home.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Content/Home.cshtml @@ -15,8 +15,8 @@

@csPage.Heading.Title

-

@csPage.Heading.Subtitle

-

Slug: @csPage.Slug

+

@csPage.Heading.Subtitle

+

Slug: @csPage.Slug

} diff --git a/src/Dfe.ContentSupport.Web/Views/Content/Privacy.cshtml b/src/Dfe.ContentSupport.Web/Views/Content/Privacy.cshtml index e6eef70..88d5bc4 100644 --- a/src/Dfe.ContentSupport.Web/Views/Content/Privacy.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Content/Privacy.cshtml @@ -3,4 +3,4 @@ }

@ViewData["Title"]

-

Use this page to detail your site's privacy policy.

\ No newline at end of file +

Use this page to detail your site's privacy policy.

\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/Error.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/Error.cshtml index 3516938..e44e743 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/Error.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/Error.cshtml @@ -8,9 +8,9 @@ @if (Model.ShowRequestId) { -

+

Request ID: @Model.RequestId -

+

}

Development Mode

diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_H.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_H.cshtml index cfe5e1c..830e6bf 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_H.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_H.cshtml @@ -4,12 +4,12 @@ switch (Model.NodeType) { case RichTextNodeType.Heading2: -

+

break; case RichTextNodeType.Heading3: -

+

break; diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml index e0a5040..46be2f8 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_HyperLink.cshtml @@ -6,7 +6,7 @@ } else { - + } \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_Paragraph.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_Paragraph.cshtml index f09928e..ca45f0f 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_Paragraph.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_Paragraph.cshtml @@ -1,5 +1,5 @@ @model RichTextContentItem -

+

\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_UnorderedList.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_UnorderedList.cshtml index 2c47203..39232a5 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_UnorderedList.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_UnorderedList.cshtml @@ -1,5 +1,5 @@ @model RichTextContentItem -
    +
    \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/_Hero.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/_Hero.cshtml index e0aab88..2385506 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/_Hero.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/_Hero.cshtml @@ -6,7 +6,7 @@

    @Model.Title

    -

    @Model.Subtitle

    +

    @Model.Subtitle

    diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/_UnsupportedElement.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/_UnsupportedElement.cshtml index 9810087..4018476 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/_UnsupportedElement.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/_UnsupportedElement.cshtml @@ -1,7 +1,7 @@ @model RichTextContentItem
    -

    +

    Unsupported element
    - internalName: @Model.InternalName
    - nodeType: @Model.NodeType