Update package-lock.json and package.json to include 'globals' dependency and improve code formatting in various components for better readability.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 54s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 54s
This commit is contained in:
@@ -5,8 +5,12 @@
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-gray-900">Spielpläne</h1>
|
||||
<p class="mt-2 text-gray-600">Alle Spielpläne der Mannschaften</p>
|
||||
<h1 class="text-3xl font-bold text-gray-900">
|
||||
Spielpläne
|
||||
</h1>
|
||||
<p class="mt-2 text-gray-600">
|
||||
Alle Spielpläne der Mannschaften
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -21,36 +25,58 @@
|
||||
<div class="flex flex-col sm:flex-row sm:items-center gap-4">
|
||||
<!-- Wettbewerbs-Filter -->
|
||||
<div class="flex items-center space-x-2">
|
||||
<label for="wettbewerb-select" class="text-sm font-medium text-gray-700">
|
||||
<label
|
||||
for="wettbewerb-select"
|
||||
class="text-sm font-medium text-gray-700"
|
||||
>
|
||||
Wettbewerb:
|
||||
</label>
|
||||
<select
|
||||
id="wettbewerb-select"
|
||||
v-model="selectedWettbewerb"
|
||||
@change="filterData"
|
||||
class="px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white text-sm"
|
||||
@change="filterData"
|
||||
>
|
||||
<option value="punktrunde">Punktrunde</option>
|
||||
<option value="pokal">Pokal</option>
|
||||
<option value="alle">Alle</option>
|
||||
<option value="punktrunde">
|
||||
Punktrunde
|
||||
</option>
|
||||
<option value="pokal">
|
||||
Pokal
|
||||
</option>
|
||||
<option value="alle">
|
||||
Alle
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Mannschafts-Filter -->
|
||||
<div class="flex items-center space-x-2">
|
||||
<label for="filter-select" class="text-sm font-medium text-gray-700">
|
||||
<label
|
||||
for="filter-select"
|
||||
class="text-sm font-medium text-gray-700"
|
||||
>
|
||||
Mannschaft:
|
||||
</label>
|
||||
<select
|
||||
id="filter-select"
|
||||
v-model="selectedFilter"
|
||||
@change="filterData"
|
||||
class="px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white text-sm"
|
||||
@change="filterData"
|
||||
>
|
||||
<option value="all">Gesamt</option>
|
||||
<option value="erwachsene">Erwachsene</option>
|
||||
<option value="nachwuchs">Nachwuchs</option>
|
||||
<option v-for="mannschaft in mannschaften" :key="mannschaft" :value="mannschaft">
|
||||
<option value="all">
|
||||
Gesamt
|
||||
</option>
|
||||
<option value="erwachsene">
|
||||
Erwachsene
|
||||
</option>
|
||||
<option value="nachwuchs">
|
||||
Nachwuchs
|
||||
</option>
|
||||
<option
|
||||
v-for="mannschaft in mannschaften"
|
||||
:key="mannschaft"
|
||||
:value="mannschaft"
|
||||
>
|
||||
{{ mannschaft }}
|
||||
</option>
|
||||
</select>
|
||||
@@ -59,12 +85,22 @@
|
||||
|
||||
<!-- Download Button -->
|
||||
<button
|
||||
@click="downloadPDF"
|
||||
:disabled="isLoading || !filteredData.length"
|
||||
class="inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:bg-gray-400"
|
||||
@click="downloadPDF"
|
||||
>
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
||||
<svg
|
||||
class="w-4 h-4 mr-2"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
||||
/>
|
||||
</svg>
|
||||
PDF Download
|
||||
</button>
|
||||
@@ -88,38 +124,95 @@
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
<div v-if="isLoading" class="text-center py-12">
|
||||
<svg class="w-8 h-8 text-gray-400 mx-auto mb-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
|
||||
<div
|
||||
v-if="isLoading"
|
||||
class="text-center py-12"
|
||||
>
|
||||
<svg
|
||||
class="w-8 h-8 text-gray-400 mx-auto mb-4 animate-spin"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
||||
/>
|
||||
</svg>
|
||||
<p class="text-gray-600">Spielpläne werden geladen...</p>
|
||||
<p class="text-gray-600">
|
||||
Spielpläne werden geladen...
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Error State -->
|
||||
<div v-else-if="error" class="bg-red-50 border border-red-200 rounded-lg p-6 text-center">
|
||||
<svg class="w-12 h-12 text-red-400 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" />
|
||||
<div
|
||||
v-else-if="error"
|
||||
class="bg-red-50 border border-red-200 rounded-lg p-6 text-center"
|
||||
>
|
||||
<svg
|
||||
class="w-12 h-12 text-red-400 mx-auto mb-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
|
||||
/>
|
||||
</svg>
|
||||
<h3 class="text-lg font-medium text-red-800 mb-2">Fehler beim Laden</h3>
|
||||
<p class="text-red-600 mb-4">{{ error }}</p>
|
||||
<button @click="loadData" class="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors">
|
||||
<h3 class="text-lg font-medium text-red-800 mb-2">
|
||||
Fehler beim Laden
|
||||
</h3>
|
||||
<p class="text-red-600 mb-4">
|
||||
{{ error }}
|
||||
</p>
|
||||
<button
|
||||
class="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"
|
||||
@click="loadData"
|
||||
>
|
||||
Erneut versuchen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Empty State -->
|
||||
<div v-else-if="!spielplanData || spielplanData.length === 0" class="text-center py-12 bg-white rounded-xl shadow-lg">
|
||||
<svg class="w-12 h-12 text-gray-400 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
|
||||
<div
|
||||
v-else-if="!spielplanData || spielplanData.length === 0"
|
||||
class="text-center py-12 bg-white rounded-xl shadow-lg"
|
||||
>
|
||||
<svg
|
||||
class="w-12 h-12 text-gray-400 mx-auto mb-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"
|
||||
/>
|
||||
</svg>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-2">Keine Spielpläne verfügbar</h3>
|
||||
<p class="text-gray-600">Es wurden noch keine Spielplandaten hochgeladen.</p>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-2">
|
||||
Keine Spielpläne verfügbar
|
||||
</h3>
|
||||
<p class="text-gray-600">
|
||||
Es wurden noch keine Spielplandaten hochgeladen.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Spielplan Table -->
|
||||
<div v-else class="bg-white rounded-xl shadow-lg overflow-hidden">
|
||||
<div
|
||||
v-else
|
||||
class="bg-white rounded-xl shadow-lg overflow-hidden"
|
||||
>
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h2 class="text-xl font-semibold text-gray-900">Spielplan</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-900">
|
||||
Spielplan
|
||||
</h2>
|
||||
<p class="text-sm text-gray-600 mt-1">
|
||||
{{ getWettbewerbText() }} - {{ filteredData.length }} von {{ spielplanData.length }} Einträgen
|
||||
</p>
|
||||
@@ -129,24 +222,42 @@
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th v-for="header in headers" :key="header"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
<th
|
||||
v-for="header in headers"
|
||||
:key="header"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||
>
|
||||
{{ formatHeader(header) }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
<tr v-for="(row, index) in filteredData" :key="index"
|
||||
:class="getRowClass(row)">
|
||||
<td v-for="header in headers" :key="header"
|
||||
class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<span v-if="header.toLowerCase().includes('datum')" class="font-mono">
|
||||
<tr
|
||||
v-for="(row, index) in filteredData"
|
||||
:key="index"
|
||||
:class="getRowClass(row)"
|
||||
>
|
||||
<td
|
||||
v-for="header in headers"
|
||||
:key="header"
|
||||
class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"
|
||||
>
|
||||
<span
|
||||
v-if="header.toLowerCase().includes('datum')"
|
||||
class="font-mono"
|
||||
>
|
||||
{{ formatDate(row[getOriginalHeader(header)]) }}
|
||||
</span>
|
||||
<span v-else-if="header.toLowerCase().includes('uhrzeit')" class="font-mono">
|
||||
<span
|
||||
v-else-if="header.toLowerCase().includes('uhrzeit')"
|
||||
class="font-mono"
|
||||
>
|
||||
{{ formatTime(row[getOriginalHeader(header)]) }}
|
||||
</span>
|
||||
<span v-else-if="header.toLowerCase().includes('mannschaft')" class="font-medium">
|
||||
<span
|
||||
v-else-if="header.toLowerCase().includes('mannschaft')"
|
||||
class="font-medium"
|
||||
>
|
||||
{{ row[getOriginalHeader(header)] || '-' }}
|
||||
</span>
|
||||
<span v-else-if="header.toLowerCase().includes('runde')">
|
||||
|
||||
Reference in New Issue
Block a user