-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding "variant carrier" popup modal (#470).
- Loading branch information
Showing
9 changed files
with
224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function showVariantCarrierModal(obj, release, chromosome, start, reference, alternative) { | ||
const box = $(`#variantcarriermodal-${release}-${chromosome}-${start}-${reference}-${alternative}`).find('.variant-carrier-results'); | ||
box.html(`<div class="text-center"><i class="iconify spin" data-icon="fa-solid:spinner"></i></div>`); | ||
$.ajax({ | ||
type: 'GET', | ||
url: `${variant_carriers_url}?release=${release}&chromosome=${chromosome}&position=${start}` + | ||
`&reference=${reference}&alternative=${alternative}`, | ||
success: (response) => { | ||
// icon.removeClass('spin').attr('data-icon', 'fa-solid:cloud-upload'); | ||
box.html(response); | ||
}, | ||
error: (jqXHR, textStatus, errorThrown) => { | ||
alert("Error during AJAX call:", textStatus, + errorThrown); | ||
}, | ||
timeout: 0 | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
variants/templates/variants/filter_result/variant_carriers_result.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% load dict %} | ||
{% load variants_tags %} | ||
|
||
<div> | ||
<p> | ||
{% if small_var %} | ||
A total of {{ count_total }} carriers were found for variant <code>{{ small_var.human_readable }}</code>. | ||
{% if count_total == count_noaccess %} | ||
You do not have access to any of them, though. | ||
{% elif count_noaccess == 0 %} | ||
They are displayed below (you have access to all of them). | ||
{% else %} | ||
You do not have access to {{ count_noaccess }} but the remaining {{ count_access }} are displayed below. | ||
{% endif %} | ||
{% else %} | ||
ERROR: variant not found! | ||
{% endif %} | ||
</p> | ||
|
||
<table class="table-sm table-striped"> | ||
<thead> | ||
<tr> | ||
<th style="width: 20%;">case</th> | ||
<th style="width: 60%;">project</th> | ||
<th style="width: 20%;">genotype</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for case, var in case_vars %} | ||
{% for name, genotype in var.genotype.items %} | ||
{% is_alt genotype|keyvalue:"gt" as do_show %} | ||
{% if do_show %} | ||
<tr> | ||
<td> | ||
{% if forloop.first %} | ||
<a href="{% url 'variants:case-detail' case.project.sodar_uuid case.sodar_uuid %}"> | ||
{{ case.name }} | ||
</a> | ||
{% else %} | ||
<span class="text-muted">{{ case.name }}</span> | ||
{% endif %} | ||
</td> | ||
<td> | ||
{% if forloop.first %} | ||
<a href="{% url 'projectroles:detail' case.project.sodar_uuid %}"> | ||
{{ case.project.title }} | ||
</a> | ||
{% else %} | ||
<span class="text-muted">{{ case.project.title }}</span> | ||
{% endif %} | ||
</td> | ||
<td> | ||
<span class="small">{{ name|strip_sample_suffix }}</span> | ||
<strong>{{ genotype|keyvalue:"gt" }}</strong> | ||
</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters