add members table

This commit is contained in:
fsociety
2024-09-29 18:21:09 +02:00
parent e76a60c600
commit c2f0014a8e
31 changed files with 1815 additions and 104 deletions

View File

@@ -0,0 +1,14 @@
<div class="px-4 py-2 rounded-lg text-sm bg-violet-100 text-gray-700">
@if($row->application_text )
<div class="flex w-full justify-between items-start">
<div class="flex">
<svg class="shrink-0 fill-current text-violet-500 mt-[3px] mr-3" width="16" height="16" viewBox="0 0 16 16">
<path d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm1 12H7V7h2v5zM8 6c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1z"></path>
</svg>
<div>{{ $row->application_text }}</div>
</div>
</div>
@else
keine Bewerbung vorhanden
@endif
</div>

View File

@@ -30,5 +30,13 @@
</div>
</a>
</li>
<li class="{{ $currentRoute === 'association.members.admin' ? $isCurrentRouteClass : $isNotCurrentRouteClass }}">
<a class="block text-gray-800 dark:text-gray-100 hover:text-gray-900 dark:hover:text-white truncate transition" href="{{ route('association.members.admin') }}">
<div class="flex items-center">
<i class="fa-sharp-duotone fa-solid fa-users h-6 w-6"></i>
<span class="text-sm font-medium ml-4 lg:opacity-0 lg:sidebar-expanded:opacity-100 2xl:opacity-100 duration-200">Mitglieder</span>
</div>
</a>
</li>
</ul>
</div>

View File

@@ -1,73 +0,0 @@
<div class="min-w-fit">
@php
$isCurrentRouteClass = 'pl-4 pr-3 py-2 rounded-lg mb-0.5 last:mb-0 bg-[linear-gradient(135deg,var(--tw-gradient-stops))] from-violet-500/[0.12] dark:from-violet-500/[0.24] to-violet-500/[0.04]';
$isNotCurrentRouteClass = 'pl-4 pr-3 py-2 rounded-lg mb-0.5 last:mb-0';
$isCurrentSubItem = 'block text-violet-500 transition truncate';
$isNotCurrentSubItem = 'block text-gray-500/90 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition truncate';
@endphp
<!-- Sidebar backdrop (mobile only) -->
<div
class="fixed inset-0 bg-gray-900 bg-opacity-30 z-40 lg:hidden lg:z-auto transition-opacity duration-200"
:class="sidebarOpen ? 'opacity-100' : 'opacity-0 pointer-events-none'"
aria-hidden="true"
x-cloak
></div>
<!-- Sidebar -->
<div
id="sidebar"
class="flex flex-col absolute z-40 left-0 top-0 lg:static lg:left-auto lg:top-auto lg:translate-x-0 h-[100dvh] overflow-y-scroll lg:overflow-y-auto no-scrollbar w-64 lg:w-20 lg:sidebar-expanded:!w-64 2xl:!w-64 shrink-0 bg-white dark:bg-[#222222] shadow-sm rounded-r-2xl p-4 transition-all duration-200 ease-in-out"
:class="sidebarOpen ? 'translate-x-0' : '-translate-x-64'"
@click.outside="sidebarOpen = false"
@keydown.escape.window="sidebarOpen = false"
x-cloak="lg"
>
<!-- Sidebar header -->
<div class="flex justify-between mb-10 pr-3 sm:px-2">
<!-- Close button -->
<button class="lg:hidden text-gray-500 hover:text-gray-400" @click.stop="sidebarOpen = !sidebarOpen"
aria-controls="sidebar" :aria-expanded="sidebarOpen">
<span class="sr-only">Close sidebar</span>
<svg class="w-6 h-6 fill-current" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M10.7 18.7l1.4-1.4L7.8 13H20v-2H7.8l4.3-4.3-1.4-1.4L4 12z"/>
</svg>
</button>
<!-- Logo -->
<img src="{{ asset('img/einundzwanzig-horizontal-inverted.svg') }}" alt="Logo" width="auto" height="32">
</div>
@php
$activeLinkGroupClass = ' bg-[linear-gradient(135deg,var(--tw-gradient-stops))] from-amber-500/[0.12] dark:from-amber-500/[0.24] to-amber-500/[0.04]';
$activeItemClass = 'block text-amber-500 transition truncate';
@endphp
<!-- Links -->
<div class="space-y-8">
@include('components.layouts.navigation.meetups', ['isCurrentRouteClass' => $isCurrentRouteClass, 'isNotCurrentRouteClass' => $isNotCurrentRouteClass])
@include('components.layouts.navigation.association', ['isCurrentRouteClass' => $isCurrentRouteClass, 'isNotCurrentRouteClass' => $isNotCurrentRouteClass])
{{--@include('components.layouts.navigation.events')
@include('components.layouts.navigation.courses')
@include('components.layouts.navigation.nostr')
@include('components.layouts.navigation.legacy')--}}
</div>
<!-- Expand / collapse button -->
<div class="pt-3 hidden lg:inline-flex 2xl:hidden justify-end mt-auto">
<div class="w-12 pl-4 pr-3 py-2">
<button
class="text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 transition-colors"
@click="sidebarExpanded = !sidebarExpanded">
<span class="sr-only">Expand / collapse sidebar</span>
<svg class="shrink-0 fill-current text-gray-400 dark:text-gray-500 sidebar-expanded:rotate-180"
xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path
d="M15 16a1 1 0 0 1-1-1V1a1 1 0 1 1 2 0v14a1 1 0 0 1-1 1ZM8.586 7H1a1 1 0 1 0 0 2h7.586l-2.793 2.793a1 1 0 1 0 1.414 1.414l4.5-4.5A.997.997 0 0 0 12 8.01M11.924 7.617a.997.997 0 0 0-.217-.324l-4.5-4.5a1 1 0 0 0-1.414 1.414L8.586 7M12 7.99a.996.996 0 0 0-.076-.373Z"/>
</svg>
</button>
</div>
</div>
</div>
</div>

