-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsequence_add.html
48 lines (37 loc) · 1.54 KB
/
sequence_add.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
{% extends "base.html" %}
{% block pagetitle %} Add Inference - {{ name }}{% endblock %}
{% block c_body %}
<div class="row pad">
<form action="{{ url_for('seq_add_inference', id=id) }}" method="POST" name="form" class="form-horizontal">
{{ form.hidden_tag() }}
<p class="col-sm-offset-1">Please select the submission and inferred sequence on which this affirmation should be based.</p>
{{ render_field_with_errors(form.submission_id, class="form-control") }}
{{ render_field_with_errors(form.sequence_name, class="form-control") }}
<div class="form-group row col-sm-10">
{{ form.cancel(class="btn btn-default col-sm-offset-1") }}
{{ form.create(class="btn btn-primary") }}
</div>
</form>
</div>
{% endblock %}
{% block scripts %}
{{ super() }}
<script>
$("#submission_id").change(function(e) {
$("#sequence_name").empty()
var submission_id = $(this).find("option:selected").val();
if(submission_id != '') {
$.ajax({
type: "GET",
url: '{{ url_for("get_sequences", id="xxx") }}'.replace("xxx", submission_id),
success: function (data) {
var opts = $.parseJSON(data);
$.each(opts, function (i, d) {
$("#sequence_name").append('<option value="' + d[0] + '">' + d[1] + '</option>');
});
}
})
}
});
</script>
{% endblock %}