@using MileageTraker.Web.Utility
@{
    Layout = null;
    var lowerPropertyName = @CustomExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
    var units = (string)ViewData.ModelMetadata.AdditionalValues["Units"];
	var color = ViewData.ModelMetadata.PropertyName == "Color" ? Model : "";
}

<dl class="dl-horizontal @lowerPropertyName">
    <dt>
        @Html.ViewData.ModelMetadata.DisplayName
    </dt>
    @if (string.IsNullOrEmpty(color))
    {
        <dd>
            @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>