Commit 6b6cda6e authored by Mikaël Salson's avatar Mikaël Salson

browser, server: Don't require files when editing a sample

parent 52883560
Pipeline #124996 passed with stages
in 16 minutes and 48 seconds
......@@ -377,9 +377,12 @@ Database.prototype = {
});
}else{
$(".file_2").show();
$(".upload_field").each(function() {
$(this).prop("required", true);
});
if ($(".is_editing").length == 0) {
// Not editing a sample, but creating new ones
$(".upload_field").each(function() {
$(this).prop("required", true);
});
}
}
},
......
......@@ -12,6 +12,9 @@
value="{{if 'id' in file:}}{{=file['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}}" />
{{if isEditing:}}
<input type="hidden" id="is_editing" name="is_editing" value="1" />
{{pass}}
</div>
<div class="field_div">
......@@ -19,7 +22,7 @@
<input class="upload_field form-control" id="file_upload_1_{{=i}}" type="file"
{{if network_source:}}
disabled
{{else:}}
{{elif not isEditing:}}
required
{{pass}}
onchange="db.upload_file_onChange('file_filename_{{=i}}', this.value)"
......@@ -30,7 +33,7 @@
<input class="upload_field form-control" id="file_upload_2_{{=i}}" type="file"
{{if network_source:}}
disabled
{{else:}}
{{elif not isEditing:}}
required
{{pass}}
title="second file for this sample (.fa, .fastq, .fa.gz, .fastq.gz)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment