aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2023-01-20 22:03:36 +0000
committerzsloan2023-02-28 14:18:09 -0600
commit1fcc582569177996bad4ddb7e4da24326244f0c2 (patch)
treefab4cbec5d1109b3fe8d2634a7eb400e42275c86
parentc7ba9ebee7708be9c6761bf77bd6c1ce48e45319 (diff)
downloadgenenetwork2-1fcc582569177996bad4ddb7e4da24326244f0c2.tar.gz
Add JS for caching mapping inputs + displaying the link
-rw-r--r--wqflask/wqflask/templates/mapping_results.html20
1 files changed, 19 insertions, 1 deletions
diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html
index 1695abc9..e7bcfc64 100644
--- a/wqflask/wqflask/templates/mapping_results.html
+++ b/wqflask/wqflask/templates/mapping_results.html
@@ -18,6 +18,7 @@
{% if temp_trait is defined %}
<input type="hidden" name="temp_trait" value="{{ temp_trait }}">
{% endif %}
+ <input type="hidden" name="inputs_hash" value="{{ hash_of_inputs }}">
<input type="hidden" name="group" value="{{ dataset.group.name }}">
<input type="hidden" name="species" value="{{ dataset.group.species }}">
<input type="hidden" name="trait_id" value="{{ this_trait.name }}">
@@ -82,7 +83,9 @@
<br>
<a class="export_mapping_results" href="#" target="_blank" >Download Full Results</a>
<br><br>
- <button type="button" class="btn btn-default share-results" style="padding-bottom: 2px; padding-top: 2px;"><span class="glyphicon glyphicon-link"></span> Copy Results Link</button>
+ <button type="button" class="btn btn-default share-results" style="padding-bottom: 2px; padding-top: 2px;"><span class="glyphicon glyphicon-link"></span> Generate Link</button>
+ <br>
+ <input type="text" name="mappingLink" style="display:none;" size="75"></input>
</div>
<div id="gn1_map_options" class="col-xs-6" style="outline: 3px double #AAAAAA; padding: 10px; margin: 10px;">
<div class="col-xs-8" style="padding: 0px;">
@@ -668,6 +671,21 @@
$('#gn1_map_tab').click(function() {
$('#gn1_map_options').css("display", "block")
})
+
+ $('.share-results').click(function() {
+ hash = $('input[name=inputs_hash]').val()
+ $.ajax({
+ method: "POST",
+ url: "/cache_mapping_inputs",
+ data: {
+ inputs_hash: hash
+ },
+ success: function() {
+ $('input[name=mappingLink]').val(window.location.origin + "/run_mapping?hash=" + hash).show();
+ }
+ });
+ })
+
</script>
{% endblock %}