mirror of
https://github.com/openvk/openvk
synced 2024-11-11 09:29:29 +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>
80 lines
4.3 KiB
XML
80 lines
4.3 KiB
XML
{extends "../@layout.xml"}
|
||
|
||
{block title}{_photo}{/block}
|
||
|
||
{block header}
|
||
{ifset $album}
|
||
<a href="{$album->getOwner()->getURL()}">
|
||
{$album->getOwner()->getCanonicalName()}
|
||
</a>
|
||
{if ($album->getOwner() instanceof openvk\Web\Models\Entities\Club)}
|
||
» <a href="/albums{$album->getOwner()->getId() * -1}">{_albums}</a>
|
||
{else}
|
||
» <a href="/albums{$album->getOwner()->getId()}">{_albums}</a>
|
||
{/if}
|
||
» <a href="/album{$album->getPrettyId()}">{$album->getName()}</a>
|
||
{else}
|
||
<a href="{$photo->getOwner()->getURL()}">{$photo->getOwner()->getCanonicalName()}</a>
|
||
{/ifset}
|
||
» {_photo}
|
||
{/block}
|
||
|
||
{block content}
|
||
<center style="margin-bottom: 8pt;">
|
||
<img src="{$photo->getURLBySizeId('large')}" style="max-width: 80%; max-height: 60vh;" />
|
||
</center>
|
||
|
||
<hr/>
|
||
|
||
<div style="width: 100%; min-height: 100px;">
|
||
<div style="float: left; min-height: 100px; width: 70%;">
|
||
{include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo}
|
||
</div>
|
||
<div style="float: left; min-height: 100px; width: 30%;">
|
||
<div>
|
||
<h4>{_information}</h4>
|
||
<span style="color: grey;">{_info_description}:</span>
|
||
{$photo->getDescription() ?? "(" . tr("none") . ")"}<br/>
|
||
<span style="color: grey;">{_info_uploaded_by}:</span>
|
||
<a href="{$photo->getOwner()->getURL()}">{$photo->getOwner()->getFullName()}</a><br/>
|
||
<span style="color: grey;">{_info_upload_date}:</span>
|
||
{$photo->getPublicationTime()}
|
||
</div>
|
||
<br/>
|
||
<h4>{_actions}</h4>
|
||
{if $thisUser->getId() != $photo->getOwner()->getId()}
|
||
{var canReport = true}
|
||
{/if}
|
||
<div n:if="isset($thisUser) && $thisUser->getId() === $photo->getOwner()->getId()">
|
||
<a href="/photo{$photo->getPrettyId()}/edit" class="profile_link" style="display:block;width:96%;">{_edit}</a>
|
||
<a id="_photoDelete" href="/photo{$photo->getPrettyId()}/delete" class="profile_link" style="display:block;width:96%;">{_delete}</a>
|
||
</div>
|
||
<a href="{$photo->getURL()}" class="profile_link" target="_blank" style="display:block;width:96%;">{_"open_original"}</a>
|
||
<a n:if="$canReport ?? false" class="profile_link" style="display:block;width:96%;" href="javascript:reportPhoto()">{_report}</a>
|
||
<script n:if="$canReport ?? false">
|
||
function reportPhoto() {
|
||
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/" + {$photo->getId()} + "?reason=" + res + "&type=photo", 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>
|
||
<a href="{$photo->getURL()}" class="profile_link" target="_blank" style="display:block;width:96%;">{_open_original}</a>
|
||
</div>
|
||
</div>
|
||
{/block}
|