Add support for all types in new poi form

This commit is contained in:
Léo Serre 2021-05-28 20:58:22 +02:00
parent 0f8259fe43
commit 072ef1d43e
2 changed files with 25 additions and 7 deletions

View File

@ -45,7 +45,6 @@ html, body {
form.form input, form.form textarea, form.form input[type=radio]:checked+label, #locale {
background: #ddd;
border-bottom: 2px solid #ccc;
display: block;
padding: 10px;
}
@ -82,6 +81,7 @@ form.form h1 {
form.form input[type=submit] {
width: auto;
display: block;
margin: 10px auto;
border-bottom: 2px solid blue;
}
@ -103,26 +103,41 @@ form.form input[type=radio]+label img {
height: 32px;
}
form.form .threecb:before {
#specific_form .threecb:after {
font-family: "Font Awesome 5 Free";
font-weight: 400;
vertical-align: middle;
padding: 3px 8px 2px 4px;
margin: 5px 10px 5px 0;
margin: 2px 10px;
display: inline-block;
width: 21px;
background: #ddd;
font-size: 25px;
}
form.form .threecb.check:before {
#specific_form .threecb.check:after {
content: "\f058"; /* check */
}
form.form .threecb.uncheck:before {
#specific_form .threecb.uncheck:after {
content: "\f057"; /* cross */
}
form.form .threecb.intermediate:before {
#specific_form .threecb.intermediate:after {
content: "\f059"; /* question */
}
#specific_form input {
margin: 2px 10px;
}
#specific_form textarea {
margin: 5px 0;
display: block;
width: calc(100% - 20px);
height: 100px;
}
#specific_form .flex_line {
align-items: center;
}
#specific_form .flex_line input {
flex: 1;
}
#abstract {
text-align: center;

View File

@ -74,13 +74,16 @@
$.each(this[type+'_jsonform'],function(index, value){
switch(index.charAt(0)) {
case 'b':
html_form+='<label class="threecb intermediate" for="'+index+'" onclick="update3State(\''+index+'\')" >'+value+'</label><input value="1" type="hidden" name="'+index+'" id="'+index+'"><br>'
html_form+='<label class="threecb intermediate" for="'+index+'" onclick="update3State(\''+index+'\')">'+value+'</label><input value="1" type="hidden" name="'+index+'" id="'+index+'"><br>'
break;
case 'n':
html_form+='<div class="flex_line"><label for="'+index+'">'+value+'</label><input min="0" max="100" type="number" name="'+index+'" id="'+index+'"></div>'
break;
case 't':
html_form+='<textarea name="'+index+'" id="'+index+'" placeholder="'+value+'"></textarea>'
break;
case 'l':
html_form+='<div class="flex_line"><label for="'+index+'">'+value+'</label><input placeholder="https://" type="url" name="'+index+'" id="'+index+'"></div>'
break;
default:
console.log("ERROR: "+index+"'s type is not known");