Files
2015-10-08 00:04:17 -04:00

40 lines
1.1 KiB
Plaintext

@using MileageTraker.Web.Utility
@{
Layout = null;
var lowerPropertyName = @CustomExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
var units = (string)ViewData.ModelMetadata.AdditionalValues["Units"];
var currency = (string)ViewData.ModelMetadata.AdditionalValues["Currency"];
var color = ViewData.ModelMetadata.PropertyName == "Color" ? Model : "";
}
<dl class="dl-horizontal @lowerPropertyName">
<dt>
@Html.ViewData.ModelMetadata.DisplayName
</dt>
@if (string.IsNullOrEmpty(color))
{
<dd>
@if (!string.IsNullOrEmpty(currency))
{
<small><em>@currency</em></small>
}
@RenderBody()
@if (!string.IsNullOrEmpty(units))
{
<small><em>@units</em></small>
}
</dd>
}
else
{
<dd>
<span class="label @Html.Encode(color)">
@RenderBody()
</span>
@if (!string.IsNullOrEmpty(units))
{
<small><em>@units</em></small>
}
</dd>
}
</dl>