From 8f8d7bbe2f9cc14b11de225d03050626119375c0 Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Sat, 25 Dec 2021 20:16:42 +0300 Subject: [PATCH] Reports: Ability to hide Share and Like buttons Also renamed the .sql file --- Web/Presenters/templates/Report/View.xml | 2 +- .../components/post/microblogpost.xml | 52 +++++++++++-------- .../templates/components/post/oldpost.xml | 44 +++++++++------- .../{00014-reports.sql => 00017-reports.sql} | 0 4 files changed, 55 insertions(+), 43 deletions(-) rename install/sqls/{00014-reports.sql => 00017-reports.sql} (100%) diff --git a/Web/Presenters/templates/Report/View.xml b/Web/Presenters/templates/Report/View.xml index b82540e6..a9e782d6 100644 --- a/Web/Presenters/templates/Report/View.xml +++ b/Web/Presenters/templates/Report/View.xml @@ -10,7 +10,7 @@ {block content}

{_comment}: {$report->getReason()}

-{include "../components/post/oldpost.xml", post => $report->getContentObject()} +{include "../components/post/oldpost.xml", post => $report->getContentObject(), forceNoDeleteLink => TRUE, forceNoShareLink => TRUE, forceNoLike => TRUE}
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} -
- {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}
diff --git a/install/sqls/00014-reports.sql b/install/sqls/00017-reports.sql similarity index 100% rename from install/sqls/00014-reports.sql rename to install/sqls/00017-reports.sql