From b2d58eb09083c2331b307511762c168b0f0c8e2a Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 31 Oct 2023 15:08:17 -0700 Subject: [PATCH 1/6] Improve performance for CssClass extensions --- .../Views/DashboardPart.Edit.cshtml | 10 +- .../Views/AliasPart.Edit.cshtml | 6 +- .../Views/AutoroutePart.Edit.cshtml | 26 ++-- .../Views/BackgroundTask/Edit.cshtml | 32 ++--- .../Views/BooleanField-Switch.Edit.cshtml | 4 +- .../Views/BooleanField.Edit.cshtml | 4 +- .../Views/ContentPickerField.Edit.cshtml | 6 +- .../Views/DateField-Localized.Edit.cshtml | 10 +- .../Views/DateField.Edit.cshtml | 10 +- .../Views/DateTimeField.Edit.cshtml | 10 +- .../Views/HtmlField-Monaco.Edit.cshtml | 6 +- .../Views/HtmlField-Multiline.Edit.cshtml | 6 +- .../Views/HtmlField-Trumbowyg.Edit.cshtml | 6 +- .../Views/HtmlField-Wysiwyg.Edit.cshtml | 6 +- .../Views/HtmlField.Edit.cshtml | 6 +- .../Views/LinkField.Edit.cshtml | 6 +- ...alizationSetContentPickerField.Edit.cshtml | 6 +- .../MultiTextField-CheckboxList.Edit.cshtml | 6 +- .../Views/MultiTextField-Picker.Edit.cshtml | 6 +- .../Views/MultiTextField.Edit.cshtml | 6 +- .../Views/NumericField-Range.Edit.cshtml | 10 +- .../Views/NumericField-Select.Edit.cshtml | 6 +- .../Views/NumericField-Slider.Edit.cshtml | 10 +- .../Views/NumericField-Spinner.Edit.cshtml | 10 +- .../Views/NumericField.Edit.cshtml | 10 +- .../Views/TextField-CodeMirror.Edit.cshtml | 6 +- .../Views/TextField-Color.Edit.cshtml | 6 +- .../Views/TextField-Email.Edit.cshtml | 6 +- .../Views/TextField-IconPicker.Edit.cshtml | 6 +- .../Views/TextField-Monaco.Edit.cshtml | 6 +- .../TextField-PredefinedList.Edit.cshtml | 6 +- .../Views/TextField-Tel.Edit.cshtml | 6 +- .../Views/TextField-TextArea.Edit.cshtml | 6 +- .../Views/TextField-Url.Edit.cshtml | 6 +- .../Views/TextField.Edit.cshtml | 6 +- .../Views/TimeField.Edit.cshtml | 10 +- .../Views/UserPickerField.Edit.cshtml | 6 +- .../Views/YoutubeField.Edit.cshtml | 6 +- .../Views/AuditTrailPart.Edit.cshtml | 6 +- .../Views/CommonPart-Date.Edit.cshtml | 10 +- .../Views/CommonPart-Owner.Edit.cshtml | 6 +- .../Views/Content.Edit.cshtml | 4 +- .../Views/ContentPart-BagPart.Edit.cshtml | 7 +- .../Views/ContentPart-FlowPart.Edit.cshtml | 7 +- .../ContentPart-WidgetsListPart.Edit.cshtml | 7 +- .../Views/ContentPart.Edit.cshtml | 26 ++-- .../Views/FacebookPluginPart.Edit.cshtml | 6 +- ...odelValidationErrorTask.Fields.Edit.cshtml | 12 +- .../Views/Items/ButtonPart.Fields.Edit.cshtml | 12 +- .../FormElementLabelPart.Fields.Edit.cshtml | 12 +- .../Items/FormElementPart.Fields.Edit.cshtml | 6 +- ...rmElementValidationPart.Fields.Edit.cshtml | 6 +- .../FormInputElementPart.Fields.Edit.cshtml | 6 +- .../Views/Items/FormPart.Fields.Edit.cshtml | 22 +-- .../Views/Items/InputPart.Fields.Edit.cshtml | 18 +-- .../Views/Items/LabelPart.Fields.Edit.cshtml | 6 +- .../Views/Items/SelectPart.Fields.Edit.cshtml | 12 +- .../Items/TextAreaPart.Fields.Edit.cshtml | 12 +- .../ValidateFormFieldTask.Fields.Edit.cshtml | 12 +- .../Items/ValidationPart.Fields.Edit.cshtml | 6 +- .../ValidationSummaryPart.Fields.Edit.cshtml | 4 +- .../Views/HtmlBodyPart-Monaco.Edit.cshtml | 4 +- .../Views/HtmlBodyPart-Trumbowyg.Edit.cshtml | 4 +- .../Views/HtmlBodyPart-Wysiwyg.Edit.cshtml | 6 +- .../Views/HtmlBodyPart.Edit.cshtml | 6 +- .../Views/LayerMetadata.Edit.cshtml | 16 +-- .../Views/LiquidPart.Edit.cshtml | 6 +- .../MarkdownBodyPart-Wysiwyg.Edit.cshtml | 6 +- .../Views/MarkdownBodyPart.Edit.cshtml | 6 +- .../Views/MarkdownField-TextArea.Edit.cshtml | 6 +- .../Views/MarkdownField-Wysiwyg.Edit.cshtml | 6 +- .../Views/MarkdownField.Edit.cshtml | 6 +- .../Views/MediaField-Attached.Edit.cshtml | 6 +- .../Views/MediaField.Edit.cshtml | 6 +- .../Views/ContentMenuItemPart.Edit.cshtml | 6 +- .../Views/HtmlMenuItemPart.Edit.cshtml | 14 +- .../Views/LinkMenuItemPart.Edit.cshtml | 12 +- .../Views/MenuItem.Edit.cshtml | 4 +- .../Views/MenuPart.Edit.cshtml | 4 +- .../Views/SearchFormPart.Edit.cshtml | 12 +- .../Views/SeoMetaPart.Edit.cshtml | 34 ++--- .../Views/SitemapPart.Edit.cshtml | 20 +-- .../Views/GeoPointField.Edit.cshtml | 4 +- .../Views/TaxonomyField-Tags.Edit.cshtml | 6 +- .../Views/TaxonomyField.Edit.cshtml | 6 +- .../Views/TaxonomyPart.Edit.cshtml | 10 +- .../Views/TitlePart.Edit.cshtml | 6 +- .../Razor/CssOrchardHelperExtensions.cs | 48 ++++++- .../Html/CssOrchardHelperExtensions.cs | 127 ++++++++++++++++-- 89 files changed, 534 insertions(+), 394 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Views/DashboardPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Views/DashboardPart.Edit.cshtml index 5cb1b391184..193847e2ff0 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Views/DashboardPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Views/DashboardPart.Edit.cshtml @@ -1,15 +1,15 @@ @using OrchardCore @model DashboardPartViewModel -
- -
+
+ +
-
+
@@ -17,7 +17,7 @@
-
+
diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Views/AliasPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Alias/Views/AliasPart.Edit.cshtml index e50848a255c..142e5c92695 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Views/AliasPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Views/AliasPart.Edit.cshtml @@ -7,9 +7,9 @@ var culture = await Orchard.GetContentCultureAsync(Model.AliasPart.ContentItem); } -
- -
+
+ +
diff --git a/src/OrchardCore.Modules/OrchardCore.Autoroute/Views/AutoroutePart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Autoroute/Views/AutoroutePart.Edit.cshtml index 43eff970207..5dec3759694 100644 --- a/src/OrchardCore.Modules/OrchardCore.Autoroute/Views/AutoroutePart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Autoroute/Views/AutoroutePart.Edit.cshtml @@ -15,8 +15,8 @@ @if (Model.Settings.AllowDisabled) { -
-
+
+
@@ -27,9 +27,9 @@ }
-
- -
+
+ +
@if (!string.IsNullOrWhiteSpace(site.BaseUrl)) { @@ -64,8 +64,8 @@ { if (showHomepageOption) { -
-
+
+
@@ -79,8 +79,8 @@ @if (Model.Settings.AllowUpdatePath) { -
-
+
+
@@ -92,8 +92,8 @@ @if (containedContentItemsAspect.Accessors.Any() && Model.Settings.AllowRouteContainedItems) { -
-
+
+
@@ -105,8 +105,8 @@ @if (Model.Settings.ManageContainedItemRoutes && Model.Settings.AllowAbsolutePath) { -
-
+
+
diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml index ae181f40db2..5ed45e665d3 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml @@ -19,22 +19,22 @@
-
- -
+
+ +
-
- -
+
+ +
-
- +
+
@@ -44,8 +44,8 @@
-
-
+
+
@@ -59,18 +59,18 @@
-
- -
+
+ +
@T["The timeout in milliseconds to acquire a lock before executing the task atomically. Leave it to zero to not use any locking."] @T["Ignored if there is no distributed lock feature enabled."]
-
- -
+
+ +
@T["The expiration in milliseconds of the lock acquired before executing the task atomically. Leave it to zero to not use any locking."] @T["Ignored if there is no distributed lock feature enabled."] diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField-Switch.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField-Switch.Edit.cshtml index 94e60154d71..7d9749faf81 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField-Switch.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField-Switch.Edit.cshtml @@ -4,8 +4,8 @@ var settings = Model.PartFieldDefinition.GetSettings(); } -
-
+
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml index ad391cc7e13..211fb2ae095 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml @@ -5,8 +5,8 @@ var settings = Model.PartFieldDefinition.GetSettings(); } -
-
+
+