33 lines
774 B
Plaintext
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> |