Skip to content

Commit

Permalink
Merge branch 'EsupPortail:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cbissler authored Nov 26, 2024
2 parents a95c4a8 + 352c999 commit 99daf42
Show file tree
Hide file tree
Showing 58 changed files with 807 additions and 367 deletions.
4 changes: 3 additions & 1 deletion .gitguardian.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
exclude_paths:
version: 2
secret:
ignored_paths:
- pod/enrichment/tests/test_views.py
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/gitguardian/ggshield
rev: v1.27.0
rev: v1.32.0
hooks:
- id: ggshield
language_version: python3
stages: [commit]
stages: [pre-commit]
38 changes: 19 additions & 19 deletions CONFIGURATION_EN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
#

##
##

* `CAS`
> default value: `1.5.2`
Expand Down Expand Up @@ -29,7 +29,7 @@
* `tagging`
> default value: `0.5.0`
##
##

### Database

Expand Down Expand Up @@ -381,7 +381,7 @@
> default value: `False`
>>
##
##

### AI Enhancement application configuration

Expand Down Expand Up @@ -415,7 +415,7 @@ Set `USE_AI_ENHANCEMENT` to True to activate this application.<br>
> default value: `False`
>> Activation of artificial intelligence enhancements. Allows users to use it.<br>
###
###

* `AFFILIATION`
> default value: ``
Expand Down Expand Up @@ -559,10 +559,10 @@ Set `USE_AI_ENHANCEMENT` to True to activate this application.<br>
> default value: `False`
>>
###
###


###
###

* `ACTIVE_MODEL_ENRICH`
> default value: `False`
Expand Down Expand Up @@ -619,7 +619,7 @@ Set `USE_DRESSING` to True to activate this application.<br>
> default value: `True`
>> Activation of dressings. Allows users to customize a video with watermark & credits.<br>
###
###


### Seaker application configuration
Expand Down Expand Up @@ -659,7 +659,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.<br>
> default value: `True`
>> Directory that will contain the video files generated by bbb-recorder.<br>
###
###

* `AFFILIATION_EVENT`
> default value: `['faculty', 'employee', 'staff']`
Expand Down Expand Up @@ -717,7 +717,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.<br>
> default value: `60`
>>
###
###

