feat(songs): add preview, searchable combo select, import toast, auto-select arrangement
- Hide translate button for already-translated songs in SongDB - Auto-select newly created/cloned arrangement via onSuccess + nextTick - Add preview button to SongDB list (fetches default arrangement preview) - Show success toast with count after .pro file import - Replace search+select with single searchable combo/autocomplete field - Wire preview modal and PDF download to real endpoints in service songs - Disable preview/PDF buttons when no arrangement selected
This commit is contained in:
parent
32e9577d4d
commit
6e48779259
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, nextTick, ref, watch } from 'vue'
|
||||||
import { router } from '@inertiajs/vue3'
|
import { router } from '@inertiajs/vue3'
|
||||||
import { VueDraggable } from 'vue-draggable-plus'
|
import { VueDraggable } from 'vue-draggable-plus'
|
||||||
|
|
||||||
|
|
@ -88,6 +88,15 @@ const addArrangement = () => {
|
||||||
{ name },
|
{ name },
|
||||||
{
|
{
|
||||||
preserveScroll: true,
|
preserveScroll: true,
|
||||||
|
onSuccess: () => {
|
||||||
|
nextTick(() => {
|
||||||
|
const updatedArrangements = props.arrangements
|
||||||
|
if (updatedArrangements.length > 0) {
|
||||||
|
const newest = updatedArrangements.reduce((a, b) => a.id > b.id ? a : b)
|
||||||
|
selectedId.value = newest.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -108,6 +117,15 @@ const cloneArrangement = () => {
|
||||||
{ name },
|
{ name },
|
||||||
{
|
{
|
||||||
preserveScroll: true,
|
preserveScroll: true,
|
||||||
|
onSuccess: () => {
|
||||||
|
nextTick(() => {
|
||||||
|
const updatedArrangements = props.arrangements
|
||||||
|
if (updatedArrangements.length > 0) {
|
||||||
|
const newest = updatedArrangements.reduce((a, b) => a.id > b.id ? a : b)
|
||||||
|
selectedId.value = newest.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ const toastVariant = ref('info')
|
||||||
const selectedSongIds = reactive({})
|
const selectedSongIds = reactive({})
|
||||||
const searchTerms = reactive({})
|
const searchTerms = reactive({})
|
||||||
const translationValues = reactive({})
|
const translationValues = reactive({})
|
||||||
|
const dropdownOpen = reactive({})
|
||||||
|
|
||||||
const showToast = (message, variant = 'info') => {
|
const showToast = (message, variant = 'info') => {
|
||||||
toastMessage.value = message
|
toastMessage.value = message
|
||||||
|
|
@ -131,8 +132,56 @@ const updateArrangementSelection = async (serviceSongId, arrangementId) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const showPlaceholder = () => {
|
const openDropdown = (serviceSongId) => {
|
||||||
showToast('Demnaechst verfuegbar')
|
dropdownOpen[serviceSongId] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeDropdown = (serviceSongId) => {
|
||||||
|
setTimeout(() => { dropdownOpen[serviceSongId] = false }, 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectSong = (serviceSongId, song) => {
|
||||||
|
selectedSongIds[serviceSongId] = song.id
|
||||||
|
searchTerms[serviceSongId] = song.title
|
||||||
|
dropdownOpen[serviceSongId] = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Preview / PDF
|
||||||
|
const previewData = ref(null)
|
||||||
|
const showPreview = ref(false)
|
||||||
|
const previewLoading = ref(false)
|
||||||
|
|
||||||
|
const openSongPreview = async (serviceSong) => {
|
||||||
|
if (!serviceSong.song_id || !serviceSong.song_arrangement_id) {
|
||||||
|
showToast('Bitte zuerst ein Arrangement auswählen.', 'warning')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
previewLoading.value = true
|
||||||
|
showPreview.value = true
|
||||||
|
try {
|
||||||
|
const response = await window.axios.get(
|
||||||
|
`/songs/${serviceSong.song_id}/arrangements/${serviceSong.song_arrangement_id}/preview`
|
||||||
|
)
|
||||||
|
previewData.value = response.data
|
||||||
|
} catch {
|
||||||
|
showToast('Vorschau konnte nicht geladen werden.', 'error')
|
||||||
|
showPreview.value = false
|
||||||
|
} finally {
|
||||||
|
previewLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const closePreview = () => {
|
||||||
|
showPreview.value = false
|
||||||
|
previewData.value = null
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadSongPdf = (serviceSong) => {
|
||||||
|
if (!serviceSong.song_id || !serviceSong.song_arrangement_id) {
|
||||||
|
showToast('Bitte zuerst ein Arrangement auswählen.', 'warning')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
window.location.href = `/songs/${serviceSong.song_id}/arrangements/${serviceSong.song_arrangement_id}/pdf`
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatDateTime = (value) => {
|
const formatDateTime = (value) => {
|
||||||
|
|
@ -252,40 +301,44 @@ const toastClasses = () => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid gap-3 md:grid-cols-[1fr,1fr,auto] md:items-end">
|
<div class="grid gap-3 md:grid-cols-[1fr,auto] md:items-end">
|
||||||
<div>
|
<div class="relative">
|
||||||
<label class="mb-1 block text-xs font-semibold uppercase tracking-wide text-gray-600">
|
<label class="mb-1 block text-xs font-semibold uppercase tracking-wide text-gray-600">
|
||||||
Song suchen
|
Song suchen und auswählen
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
data-testid="songs-block-search-input"
|
data-testid="songs-block-search-input"
|
||||||
v-model="searchTerms[serviceSong.id]"
|
v-model="searchTerms[serviceSong.id]"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Titel oder CCLI eingeben"
|
placeholder="Titel oder CCLI eingeben…"
|
||||||
class="block w-full rounded-md border-gray-300 text-sm shadow-sm focus:border-emerald-500 focus:ring-emerald-500"
|
class="block w-full rounded-md border-gray-300 text-sm shadow-sm focus:border-emerald-500 focus:ring-emerald-500"
|
||||||
|
@focus="openDropdown(serviceSong.id)"
|
||||||
|
@input="openDropdown(serviceSong.id)"
|
||||||
|
@blur="closeDropdown(serviceSong.id)"
|
||||||
>
|
>
|
||||||
</div>
|
<!-- Selected indicator -->
|
||||||
|
<div v-if="selectedSongIds[serviceSong.id]" class="mt-1 flex items-center gap-2">
|
||||||
<div>
|
<span class="text-xs text-emerald-700 font-medium">
|
||||||
<label class="mb-1 block text-xs font-semibold uppercase tracking-wide text-gray-600">
|
Ausgewählt: {{ songsCatalog.find(s => s.id === Number(selectedSongIds[serviceSong.id]))?.title || '' }}
|
||||||
Song aus DB auswaehlen
|
</span>
|
||||||
</label>
|
<button type="button" class="text-xs text-gray-400 hover:text-red-500" @click="selectedSongIds[serviceSong.id] = ''; searchTerms[serviceSong.id] = ''">✕</button>
|
||||||
<select
|
</div>
|
||||||
data-testid="songs-block-song-select"
|
<!-- Dropdown -->
|
||||||
v-model="selectedSongIds[serviceSong.id]"
|
<div
|
||||||
class="block w-full rounded-md border-gray-300 text-sm shadow-sm focus:border-emerald-500 focus:ring-emerald-500"
|
v-if="dropdownOpen[serviceSong.id] && filteredCatalog(serviceSong.id).length > 0"
|
||||||
|
class="absolute z-30 mt-1 max-h-48 w-full overflow-auto rounded-md border border-gray-200 bg-white shadow-lg"
|
||||||
>
|
>
|
||||||
<option value="">
|
<button
|
||||||
Bitte auswaehlen
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
v-for="song in filteredCatalog(serviceSong.id)"
|
v-for="song in filteredCatalog(serviceSong.id)"
|
||||||
:key="song.id"
|
:key="song.id"
|
||||||
:value="song.id"
|
type="button"
|
||||||
|
class="flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-emerald-50"
|
||||||
|
@mousedown.prevent="selectSong(serviceSong.id, song)"
|
||||||
>
|
>
|
||||||
{{ song.title }} (CCLI: {{ song.ccli_id || '-' }})
|
<span class="font-medium text-gray-900">{{ song.title }}</span>
|
||||||
</option>
|
<span class="ml-auto text-xs text-gray-400">CCLI: {{ song.ccli_id || '–' }}</span>
|
||||||
</select>
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
@ -336,7 +389,9 @@ const toastClasses = () => {
|
||||||
data-testid="songs-block-preview-button"
|
data-testid="songs-block-preview-button"
|
||||||
type="button"
|
type="button"
|
||||||
class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition hover:bg-gray-50"
|
class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition hover:bg-gray-50"
|
||||||
@click="showPlaceholder"
|
:disabled="!serviceSong.song_arrangement_id"
|
||||||
|
:class="{ 'opacity-50 cursor-not-allowed': !serviceSong.song_arrangement_id }"
|
||||||
|
@click="openSongPreview(serviceSong)"
|
||||||
>
|
>
|
||||||
Vorschau
|
Vorschau
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -344,7 +399,9 @@ const toastClasses = () => {
|
||||||
data-testid="songs-block-download-button"
|
data-testid="songs-block-download-button"
|
||||||
type="button"
|
type="button"
|
||||||
class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition hover:bg-gray-50"
|
class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition hover:bg-gray-50"
|
||||||
@click="showPlaceholder"
|
:disabled="!serviceSong.song_arrangement_id"
|
||||||
|
:class="{ 'opacity-50 cursor-not-allowed': !serviceSong.song_arrangement_id }"
|
||||||
|
@click="downloadSongPdf(serviceSong)"
|
||||||
>
|
>
|
||||||
PDF herunterladen
|
PDF herunterladen
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -360,5 +417,58 @@ const toastClasses = () => {
|
||||||
Fuer diesen Service sind aktuell keine Songs vorhanden.
|
Fuer diesen Service sind aktuell keine Songs vorhanden.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Song Preview Modal -->
|
||||||
|
<Teleport to="body">
|
||||||
|
<Transition
|
||||||
|
enter-active-class="transition duration-200 ease-out"
|
||||||
|
enter-from-class="opacity-0"
|
||||||
|
enter-to-class="opacity-100"
|
||||||
|
leave-active-class="transition duration-150 ease-in"
|
||||||
|
leave-from-class="opacity-100"
|
||||||
|
leave-to-class="opacity-0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="showPreview"
|
||||||
|
class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm"
|
||||||
|
@click.self="closePreview"
|
||||||
|
>
|
||||||
|
<div class="w-full max-w-2xl max-h-[80vh] overflow-auto rounded-2xl bg-white p-6 shadow-2xl">
|
||||||
|
<div class="flex items-center justify-between mb-4">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-900">
|
||||||
|
{{ previewData?.song?.title || 'Vorschau' }}
|
||||||
|
</h3>
|
||||||
|
<button type="button" class="text-gray-400 hover:text-gray-600" @click="closePreview">
|
||||||
|
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="previewLoading" class="flex items-center justify-center py-12">
|
||||||
|
<span class="inline-block h-6 w-6 animate-spin rounded-full border-2 border-amber-400 border-t-transparent"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="previewData" class="space-y-4">
|
||||||
|
<div v-for="(group, idx) in previewData.groups" :key="idx" class="rounded-lg border border-gray-200 p-4">
|
||||||
|
<div class="mb-2 flex items-center gap-2">
|
||||||
|
<span
|
||||||
|
class="inline-flex rounded-full px-3 py-1 text-xs font-semibold text-white"
|
||||||
|
:style="{ backgroundColor: group.color || '#6b7280' }"
|
||||||
|
>
|
||||||
|
{{ group.name }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="(slide, sIdx) in group.slides" :key="sIdx" class="mt-2 whitespace-pre-wrap text-sm text-gray-700 leading-relaxed">{{ slide.text_content }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="previewData.song?.copyright_text" class="border-t pt-3 text-xs text-gray-400">
|
||||||
|
{{ previewData.song.copyright_text }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
</Teleport>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ const deleteTarget = ref(null)
|
||||||
// Upload state
|
// Upload state
|
||||||
const isDragging = ref(false)
|
const isDragging = ref(false)
|
||||||
const uploadError = ref('')
|
const uploadError = ref('')
|
||||||
|
const uploadSuccess = ref('')
|
||||||
const fileInput = ref(null)
|
const fileInput = ref(null)
|
||||||
|
|
||||||
// Edit modal state
|
// Edit modal state
|
||||||
|
|
@ -23,6 +24,11 @@ const showEditModal = ref(false)
|
||||||
const editSongId = ref(null)
|
const editSongId = ref(null)
|
||||||
let debounceTimer = null
|
let debounceTimer = null
|
||||||
|
|
||||||
|
// Preview modal state
|
||||||
|
const previewSong = ref(null)
|
||||||
|
const previewData = ref(null)
|
||||||
|
const previewLoading = ref(false)
|
||||||
|
|
||||||
async function fetchSongs(page = 1) {
|
async function fetchSongs(page = 1) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
|
|
@ -130,6 +136,47 @@ function onSongUpdated() {
|
||||||
fetchSongs(meta.value.current_page)
|
fetchSongs(meta.value.current_page)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function openPreview(song) {
|
||||||
|
previewSong.value = song
|
||||||
|
previewLoading.value = true
|
||||||
|
previewData.value = null
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Fetch song details to get arrangements
|
||||||
|
const songRes = await fetch(`/api/songs/${song.id}`, {
|
||||||
|
headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' },
|
||||||
|
credentials: 'same-origin',
|
||||||
|
})
|
||||||
|
if (!songRes.ok) throw new Error('Song konnte nicht geladen werden')
|
||||||
|
const songDetail = await songRes.json()
|
||||||
|
|
||||||
|
const arrangements = songDetail.data?.arrangements || songDetail.arrangements || []
|
||||||
|
if (arrangements.length === 0) {
|
||||||
|
previewSong.value = null
|
||||||
|
previewLoading.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const defaultArr = arrangements.find(a => a.is_default) || arrangements[0]
|
||||||
|
const previewRes = await fetch(`/songs/${song.id}/arrangements/${defaultArr.id}/preview`, {
|
||||||
|
headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' },
|
||||||
|
credentials: 'same-origin',
|
||||||
|
})
|
||||||
|
if (!previewRes.ok) throw new Error('Vorschau konnte nicht geladen werden')
|
||||||
|
previewData.value = await previewRes.json()
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Preview error:', err)
|
||||||
|
previewSong.value = null
|
||||||
|
} finally {
|
||||||
|
previewLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function closePreview() {
|
||||||
|
previewSong.value = null
|
||||||
|
previewData.value = null
|
||||||
|
}
|
||||||
|
|
||||||
// Upload handlers (placeholder — T23 will implement parser)
|
// Upload handlers (placeholder — T23 will implement parser)
|
||||||
function handleDragOver(e) {
|
function handleDragOver(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
@ -182,6 +229,8 @@ async function uploadProFiles(files) {
|
||||||
|
|
||||||
if (successCount > 0) {
|
if (successCount > 0) {
|
||||||
await fetchSongs(1)
|
await fetchSongs(1)
|
||||||
|
uploadSuccess.value = `${successCount} ${successCount === 1 ? 'Song' : 'Songs'} erfolgreich importiert.`
|
||||||
|
setTimeout(() => { uploadSuccess.value = '' }, 4000)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
|
|
@ -286,6 +335,23 @@ function pageRange() {
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Upload Success Toast -->
|
||||||
|
<Transition
|
||||||
|
enter-active-class="transition duration-300 ease-out"
|
||||||
|
enter-from-class="translate-y-2 opacity-0"
|
||||||
|
enter-to-class="translate-y-0 opacity-100"
|
||||||
|
leave-active-class="transition duration-200 ease-in"
|
||||||
|
leave-from-class="opacity-100"
|
||||||
|
leave-to-class="opacity-0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="uploadSuccess"
|
||||||
|
class="mb-4 rounded-lg border border-emerald-300 bg-emerald-50 px-4 py-3 text-sm font-medium text-emerald-700"
|
||||||
|
>
|
||||||
|
{{ uploadSuccess }}
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
|
||||||
<!-- Search Bar -->
|
<!-- Search Bar -->
|
||||||
<div class="relative mb-6">
|
<div class="relative mb-6">
|
||||||
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-4">
|
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-4">
|
||||||
|
|
@ -431,6 +497,21 @@ function pageRange() {
|
||||||
<!-- Aktionen -->
|
<!-- Aktionen -->
|
||||||
<td class="px-4 py-3.5">
|
<td class="px-4 py-3.5">
|
||||||
<div class="flex items-center justify-end gap-1.5 opacity-0 transition-opacity group-hover:opacity-100">
|
<div class="flex items-center justify-end gap-1.5 opacity-0 transition-opacity group-hover:opacity-100">
|
||||||
|
<!-- Vorschau -->
|
||||||
|
<button
|
||||||
|
data-testid="song-list-preview-button"
|
||||||
|
type="button"
|
||||||
|
class="inline-flex items-center rounded-lg border border-gray-200 bg-white px-2.5 py-1.5 text-xs font-medium text-gray-700 shadow-sm transition-all hover:border-indigo-300 hover:bg-indigo-50 hover:text-indigo-700"
|
||||||
|
title="Vorschau"
|
||||||
|
@click="openPreview(song)"
|
||||||
|
>
|
||||||
|
<svg class="mr-1 h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" />
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||||
|
</svg>
|
||||||
|
Vorschau
|
||||||
|
</button>
|
||||||
|
|
||||||
<!-- Bearbeiten -->
|
<!-- Bearbeiten -->
|
||||||
<button
|
<button
|
||||||
data-testid="song-list-edit-button"
|
data-testid="song-list-edit-button"
|
||||||
|
|
@ -447,6 +528,7 @@ function pageRange() {
|
||||||
|
|
||||||
<!-- Übersetzen -->
|
<!-- Übersetzen -->
|
||||||
<a
|
<a
|
||||||
|
v-if="!song.has_translation"
|
||||||
data-testid="song-list-translate-link"
|
data-testid="song-list-translate-link"
|
||||||
:href="`/songs/${song.id}/translate`"
|
:href="`/songs/${song.id}/translate`"
|
||||||
class="inline-flex items-center rounded-lg border border-gray-200 bg-white px-2.5 py-1.5 text-xs font-medium text-gray-700 shadow-sm transition-all hover:border-sky-300 hover:bg-sky-50 hover:text-sky-700"
|
class="inline-flex items-center rounded-lg border border-gray-200 bg-white px-2.5 py-1.5 text-xs font-medium text-gray-700 shadow-sm transition-all hover:border-sky-300 hover:bg-sky-50 hover:text-sky-700"
|
||||||
|
|
@ -619,5 +701,62 @@ function pageRange() {
|
||||||
@updated="onSongUpdated"
|
@updated="onSongUpdated"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- Song Preview Modal -->
|
||||||
|
<Teleport to="body">
|
||||||
|
<Transition
|
||||||
|
enter-active-class="transition duration-200 ease-out"
|
||||||
|
enter-from-class="opacity-0"
|
||||||
|
enter-to-class="opacity-100"
|
||||||
|
leave-active-class="transition duration-150 ease-in"
|
||||||
|
leave-from-class="opacity-100"
|
||||||
|
leave-to-class="opacity-0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="previewSong"
|
||||||
|
class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm"
|
||||||
|
@click.self="closePreview"
|
||||||
|
>
|
||||||
|
<div class="w-full max-w-2xl max-h-[80vh] overflow-auto rounded-2xl bg-white p-6 shadow-2xl">
|
||||||
|
<div class="flex items-center justify-between mb-4">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-900">
|
||||||
|
{{ previewSong?.title || 'Vorschau' }}
|
||||||
|
</h3>
|
||||||
|
<button type="button" class="text-gray-400 hover:text-gray-600" @click="closePreview">
|
||||||
|
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="previewLoading" class="flex items-center justify-center py-12">
|
||||||
|
<span class="inline-block h-6 w-6 animate-spin rounded-full border-2 border-amber-400 border-t-transparent"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="previewData" class="space-y-4">
|
||||||
|
<div v-for="(group, idx) in previewData.groups" :key="idx" class="rounded-lg border border-gray-200 p-4">
|
||||||
|
<div class="mb-2 flex items-center gap-2">
|
||||||
|
<span
|
||||||
|
class="inline-flex rounded-full px-3 py-1 text-xs font-semibold text-white"
|
||||||
|
:style="{ backgroundColor: group.color || '#6b7280' }"
|
||||||
|
>
|
||||||
|
{{ group.name }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="(slide, sIdx) in group.slides" :key="sIdx" class="mt-2 whitespace-pre-wrap text-sm text-gray-700 leading-relaxed">{{ slide.text_content }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="previewData.song?.copyright_text" class="border-t pt-3 text-xs text-gray-400">
|
||||||
|
{{ previewData.song.copyright_text }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="py-8 text-center text-sm text-gray-500">
|
||||||
|
Kein Arrangement vorhanden.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
</Teleport>
|
||||||
|
|
||||||
</AuthenticatedLayout>
|
</AuthenticatedLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue