fn() => $projectProposal, 'image', 'isAllowed' => false, 'currentPubkey' => null, 'currentPleb' => null, ]); mount(function ($projectProposal) { $this->form->fill($projectProposal->toArray()); $this->image = $projectProposal->getFirstMedia('main'); }); usesFileUploads(); on([ 'nostrLoggedIn' => function ($pubkey) { $this->currentPubkey = $pubkey; $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first(); if ( $this->currentPleb->id !== $this->projectProposal->einundzwanzig_pleb_id && !in_array($this->currentPleb->npub, config('einundzwanzig.config.current_board'), true) ) { return $this->js('alert("Du bist hierzu nicht berechtigt.")'); } $this->isAllowed = true; }, 'nostrLoggedOut' => function () { $this->isAllowed = false; $this->currentPubkey = null; $this->currentPleb = null; }, ]); $save = function () { $this->form->validate(); if ($this->image) { $this->validate([ 'image' => 'image|max:1024', ]); $this->projectProposal ->addMedia($this->image->getRealPath()) ->toMediaCollection('main'); } $this->projectProposal->update([ ...$this->form->except('id', 'slug'), ]); return redirect()->route('association.projectSupport'); }; ?> @volt
@if ($image && method_exists($image, 'temporaryUrl') && str($image->getMimeType())->contains(['image/jpeg','image/jpg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp']))
{{ __('Preview') }}:
@endif @if (isset($projectProposal) && $projectProposal->getFirstMediaUrl('main'))
{{ __('Current picture') }}:
@endif
@error('image') {{ $message }} @enderror
{{ __('Beschreibung') }}
{{ __('Bitte verfasse einen ausführlichen und verständlichen Antragstext, damit die Abstimmung über eine mögliche Förderung erfolgen kann.') }}
{{ __('Für Bilder in Markdown verwende bitte z.B. Imgur oder einen anderen Anbieter.') }}
@error('form.description') {{ $message }} @enderror
{{ __('Zurück') }} {{ __('Speichern') }}
@endvolt