2022-04-24 08:06:45 +03:00
|
|
|
|
{var $author = $comment->getOwner()}
|
2021-12-04 22:46:26 +03:00
|
|
|
|
{var $Club = openvk\Web\Models\Entities\Club::class}
|
2022-04-24 08:06:45 +03:00
|
|
|
|
{var $postId = $comment->getTarget() instanceof \openvk\Web\Models\Entities\Post ? $comment->getTarget()->getId() : NULL}
|
2020-06-07 19:04:43 +03:00
|
|
|
|
|
|
|
|
|
<a name="cid={$comment->getId()}"></a>
|
2021-12-17 22:30:39 +03:00
|
|
|
|
<table border="0" style="font-size: 11px;" class="post comment" id="_comment{$comment->getId()}" data-comment-id="{$comment->getId()}" data-owner-id="{$author->getId()}" data-from-group="{$comment->getOwner() instanceof $Club}" n:attr="data-post-id => $postId">
|
2020-06-07 19:04:43 +03:00
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
2021-11-28 14:39:42 +03:00
|
|
|
|
<td width="30" valign="top">
|
2022-02-05 20:24:46 +03:00
|
|
|
|
<a href="{$author->getURL()}">
|
2022-04-05 14:39:13 +03:00
|
|
|
|
<img src="{$author->getAvatarURL('miniscule')}" width="30" class="cCompactAvatars" />
|
2022-02-05 20:24:46 +03:00
|
|
|
|
</a>
|
2020-06-07 19:04:43 +03:00
|
|
|
|
</td>
|
2021-11-30 18:34:07 +03:00
|
|
|
|
<td width="100%" valign="top">
|
2020-06-07 19:04:43 +03:00
|
|
|
|
<div class="post-author">
|
|
|
|
|
<a href="{$author->getURL()}"><b>
|
|
|
|
|
{$author->getCanonicalName()}
|
2022-01-08 17:01:29 +03:00
|
|
|
|
</b></a>
|
2022-03-24 15:29:00 +03:00
|
|
|
|
<img n:if="$author->isVerified()" class="name-checkmark" src="/assets/packages/static/openvk/img/checkmark.png"><br/>
|
2020-06-07 19:04:43 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div class="post-content" id="{$comment->getId()}">
|
|
|
|
|
<div class="text" id="text{$comment->getId()}">
|
|
|
|
|
{$comment->getText()|noescape}
|
2021-10-12 14:17:21 +03:00
|
|
|
|
|
|
|
|
|
<div n:ifcontent class="attachments_b">
|
|
|
|
|
<div class="attachment" n:foreach="$comment->getChildren() as $attachment" data-localized-nsfw-text="{_nsfw_warning}">
|
|
|
|
|
{include "attachment.xml", attachment => $attachment}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-06-07 19:04:43 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu">
|
2023-08-15 02:12:48 +03:00
|
|
|
|
<a
|
|
|
|
|
href="{=$linkWithPost && get_class($comment->getTarget()) == 'openvk\Web\Models\Entities\Post' ? '/wall' . $comment->getTarget()->getPrettyId() : ''}#_comment{$comment->getId()}"
|
|
|
|
|
class="date"
|
|
|
|
|
>
|
|
|
|
|
{$comment->getPublicationTime()}
|
|
|
|
|
</a>
|
2023-08-11 16:50:19 +03:00
|
|
|
|
{if !$timeOnly}
|
|
|
|
|
|
|
|
|
|
|
{if $comment->canBeDeletedBy($thisUser)}
|
|
|
|
|
<a href="/comment{$comment->getId()}/delete">{_delete}</a> |
|
|
|
|
|
{/if}
|
|
|
|
|
<a class="comment-reply">{_reply}</a>
|
|
|
|
|
{if $thisUser->getId() != $comment->getOwner()->getId()}
|
|
|
|
|
{var $canReport = true}
|
|
|
|
|
| <a href="javascript:reportComment()">Пожаловаться</a>
|
|
|
|
|
{/if}
|
|
|
|
|
<div style="float: right; font-size: .7rem;">
|
|
|
|
|
<a class="post-like-button" href="/comment{$comment->getId()}/like?hash={rawurlencode($csrfToken)}">
|
|
|
|
|
<div class="heart" style="{if $comment->hasLikeFrom($thisUser)}opacity: 1;{else}opacity: 0.4;{/if}"></div>
|
|
|
|
|
<span class="likeCnt">{if $comment->getLikesCount() > 0}{$comment->getLikesCount()}{/if}</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
2023-06-13 20:57:49 +03:00
|
|
|
|
{var $target = "wall"}
|
|
|
|
|
|
|
|
|
|
{if get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Note"}
|
|
|
|
|
{php $target = "note"}
|
|
|
|
|
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Post"}
|
|
|
|
|
{php $target = "wall"}
|
|
|
|
|
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Photo"}
|
|
|
|
|
{php $target = "photo"}
|
|
|
|
|
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Video"}
|
|
|
|
|
{php $target = "video"}
|
|
|
|
|
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Topic"}
|
|
|
|
|
{php $target = "topic"}
|
|
|
|
|
{/if}
|
|
|
|
|
|
2023-08-11 17:17:56 +03:00
|
|
|
|
|
|
|
|
|
<span n:if="$compact ?? false">
|
|
|
|
|
|
2023-08-11 17:10:18 +03:00
|
|
|
|
| <a
|
|
|
|
|
{if is_null($linkW)}
|
|
|
|
|
href="#_comment{$comment->getId()}"
|
|
|
|
|
{else}
|
|
|
|
|
href="{$target}{!is_null($comment->getTarget()) ? $comment->getTarget()->getPrettyId() : $comment->getOwner()->getId()}#_comment{$comment->getId()}"
|
|
|
|
|
{/if}
|
|
|
|
|
class="date"
|
|
|
|
|
>{$comment->getPublicationTime()}</a>
|
2023-08-11 17:17:56 +03:00
|
|
|
|
|
|
|
|
|
</span>
|
2020-06-07 19:04:43 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2023-08-11 16:50:19 +03:00
|
|
|
|
<script n:if="$canReport ?? false">
|
|
|
|
|
function reportComment() {
|
|
|
|
|
uReportMsgTxt = "Вы собираетесь пожаловаться на данный комментарий.";
|
|
|
|
|
uReportMsgTxt += "<br/>Что именно вам кажется недопустимым в этом материале?";
|
|
|
|
|
uReportMsgTxt += "<br/><br/><b>Причина жалобы</b>: <input type='text' id='uReportMsgInput' placeholder='Причина' />"
|
|
|
|
|
|
|
|
|
|
MessageBox("Пожаловаться?", uReportMsgTxt, ["Подтвердить", "Отмена"], [
|
|
|
|
|
(function() {
|
|
|
|
|
res = document.querySelector("#uReportMsgInput").value;
|
|
|
|
|
xhr = new XMLHttpRequest();
|
|
|
|
|
xhr.open("GET", "/report/" + {$comment->getId()} + "?reason=" + res + "&type=comment", true);
|
|
|
|
|
xhr.onload = (function() {
|
|
|
|
|
if(xhr.responseText.indexOf("reason") === -1)
|
|
|
|
|
MessageBox("Ошибка", "Не удалось подать жалобу...", ["OK"], [Function.noop]);
|
|
|
|
|
else
|
|
|
|
|
MessageBox("Операция успешна", "Скоро её рассмотрят модераторы", ["OK"], [Function.noop]);
|
|
|
|
|
});
|
|
|
|
|
xhr.send(null);
|
|
|
|
|
}),
|
|
|
|
|
Function.noop
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
</script>
|