Skip to content

Commit

Permalink
feature: v10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdcdev committed May 25, 2024
1 parent 11287d5 commit dc41002
Show file tree
Hide file tree
Showing 150 changed files with 3,433 additions and 6,399 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
with:
project-name: ${{ needs.metadata.outputs.project-name}}
project-path: ${{ needs.metadata.outputs.project-path }}
umbraco-version: UMBRACO_VERSION
umbraco-version: 10
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
project-name: ${{ needs.metadata.outputs.project-name}}
project-path: ${{ needs.metadata.outputs.project-path }}
umbraco-version: UMBRACO_VERSION
umbraco-version: 10
- name: Release
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Release@main
with:
Expand Down
1 change: 1 addition & 0 deletions src/TestSite.10/Composer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Umbraco.Cms.Core.Composing;
using Umbraco.Community.BackOfficeOrganiser;
using Umbraco.Community.BackOfficeOrganiser.Composing;

namespace TestSite.Ten;

Expand Down
9 changes: 2 additions & 7 deletions src/TestSite.10/TestSite.10.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="10.8.5"/>
<PackageReference Include="Umbraco.Cms" Version="10.8.6"/>
<PackageReference Include="uSync" Version="10.7.3"/>
</ItemGroup>

<ItemGroup>
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3"/>
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9"/>
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))"/>
</ItemGroup>

Expand All @@ -25,11 +25,6 @@

<ItemGroup>
<ProjectReference Include="..\Umbraco.Community.BackOfficeOrganiser\Umbraco.Community.BackOfficeOrganiser.csproj" />
<ProjectReference Include="..\Umbraco.Community.SimpleDashboards\Umbraco.Community.SimpleDashboards.csproj"/>
</ItemGroup>

<ItemGroup>
<_ContentIncludedByDefault Remove="Views\Dashboards\Basic.cshtml" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>

<h2 style="padding: 20px">@Model.Content.Value("headline")</h2>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@using Umbraco.Cms.Core.Models
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>

@{
var typedMediaPickerSingle = Model.Content.Value<MediaWithCrops>("image");
if (typedMediaPickerSingle != null)
{
<img src="@typedMediaPickerSingle.GetCropUrl("1x1")" style="object-fit:cover; width:100%; height:100%;"/>
}
else
{
<p>Missing image</p>
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>

<div style="padding: 20px">
@Model.Content.Value("richText")
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>

<div>
@await Html.GetBlockGridItemAreasHtmlAsync(Model)
</div>
9 changes: 5 additions & 4 deletions src/TestSite.10/Views/Partials/blockgrid/area.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@using Umbraco.Extensions
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea>

<div class="umb-block-grid__area"
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea>
@{
var bsClass = $"col-{Model.ColumnSpan}";
}
<div class="umb-block-grid__area @bsClass"
data-area-col-span="@Model.ColumnSpan"
data-area-row-span="@Model.RowSpan"
data-area-alias="@Model.Alias"
Expand Down
10 changes: 6 additions & 4 deletions src/TestSite.10/Views/Partials/blockgrid/areas.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@using Umbraco.Extensions
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
@{
if (Model?.Areas.Any() != true) { return; }
if (Model?.Areas.Any() != true)
{
return;
}
}

<div class="umb-block-grid__area-container"
<div class="umb-block-grid__area-container row"
style="--umb-block-grid--area-grid-columns: @(Model.AreaGridColumns?.ToString() ?? Model.GridColumns?.ToString() ?? "12");">
@foreach (var area in Model.Areas)
{
Expand Down
10 changes: 6 additions & 4 deletions src/TestSite.10/Views/Partials/blockgrid/default.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@using Umbraco.Extensions
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridModel>
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridModel>
@{
if (Model?.Any() != true) { return; }
if (Model?.Any() != true)
{
return;
}
}

<div class="umb-block-grid"
<div class="umb-block-grid container-fluid"
data-grid-columns="@(Model.GridColumns?.ToString() ?? "12");"
style="--umb-block-grid--grid-columns: @(Model.GridColumns?.ToString() ?? "12");">
@await Html.GetBlockGridItemsHtmlAsync(Model)
Expand Down
9 changes: 5 additions & 4 deletions src/TestSite.10/Views/Partials/blockgrid/items.cshtml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
@using Umbraco.Cms.Core.Models.Blocks
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<IEnumerable<BlockGridItem>>
@inherits UmbracoViewPage<IEnumerable<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>>
@{
if (Model?.Any() != true) { return; }
if (Model?.Any() != true)
{
return;
}
}

<div class="umb-block-grid__layout-container">
@foreach (var item in Model)
{

<div
class="umb-block-grid__layout-item"
data-content-element-type-alias="@item.Content.ContentType.Alias"
Expand Down
13 changes: 10 additions & 3 deletions src/TestSite.10/Views/Partials/blocklist/default.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListModel>
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListModel>
@{
if (Model?.Any() != true) { return; }
if (Model?.Any() != true)
{
return;
}
}
<div class="umb-block-list">
@foreach (var block in Model)
{
if (block?.ContentUdi == null) { continue; }
if (block?.ContentUdi == null)
{
continue;
}

var data = block.Content;

@await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block)
Expand Down
17 changes: 10 additions & 7 deletions src/TestSite.10/Views/Partials/grid/bootstrap3-fluid.cshtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@using System.Collections
@using System.Web
@using Microsoft.AspNetCore.Html
@using Newtonsoft.Json.Linq
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
@inherits UmbracoViewPage<dynamic>

@*
Razor helpers located at the bottom of this file
*@

@if (Model is JObject && Model?.sections is not null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
var oneColumn = ((ICollection)Model.sections).Count == 1;

<div class="umb-grid">
@if (oneColumn)
Expand Down Expand Up @@ -62,10 +62,11 @@
}
</div>
</div>
}
}
</div>
</div>
}

}

