Skip to content

Commit 8f9e3a3

Browse files
authored
Merge pull request #3071 from TechnologyEnhancedLearning/DLS-Release-v1.2.0
Dls release v1.2.0 to Dev
2 parents ff5383f + cb20049 commit 8f9e3a3

File tree

8 files changed

+187
-5
lines changed

8 files changed

+187
-5
lines changed

DigitalLearningSolutions.Web/Controllers/FrameworksController/Frameworks.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,20 @@ public IActionResult ViewFramework(string tabname, int frameworkId, int? framewo
716716
return View("Developer/Framework", model);
717717
}
718718

719+
[Route("/Framework/{frameworkId}/Structure/PrintLayout")]
720+
public IActionResult PrintLayout(int frameworkId) {
721+
var adminId = GetAdminId();
722+
var detailFramework = frameworkService.GetFrameworkDetailByFrameworkId(frameworkId, adminId);
723+
var routeData = new Dictionary<string, string> { { "frameworkId", detailFramework?.ID.ToString() } };
724+
var model = new FrameworkViewModel()
725+
{
726+
DetailFramework = detailFramework,
727+
};
728+
model.FrameworkCompetencyGroups = frameworkService.GetFrameworkCompetencyGroups(frameworkId).ToList();
729+
model.CompetencyFlags = frameworkService.GetCompetencyFlagsByFrameworkId(frameworkId, null, selected: true);
730+
model.FrameworkCompetencies = frameworkService.GetFrameworkCompetenciesUngrouped(frameworkId);
731+
return View("Developer/FrameworkPrintLayout", model);
732+
}
719733
[ResponseCache(CacheProfileName = "Never")]
720734
public IActionResult InsertFramework()
721735
{

DigitalLearningSolutions.Web/Styles/frameworks/frameworksShared.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,37 @@ h1.truncate-overflow::after {
251251
.float-right{
252252
float:right;
253253
}
254+
@media print {
255+
256+
address, p, .nhsuk-body-m, ol, ul, td, .nhsuk-tag {
257+
font-size: 12px !important;
258+
}
259+
260+
h1 {
261+
font-size: 20px !important;
262+
break-after: avoid;
263+
}
264+
265+
h2 {
266+
font-size: 18px !important;
267+
break-after: avoid;
268+
}
269+
270+
h3, table {
271+
break-after: avoid;
272+
break-before: auto;
273+
}
274+
275+
h3 {
276+
font-size: 16px !important;
277+
}
278+
279+
h4, th {
280+
font-size: 14px !important;
281+
}
282+
283+
tr {
284+
break-inside: avoid;
285+
page-break-inside: avoid;
286+
}
287+
}

DigitalLearningSolutions.Web/Styles/layout.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,9 @@ nav, .nhsuk-header__navigation, #header-navigation {
398398
.field-validation-valid {
399399
display: none !important;
400400
}
401+
402+
@media print {
403+
.no-print {
404+
display: none;
405+
}
406+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
@using DigitalLearningSolutions.Web.ViewModels.Frameworks;
2+
@model FrameworkViewModel;
3+
@{
4+
ViewData["Title"] = Model.DetailFramework.FrameworkName;
5+
ViewData["Application"] = "Framework Service";
6+
ViewData["HeaderPathName"] = "Framework Service";
7+
int groupNum = 0;
8+
}
9+
<link rel="stylesheet" href="@Url.Content("~/css/frameworks/frameworksShared.css")" asp-append-version="true">
10+
@section NavMenuItems {
11+
<partial name="Shared/_NavMenuItems" />
12+
}
13+
@section NavBreadcrumbs {
14+
<nav class="nhsuk-breadcrumb" aria-label="Breadcrumb">
15+
<div class="nhsuk-width-container">
16+
<ol class="nhsuk-breadcrumb__list">
17+
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-action="ViewFrameworks" asp-route-tabname="Mine">Frameworks</a></li>
18+
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-action="ViewFramework" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])" asp-route-tabname="Structure">Framework structure</a></li>
19+
<li class="nhsuk-breadcrumb__item">Print layout</li>
20+
</ol>
21+
<p class="nhsuk-breadcrumb__back"><a class="nhsuk-breadcrumb__backlink" asp-action="ViewFramework" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])" asp-route-tabname="Structure">Back to Framework</a></p>
22+
</div>
23+
</nav>
24+
}
25+
<div class="nhsuk-grid-row">
26+
27+
<div class="nhsuk-grid-column-full">
28+
<h1>
29+
@Model.DetailFramework.FrameworkName
30+
</h1>
31+
@if (!String.IsNullOrEmpty(Model.DetailFramework.Description))
32+
{
33+
<div class="nhsuk-card">
34+
<div class="nhsuk-card__content">
35+
<h2 class="nhsuk-card__heading">
36+
Framework description
37+
38+
</h2>
39+
<p class="nhsuk-card__description">
40+
@(Html.Raw(Model.DetailFramework.Description))
41+
</p>
42+
</div>
43+
</div>
44+
}
45+
<h2>Framework @Model.VocabPlural().ToLower()</h2>
46+
47+
@if (Model.FrameworkCompetencyGroups != null)
48+
{
49+
if (Model.FrameworkCompetencyGroups.Any())
50+
{
51+
@foreach (var frameworkCompetencyGroup in Model.FrameworkCompetencyGroups)
52+
{
53+
groupNum++;
54+
<h3>@frameworkCompetencyGroup.Name</h3>
55+
if (frameworkCompetencyGroup.Description != null)
56+
{
57+
<p class="nhsuk-lede-text">
58+
@frameworkCompetencyGroup.Description
59+
</p>
60+
}
61+
62+
int compNum = 0;
63+
if (frameworkCompetencyGroup.FrameworkCompetencies[0] != null)
64+
{
65+
<table class="nhsuk-table">
66+
<thead role="rowgroup" class="nhsuk-table__head">
67+
<tr role="row">
68+
<th role="columnheader" class="" scope="col">
69+
@Model.VocabSingular()
70+
</th>
71+
<th role="columnheader" class="status-tag" scope="col">
72+
Date and Signature
73+
</th>
74+
</tr>
75+
</thead>
76+
<tbody class="nhsuk-table__body">
77+
@foreach (var frameworkCompetency in frameworkCompetencyGroup.FrameworkCompetencies)
78+
{
79+
compNum++;
80+
<tr role="row" class="nhsuk-table__row">
81+
<td>
82+
<strong>@frameworkCompetency.Name</strong>
83+
84+
<partial name="_CompetencyFlags" model="Model.CompetencyFlags.Where(c => c.CompetencyId == frameworkCompetency.CompetencyID)" />
85+
@if (frameworkCompetency.Description != null)
86+
{
87+
<p class="nhsuk-lede-text--small">
88+
@Html.Raw(frameworkCompetency.Description)
89+
</p>
90+
}
91+
</td>
92+
<td>
93+
94+
</td>
95+
</tr>
96+
}
97+
</tbody>
98+
</table>
99+
}
100+
}
101+
}
102+
}
103+
@if (Model.FrameworkCompetencies != null)
104+
{
105+
if (Model.FrameworkCompetencies.Any())
106+
{
107+
groupNum++;
108+
int compNum = 0;
109+
<h2>Ungrouped competencies</h2>
110+
foreach (var frameworkCompetency in Model.FrameworkCompetencies)
111+
{
112+
compNum++;
113+
<div class="nhsuk-u-margin-left-8">
114+
<h3>@frameworkCompetency.Name</h3>
115+
<partial name="_CompetencyFlags" model="Model.CompetencyFlags.Where(c => c.CompetencyId == frameworkCompetency.CompetencyID)" />
116+
@if (frameworkCompetency.Description != null)
117+
{
118+
<p class="nhsuk-lede-text--small">
119+
@frameworkCompetency.Description
120+
</p>
121+
}
122+
</div>
123+
}
124+
}
125+
}
126+
</div>
127+
</div>

