diff --git a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Frameworks.cs b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Frameworks.cs index bdaa3d4e20..ffb9460299 100644 --- a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Frameworks.cs +++ b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Frameworks.cs @@ -716,6 +716,20 @@ public IActionResult ViewFramework(string tabname, int frameworkId, int? framewo return View("Developer/Framework", model); } + [Route("/Framework/{frameworkId}/Structure/PrintLayout")] + public IActionResult PrintLayout(int frameworkId) { + var adminId = GetAdminId(); + var detailFramework = frameworkService.GetFrameworkDetailByFrameworkId(frameworkId, adminId); + var routeData = new Dictionary { { "frameworkId", detailFramework?.ID.ToString() } }; + var model = new FrameworkViewModel() + { + DetailFramework = detailFramework, + }; + model.FrameworkCompetencyGroups = frameworkService.GetFrameworkCompetencyGroups(frameworkId).ToList(); + model.CompetencyFlags = frameworkService.GetCompetencyFlagsByFrameworkId(frameworkId, null, selected: true); + model.FrameworkCompetencies = frameworkService.GetFrameworkCompetenciesUngrouped(frameworkId); + return View("Developer/FrameworkPrintLayout", model); + } [ResponseCache(CacheProfileName = "Never")] public IActionResult InsertFramework() { diff --git a/DigitalLearningSolutions.Web/Styles/frameworks/frameworksShared.scss b/DigitalLearningSolutions.Web/Styles/frameworks/frameworksShared.scss index a6cd8f8277..b452ab9178 100644 --- a/DigitalLearningSolutions.Web/Styles/frameworks/frameworksShared.scss +++ b/DigitalLearningSolutions.Web/Styles/frameworks/frameworksShared.scss @@ -251,3 +251,37 @@ h1.truncate-overflow::after { .float-right{ float:right; } +@media print { + + address, p, .nhsuk-body-m, ol, ul, td, .nhsuk-tag { + font-size: 12px !important; + } + + h1 { + font-size: 20px !important; + break-after: avoid; + } + + h2 { + font-size: 18px !important; + break-after: avoid; + } + + h3, table { + break-after: avoid; + break-before: auto; + } + + h3 { + font-size: 16px !important; + } + + h4, th { + font-size: 14px !important; + } + + tr { + break-inside: avoid; + page-break-inside: avoid; + } +} diff --git a/DigitalLearningSolutions.Web/Styles/layout.scss b/DigitalLearningSolutions.Web/Styles/layout.scss index 7e252f49ed..c0ef2ada6a 100644 --- a/DigitalLearningSolutions.Web/Styles/layout.scss +++ b/DigitalLearningSolutions.Web/Styles/layout.scss @@ -398,3 +398,9 @@ nav, .nhsuk-header__navigation, #header-navigation { .field-validation-valid { display: none !important; } + +@media print { + .no-print { + display: none; + } +} diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/FrameworkPrintLayout.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/FrameworkPrintLayout.cshtml new file mode 100644 index 0000000000..69ec377b44 --- /dev/null +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/FrameworkPrintLayout.cshtml @@ -0,0 +1,127 @@ +@using DigitalLearningSolutions.Web.ViewModels.Frameworks; +@model FrameworkViewModel; +@{ + ViewData["Title"] = Model.DetailFramework.FrameworkName; + ViewData["Application"] = "Framework Service"; + ViewData["HeaderPathName"] = "Framework Service"; + int groupNum = 0; +} + +@section NavMenuItems { + +} +@section NavBreadcrumbs { + +} +
+ +
+

+ @Model.DetailFramework.FrameworkName +

+ @if (!String.IsNullOrEmpty(Model.DetailFramework.Description)) + { +
+
+

+ Framework description + +

+

+ @(Html.Raw(Model.DetailFramework.Description)) +

+
+
+ } +

Framework @Model.VocabPlural().ToLower()

+ + @if (Model.FrameworkCompetencyGroups != null) + { + if (Model.FrameworkCompetencyGroups.Any()) + { + @foreach (var frameworkCompetencyGroup in Model.FrameworkCompetencyGroups) + { + groupNum++; +

@frameworkCompetencyGroup.Name

+ if (frameworkCompetencyGroup.Description != null) + { +

+ @frameworkCompetencyGroup.Description +

+ } + + int compNum = 0; + if (frameworkCompetencyGroup.FrameworkCompetencies[0] != null) + { + + + + + + + + + @foreach (var frameworkCompetency in frameworkCompetencyGroup.FrameworkCompetencies) + { + compNum++; + + + + + } + +
+ @Model.VocabSingular() + + Date and Signature +
+ @frameworkCompetency.Name + + + @if (frameworkCompetency.Description != null) + { +

+ @Html.Raw(frameworkCompetency.Description) +

+ } +
+ +
+ } + } + } + } + @if (Model.FrameworkCompetencies != null) + { + if (Model.FrameworkCompetencies.Any()) + { + groupNum++; + int compNum = 0; +

Ungrouped competencies

+ foreach (var frameworkCompetency in Model.FrameworkCompetencies) + { + compNum++; +
+

@frameworkCompetency.Name

+ + @if (frameworkCompetency.Description != null) + { +

+ @frameworkCompetency.Description +

+ } +
+ } + } + } +
+
diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_Structure.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_Structure.cshtml index 849b5121ba..ca13087c27 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_Structure.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_Structure.cshtml @@ -82,6 +82,7 @@ else Add @Model.VocabSingular().ToLower() group Add ungrouped @Model.VocabSingular().ToLower() Bulk upload/update @Model.VocabPlural().ToLower() + View for print } diff --git a/DigitalLearningSolutions.Web/Views/Shared/_CookieConsentPartial.cshtml b/DigitalLearningSolutions.Web/Views/Shared/_CookieConsentPartial.cshtml index 9500f932e9..bffbbc36f8 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/_CookieConsentPartial.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/_CookieConsentPartial.cshtml @@ -9,7 +9,7 @@ @if (showCookieBanner == null && validateCookieBannerViaTempData == null) // [BY] Show cookie banner when the value is null. if the user consent yes or no then we dont display the banner { -