mirror of
https://github.com/chibicitiberiu/ytsm.git
synced 2024-02-24 05:43:31 +00:00
Merged from master
This commit is contained in:
@ -6,13 +6,17 @@
|
||||
{% for video in videos %}
|
||||
<div class="card-wrapper d-flex align-items-stretch" style="width: 18rem;">
|
||||
<div class="card mx-auto">
|
||||
<img class="card-img-top" src="{{ video.icon_best }}" alt="Thumbnail">
|
||||
<a href="{% url 'video' video.id %}">
|
||||
<img class="card-img-top" src="{{ video.icon_best }}" alt="Thumbnail">
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
{% if not video.watched %}
|
||||
<sup class="badge badge-primary">New</sup>
|
||||
{% endif %}
|
||||
{{ video.name }}
|
||||
<a href="{% url 'video' video.id %}">
|
||||
{{ video.name }}
|
||||
</a>
|
||||
</h5>
|
||||
<p class="card-text small text-muted">
|
||||
<span>{{ video.views | intcomma }} views</span>
|
||||
|
83
app/YtManagerApp/templates/YtManagerApp/video.html
Normal file
83
app/YtManagerApp/templates/YtManagerApp/video.html
Normal file
@ -0,0 +1,83 @@
|
||||
{% 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.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>•</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>
|
||||
|
||||
</p>
|
||||
</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 %}
|
Reference in New Issue
Block a user