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:
@@ -9,6 +9,7 @@ use App\Models\CourseEvent;
|
|||||||
use App\Models\LibraryItem;
|
use App\Models\LibraryItem;
|
||||||
use App\Models\MeetupEvent;
|
use App\Models\MeetupEvent;
|
||||||
use App\Models\OrangePill;
|
use App\Models\OrangePill;
|
||||||
|
use App\Models\ProjectProposal;
|
||||||
use Illuminate\Support\Facades\Cookie;
|
use Illuminate\Support\Facades\Cookie;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
@@ -136,7 +137,7 @@ class Header extends Component
|
|||||||
->orderByDesc('date')
|
->orderByDesc('date')
|
||||||
->take(2)
|
->take(2)
|
||||||
->get(),
|
->get(),
|
||||||
'projectProposals' => [],
|
'projectProposals' => ProjectProposal::query()->with(['votes'])->get(),
|
||||||
'cities' => City::query()
|
'cities' => City::query()
|
||||||
->select(['latitude', 'longitude'])
|
->select(['latitude', 'longitude'])
|
||||||
->get(),
|
->get(),
|
||||||
|
|||||||
@@ -55,6 +55,12 @@ class ProjectProposalForm extends Component
|
|||||||
$this->validate();
|
$this->validate();
|
||||||
$this->projectProposal->save();
|
$this->projectProposal->save();
|
||||||
|
|
||||||
|
if ($this->image) {
|
||||||
|
$this->projectProposal->addMedia($this->image)
|
||||||
|
->usingFileName(md5($this->image->getClientOriginalName()).'.'.$this->image->getClientOriginalExtension())
|
||||||
|
->toMediaCollection('main');
|
||||||
|
}
|
||||||
|
|
||||||
return redirect($this->fromUrl);
|
return redirect($this->fromUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,19 +67,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="flex items-center gap-x-4">
|
<div class="flex items-center gap-x-4">
|
||||||
<div
|
<div class="font-bold">{{ __('This project requires') }} </div><div
|
||||||
class="relative z-10 rounded-full bg-gray-50 py-1.5 px-3 text-xs font-medium text-gray-600 hover:bg-gray-100">
|
class="font-bold text-amber-500">{{ number_format($item->support_in_sats, 0, ',', '.') }} {{ __('sats') }}</div>
|
||||||
{{ $item->name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<h4 class="mt-2 text-sm font-semibold leading-6 text-gray-900">
|
<h4 class="mt-2 text-sm font-semibold leading-6 text-gray-900">
|
||||||
<a href="{{ route('libraryItem.view', ['libraryItem' => $item]) }}">
|
<a href="{{ route('voting.projectFunding', ['projectProposal' => $item]) }}">
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
<p class="mt-2 text-sm leading-6 text-gray-600 truncate">
|
<p class="mt-2 text-sm leading-6 text-gray-600 truncate">
|
||||||
{{ $item->description }}
|
{{ __('Yes') }}: {{ $item->votes->where('value', 1)->count() }} / {{ __('No') }}: {{ $item->votes->where('value', 0)->count() }}
|
||||||
|
</p>
|
||||||
|
<p class="mt-2 text-sm leading-6 text-gray-600 truncate">
|
||||||
|
{{ __('From') }}: {{ $item->user->name }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
Reference in New Issue
Block a user