mirror of
https://github.com/openvk/openvk
synced 2024-11-13 10:39:24 +03:00
6159262026
* Reports: [INDEV] Undone implementation of reports
* Reports: Backend is done
* Reports: Still makin it...
* Reports: Added report window
* Reports: Corrected the content type
* Reports: Make it work
* Reports: Minor fixes and localization
* Reports: Ability to hide Share and Like buttons
Also renamed the .sql file
* Revent some changes from 8f8d7bb
I will move them to the master branch
* Reports: Only for those who can access Helpdesk
* Reports: Modified the route
* Reports: Change the routes
* Reports: Show reports count
* Report: Fix URL
* Обновление репортов (#715)
* Репорты живы
* 2
* Better reports
* Логи
* Update DBEntity.updated.php
* noSpam
* Сбор IP и UserAgent + фикс логирования в IPs
* Новые поля для поиска etc.
* Fixes
* Fixes and enhancements
* Поиск по нескольким разделам
* Reports enhancements
* Совместимость с новыми логами
* Совместимость с новыми логами
* Update Logs.xml
* Update Logs.xml
* Logs i18n
* Update Logs.xml
* Update AdminPresenter.php
---------
Co-authored-by: veselcraft <veselcraft@icloud.com>
Co-authored-by: Ilya Prokopenko <55238545+Xenforce@users.noreply.github.com>
Co-authored-by: n1rwana <aydashkin@vk.com>
104 lines
No EOL
6.5 KiB
XML
104 lines
No EOL
6.5 KiB
XML
{var $author = $comment->getOwner()}
|
||
{var $Club = openvk\Web\Models\Entities\Club::class}
|
||
{var $postId = $comment->getTarget() instanceof \openvk\Web\Models\Entities\Post ? $comment->getTarget()->getId() : NULL}
|
||
|
||
<a name="cid={$comment->getId()}"></a>
|
||
<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">
|
||
<tbody>
|
||
<tr>
|
||
<td width="30" valign="top">
|
||
<a href="{$author->getURL()}">
|
||
<img src="{$author->getAvatarURL('miniscule')}" width="30" class="cCompactAvatars" />
|
||
</a>
|
||
</td>
|
||
<td width="100%" valign="top">
|
||
<div class="post-author">
|
||
<a href="{$author->getURL()}"><b>
|
||
{$author->getCanonicalName()}
|
||
</b></a>
|
||
<img n:if="$author->isVerified()" class="name-checkmark" src="/assets/packages/static/openvk/img/checkmark.png"><br/>
|
||
</div>
|
||
<div class="post-content" id="{$comment->getId()}">
|
||
<div class="text" id="text{$comment->getId()}">
|
||
{$comment->getText()|noescape}
|
||
|
||
<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>
|
||
</div>
|
||
<div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu">
|
||
<a href="#_comment{$comment->getId()}" class="date">{$comment->getPublicationTime()}</a>
|
||
{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}
|
||
{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}
|
||
|
||
<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> |
|
||
{if $comment->canBeDeletedBy($thisUser)}
|
||
<a href="/comment{$comment->getId()}/delete">{_delete}</a> |
|
||
{/if}
|
||
{if is_null($linkW)}
|
||
<a class="comment-reply">{_reply}</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>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<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> |