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()}">
|
2023-09-16 19:14:23 +03:00
|
|
|
<img src="{$author->getAvatarURL('miniscule')}" width="30" class="cCompactAvatars post-avatar" />
|
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">
|
2023-09-16 19:14:23 +03:00
|
|
|
<a href="{$author->getURL()}"><b class="post-author-name">
|
2020-06-07 19:04:43 +03:00
|
|
|
{$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()}">
|
2023-09-16 19:14:23 +03:00
|
|
|
<span data-text="{$comment->getText(false)}" class="really_text">{$comment->getText()|noescape}</span>
|
2021-10-12 14:17:21 +03:00
|
|
|
|
2023-10-03 19:40:13 +03:00
|
|
|
{var $attachmentsLayout = $comment->getChildrenWithLayout(288)}
|
|
|
|
<div n:ifcontent class="attachments attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
|
|
|
|
<div class="attachment" n:foreach="$attachmentsLayout->tiles as $attachment" style="float: {$attachment[3]|noescape}; width: {$attachment[0]|noescape}; height: {$attachment[1]|noescape};" data-localized-nsfw-text="{_nsfw_warning}">
|
|
|
|
{include "attachment.xml", attachment => $attachment[2], parent => $comment, parentType => "comment"}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div n:ifcontent class="attachments attachments_m">
|
|
|
|
<div class="attachment" n:foreach="$attachmentsLayout->extras as $attachment">
|
|
|
|
{include "attachment.xml", attachment => $attachment, post => $comment}
|
2021-10-12 14:17:21 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-07 19:04:43 +03:00
|
|
|
</div>
|
|
|
|
<div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu">
|
2024-10-25 16:28:35 +03:00
|
|
|
<a href="{if $correctLink}{$comment->getTargetURL()}{/if}#_comment{$comment->getId()}" class="date">{$comment->getPublicationTime()}
|
2023-09-14 20:54:22 +03:00
|
|
|
<span n:if="$comment->getEditTime()" class="edited editedMark">({_edited_short})</span>
|
2023-08-15 02:12:48 +03:00
|
|
|
</a>
|
2023-08-11 16:50:19 +03:00
|
|
|
{if !$timeOnly}
|
|
|
|
|
|
|
|
|
{if $comment->canBeDeletedBy($thisUser)}
|
2024-10-25 16:28:35 +03:00
|
|
|
<a href="/comment{$comment->getId()}/delete">{_delete}</a>
|
2023-08-11 16:50:19 +03:00
|
|
|
{/if}
|
2023-09-14 20:54:22 +03:00
|
|
|
{if $comment->canBeEditedBy($thisUser)}
|
2024-10-25 16:28:35 +03:00
|
|
|
|
|
|
|
|
<a id="editPost" data-id="{$comment->getId()}">{_edit}</a>
|
2023-09-14 20:54:22 +03:00
|
|
|
{/if}
|
2024-10-25 16:28:35 +03:00
|
|
|
{if !$no_reply_button}
|
|
|
|
|
|
|
|
|
<a class="comment-reply">{_reply}</a>
|
|
|
|
{/if}
|
|
|
|
{if $thisUser->getId() != $author->getRealId()}
|
|
|
|
|
|
2023-08-11 16:50:19 +03:00
|
|
|
{var $canReport = true}
|
2024-10-25 16:28:35 +03:00
|
|
|
<a href="javascript:reportComment()">{_report}</a>
|
2023-08-11 16:50:19 +03:00
|
|
|
{/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-08-11 17:17:56 +03:00
|
|
|
|
|
|
|
<span n:if="$compact ?? false">
|
|
|
|
|
2023-08-11 17:10:18 +03:00
|
|
|
| <a
|
2024-10-25 16:28:35 +03:00
|
|
|
href="#_comment{$comment->getId()}"
|
2023-08-11 17:10:18 +03:00
|
|
|
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() {
|
2023-09-17 16:22:59 +03:00
|
|
|
uReportMsgTxt = tr("going_to_report_comment");
|
|
|
|
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
|
|
|
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
2023-08-11 16:50:19 +03:00
|
|
|
|
2023-09-17 16:22:59 +03:00
|
|
|
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
2023-08-11 16:50:19 +03:00
|
|
|
(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)
|
2023-09-17 16:22:59 +03:00
|
|
|
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
2023-08-11 16:50:19 +03:00
|
|
|
else
|
2023-09-17 16:22:59 +03:00
|
|
|
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
2023-08-11 16:50:19 +03:00
|
|
|
});
|
|
|
|
xhr.send(null);
|
|
|
|
}),
|
|
|
|
Function.noop
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
</script>
|