phenotype download will print 0 values, while leaving empty values empty
[sgn.git] / mason / breeders_toolbox / trial_jbrowse_instance.mas
blobaa4f6fb31ea7092c79e368412d151e29cd807c89
1 <%args>
2 $trial_id
3 </%args>
5 <p id="trial_jbrowse_check">[loading...]</p>
7 <%perl>
9 my $project_name = lc($c->config->{project_name});
10 my $test_url = "/jbrowse_$project_name/current/data/json/trials/" . $trial_id . "/trackList.json";
11 my $jbrowse_url = "/jbrowse/?data=data%2Fjson%2Ftrials%2F" . $trial_id ."&tracks=DNA%2CGene%20exons%2C&cat=Diversity/NEXTGEN/Imputed&highlight=";
13 </%perl>
15 <script type="text/javascript" defer="defer">
16 jQuery(document).ready(function () {
17         prepareJbrowse();
19 function prepareJbrowse () { //ajax function to test for existence of given jbrowse trial url
20   jQuery.ajax({
21     type: 'GET',
22     url: "<% $test_url %>",
23     statusCode: {
24         200: function () {  // if page is found, create and display link
25                 jQuery('#trial_jbrowse_check').replaceWith('<a id="jbrowse_link" href="<% $jbrowse_url %>">View the vcf tracks for this trial in JBrowse</a>');
26                 },
27         404: function () { // if page not found, display message that jbrowse instance wasn't found
28                 jQuery('#trial_jbrowse_check').html(" <i>No Jbrowse instance found for this trial</i>.");
29                 }
30         }
31   });
33 });
34 </script>