Commit d9050574 authored by Ryan Herbert's avatar Ryan Herbert

save space in forms

replaces fieldsets with divs and removes many legends in order to save
space by eliminating the border of the fieldset.
also removes some labels and displays form elements inline.
parent 6ef972ba
...@@ -647,7 +647,7 @@ Database.prototype = { ...@@ -647,7 +647,7 @@ Database.prototype = {
var pre_process = $('#pre_process'); var pre_process = $('#pre_process');
pre_process.prop('disabled', disable); pre_process.prop('disabled', disable);
pre_process.closest("fieldset").prop('hidden', disable); pre_process.closest("div").prop('hidden', disable);
}, },
toggle_jstree: function(){ toggle_jstree: function(){
......
...@@ -89,11 +89,12 @@ FormBuilder.prototype.build_textarea = function(id, className, name, set_type, p ...@@ -89,11 +89,12 @@ FormBuilder.prototype.build_textarea = function(id, className, name, set_type, p
return t; return t;
} }
FormBuilder.prototype.build_fieldset = function(type) { FormBuilder.prototype.build_div = function(type) {
var f = document.createElement('fieldset'); var d = document.createElement('div');
f.name = type + this.index; var s = document.createElement('div');
f.appendChild(this.build_legend(capitalise(type) + " " + (this.index+1))); s.innerText = capitalise(type) + " " + (this.index+1);
return f; d.appendChild(s);
return d;
} }
FormBuilder.prototype.build_legend = function(text) { FormBuilder.prototype.build_legend = function(text) {
...@@ -159,16 +160,16 @@ PatientFormBuilder.prototype = Object.create(SetFormBuilder.prototype); ...@@ -159,16 +160,16 @@ PatientFormBuilder.prototype = Object.create(SetFormBuilder.prototype);
PatientFormBuilder.prototype.build = function(index) { PatientFormBuilder.prototype.build = function(index) {
this.index = index; this.index = index;
var fieldset = this.build_fieldset(this.type); var div = this.build_div(this.type);
fieldset.appendChild(this.createCloseButton()); div.appendChild(this.createCloseButton());
fieldset.appendChild(this.build_input('id', 'text', 'id', 'hidden', this.type)); div.appendChild(this.build_input('id', 'text', 'id', 'hidden', this.type));
fieldset.appendChild(this.build_input('sample_set_id', 'text', 'sample_set_id', 'hidden', this.type)); div.appendChild(this.build_input('sample_set_id', 'text', 'sample_set_id', 'hidden', this.type));
fieldset.appendChild(this.set_id()); div.appendChild(this.set_id());
fieldset.appendChild(this.build_field('first_name', undefined, undefined, true)); div.appendChild(this.build_field('first_name', undefined, undefined, true));
fieldset.appendChild(this.build_field('last_name', undefined, undefined, true)); div.appendChild(this.build_field('last_name', undefined, undefined, true));
fieldset.appendChild(this.build_date('birth')); div.appendChild(this.build_date('birth'));
fieldset.appendChild(this.build_info(this.type, [$('#group_select option:selected').val()])); div.appendChild(this.build_info(this.type, [$('#group_select option:selected').val()]));
return fieldset; return div;
}; };
function RunFormBuilder() { function RunFormBuilder() {
...@@ -180,17 +181,17 @@ RunFormBuilder.prototype = Object.create(SetFormBuilder.prototype); ...@@ -180,17 +181,17 @@ RunFormBuilder.prototype = Object.create(SetFormBuilder.prototype);
RunFormBuilder.prototype.build = function(index) { RunFormBuilder.prototype.build = function(index) {
this.index = index; this.index = index;
var fieldset = this.build_fieldset(this.type); var div = this.build_div(this.type);
fieldset.appendChild(this.createCloseButton()); div.appendChild(this.createCloseButton());
fieldset.appendChild(this.build_input('id', 'text', 'id', 'hidden', this.type)); div.appendChild(this.build_input('id', 'text', 'id', 'hidden', this.type));
fieldset.appendChild(this.build_input('sample_set_id', 'text', 'sample_set_id', 'hidden', this.type)); div.appendChild(this.build_input('sample_set_id', 'text', 'sample_set_id', 'hidden', this.type));
fieldset.appendChild(this.set_id()); div.appendChild(this.set_id());
fieldset.appendChild(this.build_field('name', undefined, undefined, true)); div.appendChild(this.build_field('name', undefined, undefined, true));
fieldset.appendChild(this.build_date('run_date', 'run_date', 'Date')); div.appendChild(this.build_date('run_date', 'run_date', 'Date'));
fieldset.appendChild(this.build_info(this.type, [$('#group_select option:selected').val()])); div.appendChild(this.build_info(this.type, [$('#group_select option:selected').val()]));
fieldset.appendChild(this.build_field('sequencer')); div.appendChild(this.build_field('sequencer'));
fieldset.appendChild(this.build_field('pcr', 'pcr', 'PCR')); div.appendChild(this.build_field('pcr', 'pcr', 'PCR'));
return fieldset; return div;
}; };
function GenericFormBuilder() { function GenericFormBuilder() {
...@@ -202,13 +203,13 @@ GenericFormBuilder.prototype = Object.create(SetFormBuilder.prototype); ...@@ -202,13 +203,13 @@ GenericFormBuilder.prototype = Object.create(SetFormBuilder.prototype);
GenericFormBuilder.prototype.build = function(index) { GenericFormBuilder.prototype.build = function(index) {
this.index = index; this.index = index;
var fieldset = this.build_fieldset('set'); var div = this.build_div(this.type);
fieldset.appendChild(this.createCloseButton()); div.appendChild(this.createCloseButton());
fieldset.appendChild(this.build_input('id', 'text', 'id', 'hidden', this.type)); div.appendChild(this.build_input('id', 'text', 'id', 'hidden', this.type));
fieldset.appendChild(this.build_input('sample_set_id', 'text', 'sample_set_id', 'hidden', this.type)); div.appendChild(this.build_input('sample_set_id', 'text', 'sample_set_id', 'hidden', this.type));
fieldset.appendChild(this.build_field('name', undefined, undefined, true)); div.appendChild(this.build_field('name', undefined, undefined, true));
fieldset.appendChild(this.build_info(this.type, [$('#group_select option:selected').val()])); div.appendChild(this.build_info(this.type, [$('#group_select option:selected').val()]));
return fieldset; return div;
} }
function FileFormBuilder(group_ids, source, num_files) { function FileFormBuilder(group_ids, source, num_files) {
...@@ -223,32 +224,30 @@ FileFormBuilder.prototype = Object.create(FormBuilder.prototype); ...@@ -223,32 +224,30 @@ FileFormBuilder.prototype = Object.create(FormBuilder.prototype);
FileFormBuilder.prototype.build = function(index) { FileFormBuilder.prototype.build = function(index) {
this.index = index; this.index = index;
var fieldset = this.build_fieldset('sample'); var div = this.build_div('file');
fieldset.appendChild(this.createCloseButton()); div.appendChild(this.createCloseButton());
fieldset.appendChild(this.build_hidden_fields()); div.appendChild(this.build_hidden_fields());
fieldset.appendChild(this.build_file_fieldset()); div.appendChild(this.build_file_div());
fieldset.appendChild(this.build_set_fieldset()); div.appendChild(this.build_set_div());
fieldset.appendChild(this.build_info_fieldset()); div.appendChild(this.build_date('sampling_date', 'file'));
return fieldset; div.appendChild(this.build_info('file', this.group_ids));
return div;
} }
FileFormBuilder.prototype.build_file_fieldset = function() { FileFormBuilder.prototype.build_file_div = function() {
var self = this; var self = this;
var hide_second = this.source || this.num_files < 2; var hide_second = this.source || this.num_files < 2;
var f = document.createElement('fieldset'); var d = document.createElement('div');
f.appendChild(this.build_legend('sequence file(s)')); d.className="field_div";
var s = document.createElement('div');
s.innerText = "(.fa, .fastq, .fa.gz, .fastq.gz, .clntab)";
f.appendChild(s);
var file1 = this.build_file_field(1, this.source); var file1 = this.build_file_field(1, this.source);
var file_input = file1.getElementsByTagName('input')[0]; var file_input = file1.getElementsByTagName('input')[0];
file_input.onchange = function() { file_input.onchange = function() {
db.upload_file_onChange('file_filename_' + self.index, this.value); db.upload_file_onChange('file_filename_' + self.index, this.value);
} }
f.appendChild(file1); d.appendChild(file1);
f.appendChild(this.build_file_field(2, hide_second)); d.appendChild(this.build_file_field(2, hide_second));
f.appendChild(this.build_jstree(!this.source)); d.appendChild(this.build_jstree(!this.source));
return f; return d;
} }
FileFormBuilder.prototype.build_hidden_fields = function() { FileFormBuilder.prototype.build_hidden_fields = function() {
...@@ -264,14 +263,10 @@ FileFormBuilder.prototype.build_hidden_fields = function() { ...@@ -264,14 +263,10 @@ FileFormBuilder.prototype.build_hidden_fields = function() {
return d; return d;
} }
FileFormBuilder.prototype.build_set_fieldset = function() { FileFormBuilder.prototype.build_set_div = function() {
var self = this; var self = this;
var f = document.createElement('fieldset'); var f = document.createElement('div');
f.appendChild(this.build_legend('set selection')); f.className = "field_div"
var txt = document.createElement('div');
txt.innerHTML = "You must associate this sample with at least one patient, run or set.<br>You can also associate it with any combination of the three.";
f.appendChild(txt);
f.appendChild(this.build_label('sets', 'file', 'set_ids')); f.appendChild(this.build_label('sets', 'file', 'set_ids'));
var d = document.createElement('div'); var d = document.createElement('div');
...@@ -309,25 +304,17 @@ FileFormBuilder.prototype.build_set_fieldset = function() { ...@@ -309,25 +304,17 @@ FileFormBuilder.prototype.build_set_fieldset = function() {
return f; return f;
} }
FileFormBuilder.prototype.build_info_fieldset = function() {
var f = document.createElement('fieldset');
f.appendChild(this.build_legend('sample information'));
f.appendChild(this.build_date('sampling_date', 'file'));
f.appendChild(this.build_info('file', this.group_ids));
return f;
}
FileFormBuilder.prototype.build_file_field = function(id, hidden) { FileFormBuilder.prototype.build_file_field = function(id, hidden) {
var d = this.build_wrapper(); var d = this.build_wrapper();
d.className += " file_" + id; d.className += " file_" + id;
if (this.source || hidden) { if (this.source || hidden) {
d.hidden = true; d.hidden = true;
} }
d.appendChild(this.build_label('file ' + id, 'file', 'file'));
var i = this.build_input('upload_' + id, 'upload_field', 'file'+id, 'file', 'file'); var i = this.build_input('upload_' + id, 'upload_field', 'file'+id, 'file', 'file');
if (this.source) { if (this.source) {
i.disabled = true; i.disabled = true;
} }
i.title = "(.fa, .fastq, .fa.gz, .fastq.gz, .clntab)";
d.appendChild(i); d.appendChild(i);
return d; return d;
} }
......
...@@ -6,17 +6,13 @@ ...@@ -6,17 +6,13 @@
<form id="upload_form" action="DB_ADDRESS/file/submit" enctype="multipart/form-data" method="post"> <form id="upload_form" action="DB_ADDRESS/file/submit" enctype="multipart/form-data" method="post">
{{ if source_module_active: }} {{ if source_module_active: }}
<fieldset name="file_source"> <span>file source</span>
<legend>file source</legend>
<label for="source_computer">my computer</label> <label for="source_computer">my computer</label>
<input type="radio" id="source_computer" name="source" value="computer" onchange="db.toggle_file_source()"/> <input type="radio" id="source_computer" name="source" value="computer" onchange="db.toggle_file_source()"/>
<label for="source_nfs">network</label> <label for="source_nfs">network</label>
<input type="radio" id="source_nfs" name="source" value="nfs" onchange="db.toggle_file_source()" checked="checked" /> <input type="radio" id="source_nfs" name="source" value="nfs" onchange="db.toggle_file_source()" checked="checked" />
</fieldset>
{{pass}} {{pass}}
<fieldset {{if source_module_active:}} hidden {{pass}}> <div {{if source_module_active:}} hidden {{pass}}>
<legend>Pre process</legend>
<label for="pre_process" id="pre_process__label">pre-process scenario: </label>
<select id="pre_process" name="pre_process" onChange="db.pre_process_onChange(this)" {{if source_module_active:}} disabled {{pass}}> <select id="pre_process" name="pre_process" onChange="db.pre_process_onChange(this)" {{if source_module_active:}} disabled {{pass}}>
<option required_files="1" value="0">no pre-process (1 file)</option> <option required_files="1" value="0">no pre-process (1 file)</option>
{{for row in pre_process_list :}} {{for row in pre_process_list :}}
...@@ -26,47 +22,43 @@ ...@@ -26,47 +22,43 @@
</option> </option>
{{pass}} {{pass}}
</select> </select>
</fieldset> </div>
<div>
<fieldset> You must associate this sample with at least one patient, run or set.<br>You can also associate it with any combination of the three.
<legend>set selection</legend> </div>
<div> <div class="field_div">
You must associate this sample with at least one patient, run or set.<br>You can also associate it with any combination of the three. {{ if len(errors) > 0: }}
</div> <div class="error">{{=", ".join(errors)}}</div>
<div class="field_div"> {{ pass }}
{{ if len(errors) > 0: }} <label for="set_ids" id="set_ids__label">sets: </label>
<div class="error">{{=", ".join(errors)}}</div> <div class="token_div form-control" onclick="$('#token_input').focus()">
{{ pass }} <input
<label for="set_ids" id="set_ids__label">sets: </label> hidden
<div class="token_div form-control" onclick="$('#token_input').focus()"> id="file_set_list"
<input name="set_ids"
hidden type="text"
id="file_set_list" value="{{=",".join([set['id'] for set in sets])}}">
name="set_ids" <div id="set_div" class="token_container">
type="text" {{ for set in sets: }}
value="{{=",".join([set['id'] for set in sets])}}"> <span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}">
<div id="set_div" class="token_container"> <i class="icon-cancel" onclick="new Tokeniser(document.getElementById('set_div'), document.getElementById('file_set_list')).removeToken(this.parentNode);"></i>
{{ for set in sets: }} {{=set['id'][3:]}}
<span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}"> </span>
<i class="icon-cancel" onclick="new Tokeniser(document.getElementById('set_div'), document.getElementById('file_set_list')).removeToken(this.parentNode);"></i> {{pass}}
{{=set['id'][3:]}}
</span>
{{pass}}
</div>
<input
id="token_input"
class="token_input"
autocomplete="off"
onfocus="new VidjilAutoComplete().setupSamples(this);
new Tokeniser(document.getElementById('set_div'), document.getElementById('file_set_list'));"
data-needs-atwho="true"
data-needs-tokeniser="true"
data-group-ids="{{=upload_group_ids}}"
data-keys='["generic", "patient", "run"]'
type="text">
</div> </div>
<input
id="token_input"
class="token_input"
autocomplete="off"
onfocus="new VidjilAutoComplete().setupSamples(this);
new Tokeniser(document.getElementById('set_div'), document.getElementById('file_set_list'));"
data-needs-atwho="true"
data-needs-tokeniser="true"
data-group-ids="{{=upload_group_ids}}"
data-keys='["generic", "patient", "run"]'
type="text">
</div> </div>
</fieldset> </div>
<div id="fieldset_container"> <div id="fieldset_container">
{{ for i, file in enumerate(files): }} {{ for i, file in enumerate(files): }}
{{ include 'partial/file/form.html' }} {{ include 'partial/file/form.html' }}
......
<fieldset name="file{{=i}}"> <div>
<legend>Sample {{=i+1}}</legend> <div>File {{=i+1}}</div>
{{ if file is not None and 'error' in file and len(file['error']) > 0: }} {{ if file is not None and 'error' in file and len(file['error']) > 0: }}
<div class="error">error: {{=", ".join(file['error'])}}</div> <div class="error">error: {{=", ".join(file['error'])}}</div>
{{ pass }} {{ pass }}
...@@ -13,24 +13,23 @@ ...@@ -13,24 +13,23 @@
<input type="hidden" id="sample_set_id" name="sample_set_id" value="{{if "sample_set_id" in request.vars:}}{{=request.vars["sample_set_id"]}}{{pass}}" > <input type="hidden" id="sample_set_id" name="sample_set_id" value="{{if "sample_set_id" in request.vars:}}{{=request.vars["sample_set_id"]}}{{pass}}" >
<input type="hidden" id="sample_type" name="sample_type" value="{{=sample_type}}" /> <input type="hidden" id="sample_type" name="sample_type" value="{{=sample_type}}" />
</div> </div>
<fieldset name="sequence_file">
<legend>sequence file(s)</legend> <div class="field_div">
<div>(.fa, .fastq, .fa.gz, .fastq.gz, .clntab)</div>
<div id="file_field_1_{{=i}}" class="field_div file_1" {{if source_module_active:}} hidden {{pass}}> <div id="file_field_1_{{=i}}" class="field_div file_1" {{if source_module_active:}} hidden {{pass}}>
<label for="file_upload_1_{{=i}}" id="file__label_{{=i}}"> file 1 :</label>
<input class="upload_field form-control" id="file_upload_1_{{=i}}" type="file" <input class="upload_field form-control" id="file_upload_1_{{=i}}" type="file"
{{if source_module_active:}} {{if source_module_active:}}
disabled disabled
{{pass}} {{pass}}
onchange="db.upload_file_onChange('file_filename_{{=i}}', this.value)" onchange="db.upload_file_onChange('file_filename_{{=i}}', this.value)"
title="(.fa, .fastq, .fa.gz, .fastq.gz, .clntab)"
> >
</div> </div>
<div id="file_2_{{=i}}" class="field_div file_2" hidden> <div id="file_2_{{=i}}" class="field_div file_2" hidden>
<label for="file_upload_2_{{=i}}" id="file2__label_{{=i}}"> file 2 :</label>
<input class="upload_field form-control" id="file_upload_2_{{=i}}" type="file" <input class="upload_field form-control" id="file_upload_2_{{=i}}" type="file"
{{if source_module_active:}} {{if source_module_active:}}
disabled disabled
{{pass}} {{pass}}
title="(.fa, .fastq, .fa.gz, .fastq.gz, .clntab)"
> >
</div> </div>
<div class="jstree_container" {{if not source_module_active:}} hidden {{pass}}> <div class="jstree_container" {{if not source_module_active:}} hidden {{pass}}>
...@@ -46,59 +45,50 @@ ...@@ -46,59 +45,50 @@
<div id="jstree_{{=i}}" data-index="{{=i}}"></div> <div id="jstree_{{=i}}" data-index="{{=i}}"></div>
</div> </div>
</div> </div>
</fieldset> </div>
<fieldset> <div class="field_div">
<legend>set selection</legend> <label for="file_set_ids_{{=i}}" id="file_set_ids__label_{{=i}}">sets: </label>
<div> <div class="token_div form-control" onclick="$('#token_input_{{=i}}').focus()">
You must associate this sample with at least one patient, run or set.<br>You can also associate it with any combination of the three. <input
</div> hidden
<div class="field_div"> id="file_set_list_{{=i}}"
<label for="file_set_ids_{{=i}}" id="file_set_ids__label_{{=i}}">sets: </label> name="file[{{=i}}][set_ids]"
<div class="token_div form-control" onclick="$('#token_input_{{=i}}').focus()"> type="text"
<input value="{{=",".join([set['id'] for set in file['sets']])}}">
hidden <div id="file_set_div_{{=i}}" class="token_container">
id="file_set_list_{{=i}}" {{ for set in file['sets']: }}
name="file[{{=i}}][set_ids]" <span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}">
type="text" <i class="icon-cancel" onclick="new Tokeniser(document.getElementById('file_set_div_{{=i}}'), document.getElementById('file_set_list_{{=i}}')).removeToken(this.parentNode);"></i>
value="{{=",".join([set['id'] for set in sets])}}"> {{=set['id'][3:]}}
<div id="file_set_div_{{=i}}" class="token_container"> </span>
{{ for set in file['sets']: }} {{pass}}
<span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}">
<i class="icon-cancel" onclick="new Tokeniser(document.getElementById('file_set_div_{{=i}}'), document.getElementById('file_set_list_{{=i}}')).removeToken(this.parentNode);"></i>
{{=set['id'][3:]}}
</span>
{{pass}}
</div>
<input
id="token_input_{{=i}}"
class="token_input"
autocomplete="off"
onfocus="new VidjilAutoComplete().setupSamples(this);
new Tokeniser(document.getElementById('file_set_div_{{=i}}'), document.getElementById('file_set_list_{{=i}}'));"
data-needs-atwho="true"
data-needs-tokeniser="true"
data-group-ids="{{=upload_group_ids}}"
data-keys='["generic", "patient", "run"]'
type="text">
</div> </div>
</div> <input
</fieldset> id="token_input_{{=i}}"
<fieldset> class="token_input"
<legend>sample information</legend> autocomplete="off"
<div class="field_div"> onfocus="new VidjilAutoComplete().setupSamples(this);
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text" new Tokeniser(document.getElementById('file_set_div_{{=i}}'), document.getElementById('file_set_list_{{=i}}'));"
value="{{if 'sampling_date' in file and file['sampling_date'] is not None:}}{{=file['sampling_date']}}{{pass}}"
placeholder="Sampling Date (yyyy-mm-dd)" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
</div>
<div class="field_div">
<textarea id="file_info_{{=i}}"
onfocus="new VidjilAutoComplete().setupTags(this);"
data-needs-atwho="true" data-needs-atwho="true"
data-keys="{{=group_ids}}" data-needs-tokeniser="true"
class="text form-control" data-group-ids="{{=upload_group_ids}}"
name="file[{{=i}}][info]" data-keys='["generic", "patient", "run"]'
rows="1" type="text">
placeholder="Info">{{if 'info' in file and file['info'] is not None:}}{{=file['info']}}{{pass}}</textarea>
</div> </div>
</fieldset> </div>
</fieldset> <div class="field_div">
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text"
value="{{if 'sampling_date' in file and file['sampling_date'] is not None:}}{{=file['sampling_date']}}{{pass}}"
placeholder="Sampling Date (yyyy-mm-dd)" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
</div>
<div class="field_div">
<textarea id="file_info_{{=i}}"
onfocus="new VidjilAutoComplete().setupTags(this);"
data-needs-atwho="true"
data-keys="{{=group_ids}}"
class="text form-control"
name="file[{{=i}}][info]"
rows="1"
placeholder="Info">{{if 'info' in file and file['info'] is not None:}}{{=file['info']}}{{pass}}</textarea>
</div>
</div>
<fieldset name="generic{{=i}}"> <div>Set {{=i+1}}</div>
<legend>Set {{=i+1}}</legend> <input type="hidden" id="generic_id_{{=i}}" name="generic[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
<input type="hidden" id="generic_id_{{=i}}" name="generic[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}"> <input type="hidden" sample_set_id="generic_sample_set_id_{{=i}}" name="generic[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
<input type="hidden" sample_set_id="generic_sample_set_id_{{=i}}" name="generic[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}"> {{ if set is not None and 'error' in set and len(set['error']) > 0: }}
{{ if set is not None and 'error' in set and len(set['error']) > 0: }} <div class="error">error: {{=", ".join(set['error'])}}</div>
<div class="error">error: {{=", ".join(set['error'])}}</div> {{pass}}
{{pass}} {{ if set is not None and 'message' in set and len(set['message']) > 0: }}
{{ if set is not None and 'message' in set and len(set['message']) > 0: }} <div>{{=", ".join(set['message'])}}</div>
<div>{{=", ".join(set['message'])}}</div> {{ pass }}
{{ pass }} <div class="field_div">
<div class="field_div"> <input id="sample_set_name_{{=i}}" name="generic[{{=i}}][name]" type="text" class="string form-control"
<input id="sample_set_name_{{=i}}" name="generic[{{=i}}][name]" type="text" class="string form-control" value="{{if set is not None:}}{{=set['name']}}{{pass}}" required placeholder="Name">
value="{{if set is not None:}}{{=set['name']}}{{pass}}" required placeholder="Name"> </div>
</div> <div class="field_div">
<div class="field_div"> <textarea
<textarea onfocus="$(this).data('group-ids', [$('#group_select option:selected').val()]);
onfocus="$(this).data('group-ids', [$('#group_select option:selected').val()]); new VidjilAutoComplete().setupAtWho(this);"
new VidjilAutoComplete().setupAtWho(this);" data-needs-atwho="true"
data-needs-atwho="true" class="text form-control"
class="text form-control" id="sample_set_info_{{=i}}"
id="sample_set_info_{{=i}}" name="generic[{{=i}}][info]"
name="generic[{{=i}}][info]" rows="1"
rows="1" placeholder="Info">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</textarea>
placeholder="Info">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</textarea> </div>
</div>
</fieldset>
<fieldset name="patient{{=i}}"> <div>Patient {{=i+1}}</div>
<legend>Patient {{=i+1}}</legend> <input type="hidden" id="patient_id_{{=i}}" name="patient[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
<input type="hidden" id="patient_id_{{=i}}" name="patient[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}"> <input type="hidden" sample_set_id="patient_sample_set_id_{{=i}}" name="patient[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
<input type="hidden" sample_set_id="patient_sample_set_id_{{=i}}" name="patient[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}"> {{ if set is not None and 'error' in set and len(set['error']) > 0: }}
{{ if set is not None and 'error' in set and len(set['error']) > 0: }} <div class="error">error: {{=", ".join(set['error'])}}</div>
<div class="error">error: {{=", ".join(set['error'])}}</div> {{ pass }}
{{ pass }} {{ if set is not None and 'message' in set and len(set['message']) > 0: }}
{{ if set is not None and 'message' in set and len(set['message']) > 0: }} <div>{{=", ".join(set['message'])}}</div>
<div>{{=", ".join(set['message'])}}</div> {{ pass }}
{{ pass }} <div class="field_div">
<div class="field_div">