view Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/Object.cshtml @ 285:c8f378272407

#123: Patrocinadores de las vans.
author juanjose.montesdeocaarbos
date Sat, 31 Dec 2011 14:45:55 -0300
parents 222362c29416
children
line wrap: on
line source

@if (ViewData.TemplateInfo.TemplateDepth > 1) {
    if (Model == null) {
        @ViewData.ModelMetadata.NullDisplayText
    } else {
        @ViewData.ModelMetadata.SimpleDisplayText
    }
} else {
    foreach (var prop in ViewData.ModelMetadata.Properties.Where(metadata => metadata.ShowForEdit && !ViewData.TemplateInfo.Visited(metadata)))
	{
        if (prop.HideSurroundingHtml) {
            @Html.Editor(prop.PropertyName)
        } else {
            if (!String.IsNullOrEmpty(Html.Label(prop.PropertyName).ToHtmlString())) {
				if (prop.IsRequired) {
	                <div class="editor-label"><b>@Html.Label(prop.PropertyName)</b></div>
				} else {
	                <div class="editor-label">@Html.Label(prop.PropertyName)</div>
				}
            }
            <div class="editor-field">
			@Html.Editor(prop.PropertyName) 
			@Html.ValidationMessage(prop.PropertyName)
			@Html.Display(prop.PropertyName, "Tooltip")
			</div>
        }
    }
}