Skip to content

Commit

Permalink
Merge pull request #164 from Lombiq/issue/OFFI-30
Browse files Browse the repository at this point in the history
OFFI-30: Add read-only editor type for TextField
  • Loading branch information
wAsnk authored Apr 26, 2024
2 parents 2ed63fd + 3de4da5 commit 3a5b67a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Lombiq.HelpfulExtensions/Views/TextField-Label.Edit.cshtml
Original file line number Diff line number Diff line change
@@ -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<TextFieldSettings>();
}

<div class="@Orchard.GetFieldWrapperClasses(Model.PartFieldDefinition)" id="@Html.IdFor(x => x.Text)_FieldWrapper">
<label class="@Orchard.GetLabelClasses()">@Model.PartFieldDefinition.DisplayName()</label>
<div class="@Orchard.GetEndClasses()">
<strong>@(Model.Text ?? T["<empty>"].Value)</strong>
@if (!string.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</div>
</div>
4 changes: 4 additions & 0 deletions Lombiq.HelpfulExtensions/Views/TextField-Label.Option.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@{
string currentEditor = Model.Editor;
}
<option value="Label" selected="@(currentEditor == "Label")">@T["Label (read-only)"]</option>

0 comments on commit 3a5b67a

Please sign in to comment.