mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-26 05:23:19 +00:00
🗑️ Remove unused Livewire components and Blade views related to elections, member management, changelog, project support, and meetups.
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<x-layouts.app title="{{ __('Projektförderung anlegen') }}">
|
||||
<div>
|
||||
@if($isAllowed)
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
<div
|
||||
class="flex flex-col md:flex-row items-center mb-6 space-y-4 md:space-y-0 md:space-x-4">
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold">
|
||||
Projektförderung anlegen
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md:flex">
|
||||
<!-- Left column -->
|
||||
<div class="w-full md:w-60 mb-4 md:mb-0">
|
||||
<div
|
||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||
Formular
|
||||
</h2>
|
||||
<div class="space-y-4">
|
||||
<div wire:dirty>
|
||||
<x-input label="Name" wire:model="form.name"/>
|
||||
@error('form.name')
|
||||
<span class="text-red-500">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div wire:dirty>
|
||||
<x-textarea label="Beschreibung" wire:model="form.description"/>
|
||||
@error('form.description')
|
||||
<span class="text-red-500">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
<button
|
||||
wire:click="save"
|
||||
wire:loading.attr="disabled"
|
||||
class="w-full btn-sm bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-gray-800 dark:text-gray-300">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column -->
|
||||
<div class="flex-1 md:ml-8">
|
||||
<div
|
||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||
Information
|
||||
</h2>
|
||||
<p class="text-sm text-gray-800 dark:text-gray-100">
|
||||
Fülle das Formular aus, um eine neue Projektförderung anzulegen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
<div class="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
||||
Projektförderung
|
||||
</h3>
|
||||
<p class="mt-1 max-w">
|
||||
Du bist nicht berechtigt, eine Projektförderung anzulegen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,74 @@
|
||||
<x-layouts.app title="{{ __('Projektförderung bearbeiten') }}">
|
||||
<div>
|
||||
@if($isAllowed)
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
<div
|
||||
class="flex flex-col md:flex-row items-center mb-6 space-y-4 md:space-y-0 md:space-x-4">
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold">
|
||||
Projektförderung bearbeiten
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md:flex">
|
||||
<!-- Left column -->
|
||||
<div class="w-full md:w-60 mb-4 md:mb-0">
|
||||
<div
|
||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||
Formular
|
||||
</h2>
|
||||
<div class="space-y-4">
|
||||
<div wire:dirty>
|
||||
<x-input label="Name" wire:model="form.name"/>
|
||||
@error('form.name')
|
||||
<span class="text-red-500">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div wire:dirty>
|
||||
<x-textarea label="Beschreibung" wire:model="form.description"/>
|
||||
@error('form.description')
|
||||
<span class="text-red-500">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
<button
|
||||
wire:click="update"
|
||||
wire:loading.attr="disabled"
|
||||
class="w-full btn-sm bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-gray-800 dark:text-gray-300">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column -->
|
||||
<div class="flex-1 md:ml-8">
|
||||
<div
|
||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||
Information
|
||||
</h2>
|
||||
<p class="text-sm text-gray-800 dark:text-gray-100">
|
||||
Bearbeite die Projektförderung und speichere deine Änderungen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
<div class="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
||||
Projektförderung
|
||||
</h3>
|
||||
<p class="mt-1 max-w">
|
||||
Du bist nicht berechtigt, die Projektförderung zu bearbeiten.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
use App\Models\ProjectProposal;
|
||||
use App\Support\NostrAuth;
|
||||
use Livewire\Component;
|
||||
use WireUi\Actions\Notification;
|
||||
|
||||
new class extends Component {
|
||||
public string $activeFilter = 'all';
|
||||
|
||||
public string $search = '';
|
||||
|
||||
public \Illuminate\Database\Eloquent\Collection $projects;
|
||||
|
||||
public bool $isAllowed = false;
|
||||
|
||||
public ?string $currentPubkey = null;
|
||||
|
||||
public ?\App\Models\EinundzwanzigPleb $currentPleb = null;
|
||||
|
||||
protected $listeners = [
|
||||
'nostrLoggedIn' => 'handleNostrLoggedIn',
|
||||
'nostrLoggedOut' => 'handleNostrLoggedOut',
|
||||
];
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->loadProjects();
|
||||
if (NostrAuth::check()) {
|
||||
$this->currentPubkey = NostrAuth::pubkey();
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $this->currentPubkey)->first();
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function updatedSearch(): void
|
||||
{
|
||||
$this->loadProjects();
|
||||
}
|
||||
|
||||
public function loadProjects(): void
|
||||
{
|
||||
$this->projects = ProjectProposal::query()
|
||||
->with([
|
||||
'einundzwanzigPleb.profile',
|
||||
'votes',
|
||||
])
|
||||
->where(function ($query) {
|
||||
$query
|
||||
->where('name', 'ilike', '%'.$this->search.'%')
|
||||
->orWhere('description', 'ilike', '%'.$this->search.'%')
|
||||
->orWhereHas('einundzwanzigPleb.profile', function ($q) {
|
||||
$q->where('name', 'ilike', '%'.$this->search.'%');
|
||||
});
|
||||
})
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function handleNostrLoggedIn($pubkey): void
|
||||
{
|
||||
NostrAuth::login($pubkey);
|
||||
$this->currentPubkey = $pubkey;
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first();
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
|
||||
public function handleNostrLoggedOut(): void
|
||||
{
|
||||
$this->isAllowed = false;
|
||||
$this->currentPubkey = null;
|
||||
$this->currentPleb = null;
|
||||
}
|
||||
|
||||
public function confirmDelete($id): void
|
||||
{
|
||||
$notification = new Notification($this);
|
||||
$notification->confirm([
|
||||
'title' => 'Projektunterstützung löschen',
|
||||
'message' => 'Bist du sicher, dass du diese Projektunterstützung löschen möchtest?',
|
||||
'accept' => [
|
||||
'label' => 'Ja, löschen',
|
||||
'method' => 'delete',
|
||||
'params' => $id,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function setFilter($filter): void
|
||||
{
|
||||
$this->activeFilter = $filter;
|
||||
}
|
||||
|
||||
public function delete($id): void
|
||||
{
|
||||
ProjectProposal::query()->findOrFail($id)->delete();
|
||||
$this->loadProjects();
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.association.project-support')
|
||||
->layout('layouts.app')
|
||||
->with([
|
||||
'seo' => new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'Projekt Unterstützungen', description: 'Einundzwanzig Projektunterstützungen')
|
||||
]);
|
||||
}
|
||||
};
|
||||
?>
|
||||
|
||||
<div>
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
|
||||
<!-- Page header -->
|
||||
<div class="sm:flex sm:justify-between sm:items-center mb-5">
|
||||
|
||||
<!-- Left: Title -->
|
||||
<div class="mb-4 sm:mb-0">
|
||||
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold">
|
||||
Einundzwanzig Projektunterstützungen
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<!-- Right: Actions -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 justify-start sm:justify-end gap-2">
|
||||
|
||||
<!-- Search form -->
|
||||
<form class="relative">
|
||||
<x-input type="search" wire:model.live.debounce="search"
|
||||
placeholder="Suche"/>
|
||||
</form>
|
||||
|
||||
<!-- Add meetup button -->
|
||||
@if($currentPleb && $currentPleb->association_status->value > 1 && $currentPleb->paymentEvents()->where('year', date('Y'))->where('paid', true)->exists())
|
||||
<x-button :href="route('association.projectSupport.create')" icon="plus"
|
||||
label="Projekt einreichen"/>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="mb-5">
|
||||
<ul class="flex flex-wrap -m-1">
|
||||
<li class="m-1">
|
||||
<button wire:click="setFilter('all')"
|
||||
class="inline-flex items-center justify-center text-sm font-medium leading-5 rounded-full px-3 py-1 border @if($activeFilter === 'all') border-transparent shadow-sm bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-800 @else border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 shadow-sm bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 @endif transition">
|
||||
Alle
|
||||
</button>
|
||||
</li>
|
||||
<li class="m-1">
|
||||
<button wire:click="setFilter('new')"
|
||||
class="inline-flex items-center justify-center text-sm font-medium leading-5 rounded-full px-3 py-1 border @if($activeFilter === 'new') border-transparent shadow-sm bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-800 @else border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 shadow-sm bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 @endif transition">
|
||||
Neu
|
||||
</button>
|
||||
</li>
|
||||
<li class="m-1">
|
||||
<button wire:click="setFilter('supported')"
|
||||
class="inline-flex items-center justify-center text-sm font-medium leading-5 rounded-full px-3 py-1 border @if($activeFilter === 'supported') border-transparent shadow-sm bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-800 @else border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 shadow-sm bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 @endif transition">
|
||||
Unterstützt
|
||||
</button>
|
||||
</li>
|
||||
<li class="m-1">
|
||||
<button wire:click="setFilter('rejected')"
|
||||
class="inline-flex items-center justify-center text-sm font-medium leading-5 rounded-full px-3 py-1 border @if($activeFilter === 'rejected') border-transparent shadow-sm bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-800 @else border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 shadow-sm bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 @endif transition">
|
||||
Abgelehnt
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400 italic mb-4">{{ $projects->count() }} Projekte</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="grid xl:grid-cols-2 gap-6 mb-8">
|
||||
@foreach($this->projects as $project)
|
||||
<x-project-card :project="$project" :currentPleb="$currentPleb" :section="$activeFilter"/>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,85 @@
|
||||
<x-layouts.app
|
||||
:seo="new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'Projektförderung ' . $project->name, description: $project->description)"
|
||||
>
|
||||
<div>
|
||||
@if($isAllowed)
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
<div
|
||||
class="flex flex-col md:flex-row items-center mb-6 space-y-4 md:space-y-0 md:space-x-4">
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold">
|
||||
{{ $project->name }}
|
||||
</h1>
|
||||
<div>
|
||||
@if($project->status === 'pending')
|
||||
<x-badge info label="Pending"/>
|
||||
@elseif($project->status === 'active')
|
||||
<x-badge success label="Active"/>
|
||||
@else
|
||||
<x-badge neutral label="Archiviert"/>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md:flex">
|
||||
<!-- Left column -->
|
||||
<div class="w-full md:w-60 mb-4 md:mb-0">
|
||||
<div
|
||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||
Details
|
||||
</h2>
|
||||
<dl class="space-y-3">
|
||||
<div>
|
||||
<dt class="text-xs font-semibold text-gray-500 uppercase mb-1">Status</dt>
|
||||
<dd class="text-sm text-gray-800 dark:text-gray-100">
|
||||
@if($project->status === 'pending')
|
||||
Ausstehend
|
||||
@elseif($project->status === 'active')
|
||||
Aktiv
|
||||
@else
|
||||
Archiviert
|
||||
@endif
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-xs font-semibold text-gray-500 uppercase mb-1">Erstellt am</dt>
|
||||
<dd class="text-sm text-gray-800 dark:text-gray-100">
|
||||
{{ $project->created_at->format('d.m.Y') }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column -->
|
||||
<div class="flex-1 md:ml-8">
|
||||
<div
|
||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||
Beschreibung
|
||||
</h2>
|
||||
<p class="text-sm text-gray-800 dark:text-gray-100">
|
||||
{{ $project->description ?? 'Keine Beschreibung' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||
<div class="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
||||
Projektförderung
|
||||
</h3>
|
||||
<p class="mt-1 max-w">
|
||||
Du bist nicht berechtigt, die Projektförderung einzusehen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
Reference in New Issue
Block a user