@if ($poll)
@if ($state === 'form')
@foreach ($poll->questions as $question) @php($type = $question->questionType())
{{ $question->labelFor($locale) }} @if ($question->required) ({{ __('required') }}) @endif @include($type->inputView(), [ 'type' => $type, 'question' => $question, 'settings' => $question->settings ?? [], 'prefix' => 'answers.' . $question->id, 'locale' => $locale, ])
@endforeach
{{-- The poll page shows the closing date in its heading already --}} @if ($poll->closes_at && $context === 'card')

{{ __('Open until :date', ['date' => $poll->closes_at->locale($locale)->isoFormat('LLL')]) }}

@endif {{ __('Submit vote') }} {{ __('Processing...') }}
@endif @if ($state === 'submitted')

{{ __('Thank you, your vote has been recorded.') }}

@if ($receiptCode) {{-- The code lives in x-data on this plain element: @js is not compiled inside component attributes. navigator.clipboard needs HTTPS or localhost, so fall back to execCommand. --}}

{{ __('Your receipt code') }}

{{ $receiptCode }} {{ __('Copy') }} {{ __('Copied') }} @if ($receiptEmailed) {{ __('Sent to your email address.') }} @else {{ __('Email me this code') }} {{ __('Sending...') }} @endif
@error('receipt')

{{ $message }}

@enderror

{{ __('Keep this code to check later that your vote was counted as you cast it. It is shown only once: we store a fingerprint of it, not the code itself.') }}

{{-- The dedicated poll page has this link at the bottom already --}} @if ($context !== 'page')

{{ __('Verify this poll') }}

@endif
@endif @endif @if ($state === 'closed')

{{ __('This poll is closed.') }} @if ($response) {{ __('You voted on :date.', ['date' => $response->submitted_at->locale($locale)->isoFormat('LLL')]) }} @endif

@endif @if ($state === 'voted' && $response)

@if ($response->updated_at && $response->updated_at->gt($response->submitted_at->copy()->addSecond())) {{ __('You voted on :date and changed your vote on :changed.', [ 'date' => $response->submitted_at->locale($locale)->isoFormat('LLL'), 'changed' => $response->updated_at->locale($locale)->isoFormat('LLL'), ]) }} @else {{ __('You voted on :date.', ['date' => $response->submitted_at->locale($locale)->isoFormat('LLL')]) }} @endif

@if ($poll->allow_vote_change && !$poll->isClosed()) {{ __('Change vote') }} @endif
@endif @if (!empty($summaries))

{{ $state === 'closed' ? __('Results') : __('Results so far') }}

@foreach ($poll->questions as $question) @php($type = $question->questionType())

{{ $question->labelFor($locale) }}

@include($type->resultsView(), [ 'type' => $type, 'question' => $question, 'settings' => $question->settings ?? [], 'summary' => $summaries[$question->id], 'locale' => $locale, ])
@endforeach
@endif
@endif