2020-06-07 19:04:43 +03:00
|
|
|
|
{extends "../@layout.xml"}
|
|
|
|
|
{block title}{_"post"}{/block}
|
|
|
|
|
|
|
|
|
|
{block header}
|
2021-09-17 20:17:45 +03:00
|
|
|
|
<a href="{$wallOwner->getURL()}">
|
|
|
|
|
{$wallOwner->getCanonicalName()}
|
|
|
|
|
</a>
|
|
|
|
|
»
|
2021-09-17 20:46:32 +03:00
|
|
|
|
<a href="/wall{$wallOwner->getId() * ($isWallOfGroup ? -1 : 1)}">
|
2021-09-17 20:17:45 +03:00
|
|
|
|
{_wall}
|
|
|
|
|
</a>
|
|
|
|
|
»
|
|
|
|
|
{_"post"}
|
2020-06-07 19:04:43 +03:00
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|
|
{block content}
|
|
|
|
|
{include "../components/post.xml", post => $post, forceNoCommentsLink => TRUE, forceNoDeleteLink => TRUE}
|
|
|
|
|
<hr/>
|
|
|
|
|
<div style="float: left; min-height: 100px; width: 68%;">
|
|
|
|
|
{include "../components/comments.xml",
|
|
|
|
|
comments => $comments,
|
|
|
|
|
count => $cCount,
|
|
|
|
|
page => $cPage,
|
|
|
|
|
model => "posts",
|
|
|
|
|
parent => $post }
|
|
|
|
|
</div>
|
|
|
|
|
<div style="float: left; min-height: 100px; width: 32%;">
|
2020-08-20 17:05:00 +03:00
|
|
|
|
<h4>{_actions}</h4>
|
2020-06-18 14:22:32 +03:00
|
|
|
|
{if isset($thisUser)}
|
|
|
|
|
{var canDelete = $post->canBeDeletedBy($thisUser)}
|
2021-09-26 08:34:22 +03:00
|
|
|
|
{if $thisUser->getId() != $post->getOwner()->getId()}
|
|
|
|
|
{var canReport = true}
|
|
|
|
|
{/if}
|
2020-06-18 14:22:32 +03:00
|
|
|
|
{/if}
|
|
|
|
|
|
2020-08-20 17:05:00 +03:00
|
|
|
|
<a n:if="$canDelete ?? false" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a>
|
2021-09-26 08:34:22 +03:00
|
|
|
|
<a n:if="$canReport ?? false" class="profile_link" style="display:block;width:96%;" href="javascript:reportPost()">{_report}</a>
|
2020-06-07 19:04:43 +03:00
|
|
|
|
</div>
|
2021-09-26 08:34:22 +03:00
|
|
|
|
<script n:if="$canReport ?? false">
|
|
|
|
|
function reportPost() {
|
|
|
|
|
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.pl/" + {$post->getId()} + "?reason=" + res + "&type=posts", 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>
|
2020-06-07 19:04:43 +03:00
|
|
|
|
{/block}
|