Skip to content

Commit

Permalink
Merge pull request #1165 from EsupPortail/develop
Browse files Browse the repository at this point in the history
[FREEZE] Develop #3.8.0
  • Loading branch information
ptitloup authored Jul 17, 2024
2 parents 0298e29 + 0eebb34 commit 7091bcd
Show file tree
Hide file tree
Showing 142 changed files with 4,606 additions and 3,110 deletions.
13 changes: 11 additions & 2 deletions CONFIGURATION_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ Set `USE_AI_ENHANCEMENT` to True to activate this application.<br>
* `AI_ENHANCEMENT_CGU_URL`
> default value: ``
>> URL for General Terms and Conditions for API uses for the AI video enhancement.<br>
>> Example: 'https://aristote.univ.fr/cgu'<br>
>> Project Link: https://www.demainestingenieurs.centralesupelec.fr/aristote/<br>
>> Example: '<https://aristote.univ.fr/cgu>'<br>
>> Project Link: <https://www.demainestingenieurs.centralesupelec.fr/aristote/><br>
* `AI_ENHANCEMENT_CLIENT_ID`
> default value: `mocked_id`
>> The video enhancement AI client ID.<br>
Expand Down Expand Up @@ -622,6 +622,15 @@ Set `USE_DRESSING` to True to activate this application.<br>
###


### Seaker application configuration

Speaker application to add speakers to video.<br>
Set `USE_SPEAKER` to True to activate this application.<br>

* `USE_SPEAKER`
> default value: `False`
>> Activation of the Speaker application<br>

### Video import application configuration

Import_video app to import external videos into Pod.<br>
Expand Down
16 changes: 14 additions & 2 deletions CONFIGURATION_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ Il faudra pour cela créer un fichier de langue et traduire chaque entrée.<br>
* `ARCHIVE_OWNER_USERNAME`
> valeur par défaut : `"archive"`
>> Nom de l’utilisateur pour l’archivage des vidéos.<br>
* `ARCHIVE_HOW_MANY_DAYS`
> valeur par défaut : `365`
>> Délai avant qu'une vidéo archivée ne soit déplacée vers archive_ROOT.<br>
* `POD_ARCHIVE_AFFILIATION`
> valeur par défaut : `[]`
>> Affiliations pour lesquelles on souhaite archiver la vidéo plutôt que de la supprimer.<br>
Expand Down Expand Up @@ -727,8 +730,8 @@ Mettre `USE_AI_ENHANCEMENT` à True pour activer cette application.<br>
* `AI_ENHANCEMENT_CGU_URL`
> valeur par défaut : ``
>> L’URL des conditions générales d’utilisation de l’API pour l’IA d’amélioration des vidéos.<br>
>> Exemple : 'https://aristote.univ.fr/cgu'<br>
>> Lien du projet : https://www.demainestingenieurs.centralesupelec.fr/aristote/<br>
>> Exemple : '<https://aristote.univ.fr/cgu>'<br>
>> Lien du projet : <https://www.demainestingenieurs.centralesupelec.fr/aristote/><br>
* `AI_ENHANCEMENT_CLIENT_ID`
> valeur par défaut : `mocked_id`
>> L’ID du client de l’IA d’amélioration des vidéos.<br>
Expand Down Expand Up @@ -1028,6 +1031,15 @@ Mettre `USE_DRESSING` à True pour activer cette application.<br>
### Configuration de l’application enrichment
### Configuration de l’application Intervenant
Application Intervenant permettant d'ajouter des intervenants à la vidéo.<br>
Mettre `USE_SPEAKER` à True pour activer cette application.<br>
* `USE_SPEAKER`
> valeur par défaut : `False`
>> Activation de l’application Intervenant<br>
### Configuration de l’application d’import vidéo
Application Import_video permettant d’importer des vidéos externes dans Pod.<br>
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
![last commit push](https://img.shields.io/github/last-commit/EsupPortail/Esup-Pod)
[![Author](https://img.shields.io/badge/author-Ptitloup-blue)](https://www.linkedin.com/in/nicolas-can-a6bb7869/)


## [FR]

### Plateforme de gestion de fichier vidéo
Expand Down
8 changes: 5 additions & 3 deletions pod/ai_enhancement/static/ai_enhancement/js/enrich-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @since 3.7.0
*/

// Read-only globals defined in main.js
/* global decodeString remove_quotes removeAccentsAndLowerCase */

const BORDER_CLASS = 'border-d';

Expand Down Expand Up @@ -92,7 +94,7 @@ function addTogglePairInput(aiVersionElement, initialVersionElement, input, elem
aiVersionElement.addEventListener('click', () => {
let input = document.getElementById('id_' + element);
togglePairInput(aiVersionElement, initialVersionElement, input, element);
})
});
input.addEventListener('input', () => event__inputChange(initialVersionElement, aiVersionElement));
}

Expand Down Expand Up @@ -182,7 +184,7 @@ function addEventListeners(videoSlug, videoTitle, videoDescription, videoDiscipl
'description',
'tags',
'disciplines',
]
];
const options = {
method: 'GET',
headers: {
Expand Down Expand Up @@ -227,7 +229,7 @@ function addEventListeners(videoSlug, videoTitle, videoDescription, videoDiscipl
});
aiVersionElement.addEventListener('click', () => {
toggleMultiplePairInput(aiVersionElement, initialVersionElement, input);
})
});
input.addEventListener('input', () => event__inputChange(initialVersionElement, aiVersionElement));
break;
}
Expand Down
6 changes: 1 addition & 5 deletions pod/ai_enhancement/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from pod.main.lang_settings import ALL_LANG_CHOICES, PREF_LANG_CHOICES
from pod.main.utils import json_to_web_vtt
from pod.main.views import in_maintenance
from pod.podfile.models import UserFolder
from pod.quiz.utils import import_quiz
from pod.video.models import Video, Discipline
from pod.video_encode_transcript.transcript import saveVTT
Expand Down Expand Up @@ -349,10 +348,7 @@ def enhance_subtitles(request: WSGIRequest, video_slug: str) -> HttpResponse:
+ str(True)
)

