diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2022-01-05 20:30:42 +0100 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2022-01-05 20:30:54 +0100 |
commit | 576cdae5270b12b36b8a522ce37fac26d46dbde9 (patch) | |
tree | b5fdd3d657c75510ff1faab35098650445ded4fb /client/templates | |
parent | force user linked to midata to use midata login (diff) | |
download | scout-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.html | 28 | ||||
-rw-r--r-- | client/templates/client/doc_edit.html | 35 |
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"> |