View File

@@ -59,7 +59,7 @@ mount(function() {
<!-- Links -->
<div class="space-y-8">
@include('components.layouts.navigation.meetups')
{{--@include('components.layouts.navigation.meetups')--}}
@include('components.layouts.navigation.association')
{{--@include('components.layouts.navigation.events')
@include('components.layouts.navigation.courses')

View File

@@ -278,8 +278,8 @@ $signEvent = function ($event) {
<li class="-mx-2">
<div class="flex w-full p-2 rounded text-left">
<img class="w-8 h-8 rounded-full mr-2 bg-black"
src="{{ $pleb['profile']['picture'] ?? 'https://robohash.org/' . $pleb['pubkey'] }}"
onerror="this.onerror=null; this.src='https://robohash.org/{{ $pleb['pubkey'] }}';"
src="{{ $pleb['profile']['picture'] ?? 'https://robohash.org/test' }}"
onerror="this.onerror=null; this.src='https://robohash.org/test';"
width="32"
height="32"
alt="{{ $pleb['pubkey'] }}"/>

View File

@@ -0,0 +1,33 @@
<?php
use Livewire\Volt\Component;
use function Livewire\Volt\computed;
use function Livewire\Volt\mount;
use function Livewire\Volt\state;
use function Livewire\Volt\with;
use function Livewire\Volt\updated;
use function Laravel\Folio\{middleware};
use function Laravel\Folio\name;
use function Livewire\Volt\{on};
name('association.members.admin');
state(['currentPubkey' => null]);
state(['members' => []]);
on([
'nostrLoggedIn' => function ($pubkey) {
$this->currentPubkey = $pubkey;
},
]);
?>
<x-layouts.app title="{{ __('Mitglieder') }}">
@volt
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
<livewire:einundzwanzig-pleb-table/>
</div>
@endvolt
</x-layouts.app>

View File

@@ -8,10 +8,31 @@ use function Livewire\Volt\state;
use function Livewire\Volt\with;
use function Laravel\Folio\{middleware};
use function Laravel\Folio\name;
use function Livewire\Volt\{on};
use function Livewire\Volt\{on, form};
name('association.profile');
state(['currentPubkey' => null]);
state(['currentPleb' => null]);
form(\App\Livewire\Forms\ApplicationForm::class);
on([
'nostrLoggedIn' => function ($pubkey) {
$this->currentPubkey = $pubkey;
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first();
},
]);
$save = function ($type) {
$this->form->validate();
$this->currentPleb
->update([
'application_for' => $type,
'application_text' => $this->form->reason,
]);
};
?>
<x-layouts.app title="{{ __('Wahl') }}">
@@ -42,7 +63,7 @@ name('association.profile');
<ul class="flex flex-nowrap md:block mr-3 md:mr-0">
<li class="mr-0.5 md:mr-0 md:mb-0.5">
<a class="flex items-center px-2.5 py-2 rounded-lg whitespace-nowrap bg-[linear-gradient(135deg,var(--tw-gradient-stops))] from-orange-500/[0.12] dark:from-orange-500/[0.24] to-orange-500/[0.04]"
href="settings.html">
href="#0">
<i class="fa-sharp-duotone fa-solid fa-id-card-clip shrink-0 fill-current text-orange-400 mr-2"></i>
<span
class="text-sm font-medium text-orange-500 dark:text-orange-400">Status</span>
@@ -92,50 +113,120 @@ name('association.profile');
<!-- Picture -->
<section>
<div class="flex items-center">
<x-button label="Mit Nostr verbinden" @click="openNostrLogin" x-show="!$store.nostr.user"/>
<div class="flex items-center justify-between">
<x-button label="Mit Nostr verbinden" @click="openNostrLogin"
x-show="!$store.nostr.user"/>
<template x-if="$store.nostr.user">
<div class="flex items">
<img class="w-12 h-12 rounded-full"
x-bind:src="$store.nostr.user.picture"
alt="">
<div class="ml-4">
<h3 class="text-lg leading-snug text-[#1B1B1B] dark:text-gray-100 font-bold" x-text="$store.nostr.user.nip05"></h3>
<div class="text-sm text-gray-500 dark:text-gray-400" x-text="$store.nostr.user.nip05"></div>
<h3 class="text-lg leading-snug text-[#1B1B1B] dark:text-gray-100 font-bold"
x-text="$store.nostr.user.nip05"></h3>
<div class="text-sm text-gray-500 dark:text-gray-400"
x-text="$store.nostr.user.nip05"></div>
</div>
</div>
</template>
@if($currentPubkey)
<div
class="inline-flex min-w-80 px-4 py-2 rounded-lg text-sm bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-100">
<div class="flex w-full justify-between items-start">
<div class="flex">
<svg class="shrink-0 fill-current text-green-500 mt-[3px] mr-3"
width="16" height="16" viewBox="0 0 16 16">
<path
d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zM7 11.4L3.6 8 5 6.6l2 2 4-4L12.4 6 7 11.4z"></path>
</svg>
<div>Profil in der Datenbank vorhanden. Bewerbung kann erfolgen.</div>
</div>
</div>
</div>
@endif
</div>
</section>
<!-- Business Profile -->
<section>
<h3 class="text-xl leading-snug text-[#1B1B1B] dark:text-gray-100 font-bold mb-1">
passives Mitglied werden
</h3>
<div class="text-sm">
TEXT
</div>
<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/3">
<x-button label="Beantragen"/>
@if($currentPubkey && !$currentPleb->application_for && $currentPleb->association_status->value < 2)
<h3 class="text-xl leading-snug text-[#1B1B1B] dark:text-gray-100 font-bold mb-1">
passives Mitglied werden
</h3>
<div class="text-sm">
<x-textarea
corner="Beschreibe deine Motivation, passives Mitglied zu werden."
label="Warum möchtest du passives Mitglied werden?" wire:model="form.reason"/>
</div>
</div>
<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/3 flex flex-col space-y-2">
<x-button label="Für passive Mitgliedschaft bewerben"
wire:click="save({{ \App\Enums\AssociationStatus::PASSIVE() }})"/>
<x-badge outline
label="Es wird im Anschluss ein Nostr Event erzeugt, das du mit dem Mitgliedsbeitrag zappen kannst, nachdem du bestätigt wurdest."/>
</div>
</div>
@endif
</section>
<!-- Email -->
<section>
<h3 class="text-xl leading-snug text-[#1B1B1B] dark:text-gray-100 font-bold mb-1">aktives
Mitglied werden</h3>
<div class="text-sm">
TEXT
</div>
<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/3">
<x-button label="Beantragen"/>
@if($currentPubkey && !$currentPleb->application_for && $currentPleb->association_status->value < 2)
<h3 class="text-xl leading-snug text-[#1B1B1B] dark:text-gray-100 font-bold mb-1">
aktives Mitglied werden
</h3>
<div class="text-sm">
<x-textarea
corner="Woher kennen wir dich? Was möchtest du einbringen?"
description="Wir bitten dich mindestens von mind. 3 aktiven Mitgliedern auf Nostr gefolgt zu werden."
label="Warum möchtest du aktives Mitglied werden?" wire:model="form.reason"/>
</div>
</div>
<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/3 flex flex-col space-y-2">
<x-button label="Für aktive Mitgliedschaft bewerben"
wire:click="save({{ \App\Enums\AssociationStatus::ACTIVE() }})"/>
<x-badge outline
label="Es wird im Anschluss ein Nostr Event erzeugt, das du mit dem Mitgliedsbeitrag zappen kannst, nachdem du bestätigt wurdest."/>
</div>
</div>
@endif
</section>
<section>
@if($currentPubkey && $currentPleb->application_for)
<div class="inline-flex flex-col w-full max-w-lg px-4 py-2 rounded-lg text-sm bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-400">
<div class="flex w-full justify-between items-start">
<div class="flex">
<svg class="shrink-0 fill-current text-yellow-500 mt-[3px] mr-3" width="16" height="16" viewBox="0 0 16 16">
<path d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 12c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1zm1-3H7V4h2v5z"></path>
</svg>
<div>
<div class="font-medium text-gray-800 dark:text-gray-100 mb-1">Du hast dich erfolgreich mit folgendem Grund beworben:</div>
<div>{{ $currentPleb->application_text }}</div>
</div>
</div>
</div>
</div>
@endif
</section>
<section>
@if($currentPleb && $currentPleb->association_status->value > 1)
<div class="inline-flex flex-col w-full max-w-lg px-4 py-2 rounded-lg text-sm bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-400">
<div class="flex w-full justify-between items-start">
<div class="flex">
<svg class="shrink-0 fill-current text-yellow-500 mt-[3px] mr-3" width="16" height="16" viewBox="0 0 16 16">
<path d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 12c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1zm1-3H7V4h2v5z"></path>
</svg>
<div>
<div class="font-medium text-gray-800 dark:text-gray-100 mb-1">Dein aktueller Status: {{ $currentPleb->association_status->label() }}</div>
</div>
</div>
</div>
</div>
@endif
</section>
</div>
<!-- Panel footer -->