Skip to content

Commit 501fcb7

Browse files
committed
Add V16 test site
1 parent 9d04d9f commit 501fcb7

File tree

14 files changed

+742
-0
lines changed

14 files changed

+742
-0
lines changed

src/Umbraco.Forms.Integrations.Testsite.V16/.gitignore

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
2+
3+
builder.CreateUmbracoBuilder()
4+
.AddBackOffice()
5+
.AddWebsite()
6+
.AddComposers()
7+
.Build();
8+
9+
WebApplication app = builder.Build();
10+
11+
await app.BootUmbracoAsync();
12+
13+
app.UseHttpsRedirection();
14+
15+
app.UseUmbraco()
16+
.WithMiddleware(u =>
17+
{
18+
u.UseBackOffice();
19+
u.UseWebsite();
20+
})
21+
.WithEndpoints(u =>
22+
{
23+
u.UseBackOfficeEndpoints();
24+
u.UseWebsiteEndpoints();
25+
});
26+
27+
await app.RunAsync();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:62622",
8+
"sslPort": 44363
9+
}
10+
},
11+
"profiles": {
12+
"IIS Express": {
13+
"commandName": "IISExpress",
14+
"launchBrowser": true,
15+
"environmentVariables": {
16+
"ASPNETCORE_ENVIRONMENT": "Development"
17+
}
18+
},
19+
"Umbraco.Web.UI": {
20+
"commandName": "Project",
21+
"dotnetRunMessages": true,
22+
"launchBrowser": true,
23+
"applicationUrl": "https://localhost:44363;http://localhost:62622",
24+
"environmentVariables": {
25+
"ASPNETCORE_ENVIRONMENT": "Development"
26+
}
27+
}
28+
}
29+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
<CompressionEnabled>false</CompressionEnabled> <!-- Disable compression. E.g. for umbraco backoffice files. These files should be precompressed by node and not let dotnet handle it -->
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Umbraco.Cms" Version="16.0.0" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
15+
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
16+
<PackageReference Include="Umbraco.Forms" Version="16.0.0" />
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')))" />
18+
</ItemGroup>
19+
20+
<PropertyGroup>
21+
<!-- Razor files are needed for the backoffice to work correctly -->
22+
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
23+
</PropertyGroup>
24+
25+
26+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@using Umbraco.Extensions
2+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea>
3+
4+
<div class="umb-block-grid__area"
5+
data-area-col-span="@Model.ColumnSpan"
6+
data-area-row-span="@Model.RowSpan"
7+
data-area-alias="@Model.Alias"
8+
style="--umb-block-grid--grid-columns: @Model.ColumnSpan;--umb-block-grid--area-column-span: @Model.ColumnSpan; --umb-block-grid--area-row-span: @Model.RowSpan;">
9+
@await Html.GetBlockGridItemsHtmlAsync(Model)
10+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@using Umbraco.Extensions
2+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
3+
@{
4+
if (Model?.Areas.Any() != true) { return; }
5+
}
6+
7+
<div class="umb-block-grid__area-container"
8+
style="--umb-block-grid--area-grid-columns: @(Model.AreaGridColumns?.ToString() ?? Model.GridColumns?.ToString() ?? "12");">
9+
@foreach (var area in Model.Areas)
10+
{
11+
@await Html.GetBlockGridItemAreaHtmlAsync(area)
12+
}
13+
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@using Umbraco.Extensions
2+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridModel>
3+
@{
4+
if (Model?.Any() != true) { return; }
5+
}
6+
7+
<div class="umb-block-grid"
8+
data-grid-columns="@(Model.GridColumns?.ToString() ?? "12");"
9+
style="--umb-block-grid--grid-columns: @(Model.GridColumns?.ToString() ?? "12");">
10+
@await Html.GetBlockGridItemsHtmlAsync(Model)
11+
</div>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@using Umbraco.Cms.Core.Models.Blocks
2+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<IEnumerable<BlockGridItem>>
3+
@{
4+
if (Model?.Any() != true) { return; }
5+
}
6+
7+
<div class="umb-block-grid__layout-container">
8+
@foreach (var item in Model)
9+
{
10+
11+
<div
12+
class="umb-block-grid__layout-item"
13+
data-content-element-type-alias="@item.Content.ContentType.Alias"
14+
data-content-element-type-key="@item.Content.ContentType.Key"
15+
data-element-key="@item.ContentKey"
16+
data-col-span="@item.ColumnSpan"
17+
data-row-span="@item.RowSpan"
18+
style=" --umb-block-grid--item-column-span: @item.ColumnSpan; --umb-block-grid--item-row-span: @item.RowSpan; ">
19+
@{
20+
var partialViewName = "blockgrid/Components/" + item.Content.ContentType.Alias;
21+
try
22+
{
23+
@await Html.PartialAsync(partialViewName, item)
24+
}
25+
catch (InvalidOperationException)
26+
{
27+
<p>
28+
<strong>Could not render component of type: @(item.Content.ContentType.Alias)</strong>
29+
<br/>
30+
This likely happened because the partial view <em>@partialViewName</em> could not be found.
31+
</p>
32+
}
33+
}
34+
</div>
35+
}
36+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListModel>
2+
@{
3+
if (Model?.Any() != true) { return; }
4+
}
5+
<div class="umb-block-list">
6+
@foreach (var block in Model)
7+
{
8+
if (block?.ContentUdi == null) { continue; }
9+
var data = block.Content;
10+
11+
@await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block)
12+
}
13+
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@using Umbraco.Extensions
2+
@using Umbraco.Cms.Web.Common.PublishedModels
3+
@using Umbraco.Cms.Web.Common.Views
4+
@using Umbraco.Cms.Core.Models.PublishedContent
5+
@using Microsoft.AspNetCore.Html
6+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

0 commit comments

Comments
 (0)