-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubmission_view.html
279 lines (243 loc) · 12.4 KB
/
submission_view.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{% extends "base.html" %}
{% block pagetitle %} Submission {{ sub.submission_id }} ({{ sub.owner.name }}) {% endblock %}
{% block content %}
{% include 'sequence_popup.html' %}
{{ super() }}
{% endblock %}
{% block c_body %}
<div>
<ul class="nav nav-tabs" role="tablist" id="myTab">
<li role="presentation" class="active"><a href="#sub" aria-controls="sub" role="tab" data-toggle="tab" id="tab-sub">Submission Details</a></li>
<li role="presentation"><a href="#ack" aria-controls="ack" role="tab" data-toggle="tab" id="tab-ack">Acknowledgements</a></li>
<li role="presentation"><a href="#rep" aria-controls="rep" role="tab" data-toggle="tab" id="tab-rep">Repertoire</a></li>
<li role="presentation"><a href="#primer_sets" aria-controls="primer_sets" role="tab" data-toggle="tab" id="tab-pri">Primers</a></li>
<li role="presentation"><a href="#tools" aria-controls="tools" role="tab" data-toggle="tab" id="tab-inf">Inference Tools</a></li>
<li role="presentation"><a href="#notes" aria-controls="notes" role="tab" data-toggle="tab" id="tab-notes">Notes</a></li>
{% if reviewer %}
<li role="presentation"><a href="#review" aria-controls="review" role="tab" data-toggle="tab" id="tab-rev">Review</a></li>
{% endif %}
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="sub">
<h3>Submission Details</h3>
{{ tables['submission'] }}
<h3>Inferred Sequences</h3>
<p>The inferred novel alleles from each genotype that are submitted for review. This table lists all inferences put forward by the submitter. Where IARC has
affirmed a sequence based on an inference, the corresponding sequence record will be listed in the Published column. Inferences for which no published
sequence is shown have not been affirmed.</p>
{% if reviewer %}
{{ tables['iarc_inferred_sequence'] }}
{% else %}
{{ tables['inferred_sequence'] }}
{% endif %}
{% if reviewer and tables['matches'] %}
<h3>Unreferenced Matches to Published Sequences</h3>
<p>Matches in these genotypes not currently referenced in published sequences (this section is only visible to reviewers):</p>
{{ tables['matches'] }}
{% endif %}
<h3>Genotypes</h3>
<p>Each genotype that has been inferred, along with the descriptive name of the inference tool and settings that were used.</p>
{{ tables['genotype_description'] }}
</div>
<div role="tabpanel" class="tab-pane" id="ack">
<h3>Acknowledgements</h3>
<p>Individuals who should be acknowledged as contributing to the inferences listed in this submission.</p>
{{ tables['ack'] }}
</div>
<div role="tabpanel" class="tab-pane" id="rep">
<h3>Repertoire Details</h3>
<p>Details of the repertoire from which the inferences are based. This corresponds, for example, to an NIH Project or an ENA study.</p>
{{ tables['repertoire'] }}
<h4>Repertoire Publications</h4>
<p>Publications associated with this study.</p>
{{ tables['pub'] }}
</div>
<div role="tabpanel" class="tab-pane" id="primer_sets">
<p>Sequences of the PCR primers used in the study.</p>
{% for (name, notes, table) in tables['primer_sets'] %}
<h3>{{ name }}</h3>
<p>{{ notes | textile_filter }}</p>
{{ table }}
{% endfor %}
</div>
<div role="tabpanel" class="tab-pane" id="tools">
<h3>Inference Tools and Settings</h3>
<p>Details of the inference tools and settings used to infer novel alleles. Each combination
of tool and setting is listed here, and provided with a descriptive name.</p>
{{ tables['inference_tool'] }}
</div>
<div role="tabpanel" class="tab-pane" id="notes">
<h3>Notes</h3>
{% for item in tables['submission_notes'].items %}
{% if item['item'] == 'Notes' %}
{{ item['value'] | textile_filter }}
{% endif %}
{% if item['item'] == 'Attachment File Name' %}
<br><br><br>
<p>Attached file: {{ item['value'] }}</p>
{% endif %}
{% endfor %}
{% if attachment %}
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
{{ tables['attachments'] }}
</div>
</div>
{% endif %}
</div>
{% if reviewer %}
<div role="tabpanel" class="tab-pane" id="review">
<h3>History</h3>
{{ tables['history']}}
<h3>Notes</h3>
<div class="form-group">
<button type="button" class="btn tablebutton pull-right" data-toggle="modal" data-target="#messageModal" data-type="note" data-action="note"
data-header="New Thread" data-instr=""
data-title="" id="note">New Thread</button>
</div>
{% for (id, table) in tables['notes'] %}
<div class="form-group">
{{ table }}
<button type="button" class="btn btn-sm tablebutton pull-right" data-toggle="modal" data-target="#messageModal" data-type="note" data-action="{{ id }}"
data-header="New Thread" data-instr=""
data-title="" id="note">Reply to Thread <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></button>
</div>
{% endfor %}
<form action="{{ url_for('submission', id=id) }}" method="POST" name="form" class="form-horizontal">
{% if status == 'reviewing' %}
<h3>Review Delegates</h3>
<a name="delegates"> </a>
{% include 'delegate_edit.html' %}
{% endif %}
<h3>Actions</h3>
{{ form.hidden_tag() }}
<div class="modal fade" id="messageModal" tabindex="-1" role="dialog" aria-labelledby="messageModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="messageModallLabel">New message</h4>
</div>
<div class="modal-body">
<div class="modal-instructions">
</div>
<br>
{% include 'journal_entry_form.html' %}
{{ form.type(class="hidden") }}
{{ form.action(class="hidden") }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<input type="submit" value="Save" class="btn" name="save_btn" id="save_btn">
</div>
</div>
</div>
</div>
</form>
{% if status == 'reviewing' %}
{% if not sub.public %}
<button type="button" class="btn btn-danger tablebutton" data-toggle="modal" data-target="#messageModal" data-type="history" data-action="withdraw"
data-header="Withdraw Submission" data-instr="Please provide a message for the submitter (it will also be copied to Notes)"
data-title="Submission {{ id }} - Withdraw Submission" id="withdraw">Withdraw Submission</button>
<button type="button" class="btn btn-warning tablebutton" data-toggle="modal" data-target="#messageModal" data-type="history" data-action="draft"
data-header="Return Submission to Submitter" data-instr="Please provide a message for the submitter (it will also be copied to Notes)"
data-title="Submission {{ id }} - Returned to Submitter" id="draft">Return to Submitter</button>
{% endif %}
<button type="button" class="btn btn-warning tablebutton" data-toggle="modal" data-target="#messageModal" data-type="history" data-action="complete"
data-header="Complete Review" data-instr="Please provide a message for the submitter (it will also be copied to Notes)"
data-title="Submission {{ id }} - Completed" id="complete">Complete</button>
{% elif (status == 'complete') %}
{% if not sub.public %}
<button type="button" class="btn btn-danger tablebutton" data-toggle="modal" data-target="#messageModal" data-type="history" data-action="withdraw"
data-header="Withdraw Submission" data-instr="Please provide a message for the submitter (it will also be copied to Notes)"
data-title="Submission {{ id }} - Withdraw Submission" id="withdraw">Withdraw Submission</button>
{% endif %}
<button type="button" class="btn btn-warning tablebutton" data-toggle="modal" data-target="#messageModal" data-type="history" data-action="review"
data-header="Un-Complete Submission. The submission will be returned to Review." data-instr="Please provide a message for the submitter (it will also be copied to Notes)"
data-title="Submission {{ id }} - Returned to Review" id="ret_review">Un-Complete Submission</button>
{% elif (status == 'withdrawn') %}
<button type="button" class="btn btn-warning tablebutton" data-toggle="modal" data-target="#messageModal" data-type="history" data-action="review"
data-header="Un-Withdraw Submission. The submission will be returned to Review." data-instr="Please provide a message for the submitter (it will also be copied to Notes)"
data-title="Submission {{ id }} - Returned to Review" id="ret_review">Un-Withdraw Submission</button>
{% endif %}
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block scripts %}
{{ super() }}
<script>
// Change hash for page-reload
$('.nav-tabs a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
});
// Javascript to enable link to tab
var url = document.location.toString();
var jump = '';
var anchor = '';
if (url.match('#')) {
anchor = url.split('#')[1];
}
{% if jump %}
anchor = "{{ jump }}"
{% endif %}
if(anchor != '') {
if(anchor == "delegates") {
jump = anchor;
anchor = "review"
}
$('.nav-tabs a[href="#' + anchor + '"]').tab('show');
}
$(document).ready(function ()
{
if(jump != '') {
window.location.hash = "";
window.location.hash = "#" + jump
}
});
$('#messageModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget); // Button that triggered the modal
var type = button.data('type');
var action = button.data('action');
var header = button.data('header');
var title = button.data('title');
var instructions = button.data('instr');
var modal = $(this);
modal.find('#type').val(type);
modal.find('#action').val(action);
modal.find('#title').val(title);
modal.find('.modal-title').text(header);
modal.find('.modal-instructions').text(instructions);
if(type == 'note') {
if(action != 'note') {
modal.find('#title').hide();
modal.find('#title').val('Title'); // dummy value for validation
modal.find('[for=title]').hide();
modal.on('shown.bs.modal', function () {
$('#body').focus()
})
}
else {
modal.find('#title').show();
modal.find('#title').val('');
modal.find('[for=title]').show();
modal.on('shown.bs.modal', function () {
$('#title').focus()
})
}
}
diag_class = '';
if(button.hasClass("btn-warning")) {
modal.addClass("bootstrap-dialog type-warning");
modal.find('#save_btn').addClass("btn-warning")
} else if(button.hasClass("btn-danger")) {
modal.addClass("bootstrap-dialog type-danger");
modal.find('#save_btn').addClass("btn-danger")
} else {
modal.find('#save_btn').addClass("btn-primary")
}
})
</script>
{% include 'sequence_popup_script.html' %}
{% endblock %}