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 () {
|
||||
$this->form->validate();
|
||||
if ($this->image) {
|
||||
if ($this->image && method_exists($this->image, 'temporaryUrl')) {
|
||||
$this->validate([
|
||||
'image' => 'image|max:1024',
|
||||
'image' => 'nullable|image|max:1024',
|
||||
]);
|
||||
$this->projectProposal
|
||||
->addMedia($this->image->getRealPath())
|
||||
|
||||
@@ -138,28 +138,42 @@ $delete = function ($id) {
|
||||
wire:key="project_{{ $project->id }}"
|
||||
class="flex bg-white dark:bg-gray-800 shadow-sm rounded-xl overflow-hidden">
|
||||
<!-- Image -->
|
||||
<a 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>
|
||||
</a>
|
||||
@if(!$project->sats_paid)
|
||||
<a 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>
|
||||
</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 -->
|
||||
<div class="grow p-5 flex flex-col">
|
||||
<div class="grow">
|
||||
<div class="text-sm font-semibold text-amber-500 uppercase mb-2">
|
||||
Eingereicht von: {{ $project->einundzwanzigPleb->profile->name }}
|
||||
</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">
|
||||
{{ $project->name }}
|
||||
</h3>
|
||||
</a>
|
||||
<div class="text-sm line-clamp-6">
|
||||
</div>
|
||||
<div class="text-sm line-clamp-3">
|
||||
{!! strip_tags($project->description) !!}
|
||||
</div>
|
||||
</div>
|
||||
@@ -203,12 +217,20 @@ $delete = function ($id) {
|
||||
:href="route('association.projectSupport.edit', ['projectProposal' => $project])"
|
||||
label="Editieren"/>
|
||||
@endif
|
||||
@if($currentPleb && $currentPleb->association_status->value > 2)
|
||||
@if($currentPleb && $currentPleb->association_status->value > 2 && !$project->sats_paid)
|
||||
<x-button
|
||||
icon="folder-open"
|
||||
xs
|
||||
:href="route('association.projectSupport.item', ['projectProposal' => $project])"
|
||||
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
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user