From 3775948df6ebe341967ae532ee282442b463aa58 Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Fri, 22 Jul 2022 15:40:56 +0700 Subject: [PATCH] Show the number of likes, comments and shares even if the user was not logged in i didn't know how to call a commit in short --- .../templates/components/post/oldpost.xml | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index fd593c35..b4eec2d2 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -59,12 +59,17 @@ -
- {if $post->canBeDeletedBy($thisUser) && !($forceNoDeleteLink ?? false)} +
+ {if is_null($thisUser)} + {var $forceNoDeleteLink = true} + {var $forceNoPinLink = true} + {/if} + + {if !($forceNoDeleteLink ?? false) && $post->canBeDeletedBy($thisUser)} {_delete}  |  {/if} - {if $post->canBePinnedBy($thisUser) && !($forceNoPinLink ?? false)} + {if !($forceNoPinLink ?? false) && $post->canBePinnedBy($thisUser)} {if $post->isPinned()} {_unpin} {else} @@ -84,7 +89,7 @@  |  {/if} - + {_share} {if $post->getRepostCount() > 0} ({$post->getRepostCount()}) @@ -92,11 +97,18 @@