'', 'description' => '', 'support_in_sats' => '', 'website' => '', 'accepted' => false, 'sats_paid' => 0, ]; public $file = null; public bool $isAllowed = false; public bool $isAdmin = false; public function mount($projectProposal): void { $this->project = ProjectProposal::query()->where('slug', $projectProposal)->firstOrFail(); if (NostrAuth::check()) { $currentPubkey = NostrAuth::pubkey(); $currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $currentPubkey)->first(); if ( ( $currentPleb && $currentPleb->id === $this->project->einundzwanzig_pleb_id ) || in_array($currentPleb->npub, config('einundzwanzig.config.current_board')) ) { $this->isAllowed = true; $this->form = [ 'name' => $this->project->name, 'description' => $this->project->description, 'support_in_sats' => (string) $this->project->support_in_sats, 'website' => $this->project->website ?? '', 'accepted' => (bool) $this->project->accepted, 'sats_paid' => $this->project->sats_paid, ]; } if ($currentPleb && in_array($currentPleb->npub, config('einundzwanzig.config.current_board'), true)) { $this->isAdmin = true; } } } public function deleteMainImage(): void { if ($this->project->getFirstMedia('main')) { $this->project->getFirstMedia('main')->delete(); } } public function removeFile(): void { if ($this->file) { $this->file->delete(); $this->file = null; } } public function update(): void { $this->validate([ 'form.name' => 'required|string|max:255', 'form.description' => 'required|string', 'form.support_in_sats' => 'required|integer|min:0', 'form.website' => 'required|url|max:255', 'file' => 'nullable|file|mimes:jpeg,png,jpg,gif,webp|mimetypes:image/jpeg,image/png,image/gif,image/webp|max:10240', ]); $this->project->update([ 'name' => $this->form['name'], 'description' => $this->form['description'], 'support_in_sats' => (int) $this->form['support_in_sats'], 'website' => $this->form['website'], 'accepted' => $this->isAdmin ? (bool) $this->form['accepted'] : $this->project->accepted, 'sats_paid' => $this->isAdmin ? $this->form['sats_paid'] : $this->project->sats_paid, ]); if ($this->file) { $this->project->addMedia($this->file)->toMediaCollection('main'); } $this->redirectRoute('association.projectSupport.item', $this->project); } }; ?>
@if($isAllowed)

Projektförderungs-Antrag bearbeiten

Zurück
Formular
Name
Website
Unterstützung (Sats)
Bild @if($file)
@endif
@if($project->getFirstMedia('main'))
@endif
@if($isAdmin) Admin Felder
Akzeptiert Sats bezahlt
@endif Speichern
Information

Bearbeite die Projektförderung und speichere deine Änderungen.

@else
Projektförderung kann nicht bearbeitet werden

Um diese Projektförderung zu bearbeiten, musst du entweder:

  • Der Ersteller dieser Projektförderung sein
  • Ein Mitglied des aktuellen Vorstands sein

@if(!NostrAuth::check()) Bitte melde dich zunächst mit Nostr an. @else Bitte kontaktiere den Vorstand, wenn du denkst, dass du berechtigt sein solltest. @endif

@endif