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.
- Loading branch information
Showing
7 changed files
with
101 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
using Contentful.Core.Models; | ||
using Newtonsoft.Json; | ||
|
||
namespace Childrens_Social_Care_CPD.Contentful.Models; | ||
|
||
public class Resource : IContent | ||
{ | ||
public string Id { get; set; } | ||
public string PreHeading { get; set; } | ||
public string Heading { get; set; } | ||
public string Summary { get; set; } | ||
public string ResourceListSummary { get; set; } | ||
public string Title { get; set; } | ||
public string From { get; set; } | ||
public string ResourceType { get; set; } | ||
public List<IContent> ResourceItems { get; set; } | ||
public List<string> Type { get; set; } | ||
public string Summary { get; set; } | ||
public string SearchSummary { get; set; } | ||
public List<IContent> Items { get; set; } | ||
|
||
// need these for queries | ||
[JsonProperty("$metadata")] | ||
public ContentfulMetadata Metadata { get; set; } | ||
public SystemProperties Sys { 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
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
16 changes: 7 additions & 9 deletions
16
Childrens-Social-Care-CPD/Views/Resources/_SearchResult.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,15 +1,13 @@ | ||
@using Childrens_Social_Care_CPD.Contentful.Models; | ||
|
||
@model Content | ||
@model Resource | ||
|
||
@{ var createdAt = (DateTime)Model.Sys.CreatedAt; } | ||
<div> | ||
<h2><a href="/content/@Model.Id">@Model.Title</a></h2> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum laoreet lacinia. Phasellus fringilla ligula at leo rutrum eleifend. | ||
Nulla tempor, massa in congue lobortis, lectus turpis vulputate tellus, eget cursus massa orci eu purus. Aenean non dui libero. | ||
</p> | ||
<ul> | ||
<li>Created: <time datetime="@createdAt.ToString("yyyy-MM-dd")">@createdAt.ToString("dd MMMM yyyy")</time></li> | ||
<h2><a href="@Model.Id">@Model.Title</a></h2> | ||
<p>@Model.SearchSummary</p> | ||
<ul class="govuk-list govuk-body-s" style="display:flex; gap:15px; flex-flow:row"> | ||
<li>From: @Model.From</li> | ||
<li>Update: <time datetime="@Model.Sys.UpdatedAt?.ToString("yyyy-MM-dd")">@Model.Sys.UpdatedAt?.ToString("dd MMMM yyyy")</time></li> | ||
<li>Resource type: @string.Join(", ", Model.Type.ToArray())</li> | ||
</ul> | ||
</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