mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
voting added
This commit is contained in:
@@ -58,7 +58,7 @@ class ProjectProposalVoting extends Component
|
|||||||
$this->vote->value = true;
|
$this->vote->value = true;
|
||||||
$this->vote->save();
|
$this->vote->save();
|
||||||
|
|
||||||
return to_route('project.voting.projectFunding',
|
return to_route('voting.projectFunding',
|
||||||
['projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]);
|
['projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ class ProjectProposalVoting extends Component
|
|||||||
$this->vote->value = false;
|
$this->vote->value = false;
|
||||||
$this->vote->save();
|
$this->vote->save();
|
||||||
|
|
||||||
return to_route('project.voting.projectFunding',
|
return to_route('voting.projectFunding',
|
||||||
['projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]);
|
['projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<div class="pb-5 flex flex-row justify-between">
|
<div class="pb-5 flex flex-row justify-between">
|
||||||
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('Voting') }}
|
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('Voting') }}
|
||||||
: {{ $projectProposal->name }}</h3>
|
: {{ $projectProposal->name }}</h3>
|
||||||
|
<img class="h-32" src="{{ $projectProposal->getFirstMediaUrl('main') }}" alt="{{ $projectProposal->name }}">
|
||||||
<div class="flex flex-row space-x-2 items-center">
|
<div class="flex flex-row space-x-2 items-center">
|
||||||
<div>
|
<div>
|
||||||
<x-button :href="$fromUrl">
|
<x-button :href="$fromUrl">
|
||||||
@@ -41,7 +42,8 @@
|
|||||||
<div class="text-gray-200">{{ $projectProposal->user->name }}</div>
|
<div class="text-gray-200">{{ $projectProposal->user->name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex space-x-1 text-sm text-gray-300">
|
<div class="flex space-x-1 text-sm text-gray-300">
|
||||||
<span class="font-bold">{{ __('This project requires') }} </span><span class="font-bold text-amber-500">{{ number_format($projectProposal->support_in_sats, 0, ',', '.') }} {{ __('sats') }}</span>
|
<span class="font-bold">{{ __('This project requires') }} </span><span
|
||||||
|
class="font-bold text-amber-500">{{ number_format($projectProposal->support_in_sats, 0, ',', '.') }} {{ __('sats') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -145,13 +147,15 @@
|
|||||||
@foreach($entitledVoters as $voter)
|
@foreach($entitledVoters as $voter)
|
||||||
@php
|
@php
|
||||||
$vote = $voter->votes->first();
|
$vote = $voter->votes->first();
|
||||||
if (!$voter->votes->first()) {
|
if (!$vote) {
|
||||||
$text = __('not voted yet');
|
$text = __('not voted yet');
|
||||||
} elseif (!$vote->value) {
|
} elseif ($vote && !$vote->value) {
|
||||||
$text = __('Reason') . ': ' . $voter->votes->first()?->reason;
|
$text = __('Reason') . ': ' . $voter->votes->first()?->reason;
|
||||||
|
} else {
|
||||||
|
$text = '';
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<li class="flex py-4">
|
<li class="flex py-4" wire:key="entitled_vote_{{ $voter->id }}">
|
||||||
<img class="h-10 w-10 rounded-full" src="{{ $voter->profile_photo_url }}"
|
<img class="h-10 w-10 rounded-full" src="{{ $voter->profile_photo_url }}"
|
||||||
alt="">
|
alt="">
|
||||||
<div class="ml-3">
|
<div class="ml-3">
|
||||||
@@ -184,13 +188,15 @@
|
|||||||
@foreach($otherVoters as $voter)
|
@foreach($otherVoters as $voter)
|
||||||
@php
|
@php
|
||||||
$vote = $voter->votes->first();
|
$vote = $voter->votes->first();
|
||||||
if (!$voter->votes->first()) {
|
if (!$vote) {
|
||||||
$text = __('not voted yet');
|
$text = __('not voted yet');
|
||||||
} elseif (!$vote->value) {
|
} elseif ($vote && !$vote->value) {
|
||||||
$text = __('Reason') . ': ' . $voter->votes->first()?->reason;
|
$text = __('Reason') . ': ' . $voter->votes->first()?->reason;
|
||||||
|
} else {
|
||||||
|
$text = '';
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<li class="flex py-4">
|
<li class="flex py-4" wire:key="other_vote_{{ $voter->id }}">
|
||||||
<img class="h-10 w-10 rounded-full" src="{{ $voter->profile_photo_url }}"
|
<img class="h-10 w-10 rounded-full" src="{{ $voter->profile_photo_url }}"
|
||||||
alt="">
|
alt="">
|
||||||
<div class="ml-3">
|
<div class="ml-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user