🎨 feat(project-support): add accepted checkbox and sats paid fields to project proposal form

This commit is contained in:
fsociety
2025-01-16 17:48:50 +01:00
parent a0171442a9
commit e72a1aa814
4 changed files with 225 additions and 312 deletions

View File

@@ -17,5 +17,11 @@ class ProjectProposalForm extends Form
public $description = '';
#[Validate('required|url')]
public $website= '';
public $website = '';
#[Validate('bool')]
public $accepted = '';
#[Validate('nullable|numeric')]
public $sats_paid = '';
}

View File

@@ -104,7 +104,7 @@ $handleNotApprove = function () {
:seo="new SEOData(title: 'Unterstützung für: ' . $projectProposal->name,description: str($projectProposal->description)->limit(100, '...', true), image: $projectProposal->getFirstMediaUrl('main'))">
@volt
<div>
@if($isAllowed)
@if($projectProposal->accepted || $isAllowed)
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full">
<!-- Page content -->
@@ -165,7 +165,7 @@ $handleNotApprove = function () {
<figure class="mb-6">
<img class="rounded-sm h-48" src="{{ $projectProposal->getFirstMediaUrl('main') }}"
alt="Meetup">
alt="Picture">
</figure>
<hr class="my-6 border-t border-gray-100 dark:border-gray-700/60">
@@ -197,6 +197,7 @@ $handleNotApprove = function () {
</div>
@if($isAllowed && !$projectProposal->accepted)
<!-- Sidebar -->
<div class="space-y-4">
@@ -232,28 +233,6 @@ $handleNotApprove = function () {
Zustimmungen des Vorstands ({{ count($boardVotes->where('value', 1)) }})
</div>
</div>
<ul class="space-y-3">
@foreach($boardVotes->where('value', 1) as $vote)
<li>
<div class="flex justify-between">
<div class="grow flex items-center">
<div class="relative mr-3">
<img class="w-8 h-8 rounded-full"
src="{{ $vote->einundzwanzigPleb->profile->picture }}"
width="32"
height="32"
alt="{{ $vote->einundzwanzigPleb->profile->name }}">
</div>
<div class="truncate">
<span class="text-sm font-medium text-gray-800 dark:text-gray-100">
{{ $vote->einundzwanzigPleb->profile->name }}
</span>
</div>
</div>
</div>
</li>
@endforeach
</ul>
</div>
<!-- 2nd block -->
@@ -263,28 +242,6 @@ $handleNotApprove = function () {
Ablehnungen des Vorstands ({{ count($boardVotes->where('value', 0)) }})
</div>
</div>
<ul class="space-y-3">
@foreach($boardVotes->where('value', 0) as $vote)
<li>
<div class="flex justify-between">
<div class="grow flex items-center">
<div class="relative mr-3">
<img class="w-8 h-8 rounded-full"
src="{{ $vote->einundzwanzigPleb->profile->picture }}"
width="32"
height="32"
alt="{{ $vote->einundzwanzigPleb->profile->name }}">
</div>
<div class="truncate">
<span class="text-sm font-medium text-gray-800 dark:text-gray-100">
{{ $vote->einundzwanzigPleb->profile->name }}
</span>
</div>
</div>
</div>
</li>
@endforeach
</ul>
</div>
<!-- 3rd block -->
@@ -294,29 +251,6 @@ $handleNotApprove = function () {
Zustimmungen der übrigen Mitglieder ({{ count($otherVotes->where('value', 1)) }})
</div>
</div>
<ul class="space-y-3">
@foreach($otherVotes->where('value', 1) as $vote)
<li>
<div class="flex items-center justify-between">
<div class="grow flex items-center">
<div class="relative mr-3">
<img class="w-8 h-8 rounded-full"
src="{{ $vote->einundzwanzigPleb->profile->picture }}"
width="32"
height="32"
alt="{{ $vote->einundzwanzigPleb->profile->name }}">
</div>
<div class="truncate">
<span
class="text-sm font-medium text-gray-800 dark:text-gray-100">
{{ $vote->einundzwanzigPleb->profile->name }}
</span>
</div>
</div>
</div>
</li>
@endforeach
</ul>
</div>
<!-- 3rd block -->
@@ -326,32 +260,10 @@ $handleNotApprove = function () {
Ablehnungen der übrigen Mitglieder ({{ count($otherVotes->where('value', 0)) }})
</div>
</div>
<ul class="space-y-3">
@foreach($otherVotes->where('value', 0) as $vote)
<li>
<div class="flex items-center justify-between">
<div class="grow flex items-center">
<div class="relative mr-3">
<img class="w-8 h-8 rounded-full"
src="{{ $vote->einundzwanzigPleb->profile->picture }}"
width="32"
height="32"
alt="{{ $vote->einundzwanzigPleb->profile->name }}">
</div>
<div class="truncate">
<span
class="text-sm font-medium text-gray-800 dark:text-gray-100">
{{ $vote->einundzwanzigPleb->profile->name }}
</span>
</div>
</div>
</div>
</li>
@endforeach
</ul>
</div>
</div>
@endif
</div>

View File

@@ -111,6 +111,15 @@ $save = function () {
:placeholder="__('Beabsichtigte Unterstützung in Sats')"/>
</x-input.group>
<x-input.group :for="md5('form.accepted')" :label="__('Wurde angenommen')">
<x-checkbox autocomplete="off" wire:model.debounce="form.accepted"/>
</x-input.group>
<x-input.group :for="md5('form.sats_paid')" :label="__('Letztendlich bezahlte Satoshis')">
<x-input autocomplete="off" wire:model.debounce="form.sats_paid"
:placeholder="__('Satoshi-Anzahl')"/>
</x-input.group>
<x-input.group :for="md5('form.description')">
<x-slot name="label">
<div>

View File

@@ -76,7 +76,6 @@ $delete = function ($id) {
>
@volt
<div>
@if($isAllowed)
<div class="px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto">
<!-- Page header -->
@@ -219,21 +218,21 @@ $delete = function ($id) {
:href="route('association.projectSupport.edit', ['projectProposal' => $project])"
label="Editieren"/>
@endif
@if($currentPleb && $currentPleb->association_status->value > 2 && !$project->sats_paid)
@if(($currentPleb && $currentPleb->association_status->value > 2) || $project->accepted)
<x-button
icon="folder-open"
xs
:href="route('association.projectSupport.item', ['projectProposal' => $project])"
label="Öffnen"/>
@endif
@if($currentPleb && $currentPleb->association_status->value > 1 && $project->sats_paid)
<div class="m-1.5">
</div>
<div class="py-2">
@if($project->sats_paid)
<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>
@@ -243,19 +242,6 @@ $delete = function ($id) {
</div>
</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">
Projektunterstützungen</h3>
<p class="mt-1 max-w">
Du bist nicht berechtigt, die Projektunterstützungen einzusehen.
</p>
</div>
</div>
</div>
@endif
</div>
@endvolt
</x-layouts.app>