enable disabling specific device types in form

This commit is contained in:
Alexej Rotar 2023-08-25 10:41:29 +02:00 committed by Yannik Rödel
parent 6f33eb0cb3
commit 16f5d3c9a3
2 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,7 @@
{
"applicationsClosed": true
"applicationsClosed": false,
"applicationsClosedFor": [
"laptop",
"bare-laptop"
]
}

View file

@ -1,6 +1,10 @@
---
layout: layouts/page.njk
useForms: true
devices:
laptop: Laptop
bare-laptop: Laptop ohne Akku
desktop: Desktop-Computer
---
# Privat einen Computer beantragen
@ -31,18 +35,33 @@ erhalten. Bitte teile uns zunächst deine Kontaktdaten mit.
Welches Gerät würdest du gerne von uns erhalten?
{% if config.applicationsClosedFor.length > 0 %}
Bitte beachte, dass wir derzeit folgende Geräte leider nicht anbieten können:
<ul>
{% for device in config.applicationsClosedFor %}
<li>{{ devices[device] }}</li>
{% endfor %}
</ul>
{% endif %}
{% if 'desktop' not in config.applicationsClosedFor %}
<input type="radio" id="hardware-desktop" class="radio-input" name="hardware" required value="Desktop-Computer" />
<div class="form-input">
<label for="hardware-desktop">Desktop-Computer</label>
</div>
{% endif %}
{% if 'bare-laptop' not in config.applicationsClosedFor %}
<input type="radio" id="hardware-bare-laptop" class="radio-input" name="hardware" required value="Laptop ohne Akku" />
<div class="form-input">
<label for="hardware-bare-laptop">Laptop ohne Akku</label>
</div>
{% endif %}
{% if 'laptop' not in config.applicationsClosedFor %}
<input type="radio" id="hardware-laptop" class="radio-input" name="hardware" required value="Laptop" />
<div class="form-input">
<label for="hardware-laptop">Laptop</label>
</div>
{% endif %}
Damit du einen Computer von uns erhalten kannst, benötigen wir von dir einen
Nachweis der Bedürftigkeit. Das ist eines dieser Papiere, die von offiziellen