mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
✨ feat(election): add access control for election details and voting options based on user permissions.
This commit is contained in:
@@ -72,72 +72,86 @@ $save = function () {
|
||||
|
||||
<x-layouts.app title="{{ $projectProposal->name }}">
|
||||
@volt
|
||||
<div x-cloak x-show="isAllowed" class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto"
|
||||
x-data="nostrDefault(@this)">
|
||||
<form class="space-y-8 divide-y divide-gray-700 pb-24">
|
||||
<div class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
|
||||
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
|
||||
<div>
|
||||
@if($isAllowed)
|
||||
<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 class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
|
||||
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
|
||||
|
||||
<x-input.group :for=" md5('image')" :label="__('Bild')">
|
||||
<div class="py-4">
|
||||
@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="text-gray-200">{{ __('Preview') }}:</div>
|
||||
<img class="h-48 object-contain" src="{{ $image->temporaryUrl() }}">
|
||||
@endif
|
||||
@if (isset($projectProposal) && $projectProposal->getFirstMediaUrl('main'))
|
||||
<div class="text-gray-200">{{ __('Current picture') }}:</div>
|
||||
<img class="h-48 object-contain" src="{{ $projectProposal->getFirstMediaUrl('main') }}">
|
||||
@endif
|
||||
<x-input.group :for=" md5('image')" :label="__('Bild')">
|
||||
<div class="py-4">
|
||||
@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="text-gray-200">{{ __('Preview') }}:</div>
|
||||
<img class="h-48 object-contain" src="{{ $image->temporaryUrl() }}">
|
||||
@endif
|
||||
@if (isset($projectProposal) && $projectProposal->getFirstMediaUrl('main'))
|
||||
<div class="text-gray-200">{{ __('Current picture') }}:</div>
|
||||
<img class="h-48 object-contain" src="{{ $projectProposal->getFirstMediaUrl('main') }}">
|
||||
@endif
|
||||
</div>
|
||||
<input class="text-gray-200" type="file" wire:model="image">
|
||||
@error('image') <span class="text-red-500">{{ $message }}</span> @enderror
|
||||
</x-input.group>
|
||||
|
||||
<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>
|
||||
{{ __('Beschreibung') }}
|
||||
</div>
|
||||
<div
|
||||
class="text-amber-500 text-xs py-2">{{ __('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">{{ __('Für Bilder in Markdown verwende bitte z.B. Imgur oder einen anderen Anbieter.') }}</div>
|
||||
<x-input.simple-mde model="form.description"/>
|
||||
@error('form.description') <span
|
||||
class="text-red-500 py-2">{{ $message }}</span> @enderror
|
||||
</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>
|
||||
{{ __('Zurück') }}
|
||||
</x-button>
|
||||
<x-button primary wire:click="save">
|
||||
<i class="fa fa-thin fa-save"></i>
|
||||
{{ __('Speichern') }}
|
||||
</x-button>
|
||||
</x-input.group>
|
||||
</div>
|
||||
<input class="text-gray-200" type="file" wire:model="image">
|
||||
@error('image') <span class="text-red-500">{{ $message }}</span> @enderror
|
||||
</x-input.group>
|
||||
|
||||
<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>
|
||||
{{ __('Beschreibung') }}
|
||||
</div>
|
||||
<div
|
||||
class="text-amber-500 text-xs py-2">{{ __('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">{{ __('Für Bilder in Markdown verwende bitte z.B. Imgur oder einen anderen Anbieter.') }}</div>
|
||||
<x-input.simple-mde model="form.description"/>
|
||||
@error('form.description') <span
|
||||
class="text-red-500 py-2">{{ $message }}</span> @enderror
|
||||
</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>
|
||||
{{ __('Zurück') }}
|
||||
</x-button>
|
||||
<x-button primary wire:click="save">
|
||||
<i class="fa fa-thin fa-save"></i>
|
||||
{{ __('Speichern') }}
|
||||
</x-button>
|
||||
</x-input.group>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@else
|
||||
<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="px-4 py-5 sm:px-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200">Projekt-Unterstützung</h3>
|
||||
<p class="mt-1 max-w">
|
||||
Du bist nicht berechtigt, die Projekt-Unterstützungen zu bearbeiten.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@endvolt
|
||||
</x-layouts.app>
|
||||
|
||||
Reference in New Issue
Block a user