Skip to content

Commit 78da033

Browse files
committed
v13
1 parent a350c2c commit 78da033

File tree

111 files changed

+25656
-2827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+25656
-2827
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ csharp_style_expression_bodied_accessors = true:suggestion
3333
csharp_style_expression_bodied_lambdas = true:suggestion
3434
csharp_style_expression_bodied_local_functions = true:suggestion
3535
csharp_indent_labels = no_change
36+
csharp_style_prefer_primary_constructors = true:none
37+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
38+
dotnet_diagnostic.SA1010.severity = none
3639

3740
##########################################
3841
# File Extension Settings
@@ -415,3 +418,6 @@ end_of_line = crlf
415418
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
416419
# OTHER DEALINGS IN THE SOFTWARE.
417420
##########################################
421+
422+
# IDE0290: Use primary constructor
423+
dotnet_diagnostic.IDE0290.severity = none

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<LangVersion>latest</LangVersion>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Authors>Nathan Woulfe</Authors>
66
<Copyright>Copyright © Nathan Woulfe $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
77
<PackageIcon>preflight.png</PackageIcon>
@@ -17,9 +17,9 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113" PrivateAssets="all" IsImplicitlyDefined="true" />
21-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" IsImplicitlyDefined="true" />
22-
<PackageReference Include="Umbraco.Code" Version="2.0.0" PrivateAssets="all" IsImplicitlyDefined="true" />
20+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.128" PrivateAssets="all" IsImplicitlyDefined="true" />
21+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="all" IsImplicitlyDefined="true" />
22+
<PackageReference Include="Umbraco.Code" Version="2.1.0" PrivateAssets="all" IsImplicitlyDefined="true" />
2323
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" PrivateAssets="all" IsImplicitlyDefined="true" />
2424
</ItemGroup>
2525

Preflight.Site/.gitignore renamed to Examples/Preflight.Site/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,9 @@ $RECYCLE.BIN/
457457
## Umbraco CMS
458458
##
459459

460-
# JSON schema file for appsettings.json
460+
# JSON schema files for appsettings.json
461461
appsettings-schema.json
462+
appsettings-schema.*.json
462463

463464
# Packages created from the backoffice (package.xml/package.zip)
464465
/umbraco/Data/CreatedPackages/

Preflight.Site/Preflight.Site.csproj renamed to Examples/Preflight.Site/Preflight.Site.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
6-
<IsPackable>false</IsPackable>
76
</PropertyGroup>
87

98
<ItemGroup>
10-
<PackageReference Include="clean" Version="2.1.6" />
11-
<PackageReference Include="Umbraco.Cms" Version="[12.0.0, 13)" />
9+
<PackageReference Include="Clean" Version="4.0.0" />
10+
<PackageReference Include="Umbraco.Cms" Version="13.0.3" />
1211
</ItemGroup>
1312

1413
<ItemGroup>
1514
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
16-
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
17-
<ProjectReference Include="..\src\Preflight\Preflight.csproj" />
18-
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
15+
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
16+
<ProjectReference Include="..\..\src\Preflight\Preflight.csproj" />
17+
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
1918
</ItemGroup>
2019

2120
<PropertyGroup>

Examples/Preflight.Site/Program.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
2+
3+
builder.CreateUmbracoBuilder()
4+
.AddBackOffice()
5+
.AddWebsite()
6+
.AddDeliveryApi()
7+
.AddComposers()
8+
.Build();
9+
10+
WebApplication app = builder.Build();
11+
12+
await app.BootUmbracoAsync();
13+
14+
15+
app.UseUmbraco()
16+
.WithMiddleware(u =>
17+
{
18+
u.UseBackOffice();
19+
u.UseWebsite();
20+
})
21+
.WithEndpoints(u =>
22+
{
23+
u.UseInstallerEndpoints();
24+
u.UseBackOfficeEndpoints();
25+
u.UseWebsiteEndpoints();
26+
});
27+
28+
await app.RunAsync();

