-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathBooleanField-Switch.Edit.cshtml
More file actions
22 lines (21 loc) · 1.08 KB
/
BooleanField-Switch.Edit.cshtml
File metadata and controls
22 lines (21 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@model OrchardCore.ContentFields.ViewModels.EditBooleanFieldViewModel
@using OrchardCore.ContentFields
@using OrchardCore.Mvc.Utilities
@using OrchardCore.Localization.Data
@inject IDataLocalizer D
@{
var settings = Model.PartFieldDefinition.GetSettings<BooleanFieldSettings>();
string localizedFieldName = D[Model.PartFieldDefinition.DisplayName(), DataLocalizationContext.ContentField(Model.PartFieldDefinition.PartDefinition.Name)];
}
<div class="@Orchard.GetFieldWrapperClasses(Model.PartFieldDefinition)" id="@Html.IdFor(x => x.Value)_FieldWrapper">
<div class="@Orchard.GetEndClasses(true)">
<div class="form-check form-switch">
<input asp-for="Value" type="checkbox" class="form-check-input content-preview-select" checked="@Model.Value" />
<label asp-for="Value" class="form-check-label">@(string.IsNullOrEmpty(settings.Label) ? localizedFieldName : settings.Label)</label>
@if (!string.IsNullOrEmpty(settings.Hint))
{
<span class="hint dashed">@settings.Hint</span>
}
</div>
</div>
</div>