Skip to content

Commit

Permalink
Merge branch 'develop' into LoicBonavent/feature_import_video_add_med…
Browse files Browse the repository at this point in the history
…iacad_platform
  • Loading branch information
LoicBonavent authored Dec 13, 2023
2 parents eb14eaf + 1d788ce commit 9e3140f
Show file tree
Hide file tree
Showing 78 changed files with 1,234 additions and 713 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
"globals": {
"Cookies": "readonly",
"gettext": "readonly",
"ngettext": "readonly",
"interpolate": "readonly",
"bootstrap": "readonly",
"videojs": "readonly",
Expand Down
2 changes: 2 additions & 0 deletions .gitguardian.yml
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lang:
echo "Processing python files..."
python3 manage.py makemessages --all -i "opencast-studio/*" -i "pod/custom/settings_local.py" --add-location=file
echo "Processing javascript files..."
python3 manage.py makemessages -d djangojs -l fr -l nl -i "*.min.js" -i "pod/static/*" -i "opencast-studio/*" -i "*/node_modules/*" --add-location=file
python3 manage.py makemessages -d djangojs -l fr -l nl -i "*.min.js" -i "pod/static/*" -i "opencast-studio/*" -i "*/node_modules/*" -i "node_modules/*" --add-location=file

#compilation des fichiers de langue
compilelang:
Expand All @@ -76,7 +76,7 @@ pystyle:

# Collects all static files inside all apps and put a copy inside the static directory declared in settings.py
statics:
cd pod; yarn upgrade
cd pod; yarn install; yarn upgrade
# --clear Clear the existing files before trying to copy or link the original file.
python3 manage.py collectstatic --clear

Expand Down
2 changes: 1 addition & 1 deletion pod/chapter/static/css/chapters.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ table.scroll thead th.chapter_time_end {

form#form_chapter,
form#form_chapter_import {
background-color: rgba(0 0 0 0.05);
background-color: rgb(0 0 0 / 5%);
}

.form-group.row p {
Expand Down
4 changes: 2 additions & 2 deletions pod/chapter/static/css/videojs-chapters.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
top: 0;
height: 100%;
width: 20%;
background-color: rgba(43 51 63 0.7);
background-color: rgb(43 51 63 / 70%);
overflow-y: auto;
cursor: default;
z-index: 2;
Expand Down Expand Up @@ -48,7 +48,7 @@
list-style-type: none;
text-align: -webkit-match-parent;
margin: 0 3px;
border-top: 1px solid rgba(0 0 0 0.8);
border-top: 1px solid rgb(0 0 0 / 80%);
}

.chapters-list ol li a {
Expand Down
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
6 changes: 3 additions & 3 deletions pod/completion/static/css/caption_maker.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
}

.newEditorBlock:hover {
background-color: rgba(223 230 246 0.4);
background-color: rgb(223 230 246 / 40%);
}

.newEditorBlock > textarea {
Expand All @@ -129,7 +129,7 @@

.captionBeingEdited {
border-left: 3px solid var(--pod-primary);
background-color: rgba(223 230 246 0.4);
background-color: rgb(223 230 246 / 40%);
}

.captionTimestamps {
Expand Down Expand Up @@ -226,7 +226,7 @@
.regionHighligh {
position: absolute;
z-index: 1;
background-color: rgba(173 50 122 0.5);
background-color: rgb(173 50 122 / 50%);
height: 3px;
}

Expand Down
5 changes: 2 additions & 3 deletions pod/completion/static/js/caption_maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ document.addEventListener("DOMContentLoaded", function () {

send_form_data(url, data, "processProxyVttResponse");
} else {
document.getElementById(
"captionFilename",
).value = `${file_prefix}_captions_${Date.now()}`;
document.getElementById("captionFilename").value =
`${file_prefix}_captions_${Date.now()}`;
}

let placeholder = gettext(
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/static/css/video_cut.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ input[type="range"]::-ms-thumb {
/* --bs-btn-focus-shadow-rgb: var(--pod-primary-rgb); */
--bs-btn-focus-shadow-rgb: 200, 200, 253;
--bs-btn-focus-box-shadow: 0 0 0 0.25rem
rgba(var(--bs-btn-focus-shadow-rgb) 0.5);
rgb(var(--bs-btn-focus-shadow-rgb) / 50%);
}

input[type="range"]:active::-webkit-slider-thumb,
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
2 changes: 1 addition & 1 deletion pod/enrichment/static/css/enrichment.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ table.scroll thead th {
}

form#form_enrich {
background-color: rgba(0 0 0 0.05);
background-color: rgb(0 0 0 / 5%);
}
7 changes: 6 additions & 1 deletion 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 Expand Up @@ -213,7 +218,7 @@
top: -0.5rem;
height: 100%;
position: relative;
background: rgba(100 100 100 0.5);
background: rgb(100 100 100 / 50%);
}

.vjs-chapbar-holder {
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“.' %}
</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 %}
Loading

0 comments on commit 9e3140f

Please sign in to comment.