From 579b2fb0dd880cc690f1acebd92bc4b4c99c169c Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Sun, 26 Dec 2021 18:05:22 +0700 Subject: [PATCH] Posts: Ability to hide Share and Like buttons Moved from 8f8d7bb --- .../components/post/microblogpost.xml | 52 +++++++++++-------- .../templates/components/post/oldpost.xml | 44 +++++++++------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index 8c22b51b..b5893981 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -99,34 +99,40 @@ {/if}
- -
- {if $post->getRepostCount() > 0}{$post->getRepostCount()}{/if} -
+ {if !($forceNoShareLink ?? false)} + +
+ {if $post->getRepostCount() > 0}{$post->getRepostCount()}{/if} +
+ {/if} - {var liked = $post->hasLikeFrom($thisUser)} - -
- {if $post->getLikesCount() > 0}{$post->getLikesCount()}{/if} -
+ {if !($forceNoLike ?? false)} + {var liked = $post->hasLikeFrom($thisUser)} + +
+ {if $post->getLikesCount() > 0}{$post->getLikesCount()}{/if} +
+ {/if}
{/if} -
- {if $commentsCount > 3} - {_view_other_comments} - {/if} - {foreach $comments as $comment} - {include "../comment.xml", comment => $comment, $compact => true} - {/foreach} -
- {var commentsURL = "/al_comments.pl/create/posts/" . $post->getId()} - {include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post} + {if !($forceNoCommentsLink ?? false)} +
+ {if $commentsCount > 3} + {_view_other_comments} + {/if} + {foreach $comments as $comment} + {include "../comment.xml", comment => $comment, $compact => true} + {/foreach} +
+ {var commentsURL = "/al_comments.pl/create/posts/" . $post->getId()} + {include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post} +
-
+ {/if} diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index ad256ff9..f59a9cf7 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -91,29 +91,35 @@ {_"comments"} {/if} + {/if} + + {if !($forceNoCommentsLink ?? false) && !($forceNoShareLink ?? false)}  |  {/if} - - {if $post->getRepostCount() > 0} - {_"share"} - ({$post->getRepostCount()}) - {else} - {_"share"} - {/if} - - - - + {/if} + + {if !($forceNoLike ?? false)} + + {/if}