partitioncloud-server/partitioncloud/templates/partition/attachments.html

64 lines
2.2 KiB
HTML
Raw Normal View History

{% set DISABLE_HEADER=true %}
{% extends 'base.html' %}
2024-01-25 16:22:04 +01:00
{% block title %}{{ _("Attachments de %(name)s", name=partition.name) }}{% endblock %}
{% block dialogs %}
<dialog id="create-attachment">
2024-01-25 16:22:04 +01:00
<h2>{{ _("Ajouter un attachment à %(name)s", name=partition.name) }}</h2>
<form action="/partition/{{ partition.uuid }}/add-attachment" method="post" enctype="multipart/form-data">
2024-01-25 16:22:04 +01:00
<input type="text" name="name" id="name" placeholder="{{ _('Nom') }}"><br/>
<input name="file" type="file" accept=".mp3,.mid" required=""><br/>
2024-01-25 16:22:04 +01:00
<input type="submit" value="{{ _('Ajouter') }}">
</form>
<a href="#!" class="close-dialog">Close</a>
</dialog>
{% endblock %}
{% block content %}
<object id="pdf-embed" width="400" height="500" type="application/pdf" data="/partition/{{ partition.uuid }}">
<p>
2024-01-25 16:22:04 +01:00
{{ _("Impossible d'afficher le pdf dans ce navigateur.
Il est conseillé d'utiliser Firefox sur Android.") }}
</p>
</object>
<script src="https://cdn.jsdelivr.net/combine/npm/tone@14.7.58,npm/@magenta/music@1.23.1/es6/core.js,npm/focus-visible@5,npm/html-midi-player@1.5.0"></script>
<midi-visualizer type="staff" id="midi-visualizer"></midi-visualizer>
{% if partition.attachments | length > 0 %}
<div id="attachments">
<table>
<tbody>
{% for attachment in partition.attachments %}
<tr>
{% if attachment.filetype == "mp3" %}
<td><audio controls src="/partition/attachment/{{ attachment.uuid }}.mp3"></td>
<td>🎙️ {{ attachment.name }}</td>
{% elif attachment.filetype == "mid" %}
<td><midi-player
src="/partition/attachment/{{ attachment.uuid }}.mid"
sound-font visualizer="#midi-visualizer" data-js-focus-visible>
</midi-player>
2024-01-25 16:22:04 +01:00
<noscript>{{ _("JavaScript est nécessaire pour lire les fichiers MIDI") }}</noscript>
</td>
<td>🎵 {{ attachment.name }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
<br/>
{% if user %}
<div class="centered">
2024-01-25 16:22:04 +01:00
<a href="#create-attachment"><button>{{ _("Ajouter un attachment") }}</button></a>
</div>
{% endif %}
{% endblock %}