Skip to content

Commit

Permalink
refactor: jinja variable renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Mar 27, 2024
1 parent dda100a commit cd4a4e2
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions web/b3desk/templates/meeting/recordings.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ <h1 class="fr-h2">{% trans meeting_name=meeting.name %}Enregistrements de <em>{{
{% endif %}
<p>{% trans %}Après la fin d'{{ a_meeting }}, l'encodage de l'enregistrement peut prendre autant de temps que la durée {{ of_the_meeting }}.{% endtrans %}</p>
<p>{% trans %}Si aucun modérateur ne met fin {{ of_the_meeting }}, un délai supplémentaire de plusieurs minutes s'ajoute après que tous les utilisateurs l'aient quitté.{% endtrans %}</p>
{% for r in meeting.get_recordings() %}
{% set recording_name = r.name or r.start_date.strftime("%d/%m/%Y") %}
<p>{% trans %}Les enregistrements sont conservés pour une période d’un an.{% endtrans %}</p>
{% for recording in meeting.get_recordings() %}
{% set recording_name = recording.name or recording.start_date.strftime("%d/%m/%Y") %}
<h3>
{{ recording_name }}
<button
class="fr-btn fr-btn--secondary js-modal fr-mr-2w fr-mt-1w"
title="Renommer l'enregistrement"
aria-label="Renommer l'enregistrement"
data-modal-content-id="rename-video-{{ r.recordID }}"
data-modal-content-id="rename-video-{{ recording.recordID }}"
data-modal-title="Renommer l'enregistrement"
data-modal-close-text="x"
data-modal-close-title="Fermer la fenêtre modale">
Expand All @@ -39,13 +40,13 @@ <h3>
<th>{% trans %}Actions{% endtrans %}</th>
</thead>
<tbody>
{% set p = r.playbacks.get("presentation") %}
{% if p %}
{% set playback = recording.playbacks.get("presentation") %}
{% if playback %}
<tr style="background-color: white;">
<td>
<div class="fr-grid-row fr-grid-row--gutters">
{% for i in p.images %}
{% if loop.index is le(2) %}
{% for i in playback.images %}
{% if looplayback.index is le(2) %}
<div class="fr-col">
<img alt="{{ i.alt }}" title="{{ i.alt }}" src="{{ i.url }}"/>
</div>
Expand All @@ -55,18 +56,18 @@ <h3>
</td>
<td style="vertical-align: middle">
<div class="fr-grid-row fr-grid-row--gutters">
<a class="fr-btn fr-btn--primary fr-mr-2w fr-mt-1w" target="_blank" rel="noopener" href="{{ p.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-mr-2w fr-mt-1w" id="meeting-{{ meeting.id }}-moderator-copy" onclick="navigator.clipboard.writeText('{{ p.url }}');" title="Copier le lien de l'enregistrement dans le presse-papiers">
<a class="fr-btn fr-btn--primary fr-mr-2w fr-mt-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-mr-2w fr-mt-1w" 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 r.playbacks.get("video") %}
<a class="fr-btn fr-btn--primary fr-mr-2w fr-mt-1w" download target="_blank" rel="noopener" href="{{ r.playbacks['video'].url }}" title="Voir l'enregistrement mp4 (fichier téléchargeable) et le chat">mp4</a>
{% if recording.playbacks.get("video") %}
<a class="fr-btn fr-btn--primary fr-mr-2w fr-mt-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>
{% endif %}
<button
class="fr-btn fr-btn--secondary js-modal fr-mr-2w fr-mt-1w"
title="{% trans meeting_name=meeting.name %}Supprimer video de {{ meeting_name }}{% endtrans %} "
aria-label="{% trans meeting_name=meeting.name %}Supprimer video de {{ meeting_name }}{% endtrans %}"
data-modal-content-id="delete-video-{{ r.recordID }}"
data-modal-content-id="delete-video-{{ recording.recordID }}"
data-modal-title="{% trans %}Suppression d'enregistrement{% endtrans %}"
data-modal-close-text="x"
data-modal-close-title="{% trans %}Fermer la fenêtre modale{% endtrans %}"><span class="fr-fi-delete-line"></span></button>
Expand All @@ -79,11 +80,11 @@ <h3>
</div>

<!-- Supprimer video -->
<div class="modal-template" id="delete-video-{{ r.recordID }}">
<div class="modal-template" id="delete-video-{{ recording.recordID }}">
<div class="modal-body modal-body--center">
<p>Voulez-vous vraiment supprimer l'enregistrement <em>{{ recording_name }}</em> de <em>{{ meeting.name }}</em> ?</p>
<form action="{{ url_for("meetings.delete_video_meeting") }}" method="POST" class="delete">
<input class="fr-input" type="hidden" name="recordID" value="{{ r.recordID }}" />
<input class="fr-input" type="hidden" name="recordID" value="{{ recording.recordID }}" />
<button type="submit" class="fr-btn fr-btn--primary" >{% trans %}Supprimer{% endtrans %}</button>
<button type="reset" class="fr-btn fr-btn--secondary js-modal-close" >{% trans %}Annuler{% endtrans %}</button>
{% include 'meeting/id.html' %}
Expand All @@ -93,9 +94,9 @@ <h3>
</div>

<!-- Renommer video -->
<div class="modal-template" id="rename-video-{{ r.recordID }}">
<div class="modal-template" id="rename-video-{{ recording.recordID }}">
<div class="modal-body">
<form method="POST" action="{{ url_for('meetings.update_recording_name', meeting=meeting, recording_id=r.recordID) }}">
<form method="POST" action="{{ url_for('meetings.update_recording_name', meeting=meeting, recording_id=recording.recordID) }}">
{% include 'meeting/csrf.html' %}
<div class="fr-input-group">
{{ form.name.label(class_="fr-label") }}
Expand All @@ -108,7 +109,7 @@ <h3>
{{ form.name(value=recording_name, class_="fr-input") }}
</div>
<div class="modal-body--center">
<input type="submit" class="fr-btn fr-btn--primary fr-mt-1w" id="update-recording-{{ r.recordID }}" title="Modifier le nom de l'enregistrement" value="Renommer"></input>
<input type="submit" class="fr-btn fr-btn--primary fr-mt-1w" id="update-recording-{{ recording.recordID }}" title="Modifier le nom de l'enregistrement" value="Renommer"></input>
<button type="reset" class="fr-btn fr-btn--secondary js-modal-close" >Annuler</button>
</div>
</form>
Expand Down

0 comments on commit cd4a4e2

Please sign in to comment.