DigitalLearningSolutions.Web/Views/Frameworks/Developer/_Structure.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ else
8282
<a class="nhsuk-button" asp-action="AddEditFrameworkCompetencyGroup" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Add @Model.VocabSingular().ToLower() group</a>
8383
<a class="nhsuk-button nhsuk-button--secondary" asp-action="AddEditFrameworkCompetency" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Add ungrouped @Model.VocabSingular().ToLower()</a>
8484
<a class="nhsuk-button nhsuk-button--secondary" asp-action="ImportCompetencies" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])" asp-route-isNotBlank="@(Model.FrameworkCompetencies.Any()|Model.FrameworkCompetencyGroups.Any())" asp-route-tabname="@(ViewContext.RouteData.Values["tabname"])">Bulk upload/update @Model.VocabPlural().ToLower()</a>
85+
<a class="nhsuk-button nhsuk-button--secondary" asp-action="PrintLayout" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">View for print</a>
8586
</div>
8687
</div>
8788
}

DigitalLearningSolutions.Web/Views/Shared/_CookieConsentPartial.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@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
1111
{
12-
<div id="nhsuk-cookie-banner">
12+
<div id="nhsuk-cookie-banner no-print">
1313
<div class="nhsuk-cookie-banner nhsuk-u-margin-top-3" id="cookiebanner">
1414
<div class="nhsuk-width-container ">
1515
<h2>Cookies on Digital Learning Solutions</h2>
@@ -38,7 +38,7 @@
3838
}
3939
@if (consentViaBannerPostTemp != null)
4040
{
41-
<div class="nhsuk-success-banner nhsuk-u-margin-top-3" id="nhsuk-cookie-confirmation-banner-post" role="banner" aria-label="Cookies on Digital Learning Solutions">
41+
<div class="nhsuk-success-banner no-print nhsuk-u-margin-top-3" id="nhsuk-cookie-confirmation-banner-post" role="banner" aria-label="Cookies on Digital Learning Solutions">
4242
<div class="nhsuk-width-container">
4343
<p id="nhsuk-success-banner__message">You can change your cookie settings at any time using our <a href="@Url.Action( "CookiePolicy","CookieConsent")">cookies page</a>.</p>
4444
</div>

DigitalLearningSolutions.Web/Views/Shared/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<a class="nhsuk-skip-link" href="#maincontent">Skip to main content</a>
7373
@if (Configuration["ShowAlertBanner"] == "True")
7474
{
75-
<div class="dls-alert-banner">
75+
<div class="dls-alert-banner no-print">
7676
<div class="nhsuk-width-container">
7777
<div class="hee-banner__message nhsuk-u-padding-top-4">
7878
@Html.Raw(Configuration["AlertBannerContent"])

DigitalLearningSolutions.Web/Views/Shared/_UserFeedbackBarPartial.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
@if (User.Identity.IsAuthenticated)
99
{
10-
<div class="feedback-bar">
10+
<div class="feedback-bar no-print">
1111

1212
<div class="nhsuk-width-container nhsuk-header_container nhsuk-width-container--feedback nhsuk-body-s">
1313
<div class="govuk-phase-banner__content feedback-wrapper">
@@ -24,7 +24,7 @@
2424
}
2525
else
2626
{
27-
<div class="feedback-bar">
27+
<div class="feedback-bar no-print">
2828
<div class="nhsuk-width-container nhsuk-body-s">
2929
<div class="govuk-phase-banner__content feedback-wrapper">
3030
<div class="govuk-tag govuk-phase-banner__content__tag feedback-tag">

0 commit comments

Comments
 (0)