File size: 1,806 Bytes
7fd3b3f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
{% extends "base.html" %}
{% block title %}Gestion des Podcasts{% endblock %}
{% block content %}
<h2>Ajouter un Nouveau Podcast</h2>
<form method="POST" action="{{ url_for('gestion') }}">
<div>
<label for="name">Nom du fichier audio :</label><br>
<input type="text" id="name" name="name" required>
</div>
<div>
<label for="url">Lien de téléchargement :</label><br>
<input type="url" id="url" name="url" required placeholder="https://example.com/audio.mp3">
</div>
<div>
<label for="subject">Matière :</label><br>
<input type="text" id="subject" name="subject" required>
</div>
<br>
<button type="submit">Ajouter le Podcast</button>
</form>
<h2>Podcasts Actuels</h2>
{% if podcasts %}
<table>
<thead>
<tr>
<th>Nom</th>
<th>Matière</th>
<th>URL</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for podcast in podcasts %}
<tr>
<td>{{ podcast.name }}</td>
<td>{{ podcast.subject }}</td>
<td><a href="{{ podcast.url }}" target="_blank">Lien</a></td>
<td>
<form method="POST" action="{{ url_for('delete_podcast', podcast_id=podcast.id) }}" style="display:inline;">
<button type="submit" onclick="return confirm('Êtes-vous sûr de vouloir supprimer ce podcast ?');">Supprimer</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Aucun podcast ajouté pour le moment.</p>
{% endif %}
{% endblock %} |