-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsequence_new.html
127 lines (109 loc) · 5.51 KB
/
sequence_new.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{% extends "base.html" %}
{% block pagetitle %} New Sequence - {{ species }}{% endblock %}
{% block c_body %}
<div class="col-sm-12">
<form action="{{ url_for('new_sequence', species=species) }}" method="POST" name="form" class="form-horizontal" enctype="multipart/form-data">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<p>Please complete one section below</p>
</div>
</div>
<div class="_panel col-sm-10 col-sm-offset-1">
<div class="row pad">
<div class="col-sm-12">
<b>Single Sequence Entry</b>
</div>
</div>
<div class="row pad">
<div class="col-sm-12">
{{ form.hidden_tag() }}
{{ render_field_with_errors(form.new_name, class="form-control") }}
{{ render_field_with_errors(form.species_subgroup, class="form-control") }}
</div>
</div>
<div class="row pad">
<div class="col-sm-9 col-sm-offset-3">
<input type="radio" name="record_type" id="rad_submission" value="submission" checked> The sequence will be based on information from a submission </input><br>
<input type="radio" name="record_type" id="rad_genomic" value="genomic"> The sequence will not be based on information from a submission </input><br>
</div>
</div>
<div class="row pad" id="submit_details">
<div class="col-sm-9 col-sm-offset-1">
<p>If the sequence is based on information from a submission, please select the submission and inferred sequence on which this affirmation should be based.</p>
</div>
<div class="col-sm-12">
{{ render_wide_field_with_errors(form.submission_id, class="form-control") }}
{{ render_wide_field_with_errors(form.sequence_name, class="form-control") }}
</div>
</div>
</div>
<div class="_panel col-sm-10 col-sm-offset-1">
<div class="row pad">
<div class="col-sm-10">
<b>Bulk Sequence Entry</b>
</div>
</div>
<div class="row pad">
{{ render_field_with_errors(form.upload_file, class="form-control") }}
{% if adminedit %}
{{ render_narrow_field_with_errors(form.merge_data, class="form-control", style="height: 20px;width: 20px;") }}
{% endif %}
<div class="col-sm-9 col-sm-offset-1">
<p>Gapped CDR fields indicate the coordinates of the CDRs in gapped nucleotide V-sequences. They are pre-filled with the IMGT default for alignments with no inserted codons.
If the alignment has inserted codons compared to the standard IMGT alignment, the coordinates should be adjusted accordingly.
</p>
</div>
{{ render_narrow_field_with_errors(form.gapped_cdr1_start, class="form-control") }}
{{ render_narrow_field_with_errors(form.gapped_cdr1_end, class="form-control") }}
{{ render_narrow_field_with_errors(form.gapped_cdr2_start, class="form-control") }}
{{ render_narrow_field_with_errors(form.gapped_cdr2_end, class="form-control") }}
{{ render_narrow_field_with_errors(form.gapped_cdr3_start, class="form-control") }}
</div>
</div>
<div class="_panel col-sm-10 col-sm-offset-1">
<div class="row pad">
<div class="col-sm-10">
<b>Bulk Evidence Entry</b>
</div>
</div>
<div class="row pad">
{{ render_field_with_errors(form.evidence_file, class="form-control") }}
</div>
</div>
<div class="form-group row col-sm-6">
{{ form.cancel(class="btn btn-default col-sm-offset-1") }}
{{ form.create(class="btn btn-primary") }}
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
{{ super() }}
<script>
$("#submission_id").change(function(e) {
$("#sequence_name").empty()
var submission_id = $(this).find("option:selected").val();
if(submission_id != '') {
console.log("sending request");
$.ajax({
type: "GET",
url: '{{ url_for("get_sequences", id="xxx") }}'.replace("xxx", submission_id),
success: function (data) {
console.log("processing response");
var opts = $.parseJSON(data);
$.each(opts, function (i, d) {
$("#sequence_name").append('<option value="' + d[0] + '">' + d[1] + '</option>');
console.log("processed");
});
}
})
}
});
$("#rad_submission").change(function(e) {
$("#submit_details").show();
});
$("#rad_genomic").change(function(e) {
$("#submit_details").hide();
});
</script>
{% endblock %}