Files
LeafWeb/WebCms/Views/Shared/EditorTemplates/_FieldLayout.cshtml
T
2020-08-18 21:06:08 -04:00

33 lines
774 B
Plaintext

@using StringExtensions = LeafWeb.Core.Utility.StringExtensions
@model object
@{
Layout = null;
var lowerPropertyName = StringExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
var groupClass = $"form-group {lowerPropertyName}";
if (ViewBag.groupClass != null)
{
groupClass = string.Concat(groupClass, " ", ViewBag.groupClass);
}
var labelText = string.Empty;
if (ViewBag.labelText != null)
{
labelText = ViewBag.labelText;
}
}
<div class="@groupClass">
@if (!string.IsNullOrEmpty(labelText))
{
@Html.LabelForModel(labelText)
}
else
{
@Html.LabelForModel()
}
@RenderBody()
@Html.ValidationMessage(string.Empty, new { @class = "text-danger" })
</div>