video_folder, created = UserFolder.objects.get_or_create(
name=video.slug,
owner=request.user,
)
video_folder = video.get_or_create_video_folder()
if enhancement_is_already_asked(video):
enhancement = AIEnhancement.objects.filter(video=video).first()
if enhancement.is_ready:
Expand Down
2 changes: 0 additions & 2 deletions pod/bbb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def list_meeting(request):
attendee__user_id=request.user.id, recording_available=True
)
meetings_list = meetings_list.order_by("-session_date")
# print(str(meetings_list.query))

page = request.GET.get("page", 1)

Expand Down Expand Up @@ -145,7 +144,6 @@ def live_list_meeting(request):
last_date_in_progress__gte=dateSince10Min,
)
meetings_list = meetings_list.order_by("-session_date")
# print(str(meetings_list.query))

meetings_list = check_meetings_have_live_in_progress(meetings_list, request)

Expand Down
2 changes: 1 addition & 1 deletion pod/completion/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Contributor(models.Model):

video = models.ForeignKey(Video, verbose_name=_("video"), on_delete=models.CASCADE)
name = models.CharField(
verbose_name=_("lastname / firstname"), max_length=200, default=""
verbose_name=_("last name / first name"), max_length=200, default=""
)
email_address = models.EmailField(
verbose_name=_("mail"), null=True, blank=True, default=""
Expand Down
5 changes: 5 additions & 0 deletions pod/completion/static/js/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var ajaxfail = function (data, form) {
document.addEventListener("submit", (e) => {
if (
e.target.id !== "form_new_contributor" &&
e.target.id !== "form_new_speaker" &&
e.target.id !== "form_new_document" &&
e.target.id !== "form_new_track" &&
e.target.id !== "form_new_overlay" &&
Expand Down Expand Up @@ -219,6 +220,10 @@ var sendAndGetForm = async function (elt, action, name, form, list) {
deleteConfirm = confirm(
gettext("Are you sure you want to delete this contributor?"),
);
} else if (name === "speaker") {
deleteConfirm = confirm(
gettext("Are you sure you want to delete this speaker?"),
);
} else if (name === "document") {
deleteConfirm = confirm(
gettext("Are you sure you want to delete this document?"),
Expand Down
2 changes: 1 addition & 1 deletion pod/completion/templates/contributor/list_contributor.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<caption>{% trans 'List of contributors' %}&nbsp;({{list_contributor|length}})</caption>
<thead>
<tr>
<th scope="col" class="contributor-name">{% trans 'Lastname / Firstname' %}</th>
<th scope="col" class="contributor-name">{% trans 'Last name / First name' %}</th>
<th scope="col">{% trans 'Mail' %}</th>
<th scope="col">{% trans 'Role' %}</th>
<th scope="col">{% trans 'Web link' %}</th>
Expand Down
40 changes: 40 additions & 0 deletions pod/completion/templates/video_completion.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@ <h2 class="accordion-header">
</div>

{% if request.user.is_staff %}
{% if USE_SPEAKER %}
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#compSpeakers" aria-expanded="false" aria-controls="compSpeakers">
{% trans 'Speaker(s)' %}
</button>
</h2>
<div id="compSpeakers" class="accordion-collapse collapse">
<div class="accordion-body">
{% include 'speaker/list_speaker.html' %}
<span id="form_speaker">
{% if form_speaker %}
{% include 'speaker/form_speaker.html' with form_speaker=form_speaker %}
{% endif %}
</span>
<form class="form_new completion" id="form_new_speaker" action="{% url 'video:completion:video_completion_speaker' slug=video.slug %}" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="new">
<input type="submit" value="{% trans 'Add a new speaker' %}" class="new_speaker btn btn-primary">
</form>
</div>
</div>
</div>
{% endif %}


<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#compSubtitles" aria-expanded="false" aria-controls="compSubtitles">
Expand Down Expand Up @@ -175,6 +201,18 @@ <h2 class="card-header card-title pod-card__title h4">{% trans "Help"%}</h2>
<p>{% trans 'A contributor must at least have a name and a role. You can also join the email of this contributor as well as a link (professional website for example).' %}</p>
</div>
</div>
<!-- Speaker -->
{% if USE_SPEAKER %}
<div id="speaker-info">
<button class="btn btn-link rounded-0 pod-btn" id="heading-5" data-bs-toggle="collapse" data-bs-target="#collapse-speaker" aria-expanded="false" aria-controls="collapse-speaker">
{% trans 'Speaker(s)' %}
</button>
<div id="collapse-speaker" class="collapse card-text small">
<p>{% trans 'List of speakers related to this video.' %}</p>
<p>{% trans "You can add speakers to this video by searching by their last name, first name or job. If you can't find the speaker, contact a super admin." %}</p>
</div>
</div>
{% endif %}
<div id="track-info">
<button class="btn btn-link rounded-0 pod-btn" id="heading-2" data-bs-toggle="collapse" data-bs-target="#collapse-track" aria-expanded="false" aria-controls="collapse-track">
{% trans 'Subtitle(s) and Caption(s)' %}
Expand Down Expand Up @@ -240,5 +278,7 @@ <h2 class="card-header card-title pod-card__title h4">{% trans "Help"%}</h2>
{% endblock page_aside %}

{% block more_script %}
<script src="{% static 'admin/js/vendor/select2/select2.full.min.js' %}?ver={{VERSION}}"></script>
<script src="{% static 'django_select2/django_select2.js' %}?ver={{VERSION}}"></script>
<script src="{% static 'js/completion.js' %}?ver={{VERSION}}"></script>
{% endblock more_script %}
Loading

0 comments on commit 7091bcd

Please sign in to comment.