Preflight.Site/Properties/launchSettings.json renamed to Examples/Preflight.Site/Properties/launchSettings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"windowsAuthentication": false,
55
"anonymousAuthentication": true,
66
"iisExpress": {
7-
"applicationUrl": "http://localhost:60808",
8-
"sslPort": 44384
7+
"applicationUrl": "http://localhost:42312",
8+
"sslPort": 44347
99
}
1010
},
1111
"profiles": {
@@ -20,7 +20,7 @@
2020
"commandName": "Project",
2121
"dotnetRunMessages": true,
2222
"launchBrowser": true,
23-
"applicationUrl": "https://localhost:44384;http://localhost:60808",
23+
"applicationUrl": "https://localhost:44347;http://localhost:42312",
2424
"environmentVariables": {
2525
"ASPNETCORE_ENVIRONMENT": "Development"
2626
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.Author>
2+
3+
@using Clean.Core.Models.ViewModels
4+
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels
5+
6+
@{
7+
Layout = "master.cshtml";
8+
var authorListPage = Model.Parent as AuthorList;
9+
}
10+
11+
12+
@await Html.PartialAsync("~/Views/Partials/pageHeader.cshtml", new PageHeaderViewModel(Model.Name, Model.Title, Model.Subtitle, authorListPage.MainImage, null, null))
13+
14+
<article>
15+
<div class="container">
16+
<div class="row">
17+
<div class="col-lg-8 col-md-10 mx-auto">
18+
19+
<div class="row clearfix">
20+
<div class="col-md-4 column mx-auto">
21+
<img src="@Model.MainImage.GetCropUrl(400)" alt="@Model.Name" class="w-100">
22+
<p class="caption">@Model.Name</p>
23+
</div>
24+
</div>
25+
26+
@Html.GetBlockListHtml(Model.ContentRows)
27+
</div>
28+
</div>
29+
</div>
30+
</article>

Preflight.Site/Views/articleList.cshtml renamed to Examples/Preflight.Site/Views/AuthorList.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.ArticleList>
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.AuthorList>
22

33
@using Clean.Core.Models.ViewModels
44
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels
@@ -9,4 +9,4 @@
99

1010
@await Html.PartialAsync("~/Views/Partials/pageHeader.cshtml", new PageHeaderViewModel(Model.Name, Model.Title, Model.Subtitle, Model.MainImage))
1111

12-
@await Html.PartialAsync("~/Views/Partials/latestArticles.cshtml")
12+
@await Html.PartialAsync("~/Views/Partials/authors.cshtml")
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<PaginationViewModel>
2+
3+
@using Clean.Core.Models.ViewModels;
4+
5+
<nav aria-label="Pagination controls">
6+
@if (Model.PageCount > 1)
7+
{
8+
<ul class="pagination justify-content-center">
9+
@if (Model.PageNumber > 1)
10+
{
11+
<li class="page-item">
12+
<a class="page-link text-primary" href="@($"{Model.Url}?page={Model.PageNumber - 1}")">@Umbraco.GetDictionaryValue("Paging.Previous")</a>
13+
</li>
14+
}
15+
@if(Model.ShowFirst)
16+
{
17+
<li class="page-item">
18+
<a class="page-link" href="@($"{Model.Url}?page={1}")">1</a>
19+
</li>
20+
<li class="page-item disabled">
21+
<a class="page-link" href="#">...</a>
22+
</li>
23+
}
24+
25+
@for (var p = Model.PageNumberStart; p <= Model.PageNumberEnd; p++)
26+
{
27+
var isCurrentPage = p == Model.PageNumber;
28+
<li class="page-item">
29+
@if(isCurrentPage)
30+
{
31+
@:<strong>
32+
}
33+
<a class="page-link @(isCurrentPage ? "text-primary" : null)" href="@($"{Model.Url}?page={p}")">@p</a>
34+
@if(isCurrentPage)
35+
{
36+
@:</strong>
37+
}
38+
</li>
39+
}
40+
@if (Model.PageNumber < Model.PageCount)
41+
{
42+
<li class="page-item">
43+
<a class="page-link text-primary" href="@($"{Model.Url}?page={Model.PageNumber + 1}")">@Umbraco.GetDictionaryValue("Paging.Next")</a>
44+
</li>
45+
}
46+
</ul>
47+
}
48+
</nav>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
@inherits UmbracoViewPage
2+
3+
@using Clean.Core.Helpers
4+
@using Clean.Core.Models.ViewModels;
5+
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels
6+
7+
@{
8+
AuthorList authorList = UmbracoContext.Content.GetAtRoot().DescendantsOrSelf<AuthorList>().FirstOrDefault();
9+
int modelId = Model.Id;
10+
var isAuthorListPage = modelId == authorList?.Id;
11+
var fallbackPageSize = isAuthorListPage ? 10 : 3;
12+
13+
var pageSize = QueryStringHelper.GetIntFromQueryString(Context.Request.Query, "size", fallbackPageSize);
14+
var pageNumber = QueryStringHelper.GetIntFromQueryString(Context.Request.Query, "page", 1);
15+
var allAuthors = authorList?.Children<Author>().Where(x => x.IsVisible()) ?? Enumerable.Empty<Author>();
16+
var pageOfAuthors = allAuthors.Skip((pageNumber - 1) * pageSize).Take(pageSize);
17+
var totalItemCount = allAuthors.Count();
18+
var pageCount = totalItemCount > 0 ? Math.Ceiling((double)totalItemCount / pageSize) : 1;
19+
20+
}
21+
22+
<div class="container">
23+
<div class="row">
24+
<div class="col-lg-8 col-md-10 mx-auto">
25+
<div class="container-fluid">
26+
<div class="row">
27+
@foreach (var author in pageOfAuthors)
28+
{
29+
<div class="col-4 mx-auto">
30+
<div class="card">
31+
<header>
32+
<img src="@(author.MainImage.Url())" alt="@author.Name" class="w-100" />
33+
</header>
34+
<div class="card-body">
35+
<div class="content-left text-start my-auto py-4">
36+
<h2 class="card-title">@author.Name</h2>
37+
<p class="card-description">@author.MetaDescription</p>
38+
<a href="@author.Url()" class="text-primary">
39+
@Umbraco.GetDictionaryValue("Author.ReadMore")
40+
</a>
41+
</div>
42+
</div>
43+
</div>
44+
</div>
45+
}
46+
</div>
47+
</div>
48+
49+
@if (isAuthorListPage)
50+
{
51+
@await Component.InvokeAsync("Pagination", new { totalItems = totalItemCount, url = Model.Url(), pageNumber = pageNumber, pageSize = pageSize })
52+
}
53+
</div>
54+
</div>
55+
</div>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@inherits UmbracoViewPage<BlockListItem>
2+
@using Umbraco.Cms.Core.Models.Blocks
3+
4+
@{
5+
var row = Model.Content as CodeSnippetRow;
6+
var settings = Model.Settings as CodeSnippetRowSettings;
7+
if (settings?.Hide ?? false) { return; }
8+
9+
var spacingClasses = "";
10+
if (Model.Settings is ISpacingProperties spacing)
11+
{
12+
spacingClasses = Clean.Core.Helpers.SpacingHelper.GetSpacingClasses(spacing.PaddingTop, spacing.PaddingBottom, spacing.PaddingLeft, spacing.PaddingRight, spacing.MarginTop, spacing.MarginBottom, spacing.MarginLeft, spacing.MarginRight);
13+
}
14+
15+
SmidgeHelper.RequiresCss("~/clean-assets/css/vs2015.css");
16+
SmidgeHelper.RequiresCss("~/clean-assets/css/highlightjs-copy.min.css");
17+
SmidgeHelper.RequiresJs("~/clean-assets/js/highlight.min.js");
18+
SmidgeHelper.RequiresJs("~/clean-assets/js/highlightjs-copy.min.js");
19+
SmidgeHelper.RequiresJs("~/clean-assets/js/initHighlight.js");
20+
}
21+
22+
<div class="row clearfix @(spacingClasses)">
23+
<div class="col-md-12 column">
24+
<pre><code>@row.Code</code></pre>
25+
@if (!string.IsNullOrWhiteSpace(row.Title))
26+
{
27+
<p class="caption">@row.Title</p>
28+
}
29+
</div>
30+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@inherits UmbracoViewPage<BlockListItem>
2+
@using Umbraco.Cms.Core.Models.Blocks
3+
@addTagHelper *, Clean.Core
4+
5+
@{
6+
var row = Model.Content as IconLinkRow;
7+
var settings = Model.Settings as IconLinkRowSettings;
8+
if (settings?.Hide ?? false) { return; }
9+
}
10+
11+
<li class="list-inline-item">
12+
<a href="@row.Link.Url" target="@row.Link.Target" rel="@(row.Link.Type == global::Umbraco.Cms.Core.Models.LinkType.External ? "noopener" : null)" title="@row.Link.Name">
13+
<our-svg media-item="@row.Icon" class="social-icon"></our-svg>
14+
</a>
15+
</li>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
@inherits UmbracoViewPage<BlockListItem>
2+
@using Umbraco.Cms.Core.Models.Blocks
3+
@using Clean.Core.Extensions
4+
5+
@{
6+
var row = Model.Content as ImageCarouselRow;
7+
var settings = Model.Settings as ImageCarouselRowSettings;
8+
if (settings?.Hide ?? false) { return; }
9+
if (row.Images == null || !row.Images.Any()) { return; }
10+
11+
var spacingClasses = "";
12+
if (Model.Settings is ISpacingProperties spacing)
13+
{
14+
spacingClasses = Clean.Core.Helpers.SpacingHelper.GetSpacingClasses(spacing.PaddingTop, spacing.PaddingBottom, spacing.PaddingLeft, spacing.PaddingRight, spacing.MarginTop, spacing.MarginBottom, spacing.MarginLeft, spacing.MarginRight);
15+
}
16+
17+
SmidgeHelper.RequiresCss("~/clean-assets/css/swiffy-slider.min.css");
18+
SmidgeHelper.RequiresJs("~/clean-assets/js/swiffy-slider.min.js");
19+
}
20+
21+
<div class="row clearfix @(spacingClasses)">
22+
<div class="col-md-12 column">
23+
<div class="swiffy-slider slider-item-reveal slider-nav-round slider-item-ratio slider-item-ratio-4x3" id="slider-@(row.Key.ToString())">
24+
<ul class="slider-container">
25+
@foreach (var item in row.Images)
26+
{
27+
<li><img src="@item.Url()" loading="lazy" alt="@item.Content.GetAltText()"></li>
28+
}
29+
</ul>
30+
31+
<button type="button" class="slider-nav" aria-label="Go left"></button>
32+
<button type="button" class="slider-nav slider-nav-next" aria-label="Go right"></button>
33+
34+
<div class="slider-indicators slider-indicators-square d-none d-md-flex">
35+
<button class="active" aria-label="Go to slide"></button>
36+
@if (row.Images.Count() > 1)
37+
{
38+
foreach (var image in row.Images.Skip(1))
39+
{
40+
<button aria-label="Go to slide"></button>
41+
}
42+
}
43+
</div>
44+
45+
<div class="slider-indicators slider-indicators-sm slider-indicators-dark slider-indicators-round d-md-none slider-indicators-highlight">
46+
<button class="active" aria-label="Go to slide"></button>
47+
@if (row.Images.Count() > 1)
48+
{
49+
foreach (var image in row.Images.Skip(1))
50+
{
51+
<button aria-label="Go to slide"></button>
52+
}
53+
}
54+
</div>
55+
</div>
56+
</div>
57+
</div>

0 commit comments

Comments
 (0)