Skip to content

Commit ca3dea5

Browse files
authored
+semver: minor
2 parents 12c1c66 + 998de0d commit ca3dea5

27 files changed

+549
-84
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@using jcdcdev.Umbraco.ReadingTime.Core.Extensions
2+
@inherits UmbracoViewPage<InvariantExample>
3+
4+
@{
5+
Layout = "_Layout";
6+
}
7+
8+
<div class="container">
9+
<div class="row">
10+
<div class="col">
11+
<h1 class="display-1">@Model.Name</h1>
12+
<h2>
13+
<i class="bi bi-clock me-2"></i>@Umbraco.GetDictionaryValue("ReadingTime")
14+
</h2>
15+
<p>
16+
@if (Model.ReadingTime.IsValid())
17+
{
18+
<span class="d-block">
19+
@Model.ReadingTime.DisplayTime() - Varies by Culture
20+
</span>
21+
}
22+
@if (Model.ReadingTimeInvariant.IsValid())
23+
{
24+
<span class="d-block">
25+
@Model.ReadingTimeInvariant.DisplayTime() - Invariant
26+
</span>
27+
}
28+
</p>
29+
<div class="alert alert-info">
30+
@Html.Raw(Model.InvariantText)
31+
</div>
32+
<div>
33+
@await Html.GetBlockGridHtmlAsync(Model.GridContent)
34+
</div>
35+
</div>
36+
</div>
37+
</div>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Content Key="cb40f84e-7911-4d04-8463-a725fe7009ac" Alias="Invariant Example" Level="2">
3+
<Info>
4+
<Parent Key="8aa88365-4221-4886-a491-0e968a95b93f">Home</Parent>
5+
<Path>/Home/InvariantExample</Path>
6+
<Trashed>false</Trashed>
7+
<ContentType>invariantExample</ContentType>
8+
<CreateDate>2024-04-02T22:33:23</CreateDate>
9+
<NodeName Default="Invariant Example">
10+
<Name Culture="en-gb">Invariant Example</Name>
11+
<Name Culture="sv">Invariant Example</Name>
12+
</NodeName>
13+
<SortOrder>0</SortOrder>
14+
<Published Default="true">
15+
<Published Culture="en-gb">true</Published>
16+
<Published Culture="sv">true</Published>
17+
</Published>
18+
<Schedule />
19+
<Template Key="ac68c8b8-2201-40b3-a16e-c701bcc6939a">InvariantExample</Template>
20+
</Info>
21+
<Properties>
22+
<gridContent>
23+
<Value Culture="en-gb"><![CDATA[{
24+
"layout": {
25+
"Umbraco.BlockGrid": [
26+
{
27+
"contentUdi": "umb://element/6bcc826bf554455cb5a505ec47a21446",
28+
"areas": [],
29+
"columnSpan": 12,
30+
"rowSpan": 1
31+
}
32+
]
33+
},
34+
"contentData": [
35+
{
36+
"contentTypeKey": "e6fe2e86-4f0b-47c1-b4ba-c4beb49943bc",
37+
"udi": "umb://element/6bcc826bf554455cb5a505ec47a21446",
38+
"richText": {
39+
"markup": "<p>This text is specific to en-GB. It will not be calculated within any Reading Time property editors that are <strong>not </strong>configured to vary by culture.&nbsp;</p>\n<p>This text is specific to en-GB. It will not be calculated within any Reading Time property editors that are&nbsp;<strong>not</strong> configured to vary by culture.&nbsp;</p>\n<p>This text is specific to en-GB. It will not be calculated within any Reading Time property editors that are&nbsp;<strong>not</strong> configured to vary by culture.&nbsp;</p>\n<p>This text is specific to en-GB. It will not be calculated within any Reading Time property editors that are&nbsp;<strong>not</strong> configured to vary by culture.&nbsp;</p>\n<p>This text is specific to en-GB. It will not be calculated within any Reading Time property editors that are&nbsp;<strong>not</strong> configured to vary by culture.&nbsp;</p>\n<p>This text is specific to en-GB. It will not be calculated within any Reading Time property editors that are&nbsp;<strong>not</strong> configured to vary by culture.&nbsp;</p>",
40+
"blocks": {
41+
"contentData": [],
42+
"settingsData": []
43+
}
44+
}
45+
}
46+
],
47+
"settingsData": []
48+
}]]></Value>
49+
<Value Culture="sv"><![CDATA[{
50+
"layout": {
51+
"Umbraco.BlockGrid": [
52+
{
53+
"contentUdi": "umb://element/0e4e271e6a2c4e309946b12a4999c943",
54+
"areas": [],
55+
"columnSpan": 12,
56+
"rowSpan": 1
57+
}
58+
]
59+
},
60+
"contentData": [
61+
{
62+
"contentTypeKey": "e6fe2e86-4f0b-47c1-b4ba-c4beb49943bc",
63+
"udi": "umb://element/0e4e271e6a2c4e309946b12a4999c943",
64+
"richText": {
65+
"markup": "<p>This text is specific to Swedish. It will not be calculated within any Reading Time property editors that are&nbsp;<strong>not </strong>configured to vary by culture.&nbsp;</p>",
66+
"blocks": {
67+
"contentData": [],
68+
"settingsData": []
69+
}
70+
}
71+
}
72+
],
73+
"settingsData": []
74+
}]]></Value>
75+
</gridContent>
76+
<invariantText>
77+
<Value><![CDATA[This text will show for all languages and is therefore included in ALL Reading Time property editor calculations.]]></Value>
78+
</invariantText>
79+
<readingTime>
80+
<Value Culture="en-gb"><![CDATA[<span>
81+
49 seconds
82+
</span>
83+
]]></Value>
84+
<Value Culture="sv"><![CDATA[<span>
85+
12 sekunder
86+
</span>
87+
]]></Value>
88+
</readingTime>
89+
<readingTimeInvariant>
90+
<Value><![CDATA[<span>
91+
5 seconds
92+
</span>
93+
<div class="alert alert-warning mt-2">Language specfic properties are not used in this calculation</div>]]></Value>
94+
</readingTimeInvariant>
95+
<readingTimeInvariantSlim>
96+
<Value><![CDATA[<span>
97+
5 seconds
98+
</span>
99+
]]></Value>
100+
</readingTimeInvariantSlim>
101+
</Properties>
102+
</Content>

