Mercurial > altnet-hispano
changeset 167:ea85bd893247
Ajustes menores de UI
author | nelopauselli |
---|---|
date | Sat, 06 Aug 2011 02:51:07 -0300 |
parents | fae2feae499e |
children | 97e51ddeeb58 |
files | Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Agendas/trunk/src/Agendas.Web/Content/Site.css Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/DateTime.cshtml Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/Url.cshtml |
diffstat | 6 files changed, 32 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Fri Aug 05 22:56:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Sat Aug 06 02:51:07 2011 -0300 @@ -225,6 +225,9 @@ <ItemGroup> <Content Include="Views\Shared\EditorTemplates\TimeSpan.cshtml" /> </ItemGroup> + <ItemGroup> + <Content Include="Views\Shared\EditorTemplates\Url.cshtml" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
--- a/Agendas/trunk/src/Agendas.Web/Content/Site.css Fri Aug 05 22:56:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Content/Site.css Sat Aug 06 02:51:07 2011 -0300 @@ -116,10 +116,9 @@ #main { - background: url("themes/altnethispano/images/div_content.gif") repeat-x 50% 100% transparent; + background: url("themes/altnethispano/images/div_content.gif") repeat-x 0 0 #efeff0; padding: 30px 30px 15px 30px; height: 540px; - background-color: #fff; margin-left: auto; margin-right: auto; _height: 1px; /* only IE6 applies CSS properties starting with an underscore */ @@ -133,7 +132,7 @@ line-height: normal; margin: 0; font-size: .9em; - background-color: transparent; + background-color: #efeff0; } /* TAB MENU @@ -180,7 +179,8 @@ ul#menu li a:active { - background-color: #a6e2a6; + background-color: #fff; + color: #000; text-decoration: none; }
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Fri Aug 05 22:56:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Sat Aug 06 02:51:07 2011 -0300 @@ -55,7 +55,7 @@ model.UrlInvitacion, (TipoEvento)model.TipoEvento); if (r.Succeful) { - this.AddNotification("Datos guardados"); + this.AddNotification("Evento creado"); return RedirectToAction("Index"); } ModelState.AddModelError("error", r.ToString()); @@ -67,13 +67,17 @@ public ActionResult Confirmar(string id) { var agenda = AgendaFactory.GetAgenda(); - agenda.Confirmar(new Guid(id)); + + var r = agenda.Confirmar(new Guid(id)); + if (r.Succeful) + this.AddNotification("Evento confirmado"); + else + this.AddError("Evento confirmado"); - this.AddNotification("Evento confirmado"); return RedirectToAction("Index"); } - [Authorize] + [Authorize] public ActionResult Publicar(string id) { var agenda = AgendaFactory.GetAgenda(); @@ -137,7 +141,7 @@ var r = agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha.Value, model.UrlInvitacion); if (r.Succeful) { - this.AddNotification("datos guardados"); + this.AddNotification("evento modificado"); return RedirectToAction("Index"); } ModelState.AddModelError("error", r.ToString()); @@ -198,7 +202,10 @@ var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion, (TipoEvento)model.TipoEvento); if (r.Succeful) + { + this.AddNotification("Evento propuesto"); return RedirectToAction("Index"); + } ModelState.AddModelError("error", r.ToString()); } return View("Defaulteditor", model);
--- a/Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Fri Aug 05 22:56:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Sat Aug 06 02:51:07 2011 -0300 @@ -16,7 +16,8 @@ _resolverByConvention = resolverByConvention; } - protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName) + protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, + Func<object> modelAccessor, Type modelType, string propertyName) { _attributeList = new List<Attribute>(attributes); @@ -24,17 +25,21 @@ if (propertyName != null) { + // Si no hay displayName asignado, lo buscamos entre los recursos if (string.IsNullOrWhiteSpace(modelMetadata.DisplayName)) modelMetadata.DisplayName = _resolverByConvention.GetDisplayName(propertyName); + // Si no hay description asignado, lo buscamos entre los recursos if (string.IsNullOrWhiteSpace(modelMetadata.Description)) modelMetadata.Description = _resolverByConvention.GetDescription(propertyName); - // Auto UIHint por property name. - // TODO: Sería ideal chequear si existe el template antes de asignarlo, ¿cómo? - if (string.IsNullOrWhiteSpace(modelMetadata.TemplateHint)) - modelMetadata.TemplateHint = propertyName; + // Auto UIHint por property name. + // TODO: Sería ideal chequear si existe el template antes de asignarlo, ¿cómo? + if (string.IsNullOrWhiteSpace(modelMetadata.TemplateHint)) + modelMetadata.TemplateHint = propertyName; + // Para cada validador sin texto asignado, tomamos asignamos los valores para ser buscados + // entre los recursos var validators = _attributeList.OfType<ValidationAttribute>(); foreach (var validator in validators) {
--- a/Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/DateTime.cshtml Fri Aug 05 22:56:43 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/DateTime.cshtml Sat Aug 06 02:51:07 2011 -0300 @@ -4,4 +4,4 @@ $("#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)").datepicker({ dateFormat: 'dd-mm-yy' }); }); </script> -@Html.TextBox(string.Empty, (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty)) +@Html.TextBox(string.Empty, (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { style = "width: 80px" })