@functions{
Expand All @@ -77,7 +78,7 @@

if (cfg != null)
{
foreach (JProperty property in cfg.Properties())
foreach (var property in cfg.Properties())
{
var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString());
attrs.Add(property.Name + "=\"" + propertyValue + "\"");
Expand All @@ -86,9 +87,10 @@

JObject style = contentItem.styles;

if (style != null) {
if (style != null)
{
var cssVals = new List<string>();
foreach (JProperty property in style.Properties())
foreach (var property in style.Properties())
{
var propertyValue = property.Value.ToString();
if (string.IsNullOrWhiteSpace(propertyValue) == false)
Expand All @@ -103,4 +105,5 @@

return new HtmlString(string.Join(" ", attrs));
}

}
19 changes: 11 additions & 8 deletions src/TestSite.10/Views/Partials/grid/bootstrap3.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@using System.Collections
@using System.Web
@using Microsoft.AspNetCore.Html
@using Newtonsoft.Json.Linq
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
@inherits UmbracoViewPage<dynamic>

@if (Model is JObject && Model?.sections is not null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
var oneColumn = ((ICollection)Model.sections).Count == 1;

<div class="umb-grid">
@if (oneColumn)
Expand Down Expand Up @@ -46,7 +46,8 @@
private async Task renderRow(dynamic row, bool singleColumn)
{
<div @RenderElementAttributes(row)>
@if (singleColumn) {
@if (singleColumn)
{
@:<div class="container">
}
<div class="row clearfix">
Expand All @@ -63,9 +64,10 @@
}
</div>
</div>
}
}
</div>
@if (singleColumn) {
@if (singleColumn)
{
@:</div>
}
</div>
Expand All @@ -82,7 +84,7 @@

if (cfg != null)
{
foreach (JProperty property in cfg.Properties())
foreach (var property in cfg.Properties())
{
var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString());
attrs.Add(property.Name + "=\"" + propertyValue + "\"");
Expand All @@ -94,7 +96,7 @@
if (style != null)
{
var cssVals = new List<string>();
foreach (JProperty property in style.Properties())
foreach (var property in style.Properties())
{
var propertyValue = property.Value.ToString();
if (string.IsNullOrWhiteSpace(propertyValue) == false)
Expand All @@ -109,4 +111,5 @@

return new HtmlString(string.Join(" ", attrs));
}

}
1 change: 1 addition & 0 deletions src/TestSite.10/Views/Partials/grid/editors/base.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ catch (Exception ex)

return view;
}

}
12 changes: 6 additions & 6 deletions src/TestSite.10/Views/Partials/grid/editors/embed.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
@inherits UmbracoViewPage<dynamic>

@if (Model is not null)
{
string embedValue = Convert.ToString(Model.value);
embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value;
string embedValue = Convert.ToString(Model.value);
embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value;

<div class="video-wrapper">
@Html.Raw(embedValue)
</div>
<div class="video-wrapper">
@Html.Raw(embedValue)
</div>
}
4 changes: 2 additions & 2 deletions src/TestSite.10/Views/Partials/grid/editors/macro.cshtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
@inherits UmbracoViewPage<dynamic>

@if (Model?.value is not null)
{
string macroAlias = Model.value.macroAlias.ToString();
var parameters = new Dictionary<string,object>();
var parameters = new Dictionary<string, object>();
foreach (var mpd in Model.value.macroParamsDictionary)
{
parameters.Add(mpd.Name, mpd.Value);
Expand Down
10 changes: 3 additions & 7 deletions src/TestSite.10/Views/Partials/grid/editors/media.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model dynamic
@using Umbraco.Cms.Core.Media
@using Umbraco.Cms.Core.PropertyEditors.ValueConverters
@model dynamic
@inject IImageUrlGenerator ImageUrlGenerator

@if (Model?.value is not null)
Expand All @@ -11,9 +11,7 @@
{
if (Model.value.coordinates != null)
{
url = ImageCropperTemplateCoreExtensions.GetCropUrl(
(string)url,
ImageUrlGenerator,
url = ((string)url).GetCropUrl(ImageUrlGenerator,
width: (int)Model.editor.config.size.width,
height: (int)Model.editor.config.size.height,
cropAlias: "default",
Expand All @@ -37,9 +35,7 @@
}
else
{
url = ImageCropperTemplateCoreExtensions.GetCropUrl(
(string)url,
ImageUrlGenerator,
url = ((string)url).GetCropUrl(ImageUrlGenerator,
width: (int)Model.editor.config.size.width,
height: (int)Model.editor.config.size.height,
cropDataSet: new ImageCropperValue
Expand Down
Loading

0 comments on commit dc41002

Please sign in to comment.