Reports: Ability to hide Share and Like buttons

Also renamed the .sql file
This commit is contained in:
Ilya Prokopenko 2021-12-25 20:16:42 +03:00
parent 4aadd7cd30
commit 8f8d7bbe2f
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56
4 changed files with 55 additions and 43 deletions

View file

@ -10,7 +10,7 @@
{block content} {block content}
<p><b>{_comment}: </b>{$report->getReason()}</p> <p><b>{_comment}: </b>{$report->getReason()}</p>
{include "../components/post/oldpost.xml", post => $report->getContentObject()} {include "../components/post/oldpost.xml", post => $report->getContentObject(), forceNoDeleteLink => TRUE, forceNoShareLink => TRUE, forceNoLike => TRUE}
<center> <center>
<form action="/admin/reportAction{$report->getId()}" method="post"> <form action="/admin/reportAction{$report->getId()}" method="post">
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />

View file

@ -99,34 +99,40 @@
{/if} {/if}
<div class="like_wrap"> <div class="like_wrap">
<a class="post-share-button" href="javascript:repostPost('{$post->getPrettyId()}', '{rawurlencode($csrfToken)}')"> {if !($forceNoShareLink ?? false)}
<div class="repost-icon" style="opacity: 0.4;"></div> <a class="post-share-button" href="javascript:repostPost('{$post->getPrettyId()}', '{rawurlencode($csrfToken)}')">
<span class="likeCnt">{if $post->getRepostCount() > 0}{$post->getRepostCount()}{/if}</span> <div class="repost-icon" style="opacity: 0.4;"></div>
</a> <span class="likeCnt">{if $post->getRepostCount() > 0}{$post->getRepostCount()}{/if}</span>
</a>
{/if}
{var liked = $post->hasLikeFrom($thisUser)} {if !($forceNoLike ?? false)}
<a href="/wall{$post->getPrettyId()}/like?hash={rawurlencode($csrfToken)}" {var liked = $post->hasLikeFrom($thisUser)}
class="post-like-button" <a href="/wall{$post->getPrettyId()}/like?hash={rawurlencode($csrfToken)}"
data-liked="{(int) $liked}" class="post-like-button"
data-likes="{$post->getLikesCount()}"> data-liked="{(int) $liked}"
<div class="heart" id="{if $liked}liked{/if}"></div> data-likes="{$post->getLikesCount()}">
<span class="likeCnt">{if $post->getLikesCount() > 0}{$post->getLikesCount()}{/if}</span> <div class="heart" id="{if $liked}liked{/if}"></div>
</a> <span class="likeCnt">{if $post->getLikesCount() > 0}{$post->getLikesCount()}{/if}</span>
</a>
{/if}
</div> </div>
{/if} {/if}
</div> </div>
<div n:if="$commentSection == true && $compact == false" class="post-menu-s"> {if !($forceNoCommentsLink ?? false)}
{if $commentsCount > 3} <div n:if="$commentSection == true && $compact == false" class="post-menu-s">
<a href="/wall{$post->getPrettyId()}" class="expand_button">{_view_other_comments}</a> {if $commentsCount > 3}
{/if} <a href="/wall{$post->getPrettyId()}" class="expand_button">{_view_other_comments}</a>
{foreach $comments as $comment} {/if}
{include "../comment.xml", comment => $comment, $compact => true} {foreach $comments as $comment}
{/foreach} {include "../comment.xml", comment => $comment, $compact => true}
<div n:ifset="$thisUser" id="commentTextArea{$commentTextAreaId}" n:attr="style => ($commentsCount == 0 ? 'display: none;')" class="commentsTextFieldWrap"> {/foreach}
{var commentsURL = "/al_comments.pl/create/posts/" . $post->getId()} <div n:ifset="$thisUser" id="commentTextArea{$commentTextAreaId}" n:attr="style => ($commentsCount == 0 ? 'display: none;')" class="commentsTextFieldWrap">
{include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post} {var commentsURL = "/al_comments.pl/create/posts/" . $post->getId()}
{include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post}
</div>
</div> </div>
</div> {/if}
</td> </td>
</tr> </tr>
</tbody> </tbody>

View file

@ -91,29 +91,35 @@
{_"comments"} {_"comments"}
{/if} {/if}
</a> </a>
{/if}
{if !($forceNoCommentsLink ?? false) && !($forceNoShareLink ?? false)}
&nbsp;|&nbsp; &nbsp;|&nbsp;
{/if} {/if}
<a class="post-share-button" href="javascript:repostPost('{$post->getPrettyId()}', '{rawurlencode($csrfToken)}')"> {if !($forceNoShareLink ?? false)}
{if $post->getRepostCount() > 0} <a class="post-share-button" href="javascript:repostPost('{$post->getPrettyId()}', '{rawurlencode($csrfToken)}')">
{_"share"} {if $post->getRepostCount() > 0}
(<b>{$post->getRepostCount()}</b>) {_"share"}
{else} (<b>{$post->getRepostCount()}</b>)
{_"share"} {else}
{/if} {_"share"}
</a> {/if}
<div class="like_wrap">
{var liked = $post->hasLikeFrom($thisUser)}
<a href="/wall{$post->getPrettyId()}/like?hash={rawurlencode($csrfToken)}"
class="post-like-button"
data-liked="{(int) $liked}"
data-likes="{$post->getLikesCount()}">
<div class="heart" id="{if $liked}liked{/if}"></div>
<span class="likeCnt">{if $post->getLikesCount() > 0}{$post->getLikesCount()}{/if}</span>
</a> </a>
</div> {/if}
{if !($forceNoLike ?? false)}
<div class="like_wrap">
{var liked = $post->hasLikeFrom($thisUser)}
<a href="/wall{$post->getPrettyId()}/like?hash={rawurlencode($csrfToken)}"
class="post-like-button"
data-liked="{(int) $liked}"
data-likes="{$post->getLikesCount()}">
<div class="heart" id="{if $liked}liked{/if}"></div>
<span class="likeCnt">{if $post->getLikesCount() > 0}{$post->getLikesCount()}{/if}</span>
</a>
</div>
{/if}
</div> </div>
<div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu-s"> <div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu-s">
<!-- kosfurler --> <!-- kosfurler -->