-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from Lombiq/issue/OFFI-30
OFFI-30: Add read-only editor type for TextField
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
Lombiq.HelpfulExtensions/Views/TextField-Label.Edit.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |