generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tf-fix-tags
- Loading branch information
Showing
11 changed files
with
393 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Childrens-Social-Care-CPD/Contentful/Models/PdfFileResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Contentful.Core.Models; | ||
|
||
namespace Childrens_Social_Care_CPD.Contentful.Models; | ||
|
||
public class PdfFileResource : IContent | ||
{ | ||
public string Id { get; set; } | ||
public Asset File { get; set; } | ||
public Asset FileThumbnail { get; set; } | ||
public string FileDescription { get; set; } | ||
public int PageCount { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Childrens-Social-Care-CPD/Views/Shared/_PdfFileResource.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@using Childrens_Social_Care_CPD.Contentful.Models; | ||
|
||
@model PdfFileResource | ||
|
||
<div class="govuk-!-margin-top-8"> | ||
<div class="govuk-grid-column-three-quarter"> | ||
<div class="govuk-grid-row"> | ||
<ul class="ons-document-list"> | ||
<li class="ons-document-list__item"> | ||
<div class="ons-document-list__item-image ons-document-list__item-image--file" aria-hidden="true"> | ||
<a class="ons-document-list__image-link ons-document-list__image-link--placeholder" style="background-image:url('@Model.FileThumbnail.File.Url')" href="@Model.File.File.Url" tabindex="-1"> | ||
</a> | ||
</div> | ||
<div class="ons-document-list__item-content"> | ||
<h2><a href="@Model.File.File.Url">@Model.Id</a></h2> | ||
<ul class="course-details govuk-list"> | ||
<li> | ||
@{ | ||
var fileSize = Math.Round(Decimal.Divide(Model.File.File.Details.Size, 1024), 0).ToString(); | ||
} | ||
<span class="govuk-!-font-size-16 govuk-!-font-weight-bold">PDF document download, @fileSize.ToString() KB, @Model.PageCount page(s)</span> | ||
</li> | ||
<div class="ons-document-list__item-description">@Model.FileDescription</div> | ||
</ul> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.