Fix maxVoters minimum value and value of boolean areVotersKnown

This commit is contained in:
2025-01-14 19:49:12 +01:00
parent 96133f00de
commit f784eb474f

View File

@ -29,9 +29,10 @@
<div>
<label for="areVotersKnown" class="block text-sm font-medium text-gray-700">Voter Access</label>
<select id="areVotersKnown" x-model="election.areVotersKnown" required
@change="election.areVotersKnown = JSON.parse(election.areVotersKnown)"
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500">
<option :value="true">Known voters only</option>
<option :value="false">Open to anyone</option>
<option :value=true>Known voters only</option>
<option :value=false>Open to anyone</option>
</select>
<p class="text-sm text-gray-500 mt-1">Known voters only = codes will be generated for distribution.</p>
</div>
@ -39,7 +40,7 @@
<div>
<label for="maxVoters" class="block text-sm font-medium text-gray-700">Maximum Number of Voters</label>
<input type="number" id="maxVoters" x-model.number="election.maxVoters" min="1"
<input type="number" id="maxVoters" x-model.number="election.maxVoters"
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500">
<p class="text-sm text-gray-500">0 = unlimited</p>
<template x-if="election.areVotersKnown && election.maxVoters <= 0">