mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
🎨 feat(project-support): enhance project display with conditional rendering for payment status and update image validation
This commit is contained in:
@@ -52,9 +52,9 @@ on([
|
|||||||
|
|
||||||
$save = function () {
|
$save = function () {
|
||||||
$this->form->validate();
|
$this->form->validate();
|
||||||
if ($this->image) {
|
if ($this->image && method_exists($this->image, 'temporaryUrl')) {
|
||||||
$this->validate([
|
$this->validate([
|
||||||
'image' => 'image|max:1024',
|
'image' => 'nullable|image|max:1024',
|
||||||
]);
|
]);
|
||||||
$this->projectProposal
|
$this->projectProposal
|
||||||
->addMedia($this->image->getRealPath())
|
->addMedia($this->image->getRealPath())
|
||||||
|
|||||||
@@ -138,28 +138,42 @@ $delete = function ($id) {
|
|||||||
wire:key="project_{{ $project->id }}"
|
wire:key="project_{{ $project->id }}"
|
||||||
class="flex bg-white dark:bg-gray-800 shadow-sm rounded-xl overflow-hidden">
|
class="flex bg-white dark:bg-gray-800 shadow-sm rounded-xl overflow-hidden">
|
||||||
<!-- Image -->
|
<!-- Image -->
|
||||||
<a class="relative block w-24 sm:w-56 xl:sidebar-expanded:w-40 2xl:sidebar-expanded:w-56 shrink-0"
|
@if(!$project->sats_paid)
|
||||||
href="{{ route('association.projectSupport.item', ['projectProposal' => $project]) }}">
|
<a class="relative block w-24 sm:w-56 xl:sidebar-expanded:w-40 2xl:sidebar-expanded:w-56 shrink-0"
|
||||||
<img class="absolute object-cover object-center w-full h-full"
|
href="{{ route('association.projectSupport.item', ['projectProposal' => $project]) }}">
|
||||||
src="{{ $project->getFirstMediaUrl('main') }}" alt="Meetup 01">
|
<img class="absolute object-cover object-center w-full h-full"
|
||||||
<button class="absolute top-0 right-0 mt-4 mr-4">
|
src="{{ $project->getFirstMediaUrl('main') }}" alt="Meetup 01">
|
||||||
<img class="rounded-full h-8 w-8"
|
<button class="absolute top-0 right-0 mt-4 mr-4">
|
||||||
src="{{ $project->einundzwanzigPleb->profile->picture }}"
|
<img class="rounded-full h-8 w-8"
|
||||||
alt="">
|
src="{{ $project->einundzwanzigPleb->profile->picture }}"
|
||||||
</button>
|
alt="">
|
||||||
</a>
|
</button>
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
|
<div
|
||||||
|
class="relative block w-24 sm:w-56 xl:sidebar-expanded:w-40 2xl:sidebar-expanded:w-56 shrink-0"
|
||||||
|
href="{{ route('association.projectSupport.item', ['projectProposal' => $project]) }}">
|
||||||
|
<img class="absolute object-cover object-center w-full h-full"
|
||||||
|
src="{{ $project->getFirstMediaUrl('main') }}" alt="Meetup 01">
|
||||||
|
<button class="absolute top-0 right-0 mt-4 mr-4">
|
||||||
|
<img class="rounded-full h-8 w-8"
|
||||||
|
src="{{ $project->einundzwanzigPleb->profile->picture }}"
|
||||||
|
alt="">
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<div class="grow p-5 flex flex-col">
|
<div class="grow p-5 flex flex-col">
|
||||||
<div class="grow">
|
<div class="grow">
|
||||||
<div class="text-sm font-semibold text-amber-500 uppercase mb-2">
|
<div class="text-sm font-semibold text-amber-500 uppercase mb-2">
|
||||||
Eingereicht von: {{ $project->einundzwanzigPleb->profile->name }}
|
Eingereicht von: {{ $project->einundzwanzigPleb->profile->name }}
|
||||||
</div>
|
</div>
|
||||||
<a class="inline-flex mb-2">
|
<div class="inline-flex mb-2">
|
||||||
<h3 class="text-lg font-bold text-gray-800 dark:text-gray-100">
|
<h3 class="text-lg font-bold text-gray-800 dark:text-gray-100">
|
||||||
{{ $project->name }}
|
{{ $project->name }}
|
||||||
</h3>
|
</h3>
|
||||||
</a>
|
</div>
|
||||||
<div class="text-sm line-clamp-6">
|
<div class="text-sm line-clamp-3">
|
||||||
{!! strip_tags($project->description) !!}
|
{!! strip_tags($project->description) !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -203,12 +217,20 @@ $delete = function ($id) {
|
|||||||
:href="route('association.projectSupport.edit', ['projectProposal' => $project])"
|
:href="route('association.projectSupport.edit', ['projectProposal' => $project])"
|
||||||
label="Editieren"/>
|
label="Editieren"/>
|
||||||
@endif
|
@endif
|
||||||
@if($currentPleb && $currentPleb->association_status->value > 2)
|
@if($currentPleb && $currentPleb->association_status->value > 2 && !$project->sats_paid)
|
||||||
<x-button
|
<x-button
|
||||||
icon="folder-open"
|
icon="folder-open"
|
||||||
xs
|
xs
|
||||||
:href="route('association.projectSupport.item', ['projectProposal' => $project])"
|
:href="route('association.projectSupport.item', ['projectProposal' => $project])"
|
||||||
label="Öffnen"/>
|
label="Öffnen"/>
|
||||||
|
@elseif($currentPleb && $currentPleb->association_status->value > 2 && $project->sats_paid)
|
||||||
|
<div class="m-1.5">
|
||||||
|
<div
|
||||||
|
class="text-sm inline-flex font-medium bg-green-500/20 text-green-700 rounded-full text-center px-2.5 py-1">
|
||||||
|
Wurde mit {{ number_format($project->sats_paid, 0, ',', '.') }} Sats
|
||||||
|
unterstützt
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user