Skip to content

Commit

Permalink
feat: added support for excel sheets (#119)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Whittington <[email protected]>
  • Loading branch information
ThomasWhittington and Tom Whittington authored Aug 1, 2024
1 parent 9a648c0 commit 39b881d
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
@model CustomAttachment

<section class="attachment govuk-!-margin-top-8">
@{
var fileExtension = Model.ContentType.Split('/').Last().ToLower();
if (fileExtension == "vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
fileExtension = "xlsx";
}
}

<div class="attachment-thumbnail">
<a href="@Model.Uri" download>
@{
var fileExtension = Model.ContentType.Split('/').Last().ToLower();
switch (fileExtension)
{
case "pdf":
Expand Down Expand Up @@ -40,7 +47,7 @@

<p class="attachment-metadata">
<span class="attachment-attribute"
aria-label="file type">@Model.ContentType.Split('/').Last().ToUpper()</span>,
aria-label="file type">@fileExtension.ToUpper()</span>,
<span class="attachment-attribute" aria-label="file size">
@(Model.Size / 1024) KB
</span>
Expand Down

0 comments on commit 39b881d

Please sign in to comment.