35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
@using MileageTraker.Web.Utility
|
|
@{
|
|
Layout = null;
|
|
var lowerPropertyName = @CustomExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
|
|
var values = ViewData.ModelMetadata.AdditionalValues;
|
|
var units = values.ContainsKey("Units") ? (string)values["Units"] : null;
|
|
var formatHint = values.ContainsKey("FormatHint") ? (string)values["FormatHint"] : null;
|
|
var editLabel = values.ContainsKey("EditLabel") ? (bool) values["EditLabel"] : true;
|
|
}
|
|
|
|
<div class="control-group @lowerPropertyName">
|
|
@if (editLabel) {
|
|
<div class="control-label">
|
|
@Html.LabelForModel()
|
|
</div>
|
|
}
|
|
<div class="controls">
|
|
@if (!string.IsNullOrEmpty(units))
|
|
{
|
|
<div class="input-append">
|
|
@RenderBody()
|
|
<span class="add-on">@units</span>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
@RenderBody()
|
|
}
|
|
@if (!string.IsNullOrEmpty(formatHint)) {
|
|
<div><small><em>@formatHint</em></small></div>
|
|
}
|
|
<span class="help-block">@Html.ValidationMessage("")</span>
|
|
</div>
|
|
</div>
|