-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Development' of https://github.com/DFE-Digital/sts-cont…
…ent-support into Development
- Loading branch information
Showing
39 changed files
with
385 additions
and
110 deletions.
There are no files selected for viewing
27 changes: 25 additions & 2 deletions
27
src/Dfe.ContentSupport.Web/Controllers/SitemapController.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
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,9 @@ | ||
namespace Dfe.ContentSupport.Web.Extensions; | ||
|
||
public static class DateTimeExtensions | ||
{ | ||
public static string ToLongString(this DateTime dateTime) | ||
{ | ||
return dateTime.ToString("dd MMMM yyyy"); | ||
} | ||
} |
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
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
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
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
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
95 changes: 55 additions & 40 deletions
95
src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.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 |
---|---|---|
@@ -1,49 +1,64 @@ | ||
@using System | ||
@model CustomAttachment | ||
|
||
<section class="attachment govuk-!-margin-top-8"> | ||
<div class="attachment-thumbnail"> | ||
<a href="@Model.Uri" download> | ||
@{ | ||
var fileExtension = Model.ContentType.Split('/').Last().ToLower(); | ||
switch (fileExtension) | ||
{ | ||
case "pdf": | ||
<img src="/assets/images/pdf-file-icon.svg" alt="pdf file type"> | ||
break; | ||
case "csv": | ||
case "xls": | ||
case "xlsx": | ||
<img src="/assets/images/spreadsheet-file-icon.svg" alt="spreadsheet file type" /> | ||
break; | ||
case "html": | ||
case "htm": | ||
<img src="/assets/images/html-file-icon.svg" alt="html file type"> | ||
break; | ||
default: | ||
<img src="/assets/images/generic-file-icon.svg" alt="generic file type"> | ||
break; | ||
<div class="guidance-container govuk-!-padding-8 govuk-!-margin-bottom-8"> | ||
<div class="attachment"> | ||
<div class="attachment-thumbnail govuk-!-margin-right-8"> | ||
<a href="@Model.Uri" download> | ||
@{ | ||
var fileExtension = Model.ContentType.Split('/').Last().ToLower(); | ||
if (fileExtension == "vnd.openxmlformats-officedocument.spreadsheetml.sheet") | ||
{ | ||
fileExtension = "xlsx"; | ||
} | ||
|
||
switch (fileExtension) | ||
{ | ||
case "pdf": | ||
<img src="/assets/images/pdf-file-icon.svg" alt="pdf file type"> | ||
break; | ||
case "csv": | ||
case "xls": | ||
case "xlsx": | ||
<img src="/assets/images/spreadsheet-file-icon.svg" alt="spreadsheet file type" /> | ||
break; | ||
case "html": | ||
case "htm": | ||
<img src="/assets/images/html-file-icon.svg" alt="html file type"> | ||
break; | ||
default: | ||
<img src="/assets/images/generic-file-icon.svg" alt="generic file type"> | ||
break; | ||
|
||
} | ||
} | ||
} | ||
|
||
|
||
</a> | ||
</div> | ||
|
||
<div class="attachment-details"> | ||
<h2 class="attachment-title"> | ||
<a href="@Model.Uri" aria-describedby="file-details" | ||
class="govuk-link attachment-link" download> | ||
@Model.Title | ||
</a> | ||
</h2> | ||
</div> | ||
|
||
<div class="attachment-details"> | ||
<h2 class="attachment-title"> | ||
<a href="@Model.Uri" aria-describedby="file-details" class="govuk-link attachment-link" download> | ||
@Model.Title | ||
</a> | ||
</h2> | ||
|
||
<p class="attachment-metadata"> | ||
<span class="attachment-attribute" aria-label="file type">@fileExtension.ToUpper()</span>, | ||
<span class="attachment-attribute" aria-label="file size"> | ||
@(Model.Size / 1024) KB | ||
</span> | ||
</p> | ||
@if (Model.UpdatedAt.HasValue) | ||
{ | ||
<p class="attachment-metadata"> | ||
<span class="attachment-attribute" aria-label="updated date">Last updated | ||
@Model.UpdatedAt.Value.ToString("d MMMM yyyy") | ||
</span> | ||
</p> | ||
} | ||
</div> | ||
|
||
<p class="attachment-metadata"> | ||
<span class="attachment-attribute" | ||
aria-label="file type">@Model.ContentType.Split('/').Last().ToUpper()</span>, | ||
<span class="attachment-attribute" aria-label="file size"> | ||
@(Model.Size / 1024) KB | ||
</span> | ||
</p> | ||
</div> | ||
</section> | ||
</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.