From e4615481d74a52b6d5ff34872ac25d2f84b13533 Mon Sep 17 00:00:00 2001 From: Thibaud CANALE Date: Sat, 16 Nov 2024 22:02:06 +0100 Subject: [PATCH] =?UTF-8?q?Keeps=20private=20links=20number=20=E2=80=A6=20?= =?UTF-8?q?private.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaud CANALE --- .../controller/visitor/ShaarliVisitorController.php | 1 + tpl/default/linklist.html | 12 ++++++------ tpl/vintage/page.header.html | 8 ++++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index d3f28f2f7..ac53f5b4d 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php @@ -61,6 +61,7 @@ protected function render(string $template): string $this->assignView('template', $template); $this->assignView('linkcount', $this->container->bookmarkService->count(BookmarkFilter::$ALL)); + $this->assignView('publicLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PUBLIC)); $this->assignView('privateLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PRIVATE)); $this->executeDefaultHooks($template); diff --git a/tpl/default/linklist.html b/tpl/default/linklist.html index 7208a3b60..e2916fd94 100644 --- a/tpl/default/linklist.html +++ b/tpl/default/linklist.html @@ -7,11 +7,11 @@ {include="page.header"}
- {if="!empty($linkcount)"} + {if="$is_logged_in"} {$linkcount} {function="t('shaare', 'shaares', $linkcount)"} - {if="$privateLinkcount>0"}
{$privateLinkcount} {function="t('private link', 'private links', $privateLinkcount)"} - {/if} + {else} + {$publicLinkcount} {function="t('shaare', 'shaares', $publicLinkcount)"} {/if}
@@ -56,11 +56,11 @@