Refactor project-support forms: add admin-only fields, improve Flux form components, and enhance layout for consistency. 🛠️ Remove redundant NostrAuth methods and streamline authorization logic.

This commit is contained in:
HolgerHatGarKeineNode
2026-01-20 00:49:28 +01:00
parent 28b755575f
commit a6c8fb6435
11 changed files with 459 additions and 227 deletions

View File

@@ -21,7 +21,6 @@ new class extends Component {
$this->projectProposal = \App\Models\ProjectProposal::query()->where('slug', $projectProposal)->firstOrFail();
if (NostrAuth::check()) {
$this->currentPubkey = NostrAuth::pubkey();
$this->handleNostrLoggedIn($this->currentPubkey);
$this->isAllowed = true;
}
}
@@ -45,17 +44,6 @@ new class extends Component {
->get();
}
public function handleNostrLoggedIn($pubkey): void
{
$this->currentPubkey = $pubkey;
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first();
$this->isAllowed = true;
$this->ownVoteExists = Vote::query()
->where('project_proposal_id', $this->projectProposal->id)
->where('einundzwanzig_pleb_id', $this->currentPleb->id)
->exists();
}
public function handleApprove(): void
{
Vote::query()->updateOrCreate([
@@ -95,7 +83,9 @@ new class extends Component {
<h1 class="text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold mb-2">
{{ $projectProposal->name }}
</h1>
{!! $projectProposal->description !!}
<x-markdown>
{!! $projectProposal->description !!}
</x-markdown>
</header>
<div class="space-y-3 sm:flex sm:items-center sm:justify-between sm:space-y-0 mb-6">