aboutsummaryrefslogtreecommitdiffstats
path: root/client/templates
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-01-05 20:30:42 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2022-01-05 20:30:54 +0100
commit576cdae5270b12b36b8a522ce37fac26d46dbde9 (patch)
treeb5fdd3d657c75510ff1faab35098650445ded4fb /client/templates
parentforce user linked to midata to use midata login (diff)
downloadscout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.tar.gz
scout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.zip
add radio buttons to custom parameters
Diffstat (limited to '')
-rw-r--r--client/templates/client/doc_create.html28
-rw-r--r--client/templates/client/doc_edit.html35
2 files changed, 53 insertions, 10 deletions
diff --git a/client/templates/client/doc_create.html b/client/templates/client/doc_create.html
index 2f70ef3..ce5f39d 100644
--- a/client/templates/client/doc_create.html
+++ b/client/templates/client/doc_create.html
@@ -6,6 +6,8 @@
<a href="#!" class="breadcrumb hide-on-med-and-down">Crea Iscrizione</a>
{% endblock %}
+{% load app_filter %}
+
{% block content %}
<div class="row">
<div class="col l8 offset-l2 s12">
@@ -107,12 +109,28 @@
{% endif %}
{% if custom_data %}
{% for key in keys %}
- <div class="row">
- <div class="input-field col s12">
- <input value="" name="{{key.id}}" id="{{key.id}}" type="text">
- <label for="{{key.id}}">{{key.key}}</label>
+ {% if key.key_extra|first in '!' %}
+ <div class="row">
+ <div class="col s12">
+ {% with arr=key.key_extra|parse_multiple_choice %}
+ {{arr.0}}
+ {% for val in arr.1 %}
+ <p><label>
+ <input class="with-gap" name="{{key.id}}" value="{{val}}" type="radio"/>
+ <span>{{val}}</span>
+ </label></p>
+ {% endfor %}
+ {% endwith %}
+ </div>
</div>
- </div>
+ {% else %}
+ <div class="row">
+ <div class="input-field col s12">
+ <input value="" name="{{key.id}}" id="{{key.id}}" type="text">
+ <label for="{{key.id}}">{{key.key}}</label>
+ </div>
+ </div>
+ {% endif %}
{% endfor %}
{% endif %}
<div class="row">
diff --git a/client/templates/client/doc_edit.html b/client/templates/client/doc_edit.html
index a622ea8..a9cc056 100644
--- a/client/templates/client/doc_edit.html
+++ b/client/templates/client/doc_edit.html
@@ -6,6 +6,8 @@
<a href="#!" class="breadcrumb hide-on-med-and-down">Modifica iscrizione</a>
{% endblock %}
+{% load app_filter %}
+
{% block content %}
<div class="row">
<div class="col l8 offset-l2 s12">
@@ -63,12 +65,35 @@
{% endif %}
{% if custom_data %}
{% for key in keys %}
- <div class="row">
- <div class="input-field col s12">
- <input value="{{key.value}}" name="{{key.id}}" id="{{key.id}}" type="text">
- <label for="{{key.id}}">{{key.key}}</label>
+ {% if key.key_extra|first in '!' %}
+ <div class="row">
+ <div class="col s12">
+ {% with arr=key.key_extra|parse_multiple_choice %}
+ {{arr.0}}
+ {% for val in arr.1 %}
+ {% if key.value == val %}
+ <p><label>
+ <input class="with-gap" name="{{key.key}}" value="{{val}}" type="radio" checked/>
+ <span>{{val}}</span>
+ </label></p>
+ {% else %}
+ <p><label>
+ <input class="with-gap" name="{{key.key}}" value="{{val}}" type="radio"/>
+ <span>{{val}}</span>
+ </label></p>
+ {% endif %}
+ {% endfor %}
+ {% endwith %}
+ </div>
</div>
- </div>
+ {% else %}
+ <div class="row">
+ <div class="input-field col s12">
+ <input value="{{key.value}}" name="{{key.key}}" id="{{key.id}}" type="text">
+ <label for="{{key.id}}">{{key.key}}</label>
+ </div>
+ </div>
+ {% endif %}
{% endfor %}
{% endif %}
<div class="row">