Files
timebank-cc-public/resources/views/livewire/polls/receipt-check.blade.php
T

48 lines
2.6 KiB
PHP

<div>
<form wire:submit="check" class="flex flex-wrap items-end gap-3">
<div class="flex-1 min-w-[16rem]">
<label class="block text-sm text-gray-700 mb-2" for="receipt-code">{{ __('Your receipt code') }}</label>
<x-input errorless id="receipt-code" wire:model="code" type="text" placeholder="XXXXX-XXXXX-XXXXX-XXXXX" class="w-full font-mono" autocomplete="off" />
</div>
<x-jetstream.button type="submit" wire:loading.attr="disabled" wire:target="check" class="bg-theme-brand hover:bg-opacity-80">
{{ __('Check my vote') }}
</x-jetstream.button>
</form>
@include('polls.types._error', ['field' => 'code'])
@if ($notFound)
<p class="mt-3 text-sm text-red-600">{{ __('No ballot with this receipt code was found in this poll.') }}</p>
@endif
@if ($result)
<div class="mt-4 p-4 bg-theme-background rounded-md border border-theme-border space-y-3">
<p class="text-sm text-theme-primary">
<strong>{{ __('Ballot #:sequence', ['sequence' => $result['sequence']]) }}</strong>,
{{ __('recorded :date', ['date' => \Illuminate\Support\Carbon::parse($result['recorded_at'])->setTimezone(config('app.timezone'))->locale(app()->getLocale())->isoFormat('LL')]) }}
</p>
<p class="text-sm">
@if ($result['status'] === 'counted')
<span class="text-green-700 font-semibold">{{ __('Counted in the result.') }}</span>
@elseif ($result['status'] === 'replaced')
<span class="text-theme-primary font-semibold">{{ __('Replaced by a later change of this vote; the newest ballot counts.') }}</span>
@else
<span class="text-theme-primary font-semibold">{{ __('Withdrawn: the profile that cast it was deleted, so it no longer counts.') }}</span>
@endif
</p>
<dl class="space-y-2">
@foreach ($result['answers'] as $answer)
<div>
<dt class="text-sm text-theme-secondary">{{ $answer['question'] }}</dt>
<dd class="text-sm text-theme-primary">
{{ $answer['answer'] !== '' ? $answer['answer'] : '-' }}
@if ($answer['text_checked'])
<span class="text-xs text-green-700">({{ __('text matches its fingerprint') }})</span>
@endif
</dd>
</div>
@endforeach
</dl>
</div>
@endif
</div>