diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml index d1709a4c16a..ae181f40db2 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Views/BackgroundTask/Edit.cshtml @@ -1,4 +1,4 @@ -@using OrchardCore; +@using OrchardCore @model BackgroundTaskViewModel

@RenderTitleSegments(T["Edit Task Settings"])

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 ee7a7b7bec3..94e60154d71 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField-Switch.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField-Switch.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml index 2ef73ee182f..ad391cc7e13 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/BooleanField.Edit.cshtml @@ -3,10 +3,9 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml index f4db31ad250..28b62ac3ba2 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml @@ -7,7 +7,6 @@ var selectedItems = JsonConvert.SerializeObject(Model.SelectedItems, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); var partName = Model.PartFieldDefinition.PartDefinition.Name; var fieldName = Model.PartFieldDefinition.Name; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; var searchUrl = Url.RouteUrl(new { area = "OrchardCore.ContentFields", controller = "ContentPickerAdmin", action = "SearchContentItems", part = partName, field = fieldName }); var vueElementId = $"ContentPicker_{partName}_{fieldName}_{Guid.NewGuid().ToString("n")}"; var multiple = settings.Multiple.ToString().ToLowerInvariant(); @@ -16,7 +15,7 @@ -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateField.Edit.cshtml index ed8e557107f..c59e3adac2d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateField.Edit.cshtml @@ -2,11 +2,10 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateTimeField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateTimeField.Edit.cshtml index cdfe34b4495..96f1e28f126 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateTimeField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/DateTimeField.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Monaco.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Monaco.Edit.cshtml index 0e2706f634e..3a4edc1c3b3 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Monaco.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Monaco.Edit.cshtml @@ -4,10 +4,9 @@ var settings = Model.PartFieldDefinition.GetSettings(); var monacoSettings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@await DisplayAsync(await New.ShortcodeModal()) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Multiline.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Multiline.Edit.cshtml index 3d24bbcc49a..32b3ddcea65 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Multiline.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Multiline.Edit.cshtml @@ -3,10 +3,9 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@await DisplayAsync(await New.ShortcodeModal()) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Trumbowyg.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Trumbowyg.Edit.cshtml index 1eb43f51cf2..b3d9ba82a5b 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Trumbowyg.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Trumbowyg.Edit.cshtml @@ -6,7 +6,6 @@ var settings = Model.PartFieldDefinition.GetSettings(); var trumbowygSettings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } @@ -21,7 +20,7 @@ else } -
+
@await DisplayAsync(await New.ShortcodeModal()) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml index 22424a86cc8..c316f703573 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml @@ -5,7 +5,6 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } @@ -13,7 +12,7 @@ -
+
@await DisplayAsync(await New.ShortcodeModal()) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField.Edit.cshtml index f9f5e014705..aa1de7882f3 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField.Edit.cshtml @@ -3,10 +3,9 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@await DisplayAsync(await New.ShortcodeModal()) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LinkField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LinkField.Edit.cshtml index 32844ef865a..5a4c288161f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LinkField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LinkField.Edit.cshtml @@ -6,11 +6,10 @@ var isTextRequired = settings.LinkTextMode == LinkTextMode.Required && string.IsNullOrWhiteSpace(settings.DefaultText); var urlClass = settings.Required ? "required" : null; var textClass = settings.LinkTextMode == LinkTextMode.Required ? "required" : null; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; var useFormFloating = string.IsNullOrWhiteSpace(settings.UrlPlaceholder) || string.IsNullOrWhiteSpace(settings.TextPlaceholder); } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LocalizationSetContentPickerField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LocalizationSetContentPickerField.Edit.cshtml index 2ae0bbe3430..9e6710a6c8a 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LocalizationSetContentPickerField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/LocalizationSetContentPickerField.Edit.cshtml @@ -11,7 +11,6 @@ var selectedItems = JsonConvert.SerializeObject(Model.SelectedItems, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); var partName = Model.PartFieldDefinition.PartDefinition.Name; var fieldName = Model.PartFieldDefinition.Name; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; var searchUrl = Url.RouteUrl(new { area = "OrchardCore.ContentFields", controller = "LocalizationSetContentPickerAdmin", action = "SearchLocalizationSets", part = partName, field = fieldName }); var vueElementId = $"LocalizedContentPicker_{partName}_{fieldName}_{Guid.NewGuid().ToString("n")}"; var multiple = settings.Multiple.ToString().ToLowerInvariant(); @@ -20,7 +19,7 @@ -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-CheckboxList.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-CheckboxList.Edit.cshtml index a7d96ce5004..9db7ae68795 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-CheckboxList.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-CheckboxList.Edit.cshtml @@ -10,10 +10,9 @@ Value = option.Value, Selected = Model.Values.Contains(option.Value) }).ToList(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@for (int i = 0; i < options.Count; i++) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-Picker.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-Picker.Edit.cshtml index 905918dd87c..45c7746ddda 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-Picker.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField-Picker.Edit.cshtml @@ -18,7 +18,6 @@ var partName = Model.PartFieldDefinition.PartDefinition.Name; var fieldName = Model.PartFieldDefinition.Name; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; var vueElementId = $"MultiTextField-Picker_{partName}_{fieldName}_{Guid.NewGuid().ToString("n")}"; @@ -28,7 +27,7 @@ -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField.Edit.cshtml index 3699ba2913e..34a96040176 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/MultiTextField.Edit.cshtml @@ -10,10 +10,9 @@ options.Add(new SelectListItem { Text = option.Name, Value = option.Value, Selected = isSelected }); } - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Range.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Range.Edit.cshtml index 3210280c45e..b80eedf46a3 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Range.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Range.Edit.cshtml @@ -10,10 +10,9 @@ string id = Html.IdFor(m => m.Value); string javascriptDecimalSeparator = CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator; string serverDecimalSeparator = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Select.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Select.Edit.cshtml index b6fc6245a1a..4203ac83d04 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Select.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Select.Edit.cshtml @@ -6,10 +6,9 @@ decimal step = (decimal)Math.Pow(10, 0 - settings.Scale); decimal from = settings.Minimum.HasValue ? settings.Minimum.Value : 0; decimal to = settings.Maximum.HasValue ? settings.Maximum.Value : 10; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml index b5800dd1a86..23be2ac55b8 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml @@ -10,12 +10,11 @@ string id = Html.IdFor(m => m.Value); string javascriptDecimalSeparator = CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator; string serverDecimalSeparator = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Spinner.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Spinner.Edit.cshtml index 3d191b7e6d9..d602b9b84ce 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Spinner.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Spinner.Edit.cshtml @@ -13,10 +13,9 @@ string id = Html.IdFor(m => m.Value); string javascriptDecimalSeparator = CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator; string serverDecimalSeparator = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField.Edit.cshtml index 22f6623d5b8..3ec5b5e8961 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField.Edit.cshtml @@ -5,10 +5,9 @@ string name = Model.PartFieldDefinition.DisplayName(); decimal min = settings.Minimum.HasValue ? settings.Minimum.Value : 0; decimal max = settings.Maximum.HasValue ? settings.Maximum.Value : 10000; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-CodeMirror.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-CodeMirror.Edit.cshtml index 3332b1ea577..105824b8d08 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-CodeMirror.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-CodeMirror.Edit.cshtml @@ -3,10 +3,9 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Color.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Color.Edit.cshtml index 6a456a3c97b..31200ccb927 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Color.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Color.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Email.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Email.Edit.cshtml index 0292314dbbc..642b94275e6 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Email.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Email.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml index 36ddefbaf58..dd9057850e0 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml @@ -2,7 +2,6 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } @@ -10,7 +9,7 @@ -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Monaco.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Monaco.Edit.cshtml index 1d6e46177da..ddfcc2ddc67 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Monaco.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Monaco.Edit.cshtml @@ -4,10 +4,9 @@ var settings = Model.PartFieldDefinition.GetSettings(); var monacoSettings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-PredefinedList.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-PredefinedList.Edit.cshtml index 8dc677e3812..5978ac7bf07 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-PredefinedList.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-PredefinedList.Edit.cshtml @@ -14,10 +14,9 @@ options.Add(new SelectListItem { Text = option.Name, Value = option.Value, Selected = isSelected }); } - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@if (listSettings.Editor == EditorOption.Radio) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Tel.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Tel.Edit.cshtml index ee0f0efa5aa..de595587f63 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Tel.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Tel.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-TextArea.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-TextArea.Edit.cshtml index f015923e6cd..964cc10508d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-TextArea.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-TextArea.Edit.cshtml @@ -3,10 +3,9 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Url.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Url.Edit.cshtml index 1c9d6eb4f99..3992757561c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Url.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-Url.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField.Edit.cshtml index 1bc69b349c1..9cf7c284ac1 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField.Edit.cshtml @@ -3,10 +3,9 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TimeField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TimeField.Edit.cshtml index a17bcbc0101..e9cc67726cf 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TimeField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TimeField.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/UserPickerField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/UserPickerField.Edit.cshtml index dba9d442e45..1da0b885bc0 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/UserPickerField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/UserPickerField.Edit.cshtml @@ -7,7 +7,6 @@ var selectedUsers = JsonConvert.SerializeObject(Model.SelectedUsers, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); var partName = Model.PartFieldDefinition.PartDefinition.Name; var fieldName = Model.PartFieldDefinition.Name; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; var contentTypeName = Model.TypePartDefinition.Name; var searchUrl = Url.RouteUrl(new { area = "OrchardCore.ContentFields", controller = "UserPickerAdmin", action = "SearchUsers", part = partName, field = fieldName, contentType = contentTypeName }); var vueElementId = $"UserPicker_{partName}_{fieldName}_{Guid.NewGuid().ToString("n")}"; @@ -17,7 +16,7 @@ -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/YoutubeField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/YoutubeField.Edit.cshtml index 329d6596026..4f8ca1bfa2f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/YoutubeField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/YoutubeField.Edit.cshtml @@ -2,10 +2,9 @@ @using OrchardCore.Mvc.Utilities @{ var settings = Model.PartFieldDefinition.GetSettings(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentPart.Edit.cshtml index ffe9e3bdd3d..d8f71b9204a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentPart.Edit.cshtml @@ -7,13 +7,11 @@ ContentPart contentPart = Model.ContentPart; ContentTypePartDefinition typePartDefinition = Model.ContentTypePartDefinition; var description = typePartDefinition.Description(); - var namedPart = typePartDefinition.PartDefinition.IsReusable() && typePartDefinition.Name != typePartDefinition.PartDefinition.Name; - var name = typePartDefinition.PartDefinition.Name.HtmlClassify(); } -@if (namedPart) +@if (typePartDefinition.IsNamedPart()) { -
+
@typePartDefinition.DisplayName() @@ -33,11 +31,10 @@ } else { -
+
@foreach (var shape in Model) { @await DisplayAsync(shape) - }
} diff --git a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-TextArea.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-TextArea.Edit.cshtml index fe2293f26e0..bdb4a38d5a3 100644 --- a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-TextArea.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-TextArea.Edit.cshtml @@ -3,15 +3,20 @@ @using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.Markdown.Settings @using OrchardCore.Mvc.Utilities +@using OrchardCore @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@await DisplayAsync(await New.ShortcodeModal()) - - - @settings.Hint + +
+ + @if (!string.IsNullOrEmpty(settings.Hint)) + { + @settings.Hint + } +
diff --git a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml index 14fcd2fd778..128c31cb388 100644 --- a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml @@ -3,23 +3,25 @@ @using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.Markdown.Settings @using OrchardCore.Mvc.Utilities +@using OrchardCore @{ var settings = Model.PartFieldDefinition.GetSettings(); var culture = await Orchard.GetContentCultureAsync(Model.Field.ContentItem); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@await DisplayAsync(await New.ShortcodeModal()) - - - @if (!string.IsNullOrEmpty(settings.Hint)) - { - @settings.Hint - } + +
+ + @if (!string.IsNullOrEmpty(settings.Hint)) + { + @settings.Hint + } +
-
+
@if (!string.IsNullOrWhiteSpace(settings.Hint)) diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml index 2f1e22fa240..21a9e9553a8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml @@ -7,12 +7,11 @@ @{ var settings = Model.PartFieldDefinition.GetSettings(); var modalMediaId = "Modal" + Html.IdFor(m => m); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@if (!string.IsNullOrWhiteSpace(settings.Hint)) diff --git a/src/OrchardCore.Modules/OrchardCore.Spatial/Views/GeoPointField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Spatial/Views/GeoPointField.Edit.cshtml index 0ff4a20a116..50bb2c57397 100644 --- a/src/OrchardCore.Modules/OrchardCore.Spatial/Views/GeoPointField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Spatial/Views/GeoPointField.Edit.cshtml @@ -1,3 +1,4 @@ +@using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.Spatial.ViewModels @using OrchardCore.Spatial.Settings @using OrchardCore.Mvc.Utilities @@ -5,10 +6,9 @@ @model EditGeoPointFieldViewModel @{ var settings = Model.PartFieldDefinition.Settings.ToObject(); - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField-Tags.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField-Tags.Edit.cshtml index 4c850e9a7c7..7c8de47647c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField-Tags.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField-Tags.Edit.cshtml @@ -12,7 +12,6 @@ var partName = Model.PartFieldDefinition.PartDefinition.Name; var fieldName = Model.PartFieldDefinition.Name; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; var createTagUrl = Url.Action("Create", "Tag", new { area = "OrchardCore.Taxonomies" }); @@ -28,7 +27,7 @@ -
+
@if (!string.IsNullOrEmpty(taxonomySettings.Hint)) diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField.Edit.cshtml index 84ac611ac9f..cf28ef20589 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField.Edit.cshtml @@ -7,10 +7,9 @@ var settings = Model.PartFieldDefinition.GetSettings(); int previousLevel = 0; int closingDivs = 0; - var uniqueName = $"{Model.PartFieldDefinition.PartDefinition.Name}-{Model.PartFieldDefinition.Name}"; } -
+
@if (!string.IsNullOrEmpty(settings.Hint)) diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinition.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinition.cs index b011bbc51c7..6a5fc9d769d 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinition.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinition.cs @@ -13,5 +13,6 @@ public ContentPartFieldDefinition(ContentFieldDefinition contentFieldDefinition, public ContentFieldDefinition FieldDefinition { get; private set; } public ContentPartDefinition PartDefinition { get; set; } + public ContentTypePartDefinition ContentTypePartDefinition { get; set; } } } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinitionExtensions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinitionExtensions.cs new file mode 100644 index 00000000000..efeced01a83 --- /dev/null +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinitionExtensions.cs @@ -0,0 +1,10 @@ +using OrchardCore.ContentManagement.Metadata.Settings; + +namespace OrchardCore.ContentManagement.Metadata.Models +{ + public static class ContentPartFieldDefinitionExtensions + { + public static bool IsNamedPart(this ContentPartFieldDefinition fieldDefinition) + => fieldDefinition.PartDefinition.IsReusable() && fieldDefinition.ContentTypePartDefinition.Name != fieldDefinition.PartDefinition.Name; + } +} diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartDefinition.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartDefinition.cs index 6b506a4eaf4..7027ffd18d8 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartDefinition.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartDefinition.cs @@ -9,6 +9,11 @@ public ContentTypePartDefinition(string name, ContentPartDefinition contentPartD Name = name; PartDefinition = contentPartDefinition; Settings = settings; + + foreach (var field in PartDefinition.Fields) + { + field.ContentTypePartDefinition = this; + } } public ContentPartDefinition PartDefinition { get; private set; } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartExtensions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartExtensions.cs index 969d1e455f9..72f6df4261f 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartExtensions.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypePartExtensions.cs @@ -1,4 +1,3 @@ -using System; using OrchardCore.ContentManagement.Metadata.Settings; namespace OrchardCore.ContentManagement.Metadata.Models @@ -45,5 +44,8 @@ public static string DisplayMode(this ContentTypePartDefinition typePart) { return typePart.GetSettings().DisplayMode; } + + public static bool IsNamedPart(this ContentTypePartDefinition typePart) + => typePart.PartDefinition.IsReusable() && typePart.Name != typePart.PartDefinition.Name; } } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Display/Razor/CssOrchardHelperExtensions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Display/Razor/CssOrchardHelperExtensions.cs new file mode 100644 index 00000000000..72a5690b049 --- /dev/null +++ b/src/OrchardCore/OrchardCore.ContentManagement.Display/Razor/CssOrchardHelperExtensions.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using OrchardCore.ContentManagement.Metadata.Models; +using OrchardCore.Mvc.Utilities; + +namespace OrchardCore; + +public static class CssOrchardHelper +{ + private const string FieldWrapperPrefix = "field-wrapper"; + private const string PartWrapperPrefix = "content-part-wrapper"; + + public static string GetPartWrapperCssClasses(this IOrchardHelper helper, ContentTypePartDefinition partDefinition) + { + var items = new List() + { + PartWrapperPrefix, + }; + + if (partDefinition != null) + { + items.Add($"{PartWrapperPrefix}-{partDefinition.PartDefinition.Name.HtmlClassify()}"); + + if (partDefinition.IsNamedPart()) + { + items.Add($"{PartWrapperPrefix}-{partDefinition.Name.HtmlClassify()}"); + } + } + + return helper.GetWrapperCssClasses(items.ToArray()); + } + + public static string GetFieldWrapperCssClasses(this IOrchardHelper helper, ContentPartFieldDefinition fieldDefinition) + { + var items = new List() + { + FieldWrapperPrefix + }; + + if (fieldDefinition != null) + { + items.Add($"{FieldWrapperPrefix}-{fieldDefinition.PartDefinition.Name}-{fieldDefinition.Name}".HtmlClassify()); + + if (fieldDefinition.IsNamedPart()) + { + items.Add($"{FieldWrapperPrefix}-{fieldDefinition.ContentTypePartDefinition.Name}-{fieldDefinition.Name}".HtmlClassify()); + } + } + + return helper.GetWrapperCssClasses(items.ToArray()); + } +} diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelper.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelper.cs index ea918af782d..152fd88aba8 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelper.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelper.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.DependencyInjection;