src/TestSite.13/uSync/v9/ContentTypes/home.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
<Template Key="c0fb54cd-9215-45a8-9344-83d1dc312dec">Home</Template>
2323
</AllowedTemplates>
2424
</Info>
25-
<Structure />
25+
<Structure>
26+
<ContentType Key="df6f6fab-96c4-4e0d-a222-b447fc1f9120" SortOrder="0">invariantExample</ContentType>
27+
</Structure>
2628
<GenericProperties />
2729
<Tabs />
2830
</ContentType>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ContentType Key="df6f6fab-96c4-4e0d-a222-b447fc1f9120" Alias="invariantExample" Level="1">
3+
<Info>
4+
<Name>Invariant Example</Name>
5+
<Icon>icon-item-arrangement</Icon>
6+
<Thumbnail>folder.png</Thumbnail>
7+
<Description></Description>
8+
<AllowAtRoot>False</AllowAtRoot>
9+
<IsListView>False</IsListView>
10+
<Variations>Culture</Variations>
11+
<IsElement>false</IsElement>
12+
<HistoryCleanup>
13+
<PreventCleanup>False</PreventCleanup>
14+
<KeepAllVersionsNewerThanDays></KeepAllVersionsNewerThanDays>
15+
<KeepLatestVersionPerDayForDays></KeepLatestVersionPerDayForDays>
16+
</HistoryCleanup>
17+
<Compositions>
18+
<Composition Key="ed5e3d7d-6e97-4bbb-bcaf-e02a0e0f09bf">basePage</Composition>
19+
</Compositions>
20+
<DefaultTemplate>InvariantExample</DefaultTemplate>
21+
<AllowedTemplates>
22+
<Template Key="ac68c8b8-2201-40b3-a16e-c701bcc6939a">InvariantExample</Template>
23+
</AllowedTemplates>
24+
</Info>
25+
<Structure />
26+
<GenericProperties>
27+
<GenericProperty>
28+
<Key>fdc4867f-2efd-4620-81e8-9ebb4f8b0eb3</Key>
29+
<Name>Invariant Text</Name>
30+
<Alias>invariantText</Alias>
31+
<Definition>c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3</Definition>
32+
<Type>Umbraco.TextArea</Type>
33+
<Mandatory>false</Mandatory>
34+
<Validation></Validation>
35+
<Description><![CDATA[]]></Description>
36+
<SortOrder>0</SortOrder>
37+
<Tab Alias="invariantContentSharedAcrossAllLanguages">Invariant Content - Shared across all languages</Tab>
38+
<Variations>Nothing</Variations>
39+
<MandatoryMessage></MandatoryMessage>
40+
<ValidationRegExpMessage></ValidationRegExpMessage>
41+
<LabelOnTop>false</LabelOnTop>
42+
</GenericProperty>
43+
<GenericProperty>
44+
<Key>9a270f30-39b9-4f3a-9579-198156a21784</Key>
45+
<Name>Reading Time Invariant</Name>
46+
<Alias>readingTimeInvariant</Alias>
47+
<Definition>31769ba0-a894-4da7-af48-a5de1afbecf3</Definition>
48+
<Type>jcdcdev.ReadingTime</Type>
49+
<Mandatory>false</Mandatory>
50+
<Validation></Validation>
51+
<Description><![CDATA[]]></Description>
52+
<SortOrder>1</SortOrder>
53+
<Tab Alias="invariantContentSharedAcrossAllLanguages">Invariant Content - Shared across all languages</Tab>
54+
<Variations>Nothing</Variations>
55+
<MandatoryMessage></MandatoryMessage>
56+
<ValidationRegExpMessage></ValidationRegExpMessage>
57+
<LabelOnTop>false</LabelOnTop>
58+
</GenericProperty>
59+
<GenericProperty>
60+
<Key>1d537f62-475d-4707-af7f-3876f88c896e</Key>
61+
<Name>Reading Time Invariant Slim</Name>
62+
<Alias>readingTimeInvariantSlim</Alias>
63+
<Definition>57d4574b-2e1a-449d-9c43-68ae6bce6a49</Definition>
64+
<Type>jcdcdev.ReadingTime</Type>
65+
<Mandatory>false</Mandatory>
66+
<Validation></Validation>
67+
<Description><![CDATA[The warning has been hidden in the data type settings 😎]]></Description>
68+
<SortOrder>2</SortOrder>
69+
<Tab Alias="invariantContentSharedAcrossAllLanguages">Invariant Content - Shared across all languages</Tab>
70+
<Variations>Nothing</Variations>
71+
<MandatoryMessage></MandatoryMessage>
72+
<ValidationRegExpMessage></ValidationRegExpMessage>
73+
<LabelOnTop>false</LabelOnTop>
74+
</GenericProperty>
75+
</GenericProperties>
76+
<Tabs>
77+
<Tab>
78+
<Key>601b3fc4-4890-4436-a2f6-b216eaf113d6</Key>
79+
<Caption>Invariant Content - Shared across all languages</Caption>
80+
<Alias>invariantContentSharedAcrossAllLanguages</Alias>
81+
<Type>Group</Type>
82+
<SortOrder>1</SortOrder>
83+
</Tab>
84+
</Tabs>
85+
</ContentType>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DataType Key="57d4574b-2e1a-449d-9c43-68ae6bce6a49" Alias="Invariant Example - Reading Time Invariant Slim - ReadingTime Information" Level="1">
3+
<Info>
4+
<Name>Invariant Example - Reading Time Invariant Slim - ReadingTime Information</Name>
5+
<EditorAlias>jcdcdev.ReadingTime</EditorAlias>
6+
<DatabaseType>Nvarchar</DatabaseType>
7+
</Info>
8+
<Config><![CDATA[{
9+
"HideVariationWarning": true,
10+
"Max": 1,
11+
"MaxUnit": 1,
12+
"Min": 1,
13+
"MinUnit": 1,
14+
"WordsPerMinute": 200
15+
}]]></Config>
16+
</DataType>

