Skip to content

Commit

Permalink
Keeps private links number … private.
Browse files Browse the repository at this point in the history
Signed-off-by: Thibaud CANALE <[email protected]>
  • Loading branch information
thican committed Nov 18, 2024
1 parent 5f54448 commit 14aecaa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions tpl/default/linklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
{include="page.header"}

<div class="linkcount pure-u-0 pure-u-lg-visible">
{if="!empty($linkcount)"}
<span class="strong">{$linkcount}</span> {function="t('shaare', 'shaares', $linkcount)"}
{if="$privateLinkcount>0"}
{if="$is_logged_in"}
<span class="strong">{$linkcount}</span> total {function="t('shaare', 'shaares', $linkcount)"}
<br><span class="strong">{$privateLinkcount}</span> {function="t('private link', 'private links', $privateLinkcount)"}
{/if}
{else}
<span class="strong">{$publicLinkcount}</span> {function="t('shaare', 'shaares', $publicLinkcount)"}
{/if}
</div>

Expand Down Expand Up @@ -56,11 +56,11 @@
<div class="pure-u-lg-2-24 pure-u-1-24"></div>
<div id="link-count-content" class="pure-u-lg-20-24 pure-u-22-24">
<div class="linkcount pure-u-lg-0 center">
{if="!empty($linkcount)"}
<span class="strong">{$linkcount}</span> {function="t('shaare', 'shaares', $linkcount)"}
{if="$privateLinkcount>0"}
{if="$is_logged_in"}
<span class="strong">{$linkcount}</span> total {function="t('shaare', 'shaares', $linkcount)"}
&middot; <span class="strong">{$privateLinkcount}</span> {function="t('private link', 'private links', $privateLinkcount)"}
{/if}
{else}
<span class="strong">{$publicLinkcount}</span> {function="t('shaare', 'shaares', $publicLinkcount)"}
{/if}
</div>

Expand Down
8 changes: 6 additions & 2 deletions tpl/vintage/page.header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
<div id="logo" title="Share your links !" onclick="document.location='{$titleLink}';"></div>

<div id="linkcount" class="nomobile">
{if="!empty($linkcount)"}{$linkcount} links{/if}<br>
{if="!empty($privateLinkcount)"}{$privateLinkcount} private links{/if}
{if="$is_logged_in"}
{$linkcount} total links<br>
{$privateLinkcount} private links
{else}
{$publicLinkcount} links
{/if}
</div>

<div id="menu">
Expand Down

0 comments on commit 14aecaa

Please sign in to comment.