From 253f41be74e59636ed88c56029ecef1f16973f8f Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 10 Oct 2017 22:06:25 +0200 Subject: [PATCH] Blog index: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on regroupe par titre, indifféremment de l'auteur. --- Yavsc/Controllers/BlogspotController.cs | 5 +++-- Yavsc/Views/Blogspot/Index.cshtml | 21 +++++++++------------ Yavsc/Views/Blogspot/Title.cshtml | 2 +- Yavsc/wwwroot/css/main/site.css | 4 ++++ 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Yavsc/Controllers/BlogspotController.cs b/Yavsc/Controllers/BlogspotController.cs index 6ffdf26d..a1dabdab 100644 --- a/Yavsc/Controllers/BlogspotController.cs +++ b/Yavsc/Controllers/BlogspotController.cs @@ -61,8 +61,9 @@ namespace Yavsc.Controllers .Include(p=>p.ACL).Where(p=>p.AuthorId == uid || p.Visible && p.ACL.Count == 0); } - return View(posts.OrderByDescending( p=> p.DateModified) - .GroupBy(p=> new BlogIndexKey { Title = p.Title, AuthorId = p.AuthorId } ).Skip(skip).Take(maxLen)); + return View(posts.OrderByDescending( p=> p.DateCreated) + + .GroupBy(p=> p.Title).Skip(skip).Take(maxLen)); } [Route("/Title/{id?}")] diff --git a/Yavsc/Views/Blogspot/Index.cshtml b/Yavsc/Views/Blogspot/Index.cshtml index 9cdb39d1..201f40de 100644 --- a/Yavsc/Views/Blogspot/Index.cshtml +++ b/Yavsc/Views/Blogspot/Index.cshtml @@ -1,9 +1,6 @@ -@model IEnumerable> +@model IEnumerable> @{ ViewData["Title"] = "Blogs, l'index"; - // Regroup!?! - @foreach (var group in Model) { - } } @section header {