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:
@@ -10,21 +10,33 @@
|
||||
</div>
|
||||
<button
|
||||
v-if="canWrite"
|
||||
@click="openAddModal"
|
||||
class="flex items-center px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white font-semibold rounded-lg transition-colors"
|
||||
@click="openAddModal"
|
||||
>
|
||||
<Plus :size="20" class="mr-2" />
|
||||
<Plus
|
||||
:size="20"
|
||||
class="mr-2"
|
||||
/>
|
||||
News erstellen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
<div v-if="isLoading" class="flex items-center justify-center py-12">
|
||||
<Loader2 :size="40" class="animate-spin text-primary-600" />
|
||||
<div
|
||||
v-if="isLoading"
|
||||
class="flex items-center justify-center py-12"
|
||||
>
|
||||
<Loader2
|
||||
:size="40"
|
||||
class="animate-spin text-primary-600"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- News List -->
|
||||
<div v-else class="space-y-6">
|
||||
<div
|
||||
v-else
|
||||
class="space-y-6"
|
||||
>
|
||||
<article
|
||||
v-for="item in news"
|
||||
:key="item.id"
|
||||
@@ -40,52 +52,76 @@
|
||||
v-if="item.isPublic"
|
||||
class="px-3 py-1 bg-blue-100 text-blue-800 text-xs font-semibold rounded-full flex items-center"
|
||||
>
|
||||
<Globe :size="14" class="mr-1" />
|
||||
<Globe
|
||||
:size="14"
|
||||
class="mr-1"
|
||||
/>
|
||||
Öffentlich
|
||||
</span>
|
||||
<span
|
||||
v-if="item.isHidden"
|
||||
class="px-3 py-1 bg-yellow-100 text-yellow-800 text-xs font-semibold rounded-full flex items-center"
|
||||
>
|
||||
<EyeOff :size="14" class="mr-1" />
|
||||
<EyeOff
|
||||
:size="14"
|
||||
class="mr-1"
|
||||
/>
|
||||
Ausgeblendet
|
||||
</span>
|
||||
<span
|
||||
v-if="item.expiresAt && isExpired(item.expiresAt)"
|
||||
class="px-3 py-1 bg-red-100 text-red-800 text-xs font-semibold rounded-full flex items-center"
|
||||
>
|
||||
<Calendar :size="14" class="mr-1" />
|
||||
<Calendar
|
||||
:size="14"
|
||||
class="mr-1"
|
||||
/>
|
||||
Abgelaufen
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center text-sm text-gray-500 space-x-4">
|
||||
<div class="flex items-center">
|
||||
<User :size="16" class="mr-1" />
|
||||
<User
|
||||
:size="16"
|
||||
class="mr-1"
|
||||
/>
|
||||
{{ item.author }}
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<Calendar :size="16" class="mr-1" />
|
||||
<Calendar
|
||||
:size="16"
|
||||
class="mr-1"
|
||||
/>
|
||||
{{ formatDate(item.created) }}
|
||||
</div>
|
||||
<div v-if="item.updated !== item.created" class="flex items-center">
|
||||
<Edit :size="16" class="mr-1" />
|
||||
<div
|
||||
v-if="item.updated !== item.created"
|
||||
class="flex items-center"
|
||||
>
|
||||
<Edit
|
||||
:size="16"
|
||||
class="mr-1"
|
||||
/>
|
||||
Aktualisiert: {{ formatDate(item.updated) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="canWrite" class="flex space-x-2 ml-4">
|
||||
<div
|
||||
v-if="canWrite"
|
||||
class="flex space-x-2 ml-4"
|
||||
>
|
||||
<button
|
||||
@click="openEditModal(item)"
|
||||
class="p-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors"
|
||||
title="Bearbeiten"
|
||||
@click="openEditModal(item)"
|
||||
>
|
||||
<Edit :size="20" />
|
||||
</button>
|
||||
<button
|
||||
@click="confirmDelete(item)"
|
||||
class="p-2 text-red-600 hover:bg-red-50 rounded-lg transition-colors"
|
||||
title="Löschen"
|
||||
@click="confirmDelete(item)"
|
||||
>
|
||||
<Trash2 :size="20" />
|
||||
</button>
|
||||
@@ -97,10 +133,21 @@
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div v-if="news.length === 0" class="text-center py-12">
|
||||
<Newspaper :size="48" class="mx-auto text-gray-400 mb-4" />
|
||||
<p class="text-gray-500 text-lg">Noch keine News vorhanden.</p>
|
||||
<p v-if="canWrite" class="text-gray-400 text-sm mt-2">
|
||||
<div
|
||||
v-if="news.length === 0"
|
||||
class="text-center py-12"
|
||||
>
|
||||
<Newspaper
|
||||
:size="48"
|
||||
class="mx-auto text-gray-400 mb-4"
|
||||
/>
|
||||
<p class="text-gray-500 text-lg">
|
||||
Noch keine News vorhanden.
|
||||
</p>
|
||||
<p
|
||||
v-if="canWrite"
|
||||
class="text-gray-400 text-sm mt-2"
|
||||
>
|
||||
Klicken Sie auf "News erstellen", um die erste News zu veröffentlichen.
|
||||
</p>
|
||||
</div>
|
||||
@@ -117,7 +164,10 @@
|
||||
{{ editingNews ? 'News bearbeiten' : 'News erstellen' }}
|
||||
</h2>
|
||||
|
||||
<form @submit.prevent="saveNews" class="space-y-4">
|
||||
<form
|
||||
class="space-y-4"
|
||||
@submit.prevent="saveNews"
|
||||
>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">Titel *</label>
|
||||
<input
|
||||
@@ -126,7 +176,7 @@
|
||||
required
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -147,10 +197,16 @@
|
||||
type="checkbox"
|
||||
class="w-5 h-5 text-primary-600 border-gray-300 rounded focus:ring-primary-500"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
<label for="isPublic" class="text-sm font-medium text-gray-900 cursor-pointer flex-1">
|
||||
>
|
||||
<label
|
||||
for="isPublic"
|
||||
class="text-sm font-medium text-gray-900 cursor-pointer flex-1"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<Globe :size="18" class="mr-2 text-blue-600" />
|
||||
<Globe
|
||||
:size="18"
|
||||
class="mr-2 text-blue-600"
|
||||
/>
|
||||
<span>Öffentliche News (auf Startseite anzeigen)</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 mt-1 ml-6">
|
||||
@@ -159,7 +215,10 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.isPublic" class="space-y-4">
|
||||
<div
|
||||
v-if="formData.isPublic"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">Ablaufdatum (optional)</label>
|
||||
<input
|
||||
@@ -167,7 +226,7 @@
|
||||
type="datetime-local"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
>
|
||||
<p class="text-xs text-gray-600 mt-1">
|
||||
Nach diesem Datum wird die News automatisch nicht mehr auf der Startseite angezeigt.
|
||||
</p>
|
||||
@@ -180,10 +239,16 @@
|
||||
type="checkbox"
|
||||
class="w-5 h-5 text-primary-600 border-gray-300 rounded focus:ring-primary-500"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
<label for="isHidden" class="text-sm font-medium text-gray-900 cursor-pointer flex-1">
|
||||
>
|
||||
<label
|
||||
for="isHidden"
|
||||
class="text-sm font-medium text-gray-900 cursor-pointer flex-1"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<EyeOff :size="18" class="mr-2 text-yellow-600" />
|
||||
<EyeOff
|
||||
:size="18"
|
||||
class="mr-2 text-yellow-600"
|
||||
/>
|
||||
<span>News ausblenden</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 mt-1 ml-6">
|
||||
@@ -193,17 +258,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="errorMessage" class="flex items-center p-3 rounded-md bg-red-50 text-red-700 text-sm">
|
||||
<AlertCircle :size="20" class="mr-2" />
|
||||
<div
|
||||
v-if="errorMessage"
|
||||
class="flex items-center p-3 rounded-md bg-red-50 text-red-700 text-sm"
|
||||
>
|
||||
<AlertCircle
|
||||
:size="20"
|
||||
class="mr-2"
|
||||
/>
|
||||
{{ errorMessage }}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end space-x-4 pt-4">
|
||||
<button
|
||||
type="button"
|
||||
@click="closeModal"
|
||||
class="px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors"
|
||||
:disabled="isSaving"
|
||||
@click="closeModal"
|
||||
>
|
||||
Abbrechen
|
||||
</button>
|
||||
@@ -212,7 +283,11 @@
|
||||
class="px-6 py-2 bg-primary-600 hover:bg-primary-700 text-white font-semibold rounded-lg transition-colors flex items-center"
|
||||
:disabled="isSaving"
|
||||
>
|
||||
<Loader2 v-if="isSaving" :size="20" class="animate-spin mr-2" />
|
||||
<Loader2
|
||||
v-if="isSaving"
|
||||
:size="20"
|
||||
class="animate-spin mr-2"
|
||||
/>
|
||||
<span>{{ isSaving ? 'Speichert...' : 'Speichern' }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user