private ActionResult LoadCategory(string uf, string city, string categoryUrl) { var category = RoteirosService.GetCategoryByUrl(categoryUrl); var model = new RoteirosCategory { //Base Title = "Roteiros - Massa News", Description = "Roteiros. Saiba mais!", Robots = "index, follow", Canonical = $"{Constants.UrlWeb}/dev/roteiros", //Model Menu = GetMenu(uf, city, categoryUrl), Destaque = new Destaque { Titulo = category.Nome, Link = $"/roteiros/{uf}/{city}/{category.Url}", Estabelecimentos = category.GetEstablishments().Select(DestatqueItem.Map) } }; ViewBag.ActiveNav = category.Nome; return(View("Categoria", model)); }
public ActionResult LoadNextEstablishment(string establishmentUrl) { //Remove .html establishmentUrl = establishmentUrl.Remove(establishmentUrl.Length - 5, 5); var url = establishmentUrl.TrimStart('/').Split('/').Last(); var establishment = RoteirosService.GetEstablishmentByUrl(url); return(PartialView("_EstablishmentItem", establishment)); }
private IEnumerable <Models.Roteiros.MenuItem> GetMenu(string uf, string city, string categoryUrl) { var lstCategorias = RoteirosService.GetAllMainCategories().ToList(); lstCategorias.Insert(0, new CategoriaEstabelecimento { Nome = "Destaque", Url = "destaque", Icone = "fa-star", }); return(lstCategorias.Select(s => Models.Roteiros.MenuItem.Map(s, uf, city, categoryUrl))); }
private IEnumerable <Destaque> GetDestaques(string uf, string city, string categoryUrl) { var lstCategorias = RoteirosService.GetAllMainCategories().ToList(); lstCategorias.Insert(0, new CategoriaEstabelecimento { Nome = "Destaque", Url = "destaque", Icone = "fa-star", }); var lstDestaques = lstCategorias.Select(c => new Destaque { Titulo = c.Nome, Link = $"/roteiros/{uf}/{city}/{c.Url}", Estabelecimentos = c.GetHighlights().Select(DestatqueItem.Map) }); return(lstDestaques); }
private ActionResult LoadEstablishment(string uf, string city, string category, string subCategory, string url) { var establishment = RoteirosService.GetEstablishmentByUrl(url); var model = new RoteirosEstablishments { //Base Title = "Roteiros - Massa News", Description = "Roteiros. Saiba mais!", Robots = "index, follow", Canonical = $"{Constants.UrlWeb}/dev/roteiros", //Model Establishment = establishment }; ViewBag.NavItems = establishment.Categoria.GetEstablishments().Select(s => new NoticiaNavItem(s, s.Id == establishment.Id)); ViewBag.ActiveNav = establishment.CategoriaPaiNome; return(View("Establishment", model)); }