ytsm/app/YtManagerApp/templates/YtManagerApp/video.html

83 lines
2.9 KiB
HTML

{% extends "YtManagerApp/master_default.html" %}
{% load static %}
{% load humanize %}
{% load ratings %}
{% block body %}
<div class="container">
<h2>{{ object.name }}</h2>
<div class="row">
<div class="col-8">
{% if video_mime != None %}
<video width="100%" controls autoplay>
<source src="{% url 'video-src' object.id %}" type="{{ video_mime }}">
</video>
{% else %}
<iframe id="ytplayer" type="text/html" width="100%" height="400"
src="https://www.youtube-nocookie.com/embed/{{ object.video_id }}?autoplay=1"
frameborder="0"></iframe>
{% endif %}
<div class="row mx-0 mt-2">
<p class="text-muted mb-1">
<span>{{ object.views | intcomma }} views</span>
<span>&#x2022;</span>
<span>{{ object.publish_date | naturaltime }}</span>
</p>
<div class="ml-auto">
{% starrating object.rating %}
</div>
</div>
<div class="video-description">
{{ object.description | linebreaks | urlize }}
</div>
</div>
<div class="col-4">
<h5>Manage video</h5>
<p>
<a class="btn btn-secondary" href="https://youtube.com/watch?v={{ object.video_id }}">
Watch on YouTube <span class="typcn typcn-social-youtube"></span>
</a>
</p>
{% if object.watched %}
<p>
<a class="btn btn-secondary ajax-link" href="#" data-post-url="{% url 'ajax_action_mark_video_unwatched' object.id %}">
Mark not watched
</a>
</p>
{% else %}
<p>
<a class="btn btn-secondary ajax-link" href="#" data-post-url="{% url 'ajax_action_mark_video_watched' object.id %}">
Mark watched
</a>
</p>
{% endif %}
{% if object.downloaded_path %}
<p>
<a class="btn btn-secondary ajax-link" href="#" data-post-url="{% url 'ajax_action_delete_video_files' object.id %}">
Delete downloaded
</a>
</p>
{% else %}
<p>
<a class="btn btn-secondary ajax-link" href="#" data-post-url="{% url 'ajax_action_download_video_files' object.id %}" >
Download
</a>
</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}