public GetArticleStubIndex ( ) : |
||
Résultat |
/*public ActionResult Directory() { return View(UsersCollection.All()); }*/ public ActionResult Archive() { //if (MobileHelper.IsMobileDevice(Request.UserAgent)) return RedirectToAction("about", "mobile"); ViewBag.Archive = true; ViewBag.Home = false; var model = new PostworthyArticleModel(PrimaryUser); return View(model.GetArticleStubIndex()); }
public ActionResult Index(DateTime? id = null, string slug = null) { var p = Request.QueryString["p"]; if (!string.IsNullOrEmpty(p)) { Session[p] = Request.Url.ToString(); return RedirectToAction("Details", "Article", new { id = p, slug = "p" }); } if (Request.Url.ToString().ToLower().Contains("/home/article?id=") || Request.Url.ToString().ToLower().Contains("/home/article/?id=")) { Session[Request.QueryString["id"]] = Request.Url.ToString(); return RedirectToAction("Details", "Article", new { id = Request.QueryString["id"], slug = "p" }); } DateTime date = DateTime.Now; if (id.HasValue) { date = id.Value; if (!string.IsNullOrEmpty(slug)) { switch (slug) { case PHOTOS_SLUG: return Photos(DateTime.Now.ToShortDateString() != date.ToShortDateString() ? (DateTime?)date : null); case VIDEOS_SLUG: return Videos(DateTime.Now.ToShortDateString() != date.ToShortDateString() ? (DateTime?)date : null); default: return Video(DateTime.Now.ToShortDateString() != date.ToShortDateString() ? (DateTime?)date : null, slug); } } } var model = new PostworthyArticleModel(PrimaryUser); var articles = model.GetArticleIndex(); if (articles.Articles.Count >= 5 && !id.HasValue && PrimaryUser.EnableFrontPage) return FrontPage(); ViewBag.Date = date; ViewBag.ArticleStubIndex = model.GetArticleStubIndex(); ViewBag.ArticlesIndex = articles; return View(model.GetArticleStubPage(date)); }