@if ($person)
{{ $person->tilltalsnamn }} Foto: Sveriges Riksdag

{{ $person->tilltalsnamn }} {{ $person->efternamn }} ({{ $person->parti }})

{{ App\Enums\Parties::from($person->parti)->label() }} {{ $person->valkrets }} valkrets
Född
{{ $person->fodd_ar }} ({{ Carbon\Carbon::parse($person->fodd_ar)->age }} år)
Kön
{{ ucfirst($person->kon) }}
Status
{{ $person->status }}
E-post
{{ str_replace('[på]', '@', collect($person->personuppgift->uppgift ?? [])->firstWhere('kod', 'Officiell e-postadress')->uppgift[0] ?? '-') }}
@if (! empty($votesByYear))

Voteringar

@if ($votesSelectedYear && isset($votesByYear[$votesSelectedYear]))
@if (! empty($this->votingStatistics))
@php($totalVotes = array_sum($this->votingStatistics)) @foreach ($this->votingStatistics as $voteType => $count)
{{ $voteType }} {{ $count }} ({{ round(($count / $totalVotes) * 100, 2) }}%)
@endforeach
Totalt antal voteringar {{ $totalVotes }}
@else

Ingen voteringsstatistik tillgänglig för detta år.

@endif
@foreach ($votesByYear[$votesSelectedYear] as $vote) @endforeach
Datum Beteckning Punkt Röst
{{ \Carbon\Carbon::parse($vote->systemdatum)->format('Y-m-d') }} {{ $vote->beteckning }} {{ $vote->punkt }} {{ $vote->rost }}
@else

Inga voteringar tillgängliga för detta år.

@endif
@endif

Motioner

@if (! empty($motionsByYear))
@if ($motionsSelectedYear && isset($motionsByYear[$motionsSelectedYear]))
@foreach ($motionsByYear[$motionsSelectedYear] as $motion) @endforeach
Beteckning Titel Typ Datum Status Åtgärder
{{ $motionsSelectedYear }}:{{ $motion->beteckning }}
{{ $motion->titel }}
@if (! empty($motion->undertitel))
{{ $motion->undertitel }}
@endif
{{ $motion->subtyp }} {{ \Carbon\Carbon::parse($motion->datum)->format('Y-m-d') }} {{ $motion->status }} @if (! empty($motion->dokument_url_html)) Läs @endif
@else

Inga motioner tillgängliga för detta år.

@endif @else

Inga motioner tillgängliga för denna person.

@endif

Uppdrag

@if ($selectedUppdragTab == 'current' && ! empty($currentUppdrag))
@foreach ($currentUppdrag as $uppdrag)

{{ $uppdrag->roll_kod }}

{{-- @if (!empty($uppdrag->uppgift[0]) && is_array($uppdrag->uppgift))

{{ implode(', ', $uppdrag->uppgift) }}

@endif --}}

Typ: {{ ucfirst($uppdrag->typ) }} @if (isset($uppdrag->status) && $uppdrag->status) | Status: {{ $uppdrag->status }} @endif

Från: {{ Carbon\Carbon::parse($uppdrag->from)->format('Y-m-d') }}
@if (! empty($uppdrag->tom))
Till: {{ Carbon\Carbon::parse($uppdrag->tom)->format('Y-m-d') }}
@else
Pågående
@endif
@endforeach
@elseif ($selectedUppdragTab == 'current' && empty($currentUppdrag))

Inga pågående uppdrag.

@endif @if ($selectedUppdragTab == 'previous' && ! empty($previousUppdrag))
@foreach ($previousUppdrag as $uppdrag)

{{ $uppdrag->roll_kod }}

{{-- @if (!empty($uppdrag->uppgift[0]) && is_array($uppdrag->uppgift))

{{ implode(', ', $uppdrag->uppgift) }}

@endif --}}

Typ: {{ ucfirst($uppdrag->typ) }} @if (isset($uppdrag->status) && $uppdrag->status) | Status: {{ $uppdrag->status }} @endif

{{ Carbon\Carbon::parse($uppdrag->from)->format('Y-m-d') }} - {{ Carbon\Carbon::parse($uppdrag->tom)->format('Y-m-d') }}
{{ Carbon\Carbon::parse($uppdrag->from)->diffForHumans(Carbon\Carbon::parse($uppdrag->tom), true) }}
@endforeach
@elseif ($selectedUppdragTab == 'previous' && empty($previousUppdrag))

Inga tidigare uppdrag registrerade.

@endif

Biografi

@foreach (collect($person->personuppgift->uppgift ?? [])->where('typ', 'biografi') as $bio)
{{ $bio->kod }}
{{ is_array($bio->uppgift) ? implode(', ', $bio->uppgift) : $bio->uppgift }}
@endforeach
@else

Person inte hittad

Personen kunde inte hittas i databasen.

@endif