Skip to content

Commit

Permalink
Merge branch 'main' 1.2.17dev into production
Browse files Browse the repository at this point in the history
  • Loading branch information
LoanR committed Aug 23, 2024
2 parents d7949dc + 388a4d0 commit fa0df2a
Show file tree
Hide file tree
Showing 9 changed files with 326 additions and 202 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "b3desk"
version = "1.2.16"
version = "1.2.17"
description = "Outil de visioconférence pour les agents de l'Education Nationale et de l'Etat en général."
authors = ["Your Name <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion web/b3desk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .utils import enum_converter
from .utils import model_converter

__version__ = "1.2.16"
__version__ = "1.2.17"

LANGUAGES = ["en", "fr"]

Expand Down
19 changes: 18 additions & 1 deletion web/b3desk/models/bbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,26 @@ def get_recordings(self):
type = format.find("type").text
if type in ("presentation", "video"):
data["playbacks"][type] = {
"url": format.find("url").text,
"url": (media_url := format.find("url").text),
"images": images,
}
if type == "video":
try:
resp = requests.get(
direct_link := media_url + "video-0.m4v"
)
if resp.status_code == 200:
data["playbacks"][type]["direct_link"] = (
direct_link
)
except (
requests.exceptions.HTTPError,
requests.exceptions.ConnectionError,
):
current_app.logger.warning(
"No direct recording link for meeting %s",
self.meeting.meetingID,
)
result.append(data)
except Exception as exception:
current_app.logger.error(exception)
Expand Down
17 changes: 17 additions & 0 deletions web/b3desk/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,3 +1051,20 @@ def get_email_whitelist(

ENABLE_LASUITENUMERIQUE: Optional[bool] = False
"""Enable LaSuite numerique homepage style."""

VIDEO_STREAMING_LINKS: Optional[dict[str, str]] = {}
"""List of streaming service for video sharing."""

@field_validator("VIDEO_STREAMING_LINKS", mode="before")
def get_video_streaming_links(
cls,
video_streaming_links: Optional[dict[str, str]],
info: ValidationInfo,
) -> dict[str, str]:
if not video_streaming_links:
return {}

if isinstance(video_streaming_links, str):
return json.loads(video_streaming_links)

return video_streaming_links
22 changes: 22 additions & 0 deletions web/b3desk/static/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ dialog.scampi-modal {
border-bottom: 2px solid #9C9C9C;
word-break: break-word;
}

.fr-modal__body code {
word-break: break-word;
}

button.btn-copy {
height: 100%;
}
Expand Down Expand Up @@ -322,6 +327,16 @@ color: #000091; }
.rf-col.bottom-align-container > button {
bottom: calc(1.5rem/2);
}
.lasuite-homepage__content .fr-grid-row {
flex-wrap: nowrap;
gap: 1rem;
}
.lasuite-homepage__content .lasuite-homepage__secondary-col {
margin: 0rem auto 2rem;
}
.fr-header__menu-links .lasuite-gaufre-btn {
display: none !important;
}
}

@media only screen and (max-width : 768px) {
Expand Down Expand Up @@ -376,6 +391,13 @@ color: #000091; }
.modal-body p, .modal-body label{
font-size:0.8em;
}
.lasuite-homepage__content .fr-grid-row {
flex-wrap: wrap;
gap: 0rem;
}
.lasuite-homepage__content .lasuite-homepage__secondary-col {
margin: 2rem auto 2rem;
}
}

.rf-fi-refresh-fill::before {
Expand Down
9 changes: 9 additions & 0 deletions web/b3desk/templates/brand.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
<button class="fr-btn--menu fr-btn" data-fr-opened="false" aria-controls="modal-616" aria-haspopup="menu" id="button-617" title="Menu">
Menu
</button>
{% if config.get("ENABLE_LASUITENUMERIQUE") %}
<button
type="button"
class="lasuite-gaufre-btn lasuite-gaufre-btn--vanilla js-lasuite-gaufre-btn"
title="Les services de La Suite numérique"
>
Les services de La Suite numérique
</button>
{% endif %}
</div>
</div>
<div class="fr-header__service">
Expand Down
59 changes: 55 additions & 4 deletions web/b3desk/templates/meeting/recordings.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ <h3 class="fr-h3">
{% trans %}Renommer l’enregistrement{% endtrans %}
</button>
</h3>
<span>
{% trans start_date=recording.start_date|dateformat, expiration_date=(recording.end_date+config["RECORDING_DURATION"])|dateformat %}
Enregistré le {{ start_date }} -
Expire le {{ expiration_date }}
{% endtrans %}
</span>
<div class="fr-table fr-table--bordered fr-table--layout-fixed">
<table>
<thead>
Expand All @@ -53,14 +55,19 @@ <h3 class="fr-h3">
</td>
<td style="vertical-align: middle">
<div class="fr-grid-row fr-grid-row--gutters btn-actions">
<a class="fr-btn fr-btn--primary fr-mx-1w" target="_blank" rel="noopener" href="{{ playback.url }}" title="Voir l'enregistrement"><span class="fr-icon-play-line"></span></a>
<button type="button" class="btn-copy fr-btn fr-btn--primary fr-mx-1w"" id="meeting-{{ meeting.id }}-moderator-copy" onclick="navigator.clipboard.writeText('{{ playback.url }}');" title="Copier le lien de l'enregistrement dans le presse-papiers">
<a class="fr-btn fr-btn--primary" target="_blank" rel="noopener" href="{{ playback.url }}" title="Voir l'enregistrement"><span class="fr-icon-play-line"></span></a>
<button type="button" class="btn-copy fr-btn fr-btn--primary fr-ml-1v" id="meeting-{{ meeting.id }}-moderator-copy" onclick="navigator.clipboard.writeText('{{ playback.url }}');" title="Copier le lien de l'enregistrement dans le presse-papiers">
<span class="fr-icon-clipboard-line"></span>
</button>
{% if recording.playbacks.get("video") %}
<a class="fr-btn fr-btn--primary fr-mx-1w"" download target="_blank" rel="noopener" href="{{ recording.playbacks['video'].url }}" title="Voir l'enregistrement mp4 (fichier téléchargeable) et le chat">mp4</a>
<a class="fr-btn fr-btn--primary fr-ml-2w" target="_blank" rel="noopener" href="{{ recording.playbacks['video'].url }}" title="Voir l'enregistrement mp4"><span class="fr-icon-film-line"></span></a>
{% if recording.playbacks.video.get("direct_link") %}
<button class="fr-btn fr-btn--primary fr-ml-1v" data-fr-opened="false" aria-controls="share-video-{{ recording.recordID }}" title="Partager l'enregistrement mp4">
<span class="fr-icon-links-line" aria-hidden="true"></span>
</button>
{% endif %}
{% endif %}
<button class="fr-btn fr-btn--secondary fr-fi-delete-line fr-mx-1w"" data-fr-opened="false" aria-controls="delete-video-{{ recording.recordID }}">
<button class="fr-btn fr-btn--secondary fr-fi-delete-line fr-ml-2w" data-fr-opened="false" aria-controls="delete-video-{{ recording.recordID }}">
{% trans meeting_name=meeting.name %}Supprimer video de {{ meeting_name }}{% endtrans %}
</button>
</div>
Expand Down Expand Up @@ -151,6 +158,50 @@ <h1 id="delete-video-{{ recording.recordID }}-title" class="fr-modal__title">
</div>
</dialog>

<!-- Partager la video -->
<dialog id="share-video-{{ recording.recordID }}" class="fr-modal" role="dialog" aria-labelledby="share-video-{{ recording.recordID }}-title">
<div class="fr-container fr-container--fluid fr-container-md">
<div class="fr-grid-row fr-grid-row--center">
<div class="fr-col-12 fr-col-md-8 fr-col-lg-6">
<div class="fr-modal__body">
<div class="fr-modal__header">
<button class="fr-btn--close fr-btn" aria-controls="share-video-{{ recording.recordID }}" title="Fermer">
Fermer
</button>
</div>
<div class="fr-modal__content">
<h1 id="share-video-{{ recording.recordID }}-title" class="fr-modal__title">
<span class="" aria-hidden="true"></span>
Partager l'enregistrement de "<em>{{ recording_name }}</em>"
</h1>
<p>
Cet enregistrement est conservé temporairement sur ce service. Pour le mettre à disposition de manière pérenne, fournissez ce lien à des services dédiés à la diffusion
{%- if config["VIDEO_STREAMING_LINKS"] -%}
{%- for service, link in config["VIDEO_STREAMING_LINKS"].items() -%}
{{ " tels que " if loop.first else ", " if not loop.last else " ou " }}<a href="{{link}}">{{service}}</a>
{%- endfor -%}
{%- endif -%}
.
En cas de diffusion publique, veillez préalablement à obtenir l'autorisation des participants.
</p>
{% if recording.playbacks.get("video") %}
{% if recording.playbacks.video.get("direct_link") %}
<div class="fr-grid-row fr-grid-row--center">
<input class="fr-input fr-col-9" type="text" readonly value="{{ recording.playbacks.video.direct_link }}">
<button type="button" class="fr-btn fr-btn--sm fr-btn--primary fr-col-3" id="meeting-{{ meeting.id }}-moderator-copy" onclick="navigator.clipboard.writeText('{{ recording.playbacks.video.direct_link }}');" title="Copier le lien de l'enregistrement dans le presse-papiers">
<span class="fr-icon-clipboard-line"></span> 
Copier
</button>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</dialog>

{% endfor %}
</div>
<div class="fr-mt-4w">
Expand Down
Loading

0 comments on commit fa0df2a

Please sign in to comment.