From d8b1d66cdd12ba721779264a48a772ef1037a949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Tue, 23 Apr 2024 13:48:52 +0200 Subject: [PATCH] Add Textfield edit mode "Label (read-only". --- .../Views/TextField-Label.Edit.cshtml | 19 +++++++++++++++++++ .../Views/TextField-Label.Option.cshtml | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 Lombiq.HelpfulExtensions/Views/TextField-Label.Edit.cshtml create mode 100644 Lombiq.HelpfulExtensions/Views/TextField-Label.Option.cshtml diff --git a/Lombiq.HelpfulExtensions/Views/TextField-Label.Edit.cshtml b/Lombiq.HelpfulExtensions/Views/TextField-Label.Edit.cshtml new file mode 100644 index 00000000..022f3860 --- /dev/null +++ b/Lombiq.HelpfulExtensions/Views/TextField-Label.Edit.cshtml @@ -0,0 +1,19 @@ +@using OrchardCore +@using OrchardCore.ContentFields.Settings +@using OrchardCore.ContentManagement.Metadata.Models +@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel + +@{ + var settings = Model.PartFieldDefinition.GetSettings(); +} + +
+ +
+ @(Model.Text ?? T[""].Value) + @if (!string.IsNullOrEmpty(settings.Hint)) + { + @settings.Hint + } +
+
diff --git a/Lombiq.HelpfulExtensions/Views/TextField-Label.Option.cshtml b/Lombiq.HelpfulExtensions/Views/TextField-Label.Option.cshtml new file mode 100644 index 00000000..90318007 --- /dev/null +++ b/Lombiq.HelpfulExtensions/Views/TextField-Label.Option.cshtml @@ -0,0 +1,4 @@ +@{ + string currentEditor = Model.Editor; +} +