@php switch ($poll->poll_style) { case $poll->poll_style == 'primary': $themePoll = 'bg-primary-500'; break; case $poll->poll_style == 'lime': $themePoll = 'bg-gradient-to-r from-lime-500 to-lime-600'; break; case $poll->poll_style == 'purple': $themePoll = 'bg-gradient-to-br from-purple-600 to-blue-500'; break; } @endphp
{{ $poll->question }}
@auth @if (!auth()->user()->hasPollVoted($poll->id) && $poll->poll_ends >= now()) @foreach ($choices as $choice)
{{ $choice->text }}
@endforeach @else @foreach ($choices as $choice)
@if ($poll->votes->count())
{{ $choice->text }} @if (auth()->user()->isChosenByUser(getCurrentUser()->id, $choice->id)) @endif {{ round(($choice->votes->count() / $poll->votes->count()) * 100, 2) . '%' }}
@endif
@endforeach @endif @else @if ($poll->poll_ends < \Carbon\Carbon::now()) @foreach ($choices as $choice)
@if ($poll->votes->count())
{{ $choice->text }} {{ round(($choice->votes->count() / $poll->votes->count()) * 100, 2) . '%' }}
@endif
@endforeach @else @foreach ($choices as $choice)
{{ $choice->text }}
@endforeach @endif @endauth
@if ($poll->votes->count() > 0)
{{ __('Total votes') }} {{ $poll->votes()->count() }}
@endif
{{ $poll->displayHumanTimeLeft() }}