diff Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/Object.cshtml @ 86:723aed93a0e6

Template de Object y Tooltip
author nelopauselli
date Wed, 25 May 2011 01:53:31 -0300
parents
children 222362c29416
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/Object.cshtml	Wed May 25 01:53:31 2011 -0300
@@ -0,0 +1,27 @@
+@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 && !metadata.IsComplexType && !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>
+        }
+    }
+}
\ No newline at end of file