Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONE] Fix the bug in the playlist application #1000

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4014f9d
Fix the playlists sorting
SebastienCozeDev Oct 30, 2023
02634b2
:bug: Fix the autoplay
SebastienCozeDev Oct 30, 2023
247e22d
:bug: Fix enriched videos in playlists
SebastienCozeDev Nov 6, 2023
2637772
:art: Fix flake8
SebastienCozeDev Nov 6, 2023
f28fab4
:bug: Fix the error 500 for AnonymousUser in playlist
SebastienCozeDev Nov 7, 2023
b4fba49
:bug: Fix enriched videos in playlists
SebastienCozeDev Nov 9, 2023
1fb0d94
Merge develop
SebastienCozeDev Nov 9, 2023
7afe706
:bug: Fix the numberPlaylists condition
SebastienCozeDev Nov 9, 2023
22ced78
:lock: Fix GitGuardian
SebastienCozeDev Nov 9, 2023
f33f86f
:art: Add line at the end file
SebastienCozeDev Nov 9, 2023
e54530b
:art: Replace 'var' by 'let' when it is possible
SebastienCozeDev Nov 9, 2023
b394369
:art: Rename illegible identifier
SebastienCozeDev Nov 9, 2023
12c6521
Add aria-hidden attribute
SebastienCozeDev Nov 9, 2023
60c2d86
Merge branch 'develop' into SebastienCozeDev/fix_playlist_app
SebastienCozeDev Nov 9, 2023
b9d0f14
:memo: Add JSDocs
SebastienCozeDev Nov 9, 2023
02f21c3
:memo: Add PyDocs
SebastienCozeDev Nov 10, 2023
43bd11f
:art: Improve condition
SebastienCozeDev Nov 10, 2023
2e0d2b6
Create a real request error
SebastienCozeDev Nov 10, 2023
a0d7212
Rename 'enrichmentinformations_card.html to 'enrichment_informations_…
SebastienCozeDev Nov 10, 2023
d8a6e29
:art: Fix flake8
SebastienCozeDev Nov 10, 2023
702a1aa
:bug: Replace enrichmentinformations_card by erichment_informations_c…
SebastienCozeDev Nov 10, 2023
de7ec67
Remove unused load
SebastienCozeDev Nov 10, 2023
64ac6aa
Re-add aria-hidden attributes
SebastienCozeDev Nov 10, 2023
d640ebc
Update the quotation marks
SebastienCozeDev Nov 10, 2023
c640fdc
:memo: Update PyDoc
SebastienCozeDev Nov 10, 2023
d7f23f0
:bug: Fix coverage
SebastienCozeDev Nov 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitguardian.yml
SebastienCozeDev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude_paths:
- pod/enrichment/tests/test_views.py
4 changes: 2 additions & 2 deletions pod/chapter/templates/video_chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{% endblock page_content %}
{% block page_aside %}
{% if video.owner == request.user or request.user.is_superuser or perms.chapter.add_chapter or request.user in video.additional_owners.all %}
<div class="card" id="card-managevideo">
<div class="card" id="card-manage-video">
<h2 class="card-header card-title pod-card__title h4"><i class="bi bi-gear"></i>&nbsp;{% trans "Manage video"%}</h2>
<div class="card-body card-text text-center">
{% include "videos/link_video.html" with hide_favorite_link=True %}
Expand All @@ -73,7 +73,7 @@ <h2 class="card-header card-title pod-card__title h4">{% trans "Help"%}</h2>
<p>{% trans 'You must save your chapters to view the result.' %}</p>
</div>
</div>
<div class="card mt-1" id="card-mandatoryfields">
<div class="card mt-1" id="card-mandatory-fields">
<h2 class="h4 card-header card-title pl-2">{% trans "Mandatory fields" %}</h2>
<div class="card-body card-text">
<p>
Expand Down
2 changes: 1 addition & 1 deletion pod/completion/templates/video_completion.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
{% block page_aside %}

{% if video.owner == request.user or request.user.is_superuser or perms.video.change_video or request.user in video.additional_owners.all %}
<div class="card mb-2" id="card-managevideo">
<div class="card mb-2" id="card-manage-video">
<h2 class="card-header card-title pod-card__title h4"><i class="bi bi-gear"></i>&nbsp;{% trans "Manage video"%}</h2>
<div class="card-body card-text text-center">
{% include "videos/link_video.html" with hide_favorite_link=True %}
Expand Down
2 changes: 1 addition & 1 deletion pod/cut/templates/video_cut.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1 class="modal-title fs-5" id="ConfirmationModalLabel">{% trans 'Are you sure
{% block page_aside %}
{% if access_not_allowed == True %}
{% else %}
<div class="card" id="card-managevideo">
<div class="card" id="card-manage-video">
<h2 class="card-header card-title pod-card__title h4"><i class="bi bi-gear"></i>&nbsp;{% trans "Manage video" %}</h2>
<div class="card-body card-text text-center">
{% include "videos/link_video.html" with hide_favorite_link=True %}
Expand Down
5 changes: 5 additions & 0 deletions pod/enrichment/static/css/videojs-slides.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
padding: 0 10px;
}

