forked from cidgoh/DataHarmonizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
602 lines (584 loc) · 28 KB
/
main.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>DataHarmonizer</title>
<link rel="stylesheet" href="./main.css">
</head>
<body>
<div class="w-100 h-100 position-fixed fixed-top" id="loading-screen">
<div class="d-flex h-100 align-items-center justify-content-center">
<div class="spinner-border text-primary" role="status">
<span class="sr-only">Please wait...</span>
</div>
</div>
</div>
<!-- flex grid -->
<div class="container-fluid">
<!-- buttons above Handsontable grid -->
<div class="row mt-3" id="header-row">
<div class="col">
<div class="btn-group" role="group">
<div class="btn-group" id="file-dropdown-btn-group" role="group">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">File</button>
<div class="dropdown-menu">
<span class="dropdown-item" data-toggle="modal" data-target="#select-template-modal">Change Template</span>
<span class="dropdown-item" id="new-dropdown-item">New</span>
<label for="open-file-input" class="dropdown-item mb-0" id="open-dropdown-item">Open</label>
<input type="file" accept=".xlsx,.xls,.tsv,.csv" class="form-control-file" id="open-file-input">
<span class="dropdown-item" data-toggle="modal" id="save-as-dropdown-item">Save As...</span>
<span class="dropdown-item" data-toggle="modal" id="export-to-dropdown-item">Export To...</span>
<!-- span class="dropdown-item" data-toggle="modal" id="export-to-dropdown-item" data-target="#export-to-modal">Export To...</span -->
</div>
</div>
<div class="btn-group" id="settings-dropdown-btn-group" role="group">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Settings</button>
<div class="dropdown-menu">
<span class="dropdown-item disabled" id="show-all-cols-dropdown-item">Show all columns</span>
<span class="dropdown-item" id="show-required-cols-dropdown-item">Show required columns</span>
<span class="dropdown-item" id="show-recommended-cols-dropdown-item">Show required + recommended columns</span>
<span class="dropdown-item hidden-dropdown-item" id="show-all-rows-dropdown-item">Show all rows</span>
<span class="dropdown-item hidden-dropdown-item" id="show-valid-rows-dropdown-item">Show valid rows</span>
<span class="dropdown-item hidden-dropdown-item" id="show-invalid-rows-dropdown-item">Show invalid rows</span>
<span class="dropdown-item" id="jump-to-dropdown-item" data-toggle="modal" data-target="#jump-to-modal">Jump to...</span>
<span class="dropdown-item" id="fill-dropdown-item" data-toggle="modal" data-target="#fill-modal">Fill column...</span>
<span class="dropdown-item disabled" id="version-dropdown-item"></span>
</div>
</div>
<button type="button" class="btn btn-primary" id="validate-btn">Validate</button>
</div>
<div class="btn-group d-none d-sm-inline" role="group">
<button class="btn btn-info dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Help</button>
<div class="dropdown-menu">
<span class="dropdown-item" data-toggle="modal" data-target="#getting-started-modal">Getting Started</span>
<a class="dropdown-item" target="_blank" id="help_reference" href="">Reference Guide</a>
<a class="dropdown-item" target="_blank" id="help_sop" href="">SOP</a>
<a class="dropdown-item" target="_blank" id="help_release" href="https://github.com/Public-Health-Bioinformatics/DataHarmonizer/releases">Get Latest Release</a>
<span class="dropdown-item" data-toggle="modal" data-target="#contact-us-modal">Contact Us</span>
</div>
</div>
<div class="btn-group" role="group" style="margin-right:40px">
<div class="input-group-prepend">
<div class="btn">Template</div>
</div>
<div class="input-group-append">
<div class="input-group-text" id="template_name_display" style="background-color:transparent;cursor:pointer" data-toggle="modal" data-target="#select-template-modal"></div>
</div>
</div>
<div class="btn-group" role="group" style="margin-right:40px">
<div class="input-group-prepend">
<div class="btn">Loaded file</div>
</div>
<div class="input-group-append">
<div class="input-group-text" id="file_name_display" style="background-color:transparent"></div>
</div>
</div>
<div class="btn-group" role="group" >
<div class="input-group-append">
<button class="btn btn-primary" id="next-error-button" type="submit">Next Error</button>
<div class="btn btn-primary" id="no-error-button" type="submit">No Errors</div>
</div>
</div>
</div>
</div>
<!-- Handsontable grid -->
<div class="row mt-3">
<div class="col">
<div id="grid"></div>
</div>
</div>
<!-- Buttons below Handsontable grid -->
<div class="row mt-3" id="footer-row">
<div class="col col-md-6">
<div class="input-group">
<div class="input-group-prepend">
<button class="btn btn-primary" id="add-rows-button" type="submit">Add</button>
</div>
<input type="text" class="form-control" id="add-rows-input" value="100">
<div class="input-group-append">
<span class="input-group-text">more rows at the bottom.</span>
</div>
</div>
</div>
</div>
</div>
<!-- Modals -->
<div class="modal" id="select-template-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Change Template </span>
</div>
<select class="form-control" id="select-template"></select>
<div class="input-group-append">
<button type="button" class="btn btn-primary" data-dismiss="modal" id="select-template-load">Open</button>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col d-flex d-flex">
<input type="checkbox" id="view-template-drafts" style="margin:6px">
<label for="#view-template-drafts">View draft templates</label>
</div>
<div class="col d-flex d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="clear-data-warning-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col">
<span class="text-danger">Clear existing data?</span>
</div>
</div>
<div class="row mt-3">
<div class="col-2 col-sm-6"></div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-danger" id="clear-data-confirm-btn" data-dismiss="modal">Clear</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="save-as-invalid-warning-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger">You have invalid cells. Continue saving?</div>
</div>
<div class="row mt-3">
<div class="col-2 col-sm-6"></div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-danger" data-dismiss="modal" data-toggle="modal" data-target="#save-as-modal">Continue</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="save-as-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger" id="save-as-err-msg"></div>
</div>
<div class="row">
<div class="col">
<div class="input-group">
<input type="text" class="form-control" id="base-name-save-as-input" placeholder="file name">
<div class="input-group-append">
<select class="form-control" id="file-ext-save-as-select">
<option value="xlsx" selected>.xlsx</option>
<option value="xls">.xls</option>
<option value="tsv">.tsv</option>
<option value="csv">.csv</option>
</select>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-2 col-sm-6"></div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-primary" id="save-as-confirm-btn">Save</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="export-to-invalid-warning-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger">You have invalid cells. Continue exporting?</div>
</div>
<div class="row mt-3">
<div class="col-2 col-sm-6"></div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-danger" data-dismiss="modal" data-toggle="modal" data-target="#export-to-modal">Continue</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="export-to-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger" id="export-to-err-msg"></div>
</div>
<div class="row">
<div class="col-12 col-sm-8">
<div class="input-group">
<input type="text" class="form-control" id="base-name-export-to-input" placeholder="file name">
<div class="input-group-append">
<div class="input-group-text" id="export_file_suffix">.xls</div>
</div>
</div>
</div>
<div class="col mt-2 mt-sm-0">
<select class="form-control" id="export-to-format-select">
<option value="" disabled selected>Format</option>
</select>
</div>
</div>
<div class="row mt-3">
<div class="col-2 col-sm-6"></div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-primary" id="export-to-confirm-btn">Export</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="specify-headers-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col">The second row in your imported file does not match the grid.</div>
</div>
<div class="row my-3 border" id="specify-headers-comparison-row">
<div class="col">
<div class="row">
<div class="col"><b>Expected second row:</b></div>
</div>
<div class="row">
<div class="col">
<div id="expected-headers-div"></div>
</div>
</div>
<div class="row">
<div class="col"><b>Actual second row:</b></div>
</div>
<div class="row">
<div class="col">
<div id="actual-headers-div"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<p>We will try to map your headers. <b>Which row in your file has the column headers?</b></p>
</div>
</div>
<div class="row">
<div class="col">
<input class="form-control" id="specify-headers-input" value="2">
</div>
</div>
<div class="row">
<div class="col"><i>First row = 1, Second row = 2, etc.</i></div>
</div>
<div class="row">
<div class="col text-danger" id="specify-headers-err-msg">Invalid row</div>
</div>
<div class="row mt-3">
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-primary" id="specify-headers-confirm-btn">Ok</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="unmapped-headers-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger">Failed to map:</div>
</div>
<div class="row">
<div class="col">
<ul class="list-unstyled" id="unmapped-headers-list"></ul>
</div>
</div>
<div class="row mt-3">
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="open-error-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger" id="open-err-msg"></div>
</div>
<div class="row mt-3">
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="jump-to-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col">
<div>
<label for="jump-to-input">Jump to...</label>
<input id="jump-to-input" class="form-control">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="fill-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<div>
<label for="fill-column-input">Fill cells in column ...</label>
<input id="fill-column-input" class="form-control">
</div>
</div>
<div class="col-sm-4">
<div>
<label for="fill-value-input">with value:</label>
<input id="fill-value-input" class="form-control">
</div>
</div>
<div class="col-sm-1">
<div>
<label> </label>
<button type="button" id="fill-button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
<div class="row">
<div>
<br clear="both">
<p> Use this feature to populate all the cells of a column with given value. This won't populate empty rows of the spreadsheet (as occurs when pasting a value to a column's header cell).</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="field-description-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col" id="field-description-text"></div>
</div>
<div class="row mt-3">
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="getting-started-modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="container-fluid">
<div class="row">
<div class="col">
<h5>Are you ready to harmonize your contextual data?</h5>
</div>
</div>
</div>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="carousel slide" id="getting-started-carousel" data-interval="false">
<ol class="carousel-indicators">
<li data-target="#getting-started-carousel" data-slide-to="0" class="active"></li>
<li data-target="#getting-started-carousel" data-slide-to="1"></li>
<li data-target="#getting-started-carousel" data-slide-to="2"></li>
<li data-target="#getting-started-carousel" data-slide-to="3"></li>
<li data-target="#getting-started-carousel" data-slide-to="4"></li>
<li data-target="#getting-started-carousel" data-slide-to="5"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="images/editCopyPasteDelete.gif">
<div class="carousel-caption">
<p>The contextual data collection template and validator application enables users to enter data as in an excel spreadsheet - type and pick values from dropdowns, copy/paste, add rows, etc.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/toggleRequiredCols.gif">
<div class="carousel-caption">
<p>Fields are colour-coded; required fields (minimal metadata) are yellow, strongly recommended fields are purple, optional fields are white.</p>
<p>You can toggle between all, and the required fields, by going to “Settings” and selecting “Show Required Columns”.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/doubleClickHeaders.gif">
<div class="carousel-caption">
<p>Double click on field headers to see the definition of the field, guidance on filling in the field, and examples of how data might look structured according to the constraints of the validator.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/selectingVals.gif">
<div class="carousel-caption">
<p>Picklists of controlled vocabulary are available for many fields. There are dropdown menus for some, and multi-select options for others (e.g. Signs and Symptoms). You can also see the list of terms in multi-select columns by clicking once in the multi-select box.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/validatingCells.gif">
<div class="carousel-caption">
<p>When you’re done entering your data, you can validate values by clicking on “Validate”. Errors and missing information in required fields will be coloured red.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/exportingFiles.gif">
<div class="carousel-caption">
<p>When you’ve entered and validated your data, you can save it as a .xlsx, .xls, .tsv or csv format file, by clicking on “File” followed by “Save as”. You can also format your data for IRIDA upload (you will need to perform the upload yourself), or use your entered data to create a GISAID submission form (you will need to add additional information, and perform the upload yourself), by clicking on "File" followed by "Export to".</p>
<p><i>If you have questions, or require assistance, contact [email protected].</i></p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#getting-started-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#getting-started-carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="contact-us-modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col">
<p>If you have questions, or want to notify us of bugs or potential improvements, contact us by either posting an issue at:</p>
<p>https://github.com/Public-Health-Bioinformatics/DataHarmonizer/issues</p>
<p>Or emailing us at:</p>
<p>[email protected]</p>
</div>
</div>
<div class="row mt-3">
<div class="col d-flex justify-content-end">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="missing-template-modal" role="dialog" style="display:none">
<div class="modal-dialog" role="document">
<div class="modal-content" style="z-index:2000">
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col text-danger" id="missing-template-msg"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- External libraries -->
<script src="libraries/jquery-3.5.1.min.js"></script>
<script src="libraries/popper.min.js"></script>
<script src="libraries/bootstrap.min.js"></script>
<script src="libraries/handsontable.full.min.js"></script>
<script type="text/javascript" src="libraries/shim.min.js"></script>
<script type="text/javascript" src="libraries/xlsx.full.min.js"></script>
<script type="text/javascript" src="libraries/chosen.jquery.min.js"></script>
<script type="text/javascript" src="libraries/moment.min.js"></script>
<script type="text/javascript" src="libraries/jquery-ui.min.js"></script>
<script type="text/javascript" src="libraries/FileSaver.min.js"></script>
<script src="script/export_utils.js"></script>
<script src="script/main.js"></script>
</body>
</html>