Commit d9050574 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

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,10 +22,7 @@ ...@@ -26,10 +22,7 @@
</option> </option>
{{pass}} {{pass}}
</select> </select>
</fieldset> </div>
<fieldset>
<legend>set selection</legend>
<div> <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. 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.
</div> </div>
...@@ -66,7 +59,6 @@ ...@@ -66,7 +59,6 @@
type="text"> type="text">
</div> </div>
</div> </div>
</fieldset>
<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,11 +45,6 @@ ...@@ -46,11 +45,6 @@
<div id="jstree_{{=i}}" data-index="{{=i}}"></div> <div id="jstree_{{=i}}" data-index="{{=i}}"></div>
</div> </div>
</div> </div>
</fieldset>
<fieldset>
<legend>set selection</legend>
<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.
</div> </div>
<div class="field_div"> <div class="field_div">
<label for="file_set_ids_{{=i}}" id="file_set_ids__label_{{=i}}">sets: </label> <label for="file_set_ids_{{=i}}" id="file_set_ids__label_{{=i}}">sets: </label>
...@@ -60,7 +54,7 @@ ...@@ -60,7 +54,7 @@
id="file_set_list_{{=i}}" id="file_set_list_{{=i}}"
name="file[{{=i}}][set_ids]" name="file[{{=i}}][set_ids]"
type="text" type="text"
value="{{=",".join([set['id'] for set in sets])}}"> value="{{=",".join([set['id'] for set in file['sets']])}}">
<div id="file_set_div_{{=i}}" class="token_container"> <div id="file_set_div_{{=i}}" class="token_container">
{{ for set in file['sets']: }} {{ for set in file['sets']: }}
<span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}"> <span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}">
...@@ -82,9 +76,6 @@ ...@@ -82,9 +76,6 @@
type="text"> type="text">
</div> </div>
</div> </div>
</fieldset>
<fieldset>
<legend>sample information</legend>
<div class="field_div"> <div class="field_div">
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text" <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}}" value="{{if 'sampling_date' in file and file['sampling_date'] is not None:}}{{=file['sampling_date']}}{{pass}}"
...@@ -100,5 +91,4 @@ ...@@ -100,5 +91,4 @@
rows="1" rows="1"
placeholder="Info">{{if 'info' in file and file['info'] is not None:}}{{=file['info']}}{{pass}}</textarea> placeholder="Info">{{if 'info' in file and file['info'] is not None:}}{{=file['info']}}{{pass}}</textarea>
</div> </div>
</fieldset> </div>
</fieldset>
<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);"
...@@ -22,5 +21,4 @@ ...@@ -22,5 +21,4 @@
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">
<input class="date form-control" id="patient_id_label_{{=i}}" name="patient[{{=i}}][id_label]" type="text" <input class="date form-control" id="patient_id_label_{{=i}}" name="patient[{{=i}}][id_label]" type="text"
value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Patient ID"> value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Patient ID">
</div> </div>
<div class="field_div"> <div class="field_div">
<input class="string form-control" id="patient_first_name_{{=i}}" name="patient[{{=i}}][first_name]" type="text" <input class="string form-control" id="patient_first_name_{{=i}}" name="patient[{{=i}}][first_name]" type="text"
value="{{if set is not None:}}{{=set['first_name']}}{{pass}}" required placeholder="First Name"> value="{{if set is not None:}}{{=set['first_name']}}{{pass}}" required placeholder="First Name">
</div> </div>
<div class="field_div"> <div class="field_div">
<input class="string form-control" id="patient_last_name_{{=i}}" name="patient[{{=i}}][last_name]" type="text" <input class="string form-control" id="patient_last_name_{{=i}}" name="patient[{{=i}}][last_name]" type="text"
value="{{if set is not None:}}{{=set['last_name']}}{{pass}}" required placeholder="Last Name"> value="{{if set is not None:}}{{=set['last_name']}}{{pass}}" required placeholder="Last Name">
</div> </div>
<div class="field_div"> <div class="field_div">
<input class="date form-control" id="patient_birth_{{=i}}" name="patient[{{=i}}][birth]" type="text" <input class="date form-control" id="patient_birth_{{=i}}" name="patient[{{=i}}][birth]" type="text"
value="{{if set is not None and set['birth'] is not None:}}{{=set['birth']}}{{pass}}" value="{{if set is not None and set['birth'] is not None:}}{{=set['birth']}}{{pass}}"
title="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))" placeholder="Birth (yyyy-mm-dd)"> title="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))" placeholder="Birth (yyyy-mm-dd)">
</div> </div>
<div class="field_div"> <div class="field_div">
<textarea <textarea
onfocus="$(this).data('keys', [$('#group_select option:selected').val()]); onfocus="$(this).data('keys', [$('#group_select option:selected').val()]);
new VidjilAutoComplete().setupTags(this);" new VidjilAutoComplete().setupTags(this);"
...@@ -35,5 +34,4 @@ ...@@ -35,5 +34,4 @@
name="patient[{{=i}}][info]" name="patient[{{=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="run{{=i}}"> <div>Run {{=i+1}}</div>
<legend>Run {{=i+1}}</legend> <input type="hidden" id="run_id_{{=i}}" name="run[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
<input type="hidden" id="run_id_{{=i}}" name="run[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}"> <input type="hidden" sample_set_id="run_sample_set_id_{{=i}}" name="run[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
<input type="hidden" sample_set_id="run_sample_set_id_{{=i}}" name="run[{{=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 class="date" id="run_id_label_{{=i}}" name="run[{{=i}}][id_label]" type="text" <input class="date" id="run_id_label_{{=i}}" name="run[{{=i}}][id_label]" type="text"
value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Run ID"><span></span> value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Run ID"><span></span>
</div> </div>
<div class="field_div"> <div class="field_div">
<input class="string form-control" id="run_name_{{=i}}" name="run[{{=i}}][name]" type="text" <input class="string form-control" id="run_name_{{=i}}" name="run[{{=i}}][name]" type="text"
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">
<input id="run_date_{{=i}}" name="run[{{=i}}][run_date]" type="text" class="date form-control" <input id="run_date_{{=i}}" name="run[{{=i}}][run_date]" type="text" class="date form-control"
value="{{if set is not None and set['run_date'] is not None:}}{{=set['run_date']}}{{pass}}" value="{{if set is not None and set['run_date'] is not None:}}{{=set['run_date']}}{{pass}}"
placeholder="Date (yyyy-mm-dd)" title="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))"> placeholder="Date (yyyy-mm-dd)" title="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>
<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);"
...@@ -31,13 +30,12 @@ ...@@ -31,13 +30,12 @@
name="run[{{=i}}][info]" name="run[{{=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>
<div class="field_div"> <div class="field_div">
<input id="run_sequencer_{{=i}}" name="run[{{=i}}][sequencer]" type="text" class="form-control" <input id="run_sequencer_{{=i}}" name="run[{{=i}}][sequencer]" type="text" class="form-control"
value="{{if set is not None and set['sequencer'] is not None:}}{{=set['sequencer']}}{{pass}}" placeholder="Sequencer"> value="{{if set is not None and set['sequencer'] is not None:}}{{=set['sequencer']}}{{pass}}" placeholder="Sequencer">