Skip to content

Commit

Permalink
Merge branch 'Development' into feature/feedback-banner
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-coggin committed Aug 15, 2024
2 parents c4aa7af + 3d5b0d5 commit 8747b24
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CsContentItem> Content { get; set; } = null!;
public DateTime? CreatedAt { get; init; }
public DateTime? UpdatedAt { get; init; }
Expand Down
1 change: 1 addition & 0 deletions src/Dfe.ContentSupport.Web/Services/ModelMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public CsPage MapToCsPage(ContentSupportPage incoming)
HasCitation = incoming.HasCitation,
HasBackToTop = incoming.HasBackToTop,
HasFeedbackBanner = incoming.HasFeedbackBanner,
HasPrint = incoming.HasPrint,
Content = MapEntriesToContent(incoming.Content),
ShowVerticalNavigation = incoming.ShowVerticalNavigation,
CreatedAt = incoming.Sys.CreatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ContentSupportPage : ContentBase
public bool HasCitation { get; init; }
public bool HasBackToTop { get; init; }
public bool HasFeedbackBanner { get; init; }
public bool HasPrint { get; init; }
public bool ShowVerticalNavigation { get; init; }

}
11 changes: 8 additions & 3 deletions src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,24 @@

@foreach (var content in Model.Content)
{
<partial name="_Content" model="@content" />
<partial name="_Content" model="@content"/>
}
</div>

<div class="govuk-grid-column-full">
@if (Model.HasCitation)
{
<partial name="_Citation" model="Model" />
<partial name="_Citation" model="Model"/>
}

@if (Model.HasBackToTop)
{
<partial name="_BackToTop" />
<partial name="_BackToTop"/>
}

@if (Model.HasPrint)
{
<partial name="_Print"/>
}

@if (Model.HasFeedbackBanner)
Expand Down
3 changes: 3 additions & 0 deletions src/Dfe.ContentSupport.Web/Views/Shared/_Print.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="print-button">
<button class="govuk-link print-link-button" data-module="print-link" onclick="window.print()">Print this page</button>
</div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ dl.gem-c-metadata__list {
}

.dfe-vertical-nav__section--nested .dfe-vertical-nav__section-item::before {
content: "";
content: "";
margin-left: -20px;
color: #505a5f;
}
Expand Down Expand Up @@ -438,3 +438,22 @@ dl.gem-c-metadata__list {
.dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current .dfe-vertical-nav__link {
font-weight: 700;
}

.print-link-button {
background: url(/assets/icon-print.png) no-repeat 10px 50%;
background-size: 16px 18px;
padding: 10px 10px 10px 36px;
border: 1px solid #b1b4b6;
color: #1d70b8;
cursor: pointer;
margin: 0;
margin-bottom: 15px;
font-weight: 400;
font-size: 14px;
font-size: 0.875rem;
line-height: 1.1429;
}

.print-button {
margin-top: 2rem;
}

0 comments on commit 8747b24

Please sign in to comment.