2020-06-07 19:04:43 +03:00
|
|
|
{extends "../@layout.xml"}
|
|
|
|
|
2022-08-09 09:37:08 +03:00
|
|
|
{block title}{_photo}{/block}
|
2020-06-07 19:04:43 +03:00
|
|
|
|
|
|
|
{block header}
|
|
|
|
{ifset $album}
|
|
|
|
<a href="{$album->getOwner()->getURL()}">
|
|
|
|
{$album->getOwner()->getCanonicalName()}
|
|
|
|
</a>
|
|
|
|
{if ($album->getOwner() instanceof openvk\Web\Models\Entities\Club)}
|
2022-08-09 09:37:08 +03:00
|
|
|
» <a href="/albums{$album->getOwner()->getId() * -1}">{_albums}</a>
|
2020-06-07 19:04:43 +03:00
|
|
|
{else}
|
2022-08-09 09:37:08 +03:00
|
|
|
» <a href="/albums{$album->getOwner()->getId()}">{_albums}</a>
|
2020-06-07 19:04:43 +03:00
|
|
|
{/if}
|
|
|
|
» <a href="/album{$album->getPrettyId()}">{$album->getName()}</a>
|
|
|
|
{else}
|
|
|
|
<a href="{$photo->getOwner()->getURL()}">{$photo->getOwner()->getCanonicalName()}</a>
|
|
|
|
{/ifset}
|
2022-08-09 09:37:08 +03:00
|
|
|
» {_photo}
|
2020-06-07 19:04:43 +03:00
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block content}
|
|
|
|
<center style="margin-bottom: 8pt;">
|
2022-04-05 14:39:13 +03:00
|
|
|
<img src="{$photo->getURLBySizeId('large')}" style="max-width: 80%; max-height: 60vh;" />
|
2020-06-07 19:04:43 +03:00
|
|
|
</center>
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
2023-10-03 19:40:13 +03:00
|
|
|
<div style="width: 100%; min-height: 100px;" class="ovk-photo-details">
|
|
|
|
<div style="float: left; min-height: 100px; width: 68%;margin-left: 3px;">
|
|
|
|
{include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo, custom_id => 999}
|
2020-06-07 19:04:43 +03:00
|
|
|
</div>
|
2023-10-03 19:40:13 +03:00
|
|
|
<div style="float:right;min-height: 100px;width: 30%;margin-left: 1px;">
|
2020-06-07 19:04:43 +03:00
|
|
|
<div>
|
2022-08-09 09:37:08 +03:00
|
|
|
<h4>{_information}</h4>
|
|
|
|
<span style="color: grey;">{_info_description}:</span>
|
|
|
|
{$photo->getDescription() ?? "(" . tr("none") . ")"}<br/>
|
|
|
|
<span style="color: grey;">{_info_uploaded_by}:</span>
|
2020-06-07 19:04:43 +03:00
|
|
|
<a href="{$photo->getOwner()->getURL()}">{$photo->getOwner()->getFullName()}</a><br/>
|
2022-08-09 09:37:08 +03:00
|
|
|
<span style="color: grey;">{_info_upload_date}:</span>
|
2020-06-07 19:04:43 +03:00
|
|
|
{$photo->getPublicationTime()}
|
|
|
|
</div>
|
|
|
|
<br/>
|
2021-09-17 11:38:38 +03:00
|
|
|
<h4>{_actions}</h4>
|
2023-10-03 19:40:13 +03:00
|
|
|
{if isset($thisUser) && $thisUser->getId() != $photo->getOwner()->getId()}
|
2023-08-11 16:50:19 +03:00
|
|
|
{var canReport = true}
|
|
|
|
{/if}
|
2020-06-07 19:04:43 +03:00
|
|
|
<div n:if="isset($thisUser) && $thisUser->getId() === $photo->getOwner()->getId()">
|
2022-08-09 09:37:08 +03:00
|
|
|
<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>
|
2020-06-07 19:04:43 +03:00
|
|
|
</div>
|
2023-08-11 16:50:19 +03:00
|
|
|
<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() {
|
2023-09-17 16:22:59 +03:00
|
|
|
uReportMsgTxt = tr("going_to_report_photo");
|
|
|
|
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/" + {$photo->getId()} + "?reason=" + res + "&type=photo", 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>
|
2020-06-07 19:04:43 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/block}
|