19 lines
948 B
Plaintext
19 lines
948 B
Plaintext
@model object
|
|
@{
|
|
Layout = null;
|
|
var propertyName = ViewData.ModelMetadata.PropertyName;
|
|
var lowerPropertyName = @LeafWeb.Core.Utility.StringExtensions.LowercaseFirst(propertyName);
|
|
var values = ViewData.ModelMetadata.AdditionalValues;
|
|
var units = values.ContainsKey("Units") ? (string)values["Units"] : null;
|
|
var currency = values.ContainsKey("Currency") ? (string)values["Currency"] : null;
|
|
var formatHint = values.ContainsKey("FormatHint") ? (string)values["FormatHint"] : null;
|
|
var editLabel = values.ContainsKey("EditLabel") ? (bool)values["EditLabel"] : true;
|
|
var hasError = ViewData.ModelState[propertyName] != null && ViewData.ModelState[propertyName].Errors.Any();
|
|
var hasErrorClass = hasError ? "has-error" : string.Empty;
|
|
}
|
|
<div class="form-group @lowerPropertyName @hasErrorClass">
|
|
@Html.LabelForModel()
|
|
@RenderBody()
|
|
@Html.ValidationMessage("", new { @class = "form-text"})
|
|
</div>
|