From 3d5b0d5edc46b701232529991bebbf806e66160d Mon Sep 17 00:00:00 2001 From: ThomasWhittington <46750921+ThomasWhittington@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:12:01 +0100 Subject: [PATCH] Added basic print button (#130) Co-authored-by: Tom Whittington --- .../Models/Mapped/CsPage.cs | 1 + .../Services/ModelMapper.cs | 1 + .../ViewModels/ContentSupportPage.cs | 1 + .../Views/Content/CsIndex.cshtml | 11 ++++++--- .../Views/Shared/_Print.cshtml | 3 +++ .../wwwroot/assets/icon-print.png | Bin 0 -> 213 bytes .../wwwroot/css/cands-site.css | 21 +++++++++++++++++- 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/Dfe.ContentSupport.Web/Views/Shared/_Print.cshtml create mode 100644 src/Dfe.ContentSupport.Web/wwwroot/assets/icon-print.png diff --git a/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs b/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs index 6bd5507..e7526e8 100644 --- a/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs +++ b/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs @@ -11,6 +11,7 @@ public class CsPage public bool HasCitation { get; set; } public bool ShowVerticalNavigation { get; set; } public bool HasBackToTop { get; set; } + public bool HasPrint { get; set; } public List Content { get; set; } = null!; public DateTime? CreatedAt { get; init; } public DateTime? UpdatedAt { get; init; } diff --git a/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs b/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs index c0f7aac..7c45aa6 100644 --- a/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs +++ b/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs @@ -25,6 +25,7 @@ public CsPage MapToCsPage(ContentSupportPage incoming) IsSitemap = incoming.IsSitemap, HasCitation = incoming.HasCitation, HasBackToTop = incoming.HasBackToTop, + HasPrint = incoming.HasPrint, Content = MapEntriesToContent(incoming.Content), ShowVerticalNavigation = incoming.ShowVerticalNavigation, CreatedAt = incoming.Sys.CreatedAt, diff --git a/src/Dfe.ContentSupport.Web/ViewModels/ContentSupportPage.cs b/src/Dfe.ContentSupport.Web/ViewModels/ContentSupportPage.cs index 08fe948..58e24ab 100644 --- a/src/Dfe.ContentSupport.Web/ViewModels/ContentSupportPage.cs +++ b/src/Dfe.ContentSupport.Web/ViewModels/ContentSupportPage.cs @@ -14,6 +14,7 @@ public class ContentSupportPage : ContentBase public bool IsSitemap { get; init; } public bool HasCitation { get; init; } public bool HasBackToTop { get; init; } + public bool HasPrint { get; init; } public bool ShowVerticalNavigation { get; init; } } \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml b/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml index 22bbfd5..a9e0b6d 100644 --- a/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml @@ -28,19 +28,24 @@ @foreach (var content in Model.Content) { - + }
@if (Model.HasCitation) { - + } @if (Model.HasBackToTop) { - + + } + + @if (Model.HasPrint) + { + }
\ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/_Print.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/_Print.cshtml new file mode 100644 index 0000000..402ac26 --- /dev/null +++ b/src/Dfe.ContentSupport.Web/Views/Shared/_Print.cshtml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/wwwroot/assets/icon-print.png b/src/Dfe.ContentSupport.Web/wwwroot/assets/icon-print.png new file mode 100644 index 0000000000000000000000000000000000000000..54737a3739c0d7ef981a79103756663725a82038 GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRp!3HFQtmCqP6lZ})WHAE+w=f7ZGR&GI0Tg5` z4sv&5Sa(k5C6L3C?&#~tz_78O`%fY(ke}u0;uuoFcy^MtP=f-G3-4sFhyU1Fb4xXJ ze(10`9bBF8De-U{-+|1x-AVo&U*_)&t*MSbqW65#ZpWiRJ