Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> { { "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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
6 changes: 6 additions & 0 deletions DigitalLearningSolutions.Web/Styles/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,9 @@ nav, .nhsuk-header__navigation, #header-navigation {
.field-validation-valid {
display: none !important;
}

@media print {
.no-print {
display: none;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
<link rel="stylesheet" href="@Url.Content("~/css/frameworks/frameworksShared.css")" asp-append-version="true">
@section NavMenuItems {
<partial name="Shared/_NavMenuItems" />
}
@section NavBreadcrumbs {
<nav class="nhsuk-breadcrumb" aria-label="Breadcrumb">
<div class="nhsuk-width-container">
<ol class="nhsuk-breadcrumb__list">
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-action="ViewFrameworks" asp-route-tabname="Mine">Frameworks</a></li>
<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>
<li class="nhsuk-breadcrumb__item">Print layout</li>
</ol>
<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>
</div>
</nav>
}
<div class="nhsuk-grid-row">

<div class="nhsuk-grid-column-full">
<h1>
@Model.DetailFramework.FrameworkName
</h1>
@if (!String.IsNullOrEmpty(Model.DetailFramework.Description))
{
<div class="nhsuk-card">
<div class="nhsuk-card__content">
<h2 class="nhsuk-card__heading">
Framework description

</h2>
<p class="nhsuk-card__description">
@(Html.Raw(Model.DetailFramework.Description))
</p>
</div>
</div>
}
<h2>Framework @Model.VocabPlural().ToLower()</h2>

@if (Model.FrameworkCompetencyGroups != null)
{
if (Model.FrameworkCompetencyGroups.Any())
{
@foreach (var frameworkCompetencyGroup in Model.FrameworkCompetencyGroups)
{
groupNum++;
<h3>@frameworkCompetencyGroup.Name</h3>
if (frameworkCompetencyGroup.Description != null)
{
<p class="nhsuk-lede-text">
@frameworkCompetencyGroup.Description
</p>
}

int compNum = 0;
if (frameworkCompetencyGroup.FrameworkCompetencies[0] != null)
{
<table class="nhsuk-table">
<thead role="rowgroup" class="nhsuk-table__head">
<tr role="row">
<th role="columnheader" class="" scope="col">
@Model.VocabSingular()
</th>
<th role="columnheader" class="status-tag" scope="col">
Date and Signature
</th>
</tr>
</thead>
<tbody class="nhsuk-table__body">
@foreach (var frameworkCompetency in frameworkCompetencyGroup.FrameworkCompetencies)
{
compNum++;
<tr role="row" class="nhsuk-table__row">
<td>
<strong>@frameworkCompetency.Name</strong>

<partial name="_CompetencyFlags" model="Model.CompetencyFlags.Where(c => c.CompetencyId == frameworkCompetency.CompetencyID)" />
@if (frameworkCompetency.Description != null)
{
<p class="nhsuk-lede-text--small">
@Html.Raw(frameworkCompetency.Description)
</p>
}
</td>
<td>

</td>
</tr>
}
</tbody>
</table>
}
}
}
}
@if (Model.FrameworkCompetencies != null)
{
if (Model.FrameworkCompetencies.Any())
{
groupNum++;
int compNum = 0;
<h2>Ungrouped competencies</h2>
foreach (var frameworkCompetency in Model.FrameworkCompetencies)
{
compNum++;
<div class="nhsuk-u-margin-left-8">
<h3>@frameworkCompetency.Name</h3>
<partial name="_CompetencyFlags" model="Model.CompetencyFlags.Where(c => c.CompetencyId == frameworkCompetency.CompetencyID)" />
@if (frameworkCompetency.Description != null)
{
<p class="nhsuk-lede-text--small">
@frameworkCompetency.Description
</p>
}
</div>
}
}
}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ else
<a class="nhsuk-button" asp-action="AddEditFrameworkCompetencyGroup" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Add @Model.VocabSingular().ToLower() group</a>
<a class="nhsuk-button nhsuk-button--secondary" asp-action="AddEditFrameworkCompetency" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Add ungrouped @Model.VocabSingular().ToLower()</a>
<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>
<a class="nhsuk-button nhsuk-button--secondary" asp-action="PrintLayout" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">View for print</a>
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
<div id="nhsuk-cookie-banner">
<div id="nhsuk-cookie-banner no-print">
<div class="nhsuk-cookie-banner nhsuk-u-margin-top-3" id="cookiebanner">
<div class="nhsuk-width-container ">
<h2>Cookies on Digital Learning Solutions</h2>
Expand Down Expand Up @@ -38,7 +38,7 @@
}
@if (consentViaBannerPostTemp != null)
{
<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">
<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">
<div class="nhsuk-width-container">
<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>
</div>
Expand Down
2 changes: 1 addition & 1 deletion DigitalLearningSolutions.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<a class="nhsuk-skip-link" href="#maincontent">Skip to main content</a>
@if (Configuration["ShowAlertBanner"] == "True")
{
<div class="dls-alert-banner">
<div class="dls-alert-banner no-print">
<div class="nhsuk-width-container">
<div class="hee-banner__message nhsuk-u-padding-top-4">
@Html.Raw(Configuration["AlertBannerContent"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
@if (User.Identity.IsAuthenticated)
{
<div class="feedback-bar">
<div class="feedback-bar no-print">

<div class="nhsuk-width-container nhsuk-header_container nhsuk-width-container--feedback nhsuk-body-s">
<div class="govuk-phase-banner__content feedback-wrapper">
Expand All @@ -24,7 +24,7 @@
}
else
{
<div class="feedback-bar">
<div class="feedback-bar no-print">
<div class="nhsuk-width-container nhsuk-body-s">
<div class="govuk-phase-banner__content feedback-wrapper">
<div class="govuk-tag govuk-phase-banner__content__tag feedback-tag">
Expand Down
Loading