Initial commit

This commit is contained in:
Rutra
2026-02-25 00:34:39 +01:00
commit 54b0fc3485
178 changed files with 12761 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
@component('admin/layouts/main')
@slot('main')
<h1 class="text-2xl font-bold mb-6">{{ music ? 'Modifier la musique' : 'Nouvelle musique' }}</h1>
<form action="{{ music ? `/admin/music/${music.id}` : '/admin/music' }}?_method={{ music ? 'PUT' : 'POST' }}" method="post" enctype="multipart/form-data" class="bg-white p-6 rounded shadow max-w-xl">
{{{ csrfField() }}}
<div class="space-y-4">
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-1">Nom</label>
<input type="text" name="name" id="name" value="{{ music?.name || '' }}" required
class="w-full px-3 py-2 border rounded" />
</div>
<div>
<label for="file" class="block text-sm font-medium text-gray-700 mb-1">Fichier Audio (MP3)</label>
@if(music && music.url)
<div class="mb-2 text-sm text-gray-600">
Fichier actuel: <a href="{{ music.url }}" target="_blank" class="text-blue-600 hover:underline">{{ music.url }}</a>
<audio controls src="{{ music.url }}" class="mt-2 w-full"></audio>
</div>
@endif
<input type="file" name="file" id="file" accept=".mp3,.wav,.ogg" {{ music ? '' : 'required' }}
class="w-full px-3 py-2 border rounded" />
</div>
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">
Enregistrer
</button>
</div>
</form>
@endslot
@end

View File

@@ -0,0 +1,42 @@
@component('admin/layouts/main')
@slot('main')
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold">Musiques</h1>
<a href="/admin/music/create" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">
Nouvelle piste
</a>
</div>
<div class="bg-white rounded shadow overflow-hidden">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Nom</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">URL</th>
<th class="px-4 py-2 text-right text-sm font-medium text-gray-700">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@each(m in musics)
<tr>
<td class="px-4 py-2">{{ m.name }}</td>
<td class="px-4 py-2">{{ m.url }}</td>
<td class="px-4 py-2 text-right">
<a href="/admin/music/{{ m.id }}/edit" class="text-blue-600 hover:underline mr-2">Modifier</a>
<form action="/admin/music/{{ m.id }}/delete" method="post" class="inline">
{{{ csrfField() }}}
<button type="submit" class="text-red-600 hover:underline" onclick="return confirm('Supprimer ?')">
Supprimer
</button>
</form>
</td>
</tr>
@else
<tr>
<td colspan="3" class="px-4 py-6 text-center text-gray-500">Aucune musique</td>
</tr>
@endeach
</tbody>
</table>
</div>
@endslot
@end