src/TestSite.13/uSync/v9/DataTypes/ReadingTime.config

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
<DatabaseType>Nvarchar</DatabaseType>
77
</Info>
88
<Config><![CDATA[{
9-
"Max": 2,
10-
"MaxUnit": 2,
11-
"Min": 2,
12-
"MinUnit": 2,
9+
"HideVariationWarning": false,
10+
"Max": 1,
11+
"MaxUnit": 1,
12+
"Min": 1,
13+
"MinUnit": 1,
1314
"WordsPerMinute": 200
1415
}]]></Config>
1516
</DataType>

src/TestSite.13/uSync/v9/DataTypes/BasePageReadingTimeReadingTimeInformation.config renamed to src/TestSite.13/uSync/v9/DataTypes/ReadingTimeInformation.config

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<DataType Key="9631013e-2da7-40a7-8b5f-b9cbd3877eab" Alias="Base Page - Reading Time - ReadingTime Information" Level="1">
2+
<DataType Key="31769ba0-a894-4da7-af48-a5de1afbecf3" Alias="ReadingTime Information" Level="1">
33
<Info>
4-
<Name>Base Page - Reading Time - ReadingTime Information</Name>
4+
<Name>ReadingTime Information</Name>
55
<EditorAlias>jcdcdev.ReadingTime</EditorAlias>
66
<DatabaseType>Nvarchar</DatabaseType>
77
</Info>
88
<Config><![CDATA[{
9-
"Max": 2,
10-
"MaxUnit": 2,
9+
"HideVariationWarning": false,
10+
"Max": 1,
11+
"MaxUnit": 1,
1112
"Min": 1,
1213
"MinUnit": 1,
1314
"WordsPerMinute": 200
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Template Key="07ccfaf6-9925-4577-87f0-e813e999c5cb" Alias="HomeInvariant" Level="1">
3+
<Name>Home Invariant</Name>
4+
<Parent />
5+
</Template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Template Key="ac68c8b8-2201-40b3-a16e-c701bcc6939a" Alias="InvariantExample" Level="1">
3+
<Name>Invariant Example</Name>
4+
<Parent />
5+
</Template>

0 commit comments

Comments
 (0)