/********* To edit *********/
.vjs-tech.to-edit {
width: 100% !important;
}

/********* Pip slide -> pip-slide *********/
.vjs-tech.pip-slide {
width: 80% !important;
Expand Down
223 changes: 129 additions & 94 deletions pod/enrichment/templates/enrichment/edit_enrichment.html
Original file line number Diff line number Diff line change
@@ -1,99 +1,134 @@
{% extends 'enrichment/video_enrichment.html' %} {% load i18n %} {% load static %} {% block page_title %}{% trans 'Enrichment of the video' %} "{{video.title}}"
{% endblock page_title %} {% block page_extra_head %} {{ block.super }}

<link
rel="stylesheet"
href="{% static 'css/enrichment.css' %}?ver={{VERSION}}"
>
<script src="{% static 'js/enrichment.js' %}?ver={{VERSION}}"></script>

<script>
var num = 0,
name = '';
/*** For the form ***/;
var video_duration = {{video.duration}};
/*** For the Cancel button ***/

document.addEventListener("reset", (e) => {
if (e.target !== document.querySelector("#page-video form")) return
document.getElementById("form_enrich").innerHTML = "";
document.querySelectorAll("form").forEach((form)=>{
form.style.display = "block";
})
document.querySelectorAll("table tr").forEach((tr) => {
tr.classList.remove("info");
{% extends 'enrichment/video_enrichment.html' %}
{% load i18n %}
{% load static %}



{% block page_title %}
{% trans 'Enrichment of the video' %} "{{video.title}}"
{% endblock page_title %}



{% block page_extra_head %}
{{ block.super }}

<link
rel="stylesheet"
href="{% static 'css/enrichment.css' %}?ver={{VERSION}}"
>
<script src="{% static 'js/enrichment.js' %}?ver={{VERSION}}"></script>

<script>
let num = 0;
let name = '';
/*** For the form ***/;
let video_duration = {{video.duration}};
/*** For the Cancel button ***/

document.addEventListener("reset", (e) => {
if (e.target !== document.querySelector("#page-video form")) return
document.getElementById("form_enrich").innerHTML = "";
document.querySelectorAll("form").forEach((form)=>{
form.style.display = "block";
})
document.querySelectorAll("table tr").forEach((tr) => {
tr.classList.remove("info");
});

manageResize();
});
</script>
{% endblock page_extra_head %}



manageResize();
});
</script>
{% endblock page_extra_head %} {% block video-element %}
<div id="page-video">
{% include 'enrichment/video-element-enrichment.html' %}
<hr>

<div id="info_video">
<div id="list_enrich">{% include 'enrichment/list_enrichment.html' %}</div>
<div id="form_enrich">
{% if form_enrichment %} {% include 'enrichment/form_enrichment.html' with form_enrichment=form_enrichment %}
{% block page_content %}
<div id="video-player">
{% block video-element %}
<div id="page-video">
{% include 'enrichment/video-element-enrichment.html' %}
<hr>
<div id="info_video">
<div id="list_enrich">{% include 'enrichment/list_enrichment.html' %}</div>
<div id="form_enrich">
{% if form_enrichment %} {% include 'enrichment/form_enrichment.html' with form_enrichment=form_enrichment %}
{% endif %}
</div>
{% if not form_enrichment %}
<form
id="form_new"
class="get_form"
action="{% url 'enrichment:edit_enrichment' slug=video.slug %}"
method="POST"
>
{% csrf_token %}
<input type="hidden" name="action" value="new">
<input
type="submit"
id="add_new_enrichment"
value="{% trans 'Add a new enrichment' %}"
class="btn btn-primary btn-sm"
>
</form>
{% endif %}
<hr>
<div class="d-flex justify-content-between">
<a
href="{% url 'video:video_edit' slug=video.slug %}"
class="btn btn-secondary btn-sm"
>
{% trans 'Back to video edit' %}
</a>
<a
href="{% url 'enrichment:video_enrichment' slug=video.slug %}"
class="btn btn-primary btn-sm"
>
{% trans 'See the enrich video' %}
</a>
</div>
</div>
</div>
{% endblock video-element %}
</div>
{% endblock page_content %}




{% block page_aside %}
<div class="card" id="card-enrichment-edit-informations">
<h2 class="card-header card-title pod-card__title h4">
<i class="bi bi-info-circle" aria-hidden="true"></i>&nbsp;{% trans 'Editing enrichments' %}
</h2>
<div class="card-body card-text small">
{% if video.owner == request.user or request.user.is_superuser or perms.enrichment.change_enrichment or request.user in video.additional_owners.all %}
<p>
<a href="{% url 'enrichment:group_enrichment' slug=video.slug %}">
<i class="bi bi-people" aria-hidden="true"></i>&nbsp;{% trans 'You can specify the group(s) of users who can access this page' %}
</a>
</p>
{% endif %}
</div>
{% if not form_enrichment %}
<form
id="form_new"
class="get_form"
action="{% url 'enrichment:edit_enrichment' slug=video.slug %}"
method="POST"
>
{% csrf_token %}
<input type="hidden" name="action" value="new">
<input
type="submit"
id="add_new_enrichment"
value="{% trans 'Add a new enrichment' %}"
class="btn btn-primary btn-sm"
>
</form>
{% endif %}
<hr>
<div class="d-flex justify-content-between">
<a
href="{% url 'video:video_edit' slug=video.slug %}"
class="btn btn-secondary btn-sm"
>
{% trans 'Back to video edit' %}
</a>
<a
href="{% url 'enrichment:video_enrichment' slug=video.slug %}"
class="btn btn-primary btn-sm"
>
{% trans 'See the enrich video' %}
</a>
<p>
{% trans 'The title field is required and must contains from 2 to 100 characters.' %}
</p>
<p>
{% trans 'The fields "Start" and "End" must contain an indication value in seconds. Start playback of the video, pause the video and click on "Get time from the player" to fill in the field untitled "Start". Then do the same to fill in the field untitled "End".' %}
SebastienCozeDev marked this conversation as resolved.
Show resolved Hide resolved
</p>
<p>{% trans 'You cannot overlap enrichments.' %}</p>
<p>{% trans 'You must save your enrichments to view the result.' %}</p>
</div>
</div>
</div>
{% endblock video-element %} {% block page_aside %}
<div class="card" id="card-enrichmenteditinformations">
<h2 class="card-header card-title pod-card__title h4">
<i class="bi bi-info-circle"></i>&nbsp;{% trans 'Editing enrichments' %}
</h2>
<div class="card-body card-text small">
{% if video.owner == request.user or request.user.is_superuser or perms.enrichment.change_enrichment or request.user in video.additional_owners.all %}
<p>
<a href="{% url 'enrichment:group_enrichment' slug=video.slug %}"
><i class="bi bi-people"></i>&nbsp;{% trans 'You can specify the group(s) of users who can access this page' %}</a
>
</p>
{% endif %}
<p>
{% trans 'The title field is required and must contains from 2 to 100 characters.' %}
</p>
<p>
{% trans 'The fields "Start" and "End" must contain an indication value in seconds. Start playback of the video, pause the video and click on "Get time from the player" to fill in the field untitled "Start". Then do the same to fill in the field untitled "End".' %}
</p>
<p>{% trans 'You cannot overlap enrichments.' %}</p>
<p>{% trans 'You must save your enrichments to view the result.' %}</p>
</div>
</div>
{{ block.super }} {% endblock page_aside %} {% block more_script %}
{{block.super}} {% endblock more_script %}
{{ block.super }}
{% endblock page_aside %}



{% block more_script %}
{{block.super}}
<script>
player.on('play', function() {
document.getElementById('podvideoplayer_html5_api').classList.add('to-edit');
});
</script>
{% endblock more_script %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% load i18n %}

<h2 class="card-header card-title pod-card__title h4">
<i class="bi bi-info-circle" aria-hidden="true"></i>&nbsp;{% trans 'Informations' %}
</h2>
<div class="card-body card-text">
<p>{% trans 'To help you, the different types of enrichments have specific colors:' %}</p>
<p>
<ul>
<li class="enrich_image">{% trans 'Image' %}</li>
<li class="enrich_document">{% trans 'Document' %}</li>
<li class="enrich_richtext">{% trans 'Richtext' %}</li>
<li class="enrich_weblink">{% trans 'Weblink' %}</li>
<li class="enrich_embed">{% trans 'Embed' %}</li>
</ul>
</p>
<p>{% trans 'They are visible on the video playback bar.' %}</p>
</div>
2 changes: 1 addition & 1 deletion pod/enrichment/templates/enrichment/group_enrichment.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h3>{% trans "Editing group for the enrichment of the video" %} "{{video.title}}

{% block page_aside %}
{% if video.owner == request.user or request.user.is_superuser or perms.video.change_video or request.user in video.additional_owners.all %}
<div class="card" id="card-managevideo">
<div class="card" id="card-manage-video">
<h2 class="card-header card-title pod-card__title h4"><i class="bi bi-gear"></i>&nbsp;{% trans "Manage video"%}</h2>
SebastienCozeDev marked this conversation as resolved.
Show resolved Hide resolved
<div class="card-body card-text text-center">
{% include "videos/link_video.html" %}
Expand Down
Loading