* `LTI_ENABLED`
> default value: `False`
Expand All @@ -737,7 +737,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.<br>
>> ```
>>
###
###
* `HOMEPAGE_VIEW_VIDEOS_FROM_NON_VISIBLE_CHANNELS`
> default value: `False`
Expand All @@ -764,7 +764,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.<br>
> default value: `False`
>> Webtv mode allows you to switch POD into a webtv application removing the connection buttons for example<br>
###
###
Expand Down Expand Up @@ -864,7 +864,7 @@ Set `USE_PLAYLIST` to True to activate this application.<br>
> default value: `True`
>> Activation of promoted playlists. Allows users to use the promoted playlists.<br>
###
###
* `FILES_DIR`
> default value: `files`
Expand All @@ -879,7 +879,7 @@ Set `USE_PLAYLIST` to True to activate this application.<br>
> default value: `('jpg', 'jpeg', 'bmp', 'png', 'gif', 'tiff', 'webp')`
>> Allowed extensions for images uploaded in the file manager (must be lowercase).<br>
###
###
* `USE_NOTIFICATIONS`
> default value: `True`
Expand All @@ -906,7 +906,7 @@ Set `USE_QUIZ` to True to activate this application.<br>
> default value: `True`
>> Activation of quizzes. Allows users to create, respond and use quizzes in videos.<br>
###
###

* `ALLOW_MANUAL_RECORDING_CLAIMING`
> default value: `False`
Expand Down Expand Up @@ -968,7 +968,7 @@ Set `USE_QUIZ` to True to activate this application.<br>
> default value: `False`
>> If True, displays the video preview icon in the "Claim a recording" page.<br>
###
###

* `ACTIVE_VIDEO_COMMENT`
> default value: `False`
Expand Down Expand Up @@ -1076,7 +1076,7 @@ Set `USE_QUIZ` to True to activate this application.<br>
> default value: `False`
>>
###
###



Expand Down Expand Up @@ -1125,7 +1125,7 @@ Set `USE_QUIZ` to True to activate this application.<br>
> default value: `[]`
>>
###
###

* `ES_INDEX`
> default value: `pod`
Expand All @@ -1146,7 +1146,7 @@ Set `USE_QUIZ` to True to activate this application.<br>
> default value: `{}`
>>
###
###

Application for sending xAPI statements to an LRS.<br>
No statements persist in Pod, they are all sent to the configured LRS.<br>
Expand Down
4 changes: 4 additions & 0 deletions CONFIGURATION_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ Mettre `USE_AI_ENHANCEMENT` à True pour activer cette application.<br>
* `USE_AI_ENHANCEMENT`
> valeur par défaut : `False`
>> Activation des améliorations de l'intelligence artificielle. Permet aux utilisateurs de l'utiliser.<br>
* `AI_ENHANCEMENT_PROXY_URL`
> valeur par défaut : ``
>> L’URL du serveur proxy pour les requêtes venant d'Aristote.<br>
>> Exemple : '<https://proxy_aristote.univ.fr>'<br>
### Configuration de l’application authentification
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Affiche la liste des commandes disponibles
help:
echo "Syntax: [make target] where target is in this list:"
@echo "Syntax: [make target] where target is in this list:"
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t

# Démarre le serveur de test
Expand Down
13 changes: 8 additions & 5 deletions pod/ai_enhancement/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
settings, "AI_ENHANCEMENT_CLIENT_SECRET", "mocked_secret"
)
AI_ENHANCEMENT_TO_STAFF_ONLY = getattr(settings, "AI_ENHANCEMENT_TO_STAFF_ONLY", True)
AI_ENHANCEMENT_PROXY_URL = getattr(settings, "AI_ENHANCEMENT_PROXY_URL", "")
LANG_CHOICES = getattr(
settings,
"LANG_CHOICES",
Expand Down Expand Up @@ -95,14 +96,16 @@ def send_enhancement_creation_request(
+ request.user.username
).encode("utf-8")
).hexdigest()
if AI_ENHANCEMENT_PROXY_URL:
base_url = AI_ENHANCEMENT_PROXY_URL
else:
base_url = url_scheme + "://" + get_current_site(request).domain

creation_response = aristote.create_enhancement_from_url(
url_scheme + "://" + get_current_site(request).domain + mp3_url,
base_url + mp3_url,
["video/mp3"],
end_user_identifier + "@%s" % get_current_site(request).domain,
url_scheme
+ "://"
+ get_current_site(request).domain
+ reverse("ai_enhancement:webhook"),
base_url + reverse("ai_enhancement:webhook"),
)
if creation_response:
if creation_response["status"] == "OK":
Expand Down
3 changes: 2 additions & 1 deletion pod/completion/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def enrich_kaldi_model_launch() -> None:

@admin.action(description=_("Enrich with selected subtitles"))
def enrich_model(modeladmin, request, queryset) -> None:
"""Enrich with selected subtitles."""
text = ""
title = ""
for query in list(queryset.all()):
Expand All @@ -249,7 +250,7 @@ def enrich_model(modeladmin, request, queryset) -> None:
title += query.video.title
file = query.src.file
for caption in webvtt.read(file.path):
text += caption.text + " \n"
text += caption.text + "\n"
query.enrich_ready = False
query.save()

Expand Down
9 changes: 7 additions & 2 deletions pod/dressing/templates/my_dressings.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,15 @@
{% endif %}
</td><td>
<div class="d-flex justify-content-between">
<a href="{% url 'dressing:dressing_edit' dressing_id=dressing.pk %}" class="btn btn-primary me-1" title="{% blocktrans with title=dressing.title %}Edit “{{title}}”{% endblocktrans %}" data-bs-toggle="tooltip" data-bs-placement="top">
<a href="{% url 'dressing:dressing_edit' dressing_id=dressing.pk %}"
class="btn btn-primary me-1"
title="{% blocktrans with title=dressing.title %}Edit “{{title}}”{% endblocktrans %}"
data-bs-toggle="tooltip" data-bs-placement="top">
<i class="bi bi-pencil-square" aria-hidden="true"></i>
</a>
<a href="{% url 'dressing:dressing_delete' dressing_id=dressing.pk %}" class="btn btn-danger" title="{% blocktrans with title=dressing.title%}Delete “{{title}}”{% endblocktrans %}" data-bs-toggle="tooltip" data-bs-placement="top">
<a href="{% url 'dressing:dressing_delete' dressing_id=dressing.pk %}" class="btn btn-danger"
title="{% blocktrans with title=dressing.title%}Delete “{{title}}”{% endblocktrans %}"
data-bs-toggle="tooltip" data-bs-placement="top">
<i class="bi bi-trash" aria-hidden="true"></i>
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions pod/import_video/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class ExternalRecordingForm(forms.ModelForm):
),
)

def filter_fields_admin(form):
def filter_fields_admin(form) -> None:
"""List fields, depends on user right."""
if not form.is_superuser and not form.is_admin:
form.remove_field("owner")
form.remove_field("site")

def clean(self):
def clean(self) -> None:
"""Clean method."""
cleaned_data = super(ExternalRecordingForm, self).clean()
try:
Expand Down
2 changes: 1 addition & 1 deletion pod/import_video/templates/import_video/add_or_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% if form.errors %}
<p class="text-danger">{% trans "One or more errors have been found in the form." %}<br>
{% for error in form.non_field_errors %}
<span> - {{ error }}</span> <br>
<span> - {{ error }}</span><br>
{% endfor %}
</p>
{% endif %}
Expand Down
4 changes: 1 addition & 3 deletions pod/import_video/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,7 @@ def check_source_url(source_url: str): # noqa: C901
# https://xxx/playback/presentation/2.0/playback.html?meetingId=ID
# to https://xxx/playback/presentation/2.3/ID?meetingId=ID
media_id = array_url[-1]
source_video_url = source_url.replace(
"/2.0/playback.html", "/2.3/" + media_id
).replace("playback.html?meetingId=", "")
source_video_url = source_url
format = "webm"
platform = "BBB_Presentation"
elif source_url.find("/playback/presentation/2.3/") != -1:
Expand Down
8 changes: 5 additions & 3 deletions pod/live/templates/live/event-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ <h2 class="modal-title h5" id="shareLabel">
<input class="form-control" type="text" name="txtpartage" id="txtpartage" value="{% if request.is_secure %}https{% else %}http{% endif %}://{{ request.META.HTTP_HOST }}{% url 'live:event' slug=event.slug %}{% if event.is_draft == True %}{{ event.get_hashkey }}/{% endif %}">
</div>
<div class="form-group m-2">
{% get_event_qrcode event.id as qrcode %}
<label>{% trans 'QR code for this link:' %}&nbsp;</label><br>
{% get_event_qrcode event.id as qrcode %}
<label>{% trans 'QR code for this link:' %}</label><br>
{{ qrcode }}
<br>
<button id="btn-download-qr-code" type="submit" data-slug="{{ event.slug }}" class="btn btn-primary my-2" title="{% trans 'Download this QR code' %}">{% trans 'Download' %}</button>
<button id="btn-download-qr-code" type="submit" data-slug="{{ event.slug }}"
class="btn btn-primary my-2"
title="{% trans 'Download this QR code' %}">{% trans 'Download' %}</button>
</div>
</fieldset>
</div> <!-- End modal body-->
Expand Down
2 changes: 1 addition & 1 deletion pod/live/templates/live/event_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<p class="small video-title">
<a href="{{event.get_absolute_url}}
{% if playlist %}?playlist={{playlist.slug}}{% endif %}"
title="{{event.title}}">
title="{% blocktrans with title=event.title %}See the event “{{ title }}”.{% endblocktrans %}">
{{event.title|capfirst|truncatechars:43}}
</a>
</br>
Expand Down
2 changes: 1 addition & 1 deletion pod/live/templates/live/my_events.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
{% if display_creation_button %}
<div class="d-flex infinite-container mb-2" id="event_add">
<a class="btn btn-primary" href="{% url 'live:event_edit' %}" title="{% trans 'Plan an event' %}">
<a class="btn btn-primary" href="{% url 'live:event_edit' %}">
<i class="bi bi-plus pod-add" aria-hidden="true"></i>
<span>{% trans "Plan an event" %}</span>
</a>
Expand Down
Binary file modified pod/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 99daf42

Please sign in to comment.