@if($item->voteOptions && $item->voteOptions->count() > 0)
@php
$totalVotes = $item->voteOptions->sum('votes_count');
$hasMultipleOptions = $item->voteOptions->count() > 1;
@endphp
{{ $totalVotes }}
@if($hasMultipleOptions)
{{-- Multiple options breakdown --}}
@foreach($item->voteOptions->take(3) as $index => $option)
{{ $option->votes_count }}
@if($option->name)
{{ Str::limit($option->name, 8) }}
@endif
@if($totalVotes > 0)
{{ round(($option->votes_count / $totalVotes) * 100) }}%
@endif
@endforeach
@if($item->voteOptions->count() > 3)
+{{ $item->voteOptions->count() - 3 }}
@endif
{{-- Multi-color progress bar --}}
@foreach($item->voteOptions as $index => $option)
@if($totalVotes > 0)
@endif
@endforeach
@else
{{-- Single option progress --}}
@if($item->options->first())
@php
$option = $item->options->first();
$percentage = $totalVotes > 0 ? round(($option->votes_count / $totalVotes) * 100) : 0;
@endphp
{{ $option->votes_count }}
@if($option->name)
{{ $option->name }}
@endif
@endif
@endif
@else
{{-- Simple view when no options --}}
{{ $item->votes_count ?? 0 }}
@endif
|
{{ $item->created_at?->format('d.m.Y') }}
{{ $item->created_at?->format('H:i') }}
{{ $item->created_at?->shortRelativeDiffForHumans() }}
|
@if($item->published_at)
{{ $item->published_at ? date('d.m.Y', strtotime($item->published_at)) : '' }}
{{ $item->published_at ? date('H:i', strtotime($item->published_at)) : '' }}
{{ __('labels.published') }}
@else
{{ __('labels.draft') }}
@endif
|