From 605d8859178a8f34a660d7052eb1c448e91c1425 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 21 Sep 2026 11:12:20 +0100 Subject: [PATCH 1/4] Rewrite Blogspot Index view with skip/take pagination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renders Prev/Next pager from the Index(string id, int skip, int take) call profile, drops dead .sametitle JS, and replaces the redundant ReadPermission branch and Minutes>0 modifié check. Co-Authored-By: Claude Code --- src/Yavsc.Org/Views/Blogspot/Index.cshtml | 206 +++++++++++++++------- 1 file changed, 138 insertions(+), 68 deletions(-) diff --git a/src/Yavsc.Org/Views/Blogspot/Index.cshtml b/src/Yavsc.Org/Views/Blogspot/Index.cshtml index 1179dba53..9f29a9417 100644 --- a/src/Yavsc.Org/Views/Blogspot/Index.cshtml +++ b/src/Yavsc.Org/Views/Blogspot/Index.cshtml @@ -1,85 +1,155 @@ - @model IEnumerable @{ ViewBag.Title = "Blogs, l'index"; + + // Pagination reflects the Index(string id, int skip, int take) + // call profile. The service applies Skip/Take server-side, so + // the view only needs the current page params to build Prev/Next + // links — it does not receive a total count. + int currentSkip = Context.Request.Query.TryGetValue("skip", out var skipVal) && int.TryParse(skipVal, out var s) ? s : 0; + int currentTake = Context.Request.Query.TryGetValue("take", out var takeVal) && int.TryParse(takeVal, out var t) ? t : 25; + + var posts = Model.ToList(); + bool hasPrev = currentSkip > 0; + bool hasNext = posts.Count >= currentTake; + + int prevSkip = Math.Max(0, currentSkip - currentTake); + int nextSkip = currentSkip + currentTake; + + int maxSummaryLen = 256; } @section header { -} -@section scripts { - + .blog-index .post-meta { + font-size: .8rem; + color: var(--bs-secondary-color, #6c757d); + } + .blog-index .post-author img { + width: 1.25rem; + height: 1.25rem; + border-radius: 50%; + vertical-align: middle; + margin-right: .25rem; + } + .blog-index .actiongroup { + margin-top: .5rem; + display: flex; + gap: .5rem; + } + .blog-index .post-summary { + margin: .25rem 0; + } + .blog-index .post-summary > p:last-child { + margin-bottom: 0; + } + .blog-pager { + display: flex; + justify-content: space-between; + margin-top: 1.5rem; + } + }

@ViewBag.Title

@ViewBag.StatusMessage

-
-@{ - int maxTextLen = 75; - foreach (var post in Model) { -
- - - -
-

@post.Title

-
-
- - @post.Article - @Html.DisplayFor(m => post.Author) - - posté le @post.DateCreated.ToString("dddd d MMM yyyy à H:mm") - @if ((post.DateModified - post.DateCreated).Minutes > 0){ - @:- Modifié le @post.DateModified.ToString("dddd d MMM yyyy à H:mm") - } - -
-
- @if ((await AuthorizationService.AuthorizeAsync(User, post, new ReadPermission())).Succeeded) - { - Details - } - else - { - Details - } - @if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded) - { - Delete - - } -
-
- } +@if (!posts.Any()) +{ +

Néant

} -
+else +{ +
+ @foreach (var post in posts) + { + var canEdit = (await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded; +
+ @if (!string.IsNullOrEmpty(post.Photo)) + { + + @post.Title + + } +
+

+ @post.Title +

+
+ + @post.Article + +
+ +
+ Details + @if (canEdit) + { + Delete + } +
+
+
+ } +
-@if(Model.Count()==0){

Néant

} + +} \ No newline at end of file From 1455ba5187b43862e8a0929078a252ef80ad8abe Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 21 Sep 2026 11:21:33 +0100 Subject: [PATCH 2/4] Restore tree-structured comments in Blog Details The $.psc.blogcomment widget (from the removed wwwroot/js/comment.js) provided reply-to-comment nesting. Rewrite Details.cshtml to drive the same /api/v1/blogcomments endpoint with ParentId, delegating reply clicks so they work across the whole nested tree. Render comment metadata server-side in the Comment view component template (the widget used to add it client-side) and Include Author so nested comments get their author instead of relying on the request-scoped identity map. Co-Authored-By: Claude Code --- .../ViewComponents/CommentViewComponent.cs | 5 +- src/Yavsc.Org/Views/Blogspot/Details.cshtml | 287 +++++++++++++----- .../Shared/Components/Comment/Default.cshtml | 38 ++- 3 files changed, 238 insertions(+), 92 deletions(-) diff --git a/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs b/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs index 6f85a953f..32b7a14b2 100644 --- a/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs +++ b/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs @@ -18,7 +18,10 @@ namespace Yavsc.ViewComponents } public async Task InvokeAsync(long id) { - var comment = await context.Comment.Include(c=>c.Children).FirstOrDefaultAsync(c => c.Id==id); + var comment = await context.Comment + .Include(c => c.Children) + .Include(c => c.Author) + .FirstOrDefaultAsync(c => c.Id==id); if (comment == null) throw new InvalidOperationException(); ViewBag.apictlr = "/api/v1/blogcomments"; diff --git a/src/Yavsc.Org/Views/Blogspot/Details.cshtml b/src/Yavsc.Org/Views/Blogspot/Details.cshtml index a78964c5e..3cf4ff9ee 100644 --- a/src/Yavsc.Org/Views/Blogspot/Details.cshtml +++ b/src/Yavsc.Org/Views/Blogspot/Details.cshtml @@ -1,102 +1,231 @@ @model BlogPost @{ - ViewBag.Title=Model.Title; + ViewBag.Title = Model.Title; } -@section scripts { - - - +@section header { } +@section scripts { + +} + +
+
+ @if (!string.IsNullOrEmpty(Model.Photo)) + { + @Model.Title + } +
+

@Model.Title

+ +
+
+ @Model.Article
- -

@Model.Title

- - @Html.DisplayFor(m=>m.Author) - @Html.DisplayFor(m=>m.Article) -
- @if (Model.Comments!=null) { - foreach (var comment in Model.Comments.Where(c=>c.ParentId==null)) { + @if (Model.Comments != null) + { + foreach (var comment in Model.Comments.Where(c => c.ParentId == null)) + { @await Component.InvokeAsync("Comment", new { id = comment.Id }) } }
-@if (User.GetUserId()!=null) { -
-
- - - - - + + @if (User.GetUserId() != null) + { +
+
+ + + + + +
- -
} - else { -

Vous devez être identifié pour commenter.

+ else + { +

Vous devez être identifié pour commenter.

} Back to List - +
\ No newline at end of file diff --git a/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml b/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml index 4d9344eba..e83ea14c6 100644 --- a/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml +++ b/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml @@ -1,16 +1,30 @@ @model Comment -
+
+
@Model.Article - - @if (Model.Children!=null) { -
- @foreach (var comment in Model.Children) - { - @await this.Component.InvokeAsync("Comment", new { id = comment.Id}); - }
-} -
- + + — @(Model.Author?.UserName ?? "Anonyme"), + posté le @Model.DateCreated.ToString("dddd d MMM yyyy à H:mm") + + @if (User.GetUserId() != null) + { + + } +
+ @if (Model.Children != null) + { + foreach (var comment in Model.Children) + { + @await this.Component.InvokeAsync("Comment", new { id = comment.Id }) + } + } +
+
\ No newline at end of file From 625e062b4b6fa0635d8dd18c692d77fb7ba3e11e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 21 Sep 2026 11:29:33 +0100 Subject: [PATCH 3/4] Fix white-on-white comment blocks in quartz theme Quartz sets white body text on a coloured page background, but --bs-tertiary-bg is near-white in its light variant. The .blogcomment background now uses a semi-transparent black overlay so white text stays legible, matching the dropdown hover fix. Co-Authored-By: Claude Code --- src/Yavsc.Org/Views/Blogspot/Details.cshtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Yavsc.Org/Views/Blogspot/Details.cshtml b/src/Yavsc.Org/Views/Blogspot/Details.cshtml index 3cf4ff9ee..0b07b0d94 100644 --- a/src/Yavsc.Org/Views/Blogspot/Details.cshtml +++ b/src/Yavsc.Org/Views/Blogspot/Details.cshtml @@ -35,7 +35,11 @@ margin: .3em 0; padding: .5rem .75rem; border-left: 3px solid var(--bs-border-color, #dee2e6); - background: var(--bs-tertiary-bg, #f8f9fa); + /* Quartz ships white body text on a coloured page bg, so + use a semi-transparent black overlay rather than + --bs-tertiary-bg (which is near-white in the quartz + light variant and would render white-on-white). */ + background: rgba(0, 0, 0, 0.15); border-radius: .25rem; } .blogcomment .comment-body > :last-child { From 60c10781f05f42b2b104eecf1649b0aeda91eac9 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 21 Sep 2026 12:49:38 +0100 Subject: [PATCH 4/4] deploy in pre and prod : bug fixes --- contrib/Makefile | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/contrib/Makefile b/contrib/Makefile index 8f9beb420..4c7e0e6d6 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -7,8 +7,14 @@ APP_INSTALL_PREFIX=preprod- include .$(APP_INSTALL_ENV).env -generated/: - @mkdir -p $@ +reinstall: copy-binaries + @for project in $(APP_PROJECT_NAMES); do \ + echo "🚀 Starting $(APP_INSTALL_PREFIX)yavsc$${project}" \ + sudo systemctl start $(APP_INSTALL_PREFIX)yavsc$${project} ; done + @echo "💯 backend started" + +reinstall-prod: + make APP_INSTALL_ENV= APP_INSTALL_PREFIX= APP_INSTALL_ENV=production generated/$(APP_INSTALL_PREFIX)yavscOrg.service: generated/$(APP_INSTALL_PREFIX)yavscBlogs.service: @@ -62,7 +68,6 @@ copy-binaries: build_publish_Org build_publish_Blogs build_publish_Api stop-serv @sudo chown -R $(USER_AND_GROUP) $(DESTDIR)$(APPDIR) @sync - $(DESTDIR)/etc/systemd/system/$(APP_INSTALL_PREFIX)yavsc%.service: generated/$(APP_INSTALL_PREFIX)yavsc%.service sudo cp $^ $@ sudo chown root:root $@ @@ -81,21 +86,11 @@ install: copy-binaries copy-services sudo systemctl start yavsc$${project} ; \ done -reinstall: copy-binaries - @for project in $(APP_PROJECT_NAMES); do \ - sudo systemctl start yavsc$${project} ; done - -reinstall-prod: - make APP_INSTALL_ENV= APP_INSTALL_PREFIX= - -reinstall-pre: copy-binaries - @for project in $(APP_PROJECT_NAMES); do \ - sudo systemctl start yavscPre$${project} ; done stop-services: @for project in $(APP_PROJECT_NAMES); \ do \ - sudo systemctl stop yavsc$${project} ; \ + sudo systemctl stop $(APP_INSTALL_PREFIX)yavsc$${project} ; \ done $(SLNDIR)/src/Yavsc.Org/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_publish @@ -118,3 +113,5 @@ showBlogsLogs: clean: @rm -rf generated +generated/: + @mkdir -p $@