Skip to content

Commit

Permalink
Passe au DSFR les modal d'enregistrement
Browse files Browse the repository at this point in the history
  • Loading branch information
funelie authored and LoanR committed Mar 29, 2024
1 parent 5c7fea3 commit 1d10dce
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 30 deletions.
4 changes: 2 additions & 2 deletions web/b3desk/templates/meeting/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h2 class="fr-h3">Vous pouvez ajouter un fichier :</h2>
<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="delete-file-{{ file.id }}" title="Fermer"></button>
<button class="fr-btn--close fr-btn" aria-controls="delete-file-{{ file.id }}" title="Fermer">Fermer</button>
</div>
<div class="fr-modal__content">
<h1 id="delete-file-{{ file.id }}-title" class="fr-modal__title">
Expand All @@ -156,7 +156,7 @@ <h1 id="delete-file-{{ file.id }}-title" class="fr-modal__title">
<p class="padbot">Voulez-vous vraiment supprimer le fichier <em>{{ file.short_title }}</em> ?</p>
</div>
<div class="fr-modal__footer">
<form action="{{ url_for("meeting_files.delete_meeting_file") }}" method="POST" onsubmit="deleteFile(event)">
<form class="delete" action="{{ url_for("meeting_files.delete_meeting_file") }}" method="POST" onsubmit="deleteFile(event)">
<input class="fr-input" type="hidden" name="id" value="{{ file.id }}" />
<ul class="fr-btns-group fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--right">
<li>
Expand Down
108 changes: 80 additions & 28 deletions web/b3desk/templates/meeting/recordings.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ <h1 class="fr-h2">{% trans meeting_name=meeting.name %}Enregistrements de <em>{{
{% 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-{{ recording.recordID }}"
data-modal-title="Renommer l'enregistrement"
data-modal-close-text="x"
data-modal-close-title="Fermer la fenêtre modale">
<span class="fr-icon-edit-line"></span>
<button class="fr-btn fr-btn--secondary fr-icon-edit-line" data-fr-opened="false" aria-controls="rename-video-{{ recording.recordID }}">
Renommer l'enregistrement
</button>
</h3>
<div class="fr-table fr-table--bordered fr-table--layout-fixed">
Expand Down Expand Up @@ -62,14 +55,9 @@ <h3>
{% 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-{{ 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>
<button class="fr-btn fr-btn--secondary fr-fi-delete-line" data-fr-opened="false" aria-controls="delete-video-{{ recording.recordID }}">
{% trans meeting_name=meeting.name %}Supprimer video de {{ meeting_name }}{% endtrans %}
</button>
</div>
</td>
</tr>
Expand All @@ -79,18 +67,44 @@ <h3>
</div>

<!-- Supprimer video -->
<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="{{ 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' %}
{% include 'meeting/csrf.html' %}
</form>

<dialog id="delete-video-{{ recording.recordID }}" class="fr-modal" role="dialog" aria-labelledby="delete-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="delete-video-{{ recording.recordID }}" title="Fermer">
Fermer
</button>
</div>
<div class="fr-modal__content">
<h1 id="delete-video-{{ recording.recordID }}-title" class="fr-modal__title">
<span class="" aria-hidden="true"></span>
Supprimer "<em>{{ recording_name }}</em>" ?
</h1>
<p>Voulez-vous vraiment supprimer l'enregistrement <em>{{ recording_name }}</em> de <em>{{ meeting.name }}</em> ?</p>
</div>
<div class="fr-modal__footer">
<form action="{{ url_for("meetings.delete_video_meeting") }}" method="POST" class="delete">
<input class="fr-input" type="hidden" name="recordID" value="{{ recording.recordID }}" />
<ul class="fr-btns-group fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--right">
<li>
<button type="submit" class="fr-btn fr-btn--primary" >{% trans %}Supprimer{% endtrans %}</button>
</li>
<li>
<button type="reset" class="fr-btn fr-btn--secondary js-modal-close" >{% trans %}Annuler{% endtrans %}</button>
</li>
</ul>
{% include 'meeting/id.html' %}
{% include 'meeting/csrf.html' %}
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</dialog>

<!-- Renommer video -->
<div class="modal-template" id="rename-video-{{ recording.recordID }}">
Expand All @@ -114,6 +128,44 @@ <h3>
</form>
</div>
</div>
<dialog id="rename-video-{{ r.recordID }}" class="fr-modal" role="dialog" aria-labelledby="rename-video-{{ r.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="rename-video-{{ r.recordID }}" title="Fermer">
Fermer
</button>
</div>
<div class="fr-modal__content">
<form method="POST" action="{{ url_for('meetings.update_recording_name', meeting=meeting, recording_id=r.recordID) }}">
{% include 'meeting/csrf.html' %}
<div class="fr-input-group">
{{ form.name.label(class_="fr-label") }}
<p class="fr-hint-text">{{ form.name.description }}</p>
{% if form.name.errors %}
{% for error in form.name.errors %}
<p class="fr-error-text">{{ error }}</p>
{% endfor %}
{% endif %}
{{ form.name(value=recording_name, class_="fr-input") }}
</div>
<ul class="fr-btns-group fr-btns-group--inline-reverse fr-btns-group--inline-lg fr-btns-group--right">
<li>
<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>
</li>
<li>
<button type="reset" class="fr-btn fr-btn--secondary js-modal-close" >Annuler</button>
</li>
</ul>
</form>
</div>
</div>
</div>
</div>
</div>
</dialog>

{% endfor %}
</div>
Expand Down

0 comments on commit 1d10dce

Please sign in to comment.