mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-25 04:13:17 +00:00
🛠️ Refactor and streamline Blade templates for project support and elections, including improved conditionals and structure cleanup
🛠️ Replace `shell_exec` with `Process` in Changelog Livewire component for safer command execution
This commit is contained in:
@@ -4,7 +4,9 @@ namespace App\Livewire\Association\Election;
|
|||||||
|
|
||||||
use App\Models\EinundzwanzigPleb;
|
use App\Models\EinundzwanzigPleb;
|
||||||
use App\Models\Election;
|
use App\Models\Election;
|
||||||
|
use App\Models\Profile;
|
||||||
use App\Support\NostrAuth;
|
use App\Support\NostrAuth;
|
||||||
|
use Livewire\Attributes\Computed;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use swentel\nostr\Event\Event as NostrEvent;
|
use swentel\nostr\Event\Event as NostrEvent;
|
||||||
use swentel\nostr\Filter\Filter;
|
use swentel\nostr\Filter\Filter;
|
||||||
@@ -39,12 +41,149 @@ final class Show extends Component
|
|||||||
|
|
||||||
public bool $isNotClosed = true;
|
public bool $isNotClosed = true;
|
||||||
|
|
||||||
|
public array $positions = [
|
||||||
|
'presidency' => ['icon' => 'fa-crown', 'title' => 'Präsidium'],
|
||||||
|
'board' => ['icon' => 'fa-users', 'title' => 'Vizepräsidium'],
|
||||||
|
];
|
||||||
|
|
||||||
protected $listeners = [
|
protected $listeners = [
|
||||||
'nostrLoggedIn' => 'handleNostrLoggedIn',
|
'nostrLoggedIn' => 'handleNostrLoggedIn',
|
||||||
'nostrLoggedOut' => 'handleNostrLoggedOut',
|
'nostrLoggedOut' => 'handleNostrLoggedOut',
|
||||||
'echo:votes,.newVote' => 'handleNewVote',
|
'echo:votes,.newVote' => 'handleNewVote',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
#[Computed]
|
||||||
|
public function loadedEvents(): array
|
||||||
|
{
|
||||||
|
return collect($this->events)
|
||||||
|
->map(function ($event) {
|
||||||
|
$profile = Profile::query()
|
||||||
|
->where('pubkey', $event['pubkey'])
|
||||||
|
->first()
|
||||||
|
?->toArray();
|
||||||
|
$votedFor = Profile::query()
|
||||||
|
->where('pubkey', str($event['content'])->before(',')->toString())
|
||||||
|
->first()
|
||||||
|
?->toArray();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'id' => $event['id'],
|
||||||
|
'kind' => $event['kind'],
|
||||||
|
'content' => $event['content'],
|
||||||
|
'pubkey' => $event['pubkey'],
|
||||||
|
'tags' => $event['tags'],
|
||||||
|
'created_at' => $event['created_at'],
|
||||||
|
'profile' => $profile,
|
||||||
|
'votedFor' => $votedFor,
|
||||||
|
'type' => str($event['content'])->after(',')->toString(),
|
||||||
|
];
|
||||||
|
})
|
||||||
|
->sortByDesc('created_at')
|
||||||
|
->unique(fn ($event) => $event['pubkey'].$event['type'])
|
||||||
|
->values()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Computed]
|
||||||
|
public function loadedBoardEvents(): array
|
||||||
|
{
|
||||||
|
return collect($this->boardEvents)
|
||||||
|
->map(function ($event) {
|
||||||
|
$profile = Profile::query()
|
||||||
|
->where('pubkey', $event['pubkey'])
|
||||||
|
->first()
|
||||||
|
?->toArray();
|
||||||
|
$votedFor = Profile::query()
|
||||||
|
->where('pubkey', str($event['content'])->before(',')->toString())
|
||||||
|
->first()
|
||||||
|
?->toArray();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'id' => $event['id'],
|
||||||
|
'kind' => $event['kind'],
|
||||||
|
'content' => $event['content'],
|
||||||
|
'pubkey' => $event['pubkey'],
|
||||||
|
'tags' => $event['tags'],
|
||||||
|
'created_at' => $event['created_at'],
|
||||||
|
'profile' => $profile,
|
||||||
|
'votedFor' => $votedFor,
|
||||||
|
'type' => str($event['content'])->after(',')->toString(),
|
||||||
|
];
|
||||||
|
})
|
||||||
|
->sortByDesc('created_at')
|
||||||
|
->values()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Computed]
|
||||||
|
public function electionConfig(): array
|
||||||
|
{
|
||||||
|
$loadedEvents = $this->loadedEvents();
|
||||||
|
|
||||||
|
return collect(json_decode($this->election->candidates, true, 512, JSON_THROW_ON_ERROR))
|
||||||
|
->map(function ($c) use ($loadedEvents) {
|
||||||
|
$candidates = Profile::query()
|
||||||
|
->whereIn('pubkey', $c['c'])
|
||||||
|
->get()
|
||||||
|
->map(function ($p) use ($loadedEvents, $c) {
|
||||||
|
$votedClass = ' bg-green-500/20 text-green-700';
|
||||||
|
$notVotedClass = ' bg-gray-500/20 text-gray-100';
|
||||||
|
$hasVoted = $loadedEvents
|
||||||
|
->filter(fn ($e) => $e['type'] === $c['type'] && $e['pubkey'] === $this->currentPubkey)
|
||||||
|
->firstWhere('votedFor.pubkey', $p->pubkey);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'pubkey' => $p->pubkey,
|
||||||
|
'name' => $p->name,
|
||||||
|
'picture' => $p->picture,
|
||||||
|
'votedClass' => $hasVoted ? $votedClass : $notVotedClass,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
return [
|
||||||
|
'type' => $c['type'],
|
||||||
|
'c' => $c['c'],
|
||||||
|
'candidates' => $candidates,
|
||||||
|
];
|
||||||
|
})
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Computed]
|
||||||
|
public function electionConfigBoard(): array
|
||||||
|
{
|
||||||
|
$loadedBoardEvents = $this->loadedBoardEvents();
|
||||||
|
|
||||||
|
return collect(json_decode($this->election->candidates, true, 512, JSON_THROW_ON_ERROR))
|
||||||
|
->map(function ($c) use ($loadedBoardEvents) {
|
||||||
|
$candidates = Profile::query()
|
||||||
|
->whereIn('pubkey', $c['c'])
|
||||||
|
->get()
|
||||||
|
->map(function ($p) use ($loadedBoardEvents, $c) {
|
||||||
|
$votedClass = ' bg-green-500/20 text-green-700';
|
||||||
|
$notVotedClass = ' bg-gray-500/20 text-gray-100';
|
||||||
|
$hasVoted = $loadedBoardEvents
|
||||||
|
->filter(fn ($e) => $e['type'] === $c['type'] && $e['pubkey'] === $this->currentPubkey)
|
||||||
|
->firstWhere('votedFor.pubkey', $p->pubkey);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'pubkey' => $p->pubkey,
|
||||||
|
'name' => $p->name,
|
||||||
|
'picture' => $p->picture,
|
||||||
|
'votedClass' => $hasVoted ? $votedClass : $notVotedClass,
|
||||||
|
'hasVoted' => $hasVoted,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
return [
|
||||||
|
'type' => $c['type'],
|
||||||
|
'c' => $c['c'],
|
||||||
|
'candidates' => $candidates,
|
||||||
|
];
|
||||||
|
})
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
public function mount(Election $election): void
|
public function mount(Election $election): void
|
||||||
{
|
{
|
||||||
$this->election = $election;
|
$this->election = $election;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Livewire;
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Process;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
final class Changelog extends Component
|
final class Changelog extends Component
|
||||||
@@ -10,7 +11,9 @@ final class Changelog extends Component
|
|||||||
|
|
||||||
public function mount(): void
|
public function mount(): void
|
||||||
{
|
{
|
||||||
$output = shell_exec('git log -n1000 --pretty=format:"%H|%s|%an|%ad" --date=format:"%Y-%m-%d %H:%M:%S"');
|
$process = Process::fromShellCommandline('git log -n1000 --pretty=format:"%H|%s|%an|%ad" --date=format:"%Y-%m-%d %H:%M:%S"');
|
||||||
|
$process->run();
|
||||||
|
$output = $process->getOutput();
|
||||||
$lines = explode("\n", trim($output));
|
$lines = explode("\n", trim($output));
|
||||||
$entries = [];
|
$entries = [];
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<?php
|
@php
|
||||||
$positions = [
|
$positions = [
|
||||||
'presidency' => ['icon' => 'fa-crown', 'title' => 'Präsidium'],
|
'presidency' => ['icon' => 'fa-crown', 'title' => 'Präsidium'],
|
||||||
'board' => ['icon' => 'fa-users', 'title' => 'Vorstandsmitglieder'],
|
'board' => ['icon' => 'fa-users', 'title' => 'Vorstandsmitglieder'],
|
||||||
];
|
];
|
||||||
?>
|
@endphp
|
||||||
|
|
||||||
<?php if ($isAllowed): ?>
|
@if($isAllowed)
|
||||||
|
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto" x-data="electionAdminCharts()">
|
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto" x-data="electionAdminCharts()">
|
||||||
|
|
||||||
@@ -16,16 +16,16 @@
|
|||||||
<!-- Left: Title -->
|
<!-- Left: Title -->
|
||||||
<div class="mb-4 sm:mb-0">
|
<div class="mb-4 sm:mb-0">
|
||||||
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold">
|
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold">
|
||||||
Wahl des Vorstands <?php echo e($election->year); ?>
|
Wahl des Vorstands {{ $election->year }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
@php
|
||||||
$president = $positions['presidency'];
|
$president = $positions['presidency'];
|
||||||
$board = $positions['board'];
|
$board = $positions['board'];
|
||||||
?>
|
@endphp
|
||||||
|
|
||||||
<!-- Cards -->
|
<!-- Cards -->
|
||||||
<div class="grid gap-y-4">
|
<div class="grid gap-y-4">
|
||||||
@@ -33,11 +33,11 @@
|
|||||||
class="flex flex-col bg-white dark:bg-gray-800 shadow-sm rounded-xl">
|
class="flex flex-col bg-white dark:bg-gray-800 shadow-sm rounded-xl">
|
||||||
<header class="px-5 py-4 border-b border-gray-100 dark:border-gray-700/60">
|
<header class="px-5 py-4 border-b border-gray-100 dark:border-gray-700/60">
|
||||||
<h2 class="font-semibold text-gray-800 dark:text-gray-100"><i
|
<h2 class="font-semibold text-gray-800 dark:text-gray-100"><i
|
||||||
class="fa-sharp-duotone fa-solid <?php echo e($president['icon']); ?> w-5 h-5 fill-current text-white mr-4"></i><?php echo e($president['title']); ?>
|
class="fa-sharp-duotone fa-solid {{ $president['icon'] }} w-5 h-5 fill-current text-white mr-4"></i>{{ $president['title'] }}
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<div class="grow">
|
<div class="grow">
|
||||||
<!-- Change the height attribute to adjust the chart height -->
|
<!-- Change| height attribute to adjust chart height -->
|
||||||
<canvas x-ref="chart_presidency" width="724" height="288"
|
<canvas x-ref="chart_presidency" width="724" height="288"
|
||||||
style="display: block; box-sizing: border-box; height: 288px; width: 724px;"></canvas>
|
style="display: block; box-sizing: border-box; height: 288px; width: 724px;"></canvas>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
class="flex flex-col bg-white dark:bg-gray-800 shadow-sm rounded-xl">
|
class="flex flex-col bg-white dark:bg-gray-800 shadow-sm rounded-xl">
|
||||||
<header class="px-5 py-4 border-b border-gray-100 dark:border-gray-700/60">
|
<header class="px-5 py-4 border-b border-gray-100 dark:border-gray-700/60">
|
||||||
<h2 class="font-semibold text-gray-800 dark:text-gray-100"><i
|
<h2 class="font-semibold text-gray-800 dark:text-gray-100"><i
|
||||||
class="fa-sharp-duotone fa-solid <?php echo e($board['icon']); ?> w-5 h-5 fill-current text-white mr-4"></i><?php echo e($board['title']); ?>
|
class="fa-sharp-duotone fa-solid {{ $board['icon'] }} w-5 h-5 fill-current text-white mr-4"></i>{{ $board['title'] }}
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<div class="grow">
|
<div class="grow">
|
||||||
<!-- Change the height attribute to adjust the chart height -->
|
<!-- Change| height attribute to adjust chart height -->
|
||||||
<canvas x-ref="chart_board" width="724" height="288"
|
<canvas x-ref="chart_board" width="724" height="288"
|
||||||
style="display: block; box-sizing: border-box; height: 288px; width: 724px;"></canvas>
|
style="display: block; box-sizing: border-box; height: 288px; width: 724px;"></canvas>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
@@ -70,5 +70,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<x-layouts.app title="{{ __('Wahlen') }}">
|
<x-layouts.app title="{{ __('Wahlen') }}">
|
||||||
<div>
|
<div>
|
||||||
<?php if($isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div class="relative flex h-full">
|
<div class="relative flex h-full">
|
||||||
<?php foreach($elections as $election): ?>
|
@foreach($elections as $election)
|
||||||
<div class="w-full sm:w-1/3 p-4">
|
<div class="w-full sm:w-1/3 p-4" wire:key="election-{{ $loop->index }}">
|
||||||
<div class="shadow-lg rounded-lg overflow-hidden">
|
<div class="shadow-lg rounded-lg overflow-hidden">
|
||||||
<?php echo e($election['year']); ?>
|
{{ $election['year'] }}
|
||||||
</div>
|
</div>
|
||||||
<div class="shadow-lg rounded-lg overflow-hidden">
|
<div class="shadow-lg rounded-lg overflow-hidden">
|
||||||
<x-textarea wire:model="elections.<?php echo e($loop->index); ?>.candidates" rows="25"
|
<x-textarea wire:model="elections.{{ $loop->index }}.candidates" rows="25"
|
||||||
label="candidates" placeholder=""/>
|
label="candidates" placeholder=""/>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-2">
|
<div class="py-2">
|
||||||
<x-button label="Speichern" wire:click="saveElection(<?php echo e($loop->index); ?>)"/>
|
<x-button label="Speichern" wire:click="saveElection({{ $loop->index }})" wire:loading.attr="disabled"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
@@ -28,6 +28,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -2,69 +2,11 @@
|
|||||||
:seo="new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'Wahlen ' . $election->year, description: 'Wahlen des Vereins im Jahr ' . $election->year)"
|
:seo="new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'Wahlen ' . $election->year, description: 'Wahlen des Vereins im Jahr ' . $election->year)"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<?php if($isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div x-cloak class="relative flex h-full" x-data="nostrApp(@this)"
|
<div x-cloak class="relative flex h-full" x-data="nostrApp(@this)"
|
||||||
wire:poll.600000ms="checkElection">
|
wire:poll.600000ms="checkElection">
|
||||||
|
|
||||||
<?php
|
<!-- Inbox sidebar -->
|
||||||
$positions = [
|
|
||||||
'presidency' => ['icon' => 'fa-crown', 'title' => 'Präsidium'],
|
|
||||||
'board' => ['icon' => 'fa-users', 'title' => 'Vizepräsidium'],
|
|
||||||
];
|
|
||||||
$loadedEvents = collect($events)
|
|
||||||
->map(function($event) {
|
|
||||||
$profile = \App\Models\Profile::query()
|
|
||||||
->where('pubkey', $event['pubkey'])
|
|
||||||
->first()
|
|
||||||
?->toArray();
|
|
||||||
$votedFor = \App\Models\Profile::query()
|
|
||||||
->where('pubkey', str($event['content'])->before(',')->toString())
|
|
||||||
->first()
|
|
||||||
?->toArray();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'id' => $event['id'],
|
|
||||||
'kind' => $event['kind'],
|
|
||||||
'content' => $event['content'],
|
|
||||||
'pubkey' => $event['pubkey'],
|
|
||||||
'tags' => $event['tags'],
|
|
||||||
'created_at' => $event['created_at'],
|
|
||||||
'profile' => $profile,
|
|
||||||
'votedFor' => $votedFor,
|
|
||||||
'type' => str($event['content'])->after(',')->toString(),
|
|
||||||
];
|
|
||||||
})
|
|
||||||
->sortByDesc('created_at')
|
|
||||||
->unique(fn ($event) => $event['pubkey'] . $event['type'])
|
|
||||||
->values();
|
|
||||||
$loadedBoardEvents = collect($boardEvents)
|
|
||||||
->map(function($event) {
|
|
||||||
$profile = \App\Models\Profile::query()
|
|
||||||
->where('pubkey', $event['pubkey'])
|
|
||||||
->first()
|
|
||||||
?->toArray();
|
|
||||||
$votedFor = \App\Models\Profile::query()
|
|
||||||
->where('pubkey', str($event['content'])->before(',')->toString())
|
|
||||||
->first()
|
|
||||||
?->toArray();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'id' => $event['id'],
|
|
||||||
'kind' => $event['kind'],
|
|
||||||
'content' => $event['content'],
|
|
||||||
'pubkey' => $event['pubkey'],
|
|
||||||
'tags' => $event['tags'],
|
|
||||||
'created_at' => $event['created_at'],
|
|
||||||
'profile' => $profile,
|
|
||||||
'votedFor' => $votedFor,
|
|
||||||
'type' => str($event['content'])->after(',')->toString(),
|
|
||||||
];
|
|
||||||
})
|
|
||||||
->sortByDesc('created_at')
|
|
||||||
->values();
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!-- Inbox sidebar -->
|
|
||||||
<div id="inbox-sidebar"
|
<div id="inbox-sidebar"
|
||||||
class="absolute z-20 top-0 bottom-0 w-full md:w-auto md:static md:top-auto md:bottom-auto -mr-px md:translate-x-0 transition-transform duration-200 ease-in-out"
|
class="absolute z-20 top-0 bottom-0 w-full md:w-auto md:static md:top-auto md:bottom-auto -mr-px md:translate-x-0 transition-transform duration-200 ease-in-out"
|
||||||
:class="inboxSidebarOpen ? 'translate-x-0' : '-translate-x-full'">
|
:class="inboxSidebarOpen ? 'translate-x-0' : '-translate-x-full'">
|
||||||
@@ -154,11 +96,11 @@
|
|||||||
Plebs
|
Plebs
|
||||||
</div>
|
</div>
|
||||||
<ul class="mb-6">
|
<ul class="mb-6">
|
||||||
<?php foreach($plebs as $pleb): ?>
|
@foreach($plebs as $pleb)
|
||||||
<li class="-mx-2">
|
<li class="-mx-2">
|
||||||
<div class="flex w-full p-2 rounded text-left">
|
<div class="flex w-full p-2 rounded text-left">
|
||||||
<img class="w-8 h-8 rounded-full mr-2 bg-black"
|
<img class="w-8 h-8 rounded-full mr-2 bg-black"
|
||||||
src="<?php echo e($pleb['profile']['picture'] ?? 'https://robohash.org/test'); ?>"
|
src="{{ $pleb['profile']['picture'] ?? 'https://robohash.org/test' }}"
|
||||||
onerror="this.onerror=null; this.src='https://robohash.org/test';"
|
onerror="this.onerror=null; this.src='https://robohash.org/test';"
|
||||||
width="32"
|
width="32"
|
||||||
height="32"
|
height="32"
|
||||||
@@ -167,34 +109,34 @@
|
|||||||
<div class="flex items-center justify-between mb-1.5">
|
<div class="flex items-center justify-between mb-1.5">
|
||||||
<div class="truncate">
|
<div class="truncate">
|
||||||
<span
|
<span
|
||||||
class="text-sm font-semibold text-gray-800 dark:text-gray-100 truncate"><?php echo e($pleb['profile']['name'] ?? $pleb['pubkey']); ?></span>
|
class="text-sm font-semibold text-gray-800 dark:text-gray-100 truncate">{{ $pleb['profile']['name'] ?? $pleb['pubkey'] }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xs text-gray-500 font-medium">
|
<div class="text-xs text-gray-500 font-medium">
|
||||||
<x-badge
|
<x-badge
|
||||||
color="<?php echo e(\App\Enums\AssociationStatus::from($pleb['association_status'])->color()); ?>"
|
:color="\App\Enums\AssociationStatus::from($pleb['association_status'])->color()"
|
||||||
label="<?php echo e(\App\Enums\AssociationStatus::from($pleb['association_status'])->label()); ?>"/>
|
:label="\App\Enums\AssociationStatus::from($pleb['association_status'])->label()"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="text-xs font-medium text-gray-800 dark:text-gray-100 truncate mb-0.5">
|
class="text-xs font-medium text-gray-800 dark:text-gray-100 truncate mb-0.5">
|
||||||
<div class="flex items-center space-x-2 h-5">
|
<div class="flex items-center space-x-2 h-5">
|
||||||
<?php foreach($positions as $name => $p): ?>
|
@foreach($positions as $name => $p)
|
||||||
<?php
|
@php
|
||||||
$votedResult = $loadedEvents->filter(fn ($e) => $e['pubkey'] === $pleb['pubkey'])->firstWhere('type', $name);
|
$votedResult = $this->loadedEvents->filter(fn ($e) => $e['pubkey'] === $pleb['pubkey'])->firstWhere('type', $name);
|
||||||
?>
|
@endphp
|
||||||
<div class="flex space-x-2"
|
<div class="flex space-x-2"
|
||||||
wire:key="p_<?php echo e($name); ?>">
|
wire:key="p_{{ $name }}">
|
||||||
<?php if($votedResult): ?>
|
@if($votedResult)
|
||||||
<i class="fa-sharp-duotone fa-solid <?php echo e($p['icon']); ?> w-4 h-4 fill-current text-green-500"></i>
|
<i class="fa-sharp-duotone fa-solid {{ $p['icon'] }} w-4 h-4 fill-current text-green-500"></i>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -204,64 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Inbox body -->
|
<!-- Inbox body -->
|
||||||
<?php if($currentPubkey): ?>
|
@if($currentPubkey)
|
||||||
|
|
||||||
<?php
|
|
||||||
$electionConfig = collect(json_decode($election->candidates, true, 512, JSON_THROW_ON_ERROR))
|
|
||||||
->map(function ($c) use ($loadedEvents, $currentPubkey) {
|
|
||||||
$candidates = \App\Models\Profile::query()
|
|
||||||
->whereIn('pubkey', $c['c'])
|
|
||||||
->get()
|
|
||||||
->map(function ($p) use ($loadedEvents, $c, $currentPubkey) {
|
|
||||||
$votedClass = ' bg-green-500/20 text-green-700';
|
|
||||||
$notVotedClass = ' bg-gray-500/20 text-gray-100';
|
|
||||||
$hasVoted = $loadedEvents
|
|
||||||
->filter(fn($e) => $e['type'] === $c['type'] && $e['pubkey'] === $currentPubkey)
|
|
||||||
->firstWhere('votedFor.pubkey', $p->pubkey);
|
|
||||||
|
|
||||||
return [
|
|
||||||
'pubkey' => $p->pubkey,
|
|
||||||
'name' => $p->name,
|
|
||||||
'picture' => $p->picture,
|
|
||||||
'votedClass' => $hasVoted ? $votedClass : $notVotedClass,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
return [
|
|
||||||
'type' => $c['type'],
|
|
||||||
'c' => $c['c'],
|
|
||||||
'candidates' => $candidates,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
$electionConfigBoard = collect(json_decode($election->candidates, true, 512, JSON_THROW_ON_ERROR))
|
|
||||||
->map(function ($c) use ($loadedBoardEvents, $currentPubkey) {
|
|
||||||
$candidates = \App\Models\Profile::query()
|
|
||||||
->whereIn('pubkey', $c['c'])
|
|
||||||
->get()
|
|
||||||
->map(function ($p) use ($loadedBoardEvents, $c, $currentPubkey) {
|
|
||||||
$votedClass = ' bg-green-500/20 text-green-700';
|
|
||||||
$notVotedClass = ' bg-gray-500/20 text-gray-100';
|
|
||||||
$hasVoted = $loadedBoardEvents
|
|
||||||
->filter(fn($e) => $e['type'] === $c['type'] && $e['pubkey'] === $currentPubkey)
|
|
||||||
->firstWhere('votedFor.pubkey', $p->pubkey);
|
|
||||||
|
|
||||||
return [
|
|
||||||
'pubkey' => $p->pubkey,
|
|
||||||
'name' => $p->name,
|
|
||||||
'picture' => $p->picture,
|
|
||||||
'votedClass' => $hasVoted ? $votedClass : $notVotedClass,
|
|
||||||
'hasVoted' => $hasVoted,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
return [
|
|
||||||
'type' => $c['type'],
|
|
||||||
'c' => $c['c'],
|
|
||||||
'candidates' => $candidates,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="grow flex flex-col md:translate-x-0 transition-transform duration-300 ease-in-out"
|
<div class="grow flex flex-col md:translate-x-0 transition-transform duration-300 ease-in-out"
|
||||||
:class="inboxSidebarOpen ? 'translate-x-1/3' : 'translate-x-0'">
|
:class="inboxSidebarOpen ? 'translate-x-1/3' : 'translate-x-0'">
|
||||||
|
|
||||||
@@ -272,12 +157,12 @@
|
|||||||
<div
|
<div
|
||||||
class="flex flex-col space-y-2 sm:space-y-0 sm:flex-row justify-between items-center w-full">
|
class="flex flex-col space-y-2 sm:space-y-0 sm:flex-row justify-between items-center w-full">
|
||||||
<div>
|
<div>
|
||||||
<?php if($isNotClosed): ?>
|
@if($isNotClosed)
|
||||||
<x-badge success
|
<x-badge success
|
||||||
label="Die Wahl ist geöffnet bis zum <?php echo e($election->end_time?->timezone('Europe/Berlin')->format('d.m.Y H:i')); ?>"/>
|
label="Die Wahl ist geöffnet bis zum {{ $election->end_time?->timezone('Europe/Berlin')->format('d.m.Y H:i') }}"/>
|
||||||
<?php else: ?>
|
@else
|
||||||
<x-badge negative label="Die Wahl ist geschlossen"/>
|
<x-badge negative label="Die Wahl ist geschlossen"/>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<x-button secondary
|
<x-button secondary
|
||||||
@@ -311,52 +196,49 @@
|
|||||||
<h1 class="text-xl leading-snug text-gray-800 dark:text-gray-100 font-bold mb-1 sm:mb-0 ml-2">
|
<h1 class="text-xl leading-snug text-gray-800 dark:text-gray-100 font-bold mb-1 sm:mb-0 ml-2">
|
||||||
Wahl des Präsidiums
|
Wahl des Präsidiums
|
||||||
</h1>
|
</h1>
|
||||||
<?php
|
|
||||||
$president = $positions['presidency'];
|
|
||||||
$board = $positions['board'];
|
|
||||||
?>
|
|
||||||
<div class="grid sm:grid-cols-2 gap-6">
|
<div class="grid sm:grid-cols-2 gap-6">
|
||||||
<div
|
<div
|
||||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl">
|
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl">
|
||||||
<div class="flex flex-col h-full p-5">
|
<div class="flex flex-col h-full p-5">
|
||||||
<header>
|
<header>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<i class="fa-sharp-duotone fa-solid <?php echo e($president['icon']); ?> w-9 h-9 fill-current text-white"></i>
|
<i class="fa-sharp-duotone fa-solid {{ $positions['presidency']['icon'] }} w-9 h-9 fill-current text-white"></i>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="grow mt-2">
|
<div class="grow mt-2">
|
||||||
<div
|
<div
|
||||||
class="inline-flex text-gray-800 dark:text-gray-100 hover:text-gray-900 dark:hover:text-white mb-1">
|
class="inline-flex text-gray-800 dark:text-gray-100 hover:text-gray-900 dark:hover:text-white mb-1">
|
||||||
<h2 class="text-xl leading-snug font-semibold"><?php echo e($president['title']); ?></h2>
|
<h2 class="text-xl leading-snug font-semibold">{{ $positions['presidency']['title'] }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<?php
|
@php
|
||||||
$votedResult = $loadedEvents->filter(fn ($event) => $event['pubkey'] === $currentPubkey)->firstWhere('type', 'presidency');
|
$votedResult = $this->loadedEvents->filter(fn ($event) => $event['pubkey'] === $currentPubkey)->firstWhere('type', 'presidency');
|
||||||
?>
|
$votedName = $votedResult['votedFor']['name'] ?? 'error';
|
||||||
<?php if($votedResult): ?>
|
@endphp
|
||||||
<span>Du hast "<?php echo e($votedResult['votedFor']['name'] ?? 'error'); ?>" gewählt</span>
|
@if($votedResult)
|
||||||
<?php else: ?>
|
<span>Du hast "{{ $votedName }}" gewählt</span>
|
||||||
|
@else
|
||||||
<span>Wähle deinen Kandidaten für das Präsidium.</span>
|
<span>Wähle deinen Kandidaten für das Präsidium.</span>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer class="mt-5">
|
<footer class="mt-5">
|
||||||
<div class="grid sm:grid-cols-2 gap-2">
|
<div class="grid sm:grid-cols-2 gap-2">
|
||||||
<?php foreach($electionConfig->firstWhere('type', 'presidency')['candidates'] ?? [] as $c): ?>
|
@foreach($this->electionConfig->firstWhere('type', 'presidency')['candidates'] ?? [] as $c)
|
||||||
<div
|
<div
|
||||||
<?php if($isNotClosed): ?>wire:click="vote('<?php echo e($c['pubkey']); ?>', 'presidency')"
|
@if($isNotClosed)wire:click="vote('{{ $c['pubkey'] }}', 'presidency')"
|
||||||
<?php endif; ?>
|
@endif
|
||||||
class="<?php echo e($c['votedClass']); ?> cursor-pointer text-xs inline-flex font-medium rounded-full text-center px-2.5 py-1">
|
class="{{ $c['votedClass'] }} cursor-pointer text-xs inline-flex font-medium rounded-full text-center px-2.5 py-1">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img class="w-6 h-6 rounded-full mr-2 bg-black"
|
<img class="w-6 h-6 rounded-full mr-2 bg-black"
|
||||||
src="<?php echo e($c['picture'] ?? 'https://robohash.org/' . $c['pubkey']); ?>"
|
src="{{ $c['picture'] ?? 'https://robohash.org/' . $c['pubkey'] }}"
|
||||||
onerror="this.onerror=null; this.src='https://robohash.org/<?php echo e($c['pubkey']); ?>';"
|
onerror="this.onerror=null; this.src='https://robohash.org/{{ $c['pubkey'] }}';"
|
||||||
width="24" height="24"
|
width="24" height="24"
|
||||||
alt="<?php echo e($c['name']); ?>"/>
|
alt="{{ $c['name'] }}"/>
|
||||||
<?php echo e($c['name']); ?>
|
{{ $c['name'] }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
@@ -378,21 +260,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<footer class="mt-5">
|
<footer class="mt-5">
|
||||||
<div class="grid sm:grid-cols-4 gap-2">
|
<div class="grid sm:grid-cols-4 gap-2">
|
||||||
<?php foreach($electionConfigBoard->firstWhere('type', 'board')['candidates'] ?? [] as $c): ?>
|
@foreach($this->electionConfigBoard->firstWhere('type', 'board')['candidates'] ?? [] as $c)
|
||||||
<div
|
<div
|
||||||
<?php if($isNotClosed && !$c['hasVoted']): ?>wire:click="vote('<?php echo e($c['pubkey']); ?>', 'board', true)"
|
@if($isNotClosed && !$c['hasVoted'])wire:click="vote('{{ $c['pubkey'] }}', 'board', true)"
|
||||||
<?php endif; ?>
|
@endif
|
||||||
class="<?php echo e($c['votedClass']); ?> cursor-pointer text-xs inline-flex font-medium rounded-full text-center px-2.5 py-1">
|
class="{{ $c['votedClass'] }} cursor-pointer text-xs inline-flex font-medium rounded-full text-center px-2.5 py-1">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img class="w-6 h-6 rounded-full mr-2 bg-black"
|
<img class="w-6 h-6 rounded-full mr-2 bg-black"
|
||||||
src="<?php echo e($c['picture'] ?? 'https://robohash.org/' . $c['pubkey']); ?>"
|
src="{{ $c['picture'] ?? 'https://robohash.org/' . $c['pubkey'] }}"
|
||||||
onerror="this.onerror=null; this.src='https://robohash.org/<?php echo e($c['pubkey']); ?>';"
|
onerror="this.onerror=null; this.src='https://robohash.org/{{ $c['pubkey'] }}';"
|
||||||
width="24" height="24"
|
width="24" height="24"
|
||||||
alt="<?php echo e($c['name']); ?>"/>
|
alt="{{ $c['name'] }}"/>
|
||||||
<?php echo e($c['name']); ?>
|
{{ $c['name'] }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
@@ -408,7 +290,7 @@
|
|||||||
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-xl mb-8">
|
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-xl mb-8">
|
||||||
<header class="px-5 py-4">
|
<header class="px-5 py-4">
|
||||||
<h2 class="font-semibold text-gray-800 dark:text-gray-100">Präsidium Log <span
|
<h2 class="font-semibold text-gray-800 dark:text-gray-100">Präsidium Log <span
|
||||||
class="text-gray-400 dark:text-gray-500 font-medium"><?php echo e($loadedEvents->count()); ?></span>
|
class="text-gray-400 dark:text-gray-500 font-medium">{{ count($this->loadedEvents) }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<div>
|
<div>
|
||||||
@@ -442,29 +324,29 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<!-- Table body -->
|
<!-- Table body -->
|
||||||
<tbody class="text-sm">
|
<tbody class="text-sm">
|
||||||
<?php foreach($loadedEvents as $event): ?>
|
@foreach($this->loadedEvents as $event)
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div
|
<div
|
||||||
class="font-medium"><?php echo e(\Illuminate\Support\Str::limit($event['id'], 10)); ?></div>
|
class="font-medium">{{ Str::limit($event['id'], 10) }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['kind']); ?></div>
|
<div>{{ $event['kind'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['profile']['name'] ?? ''); ?></div>
|
<div>{{ $event['profile']['name'] ?? '' }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['created_at']); ?></div>
|
<div>{{ $event['created_at'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['votedFor']['name'] ?? ''); ?></div>
|
<div>{{ $event['votedFor']['name'] ?? '' }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['type']); ?></div>
|
<div>{{ $event['type'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -475,7 +357,7 @@
|
|||||||
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-xl mb-8">
|
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-xl mb-8">
|
||||||
<header class="px-5 py-4">
|
<header class="px-5 py-4">
|
||||||
<h2 class="font-semibold text-gray-800 dark:text-gray-100">Board Log <span
|
<h2 class="font-semibold text-gray-800 dark:text-gray-100">Board Log <span
|
||||||
class="text-gray-400 dark:text-gray-500 font-medium"><?php echo e($loadedBoardEvents->count()); ?></span>
|
class="text-gray-400 dark:text-gray-500 font-medium">{{ count($this->loadedBoardEvents) }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<div>
|
<div>
|
||||||
@@ -509,29 +391,29 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<!-- Table body -->
|
<!-- Table body -->
|
||||||
<tbody class="text-sm">
|
<tbody class="text-sm">
|
||||||
<?php foreach($loadedBoardEvents as $event): ?>
|
@foreach($this->loadedBoardEvents as $event)
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div
|
<div
|
||||||
class="font-medium"><?php echo e(\Illuminate\Support\Str::limit($event['id'], 10)); ?></div>
|
class="font-medium">{{ Str::limit($event['id'], 10) }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['kind']); ?></div>
|
<div>{{ $event['kind'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['profile']['name'] ?? ''); ?></div>
|
<div>{{ $event['profile']['name'] ?? '' }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['created_at']); ?></div>
|
<div>{{ $event['created_at'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['votedFor']['name'] ?? ''); ?></div>
|
<div>{{ $event['votedFor']['name'] ?? '' }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
<td class="px-2 first:pl-5 last:pr-5 py-3 whitespace-nowrap">
|
||||||
<div><?php echo e($event['type']); ?></div>
|
<div>{{ $event['type'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -542,10 +424,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
@@ -556,7 +438,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<x-layouts.app title="{{ __('Mitglieder') }}">
|
<x-layouts.app title="{{ __('Mitglieder') }}">
|
||||||
<div>
|
<div>
|
||||||
<?php if($isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||||
<livewire:einundzwanzig-pleb-table/>
|
<livewire:einundzwanzig-pleb-table/>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
@@ -15,6 +15,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
:seo="new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'News', description: 'Die News des Vereins.')"
|
:seo="new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'News', description: 'Die News des Vereins.')"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<?php if($isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 md:py-0 w-full max-w-9xl mx-auto">
|
<div class="px-4 sm:px-6 lg:px-8 py-8 md:py-0 w-full max-w-9xl mx-auto">
|
||||||
|
|
||||||
<div class="xl:flex">
|
<div class="xl:flex">
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Links -->
|
<!-- Links -->
|
||||||
<div
|
<div
|
||||||
class="flex flex-nowrap overflow-x-scroll no-scrollbar md:block md:overflow-auto px-4 md:space-y-3 -mx-4">
|
class="flex flex-nowrap overflow-x-scroll no-scrollbar md:block md:overflow-auto px-4 md:space-y-3 -mx-4">
|
||||||
@@ -37,17 +36,17 @@
|
|||||||
Menu
|
Menu
|
||||||
</div>
|
</div>
|
||||||
<ul class="flex flex-nowrap md:block mr-3 md:mr-0">
|
<ul class="flex flex-nowrap md:block mr-3 md:mr-0">
|
||||||
<?php foreach(\App\Enums\NewsCategory::selectOptions() as $category): ?>
|
@foreach(\App\Enums\NewsCategory::selectOptions() as $category)
|
||||||
<li class="mr-0.5 md:mr-0 md:mb-0.5"
|
<li class="mr-0.5 md:mr-0 md:mb-0.5"
|
||||||
wire:key="category_<?php echo e($category['value']); ?>">
|
wire:key="category_{{ $category['value'] }}">
|
||||||
<div
|
<div
|
||||||
class="flex items-center px-2.5 py-2 rounded-lg whitespace-nowrap bg-white dark:bg-gray-800">
|
class="flex items-center px-2.5 py-2 rounded-lg whitespace-nowrap bg-white dark:bg-gray-800">
|
||||||
<i class="fa-sharp-duotone fa-solid fa-<?php echo e($category['icon']); ?> shrink-0 fill-current text-amber-500 mr-2"></i>
|
<i class="fa-sharp-duotone fa-solid fa-{{ $category['icon'] }} shrink-0 fill-current text-amber-500 mr-2"></i>
|
||||||
<span
|
<span
|
||||||
class="text-sm font-medium text-amber-500"><?php echo e($category['label']); ?></span>
|
class="text-sm font-medium text-amber-500">{{ $category['label'] }}</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,27 +59,25 @@
|
|||||||
<div class="md:py-8">
|
<div class="md:py-8">
|
||||||
|
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<?php $__empty_1 = true; ?>
|
@forelse($news as $post)
|
||||||
<?php foreach($news as $post): ?>
|
<article wire:key="post_{{ $post->id }}"
|
||||||
<?php $__empty_1 = false; ?>
|
|
||||||
<article wire:key="post_<?php echo e($post->id); ?>"
|
|
||||||
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||||
<div class="flex flex-start space-x-4">
|
<div class="flex flex-start space-x-4">
|
||||||
<!-- Avatar -->
|
<!-- Avatar -->
|
||||||
<div class="shrink-0 mt-1.5">
|
<div class="shrink-0 mt-1.5">
|
||||||
<img class="w-8 h-8 rounded-full"
|
<img class="w-8 h-8 rounded-full"
|
||||||
src="<?php echo e($post->einundzwanzigPleb->profile?->picture ?? asset('einundzwanzig-alpha.jpg')); ?>"
|
src="{{ $post->einundzwanzigPleb->profile?->picture ?? asset('einundzwanzig-alpha.jpg') }}"
|
||||||
width="32" height="32"
|
width="32" height="32"
|
||||||
alt="<?php echo e($post->einundzwanzigPleb->profile?->name); ?>">
|
alt="{{ $post->einundzwanzigPleb->profile?->name }}">
|
||||||
</div>
|
</div>
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<div class="grow">
|
<div class="grow">
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<h2 class="font-semibold text-gray-800 dark:text-gray-100 mb-2">
|
<h2 class="font-semibold text-gray-800 dark:text-gray-100 mb-2">
|
||||||
<?php echo e($post->name); ?>
|
{{ $post->name }}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="mb-6">
|
<p class="mb-6">
|
||||||
<?php echo e($post->description); ?>
|
{{ $post->description }}
|
||||||
</p>
|
</p>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<footer class="flex flex-wrap text-sm">
|
<footer class="flex flex-wrap text-sm">
|
||||||
@@ -95,14 +92,14 @@
|
|||||||
<path
|
<path
|
||||||
d="M15.686 5.708 10.291.313c-.4-.4-.999-.4-1.399 0s-.4 1 0 1.399l.6.6-6.794 3.696-1-1C1.299 4.61.7 4.61.3 5.009c-.4.4-.4 1 0 1.4l1.498 1.498 2.398 2.398L.6 14.001 2 15.4l3.696-3.697L9.692 15.7c.5.5 1.199.2 1.398 0 .4-.4.4-1 0-1.4l-.999-.998 3.697-6.695.6.6c.599.6 1.199.2 1.398 0 .3-.4.3-1.1-.1-1.499Zm-7.193 6.095L4.196 7.507l6.695-3.697 1.298 1.299-3.696 6.694Z"></path>
|
d="M15.686 5.708 10.291.313c-.4-.4-.999-.4-1.399 0s-.4 1 0 1.399l.6.6-6.794 3.696-1-1C1.299 4.61.7 4.61.3 5.009c-.4.4-.4 1 0 1.4l1.498 1.498 2.398 2.398L.6 14.001 2 15.4l3.696-3.697L9.692 15.7c.5.5 1.199.2 1.398 0 .4-.4.4-1 0-1.4l-.999-.998 3.697-6.695.6.6c.599.6 1.199.2 1.398 0 .3-.4.3-1.1-.1-1.499Zm-7.193 6.095L4.196 7.507l6.695-3.697 1.298 1.299-3.696 6.694Z"></path>
|
||||||
</svg>
|
</svg>
|
||||||
<?php echo e($post->einundzwanzigPleb->profile->name); ?>
|
{{ $post->einundzwanzigPleb->profile->name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex items-center after:block after:content-['·'] last:after:content-[''] after:text-sm after:text-gray-400 dark:after:text-gray-600 after:px-2">
|
class="flex items-center after:block after:content-['·'] last:after:content-[''] after:text-sm after:text-gray-400 dark:after:text-gray-600 after:px-2">
|
||||||
<span
|
<span
|
||||||
class="text-gray-500"><?php echo e($post->created_at->format('d.m.Y')); ?></span>
|
class="text-gray-500">{{ $post->created_at->format('d.m.Y') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,21 +111,21 @@
|
|||||||
:href="url()->temporarySignedRoute('dl', now()->addMinutes(30), ['media' => $post->getFirstMedia('pdf')])"
|
:href="url()->temporarySignedRoute('dl', now()->addMinutes(30), ['media' => $post->getFirstMedia('pdf')])"
|
||||||
label="Öffnen"
|
label="Öffnen"
|
||||||
primary icon="cloud-arrow-down"/>
|
primary icon="cloud-arrow-down"/>
|
||||||
<?php if($canEdit): ?>
|
@if($canEdit)
|
||||||
<x-button
|
<x-button
|
||||||
xs
|
xs
|
||||||
wire:click="delete(<?php echo e($post->id); ?>)"
|
wire:click="delete({{ $post->id }})"
|
||||||
|
wire:loading.attr="disabled"
|
||||||
label="Löschen"
|
label="Löschen"
|
||||||
negative icon="trash"/>
|
negative icon="trash"/>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<?php endforeach; ?>
|
@empty
|
||||||
<?php if($__empty_1): ?>
|
|
||||||
<article class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
<article class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||||
<p>Keine News vorhanden.</p>
|
<p>Keine News vorhanden.</p>
|
||||||
</article>
|
</article>
|
||||||
<?php endif; ?>
|
@endforelse
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -145,43 +142,36 @@
|
|||||||
<!-- Blocks -->
|
<!-- Blocks -->
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
|
|
||||||
<?php if($canEdit): ?>
|
@if($canEdit)
|
||||||
<div class="bg-white dark:bg-gray-800 p-4 rounded-xl">
|
<div class="bg-white dark:bg-gray-800 p-4 rounded-xl">
|
||||||
<div
|
<div
|
||||||
class="text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase mb-4">
|
class="text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase mb-4">
|
||||||
News anlegen
|
News anlegen
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 flex flex-col space-y-2">
|
<div class="mt-4 flex flex-col space-y-2">
|
||||||
<div>
|
<div wire:dirty>
|
||||||
<input class="text-gray-200" type="file" wire:model="file">
|
<input class="text-gray-200" type="file" wire:model="file">
|
||||||
<?php $__errorArgs = ['file'];
|
@error('file')
|
||||||
$__bag = $errors->getBag($__errorProps ?? 'default');
|
<span class="text-red-500">{{ $message }}</span>
|
||||||
if ($__bag->has($__errorArgs)) :
|
@enderror
|
||||||
if (isset($message)) { $__messageOriginal = $message; }
|
</div>
|
||||||
$message = $__bag->first($__errorArgs); ?>
|
<div wire:dirty>
|
||||||
<span class="text-red-500"><?php echo e($message); ?></span>
|
<x-native-select
|
||||||
<?php unset($message);
|
wire:model="form.category"
|
||||||
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
label="Kategorie"
|
||||||
endif;
|
placeholder="Wähle Kategorie"
|
||||||
unset($__errorArgs, $__bag); ?>
|
:options="\App\Enums\NewsCategory::selectOptions()"
|
||||||
</div>
|
option-label="label" option-value="value"
|
||||||
<div>
|
/>
|
||||||
<x-native-select
|
</div>
|
||||||
wire:model="form.category"
|
<div wire:dirty>
|
||||||
label="Kategorie"
|
<x-input label="Titel" wire:model="form.name"/>
|
||||||
placeholder="Wähle Kategorie"
|
</div>
|
||||||
:options="\App\Enums\NewsCategory::selectOptions()"
|
<div wire:dirty>
|
||||||
option-label="label" option-value="value"
|
<x-textarea
|
||||||
/>
|
description="optional"
|
||||||
</div>
|
label="Beschreibung" wire:model="form.description"/>
|
||||||
<div>
|
</div>
|
||||||
<x-input label="Titel" wire:model="form.name"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<x-textarea
|
|
||||||
description="optional"
|
|
||||||
label="Beschreibung" wire:model="form.description"/>
|
|
||||||
</div>
|
|
||||||
<button
|
<button
|
||||||
wire:click="save"
|
wire:click="save"
|
||||||
class="btn-sm w-full 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">
|
class="btn-sm w-full 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">
|
||||||
@@ -189,7 +179,7 @@ unset($__errorArgs, $__bag); ?>
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -199,7 +189,7 @@ unset($__errorArgs, $__bag); ?>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
@@ -212,6 +202,6 @@ unset($__errorArgs, $__bag); ?>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -199,10 +199,10 @@
|
|||||||
<div class="sm:flex sm:items-center space-y-4 sm:space-y-0 sm:space-x-4 mt-5">
|
<div class="sm:flex sm:items-center space-y-4 sm:space-y-0 sm:space-x-4 mt-5">
|
||||||
<div class="sm:w-1/2 flex flex-col space-y-2">
|
<div class="sm:w-1/2 flex flex-col space-y-2">
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<div>
|
<div wire:dirty>
|
||||||
<x-checkbox wire:model="form.check"
|
<x-checkbox wire:model="form.check"
|
||||||
label="Ich stimme den Vereins-Statuten zu"/>
|
label="Ich stimme den Vereins-Statuten zu"/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="https://einundzwanzig.space/verein/" target="_blank"
|
<a href="https://einundzwanzig.space/verein/" target="_blank"
|
||||||
class="text-amber-500">Statuten</a>
|
class="text-amber-500">Statuten</a>
|
||||||
@@ -238,9 +238,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 text-amber-500">
|
class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 text-amber-500">
|
||||||
<x-toggle xl warning
|
<x-toggle xl warning
|
||||||
wire:model.live="no"
|
wire:model.live="no"
|
||||||
label="NEIN">
|
wire:dirty
|
||||||
|
label="NEIN">
|
||||||
<x-slot name="description">
|
<x-slot name="description">
|
||||||
<span class="py-2 text-amber-500">Ich informiere mich selbst in der News Sektion und gebe keine E-Mail Adresse raus.</span>
|
<span class="py-2 text-amber-500">Ich informiere mich selbst in der News Sektion und gebe keine E-Mail Adresse raus.</span>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
@@ -249,9 +250,9 @@
|
|||||||
@if($showEmail)
|
@if($showEmail)
|
||||||
<div wire:key="showEmail"
|
<div wire:key="showEmail"
|
||||||
class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2">
|
class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2">
|
||||||
<x-input wire:model.live.debounce="fax" label="Fax-Nummer"/>
|
<x-input wire:model.live.debounce="fax" wire:dirty label="Fax-Nummer"/>
|
||||||
<x-input wire:model.live.debounce="email"
|
<x-input wire:model.live.debounce="email" wire:dirty
|
||||||
label="E-Mail Adresse"/>
|
label="E-Mail Adresse"/>
|
||||||
</div>
|
</div>
|
||||||
<div wire:key="showSave" class="flex space-x-2 mt-2">
|
<div wire:key="showSave" class="flex space-x-2 mt-2">
|
||||||
<x-button wire:click="saveEmail" label="Speichern"/>
|
<x-button wire:click="saveEmail" label="Speichern"/>
|
||||||
|
|||||||
@@ -1,102 +1,74 @@
|
|||||||
<x-layouts.app title="Neuer Vorschlag für eine Unterstützung">
|
<x-layouts.app title="{{ __('Projektförderung anlegen') }}">
|
||||||
<div>
|
<div>
|
||||||
<?php if($isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||||
<form class="space-y-8 divide-y divide-gray-700 pb-24">
|
<div
|
||||||
<div class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
|
class="flex flex-col md:flex-row items-center mb-6 space-y-4 md:space-y-0 md:space-x-4">
|
||||||
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
|
<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>
|
||||||
|
|
||||||
<x-input.group :for=" md5('image')" :label="__('Bild')">
|
<div class="md:flex">
|
||||||
<div class="py-4">
|
<!-- Left column -->
|
||||||
<?php if ($image && method_exists($image, 'temporaryUrl') && str($image->getMimeType())->contains(['image/jpeg','image/jpg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp'])): ?>
|
<div class="w-full md:w-60 mb-4 md:mb-0">
|
||||||
<div class="text-gray-200">{{ __('Preview') }}:</div>
|
<div
|
||||||
<img class="h-48 object-contain" src="<?php echo e($image->temporaryUrl()); ?>">
|
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||||
<?php endif; ?>
|
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||||
<?php if (isset($projectProposal) && $projectProposal->getFirstMediaUrl('main')): ?>
|
Formular
|
||||||
<div class="text-gray-200">{{ __('Current picture') }}:</div>
|
</h2>
|
||||||
<img class="h-48 object-contain"
|
<div class="space-y-4">
|
||||||
src="<?php echo e($projectProposal->getFirstMediaUrl('main')); ?>">
|
<div wire:dirty>
|
||||||
<?php endif; ?>
|
<x-input label="Name" wire:model="form.name"/>
|
||||||
|
@error('form.name')
|
||||||
|
<span class="text-red-500">{{ $message }}</span>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<input class="text-gray-200" type="file" wire:model="image">
|
<div wire:dirty>
|
||||||
<?php $__errorArgs = ['image'];
|
<x-textarea label="Beschreibung" wire:model="form.description"/>
|
||||||
$__bag = $errors->getBag($__errorProps ?? 'default');
|
@error('form.description')
|
||||||
if ($__bag->has($__errorArgs)) :
|
<span class="text-red-500">{{ $message }}</span>
|
||||||
if (isset($message)) { $__messageOriginal = $message; }
|
@enderror
|
||||||
$message = $__bag->first($__errorArgs); ?>
|
</div>
|
||||||
<span class="text-red-500"><?php echo e($message); ?></span>
|
<button
|
||||||
<?php unset($message);
|
wire:click="save"
|
||||||
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
wire:loading.attr="disabled"
|
||||||
endif;
|
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">
|
||||||
unset($__errorArgs, $__bag); ?>
|
Speichern
|
||||||
</x-input.group>
|
</button>
|
||||||
|
</div>
|
||||||
<x-input.group :for="md5('form.name')" :label="__('Name')">
|
|
||||||
<x-input autocomplete="off" wire:model.debounce="form.name"
|
|
||||||
:placeholder="__('Name')"/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.website')" :label="__('Webseite des Projekts')">
|
|
||||||
<x-input autocomplete="off" wire:model.debounce="form.website"
|
|
||||||
:placeholder="__('Website')"
|
|
||||||
description="Eine valide URL beginnt immer mit https://"
|
|
||||||
/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.name')" :label="__('Beabsichtigte Unterstützung in Sats')">
|
|
||||||
<x-input type="number" autocomplete="off" wire:model.debounce="form.support_in_sats"
|
|
||||||
:placeholder="__('Beabsichtigte Unterstützung in Sats')"/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.description')">
|
|
||||||
<x-slot name="label">
|
|
||||||
<div>
|
|
||||||
<?php echo e(__('Beschreibung')); ?>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="text-amber-500 text-xs py-2"><?php echo e(__('Bitte verfasse einen ausführlichen und verständlichen Antragstext, damit die Abstimmung über eine mögliche Förderung erfolgen kann.')); ?></div>
|
|
||||||
</x-slot>
|
|
||||||
<div
|
|
||||||
class="text-amber-500 text-xs py-2"><?php echo e(__('Für Bilder in Markdown verwende bitte z.B. Imgur oder einen anderen Anbieter.')); ?></div>
|
|
||||||
<x-input.simple-mde model="form.description"/>
|
|
||||||
<?php $__errorArgs = ['form.description'];
|
|
||||||
$__bag = $errors->getBag($__errorProps ?? 'default');
|
|
||||||
if ($__bag->has($__errorArgs)) :
|
|
||||||
if (isset($message)) { $__messageOriginal = $message; }
|
|
||||||
$message = $__bag->first($__errorArgs); ?>
|
|
||||||
<span class="text-red-500 py-2"><?php echo e($message); ?></span>
|
|
||||||
<?php unset($message);
|
|
||||||
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
|
||||||
endif;
|
|
||||||
unset($__errorArgs, $__bag); ?>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('save')" label="">
|
|
||||||
<x-button secondary :href="route('association.projectSupport')">
|
|
||||||
<i class="fa fa-thin fa-arrow-left"></i>
|
|
||||||
<?php echo e(__('Zurück')); ?>
|
|
||||||
</x-button>
|
|
||||||
<x-button primary wire:click="save">
|
|
||||||
<i class="fa fa-thin fa-save"></i>
|
|
||||||
<?php echo e(__('Save')); ?>
|
|
||||||
</x-button>
|
|
||||||
</x-input.group>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
<!-- 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>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
||||||
Projekt-Unterstützung</h3>
|
Projektförderung
|
||||||
|
</h3>
|
||||||
<p class="mt-1 max-w">
|
<p class="mt-1 max-w">
|
||||||
Du bist nicht berechtigt, die Projekt-Unterstützungen zu bearbeiten.
|
Du bist nicht berechtigt, eine Projektförderung anzulegen.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -1,111 +1,74 @@
|
|||||||
<x-layouts.app title="<?php echo e($projectProposal->name); ?>">
|
<x-layouts.app title="{{ __('Projektförderung bearbeiten') }}">
|
||||||
<div>
|
<div>
|
||||||
<?php if($isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||||
<form class="space-y-8 divide-y divide-gray-700 pb-24">
|
<div
|
||||||
<div class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
|
class="flex flex-col md:flex-row items-center mb-6 space-y-4 md:space-y-0 md:space-x-4">
|
||||||
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
|
<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>
|
||||||
|
|
||||||
<x-input.group :for=" md5('image')" :label="__('Bild')">
|
<div class="md:flex">
|
||||||
<div class="py-4">
|
<!-- Left column -->
|
||||||
<?php if ($image && method_exists($image, 'temporaryUrl') && str($image->getMimeType())->contains(['image/jpeg','image/jpg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp'])): ?>
|
<div class="w-full md:w-60 mb-4 md:mb-0">
|
||||||
<div class="text-gray-200">{{ __('Preview') }}:</div>
|
<div
|
||||||
<img class="h-48 object-contain" src="<?php echo e($image->temporaryUrl()); ?>">
|
class="bg-white dark:bg-gray-800 shadow-sm rounded-xl p-5">
|
||||||
<?php endif; ?>
|
<h2 class="text-lg font-semibold text-gray-800 dark:text-gray-100 mb-4">
|
||||||
<?php if (isset($projectProposal) && $projectProposal->getFirstMediaUrl('main')): ?>
|
Formular
|
||||||
<div class="text-gray-200">{{ __('Current picture') }}:</div>
|
</h2>
|
||||||
<img class="h-48 object-contain"
|
<div class="space-y-4">
|
||||||
src="<?php echo e($projectProposal->getFirstMediaUrl('main')); ?>">
|
<div wire:dirty>
|
||||||
<?php endif; ?>
|
<x-input label="Name" wire:model="form.name"/>
|
||||||
|
@error('form.name')
|
||||||
|
<span class="text-red-500">{{ $message }}</span>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<input class="text-gray-200" type="file" wire:model="image">
|
<div wire:dirty>
|
||||||
<?php $__errorArgs = ['image'];
|
<x-textarea label="Beschreibung" wire:model="form.description"/>
|
||||||
$__bag = $errors->getBag($__errorProps ?? 'default');
|
@error('form.description')
|
||||||
if ($__bag->has($__errorArgs)) :
|
<span class="text-red-500">{{ $message }}</span>
|
||||||
if (isset($message)) { $__messageOriginal = $message; }
|
@enderror
|
||||||
$message = $__bag->first($__errorArgs); ?>
|
</div>
|
||||||
<span class="text-red-500"><?php echo e($message); ?></span>
|
<button
|
||||||
<?php unset($message);
|
wire:click="update"
|
||||||
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
wire:loading.attr="disabled"
|
||||||
endif;
|
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">
|
||||||
unset($__errorArgs, $__bag); ?>
|
Speichern
|
||||||
</x-input.group>
|
</button>
|
||||||
|
</div>
|
||||||
<x-input.group :for="md5('form.name')" :label="__('Name')">
|
|
||||||
<x-input autocomplete="off" wire:model.debounce="form.name"
|
|
||||||
:placeholder="__('Name')"/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.website')" :label="__('Webseite des Projekts')">
|
|
||||||
<x-input autocomplete="off" wire:model.debounce="form.website"
|
|
||||||
:placeholder="__('Website')"
|
|
||||||
description="Eine valide URL beginnt immer mit https://"
|
|
||||||
/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.name')" :label="__('Beabsichtigte Unterstützung in Sats')">
|
|
||||||
<x-input type="number" autocomplete="off" wire:model.debounce="form.support_in_sats"
|
|
||||||
:placeholder="__('Beabsichtigte Unterstützung in Sats')"/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.accepted')" :label="__('Wurde angenommen')">
|
|
||||||
<x-checkbox autocomplete="off" wire:model.debounce="form.accepted"/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.sats_paid')" :label="__('Letztendlich bezahlte Satoshis')">
|
|
||||||
<x-input autocomplete="off" wire:model.debounce="form.sats_paid"
|
|
||||||
:placeholder="__('Satoshi-Anzahl')"/>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('form.description')">
|
|
||||||
<x-slot name="label">
|
|
||||||
<div>
|
|
||||||
<?php echo e(__('Beschreibung')); ?>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="text-amber-500 text-xs py-2"><?php echo e(__('Bitte verfasse einen ausführlichen und verständlichen Antragstext, damit die Abstimmung über eine mögliche Förderung erfolgen kann.')); ?></div>
|
|
||||||
</x-slot>
|
|
||||||
<div
|
|
||||||
class="text-amber-500 text-xs py-2"><?php echo e(__('Für Bilder in Markdown verwende bitte z.B. Imgur oder einen anderen Anbieter.')); ?></div>
|
|
||||||
<x-input.simple-mde model="form.description"/>
|
|
||||||
<?php $__errorArgs = ['form.description'];
|
|
||||||
$__bag = $errors->getBag($__errorProps ?? 'default');
|
|
||||||
if ($__bag->has($__errorArgs)) :
|
|
||||||
if (isset($message)) { $__messageOriginal = $message; }
|
|
||||||
$message = $__bag->first($__errorArgs); ?>
|
|
||||||
<span class="text-red-500 py-2"><?php echo e($message); ?></span>
|
|
||||||
<?php unset($message);
|
|
||||||
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
|
||||||
endif;
|
|
||||||
unset($__errorArgs, $__bag); ?>
|
|
||||||
</x-input.group>
|
|
||||||
|
|
||||||
<x-input.group :for="md5('save')" label="">
|
|
||||||
<x-button secondary :href="route('association.projectSupport')">
|
|
||||||
<i class="fa fa-thin fa-arrow-left"></i>
|
|
||||||
<?php echo e(__('Zurück')); ?>
|
|
||||||
</x-button>
|
|
||||||
<x-button primary wire:click="save">
|
|
||||||
<i class="fa fa-thin fa-save"></i>
|
|
||||||
<?php echo e(__('Speichern')); ?>
|
|
||||||
</x-button>
|
|
||||||
</x-input.group>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
<!-- 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>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
||||||
Projekt-Unterstützung</h3>
|
Projektförderung
|
||||||
|
</h3>
|
||||||
<p class="mt-1 max-w">
|
<p class="mt-1 max-w">
|
||||||
Du bist nicht berechtigt, die Projekt-Unterstützungen zu bearbeiten.
|
Du bist nicht berechtigt, die Projektförderung zu bearbeiten.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -1,157 +1,85 @@
|
|||||||
<x-layouts.app
|
<x-layouts.app
|
||||||
:seo="new SEOData(title: 'Unterstützung für: ' . $projectProposal->name, description: $projectProposal->accepted ? 'Wurde mit ' . number_format($projectProposal->sats_paid, 0, ',', '.') . ' Satoshis unterstützt!' :str($projectProposal->description)->limit(100, '...', true), image: $projectProposal->getFirstMediaUrl('main'))">
|
:seo="new \RalphJSmit\Laravel\SEO\Support\SEOData(title: 'Projektförderung ' . $project->name, description: $project->description)"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<?php if($projectProposal->accepted || $isAllowed): ?>
|
@if($isAllowed)
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full">
|
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
||||||
|
<div
|
||||||
<!-- Page content -->
|
class="flex flex-col md:flex-row items-center mb-6 space-y-4 md:space-y-0 md:space-x-4">
|
||||||
<div class="max-w-5xl mx-auto flex flex-col lg:flex-row lg:space-x-8 xl:space-x-16">
|
<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">
|
||||||
<!-- Content -->
|
{{ $project->name }}
|
||||||
<div>
|
</h1>
|
||||||
<div class="mb-6">
|
<div>
|
||||||
<a class="btn-sm px-3 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"
|
@if($project->status === 'pending')
|
||||||
href="<?php echo e(route('association.projectSupport')); ?>"
|
<x-badge info label="Pending"/>
|
||||||
>
|
@elseif($project->status === 'active')
|
||||||
<svg class="fill-current text-gray-400 dark:text-gray-500 mr-2" width="7" height="12"
|
<x-badge success label="Active"/>
|
||||||
viewBox="0 0 7 12">
|
@else
|
||||||
<path d="M5.4.6 6.8 2l-4 4 4 4-1.4 1.4L0 6z"></path>
|
<x-badge neutral label="Archiviert"/>
|
||||||
</svg>
|
@endif
|
||||||
<span>Zurück zur Übersicht</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm font-semibold text-violet-500 uppercase mb-2">
|
|
||||||
<?php echo e($projectProposal->created_at->translatedFormat('d.m.Y')); ?>
|
|
||||||
</div>
|
|
||||||
<header class="mb-4">
|
|
||||||
<!-- Title -->
|
|
||||||
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold mb-2">
|
|
||||||
<?php echo e($projectProposal->name); ?>
|
|
||||||
</h1>
|
|
||||||
<x-markdown>
|
|
||||||
<?php echo $projectProposal->description; ?>
|
|
||||||
</x-markdown>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="space-y-3 sm:flex sm:items-center sm:justify-between sm:space-y-0 mb-6">
|
|
||||||
<!-- Author -->
|
|
||||||
<div class="flex items-center sm:mr-4">
|
|
||||||
<a class="block mr-2 shrink-0" href="#0">
|
|
||||||
<img class="rounded-full"
|
|
||||||
src="<?php echo e($projectProposal->einundzwanzigPleb->profile?->picture ?? asset('einundzwanzig-alpha.jpg')); ?>"
|
|
||||||
width="32" height="32" alt="User 04">
|
|
||||||
</a>
|
|
||||||
<div class="text-sm whitespace-nowrap">Eingereicht von
|
|
||||||
<div
|
|
||||||
class="font-semibold text-gray-800 dark:text-gray-100"><?php echo e($projectProposal->einundzwanzigPleb?->profile->name ?? str($projectProposal->einundzwanzigPleb->npub)->limit(32)); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Right side -->
|
|
||||||
<div class="flex flex-wrap items-center sm:justify-end space-x-2">
|
|
||||||
<!-- Tags -->
|
|
||||||
<div
|
|
||||||
class="text-xs inline-flex items-center font-medium border border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-400 rounded-full text-center px-2.5 py-1">
|
|
||||||
<a target="_blank" href="<?php echo e($projectProposal->website); ?>"><span>Webseite</span></a>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="text-xs inline-flex font-medium uppercase bg-green-500/20 text-green-700 rounded-full text-center px-2.5 py-1">
|
|
||||||
<?php echo e(number_format($projectProposal->support_in_sats, 0, ',', '.')); ?> Sats
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<figure class="mb-6">
|
|
||||||
<img class="rounded-sm h-48" src="<?php echo e($projectProposal->getFirstMediaUrl('main')); ?>"
|
|
||||||
alt="Picture">
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
<hr class="my-6 border-t border-gray-100 dark:border-gray-700/60">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if($isAllowed && !$projectProposal->accepted): ?>
|
|
||||||
<!-- Sidebar -->
|
|
||||||
<div class="space-y-4">
|
|
||||||
|
|
||||||
<!-- 1st block -->
|
|
||||||
<div class="bg-white dark:bg-gray-800 p-5 shadow-sm rounded-xl lg:w-72 xl:w-80">
|
|
||||||
<?php if(!$ownVoteExists): ?>
|
|
||||||
<div class="space-y-2">
|
|
||||||
<button
|
|
||||||
wire:click="approve"
|
|
||||||
class="btn w-full bg-gray-900 text-gray-100 hover:bg-gray-800 dark:bg-gray-100 dark:text-gray-800 dark:hover:bg-white">
|
|
||||||
<i class="fill-current shrink-0 fa-sharp-duotone fa-solid fa-thumbs-up"></i>
|
|
||||||
<span class="ml-1">Zustimmen</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
wire:click="notApprove"
|
|
||||||
class="btn w-full bg-red-900 text-red-100 hover:bg-red-800 dark:bg-red-100 dark:text-red-800 dark:hover:bg-red-400">
|
|
||||||
<i class="fill-current shrink-0 fa-sharp-duotone fa-solid fa-thumbs-down"></i>
|
|
||||||
<span class="ml-1">Ablehnen</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
|
||||||
<div class="space-y-2">
|
|
||||||
<p>Du hast bereits abgestimmt.</p>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 2nd block -->
|
|
||||||
<div class="bg-white dark:bg-gray-800 p-5 shadow-sm rounded-xl lg:w-72 xl:w-80">
|
|
||||||
<div class="flex justify-between space-x-1 mb-5">
|
|
||||||
<div class="text-sm text-gray-800 dark:text-gray-100 font-semibold">
|
|
||||||
Zustimmungen des Vorstands (<?php echo e(count($boardVotes->where('value', 1))); ?>)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 2nd block -->
|
|
||||||
<div class="bg-white dark:bg-gray-800 p-5 shadow-sm rounded-xl lg:w-72 xl:w-80">
|
|
||||||
<div class="flex justify-between space-x-1 mb-5">
|
|
||||||
<div class="text-sm text-gray-800 dark:text-gray-100 font-semibold">
|
|
||||||
Ablehnungen des Vorstands (<?php echo e(count($boardVotes->where('value', 0))); ?>)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 3rd block -->
|
|
||||||
<div class="bg-white dark:bg-gray-800 p-5 shadow-sm rounded-xl lg:w-72 xl:w-80">
|
|
||||||
<div class="flex justify-between space-x-1 mb-5">
|
|
||||||
<div class="text-sm text-gray-800 dark:text-gray-100 font-semibold">
|
|
||||||
Zustimmungen der übrigen Mitglieder (<?php echo e(count($otherVotes->where('value', 1))); ?>)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 3rd block -->
|
|
||||||
<div class="bg-white dark:bg-gray-800 p-5 shadow-sm rounded-xl lg:w-72 xl:w-80">
|
|
||||||
<div class="flex justify-between space-x-1 mb-5">
|
|
||||||
<div class="text-sm text-gray-800 dark:text-gray-100 font-semibold">
|
|
||||||
Ablehnungen der übrigen Mitglieder (<?php echo e(count($otherVotes->where('value', 0))); ?>)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</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>
|
</div>
|
||||||
<?php else: ?>
|
@else
|
||||||
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
|
<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="bg-white dark:bg-[#1B1B1B] shadow overflow-hidden sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">
|
||||||
Projekt-Unterstützung
|
Projektförderung
|
||||||
</h3>
|
</h3>
|
||||||
<p class="mt-1 max-w">
|
<p class="mt-1 max-w">
|
||||||
Du bist nicht berechtigt, die Projekt-Unterstützungen einzusehen.
|
Du bist nicht berechtigt, die Projektförderung einzusehen.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-layouts.app>
|
</x-layouts.app>
|
||||||
|
|||||||
@@ -23,9 +23,7 @@
|
|||||||
<div>
|
<div>
|
||||||
Beschreibung: {{ $event['content'] }}
|
Beschreibung: {{ $event['content'] }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
@dump($event)
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user