openvk/Web/Presenters/templates/Videos/View.xml

102 lines
4.2 KiB
XML
Raw Permalink Normal View History

2020-06-25 15:09:55 +03:00
{extends "../@layout.xml"}
{block title}{_video}{/block}
2020-06-25 15:09:55 +03:00
{block header}
<a href="{$user->getURL()}">{$user->getCanonicalName()}</a>
»
2022-08-09 09:37:08 +03:00
<a href="/videos{$user->getId()}">{_videos}</a>
2020-06-25 15:09:55 +03:00
»
2022-08-09 09:37:08 +03:00
{_video}
2020-06-25 15:09:55 +03:00
{/block}
{block content}
<center style="margin-bottom: 8pt;">
{if $video->getType() === 0}
<div class="bsdn" data-name="{$video->getName()}" data-author="{$user->getCanonicalName()}">
<video src="{$video->getURL()}"></video>
</div>
2020-06-25 15:09:55 +03:00
{else}
2022-04-24 08:06:45 +03:00
{var $driver = $video->getVideoDriver()}
2020-06-25 15:09:55 +03:00
{if !$driver}
{_unknown_video}
2020-06-25 15:09:55 +03:00
{else}
{$driver->getEmbed()|noescape}
{/if}
{/if}
</center>
<hr/>
<div style="width: 100%; min-height: 100px;">
<div style="float: left; min-height: 100px; width: 68%; margin-right: 2%;" id="comments">
2020-06-25 15:09:55 +03:00
{include "../components/comments.xml",
comments => $comments,
count => $cCount,
page => $cPage,
model => "videos",
parent => $video}
</div>
2021-09-14 02:35:46 +03:00
<div style="float: left; min-height: 100px; width: 30%; overflow: hidden; overflow-wrap: break-word;">
2020-06-25 15:09:55 +03:00
<div>
2022-08-09 09:37:08 +03:00
<h4>{_information}</h4>
<span style="color: grey;">{_info_name}:</span>
2020-06-25 15:09:55 +03:00
{$video->getName()}<br/>
2022-08-09 09:37:08 +03:00
<span style="color: grey;">{_info_description}:</span>
{$video->getDescription() ?? "(" . tr("none") . ")"}<br/>
<span style="color: grey;">{_info_uploaded_by}:</span>
2020-06-25 15:09:55 +03:00
<a href="{$user->getURL()}">{$user->getFullName()}</a><br/>
2022-08-09 09:37:08 +03:00
<span style="color: grey;">{_info_upload_date}:</span>
2020-06-25 15:09:55 +03:00
{$video->getPublicationTime()}
</div>
<br/>
<div>
<div n:if="isset($thisUser) && $thisUser->getId() === $user->getId()">
<h4>{_actions}</h4>
<a href="/video{$video->getPrettyId()}/edit" class="profile_link" style="display:block;width:96%;">
{_edit}
</a>
<a href="/video{$video->getPrettyId()}/remove" class="profile_link" style="display:block;width:96%;">
{_delete}
</a>
</div>
<a href="/video{$video->getPrettyId()}" class="profile_link" id="videoOpen" data-id="{$video->getId()}" style="display:block;width:96%;">
{_watch_in_window}
</a>
2020-06-25 15:09:55 +03:00
</div>
{if isset($thisUser)}
{if $thisUser->getId() != $video->getOwner()->getId()}
{var canReport = true}
{/if}
{/if}
<a n:if="$canReport ?? false" class="profile_link" style="display:block;width:96%;" href="javascript:reportVideo()">{_report}</a>
<script n:if="$canReport ?? false">
function reportVideo() {
uReportMsgTxt = tr("going_to_report_video");
uReportMsgTxt += "<br/>"+tr("report_question_text");
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
(function() {
res = document.querySelector("#uReportMsgInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/report/" + {$video->getId()} + "?reason=" + res + "&type=video", true);
xhr.onload = (function() {
if(xhr.responseText.indexOf("reason") === -1)
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
else
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
]);
}
</script>
2020-06-25 15:09:55 +03:00
</div>
</div>
{/block}