|
{% 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 %} |