-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3550 from solgenomics/topic/acronyms_display
adds trait acronyms legend in trial detail page
- Loading branch information
Showing
9 changed files
with
297 additions
and
194 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,70 @@ | ||
/** | ||
* trait acronyms loader | ||
* Isaak Y Tecle <[email protected]> | ||
* | ||
*/ | ||
|
||
|
||
var solGS = solGS || function solGS () {}; | ||
|
||
solGS.acronyms = { | ||
|
||
loadAcronyms: function() { | ||
var id; | ||
var page = document.URL; | ||
|
||
if (page.match(/breeders\/trial\//)) { | ||
id = jQuery('#trial_id').val(); | ||
} else { | ||
id = jQuery('#training_pop_id').val(); | ||
} | ||
|
||
var acros = jQuery.ajax({ | ||
type : 'POST', | ||
dataType: 'json', | ||
data : {'id': id}, | ||
url : '/solgs/load/trait/acronyms/', | ||
}); | ||
|
||
return acros; | ||
}, | ||
|
||
|
||
displayAcronyms: function(data) { | ||
|
||
var table = jQuery('#trait_acronyms_table').DataTable({ | ||
'searching' : false, | ||
'ordering' : false, | ||
'processing': true, | ||
'paging' : false, | ||
'info' : false, | ||
}); | ||
|
||
table.rows.add(data).draw(); | ||
|
||
} | ||
|
||
///////////// | ||
} | ||
//////////// | ||
|
||
|
||
jQuery(document).ready( function() { | ||
console.log('loading acronyms....') | ||
|
||
jQuery('#trait_acronyms_div').show(); | ||
|
||
solGS.acronyms.loadAcronyms().done( function(res) { | ||
solGS.acronyms.displayAcronyms(res.acronyms); | ||
}); | ||
|
||
solGS.acronyms.loadAcronyms().fail( function(res) { | ||
jQuery('#trait_acronyms_table').hide(); | ||
var errorMsg = 'Error occured loading acronyms'; | ||
jQuery('#acronyms_message') | ||
.html(errorMsg) | ||
.show() | ||
.fadeOut(50000); | ||
}); | ||
|
||
}); |
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
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
<%doc> | ||
|
||
=head1 NAME | ||
|
||
/solgs/population/acronym.mas -- displays a list of traits and their acronyms. | ||
|
||
=AUTHOR | ||
|
||
Isaak Y Tecle ([email protected]) | ||
|
||
=cut | ||
|
||
</%doc> | ||
|
||
<%args> | ||
|
||
$trial_id => undef; | ||
$training_pop_id => undef; | ||
|
||
</%args> | ||
|
||
<%perl> | ||
</%perl> | ||
|
||
|
||
<& /util/import_javascript.mas, classes => ["solGS.loadAcronyms", "jquery.dataTables"] &> | ||
|
||
<&| /page/info_section.mas, | ||
collapsible => 1, | ||
collapsed => 1, | ||
title => "Acronyms legend", | ||
&> | ||
|
||
|
||
<div id="trait_acronyms_div" style="display:none"> | ||
<div id="acronyms_message" class="message"></div> | ||
|
||
<table class="table" id="trait_acronyms_table" style="text-align: left;"> | ||
<thead> | ||
<tr> | ||
<th>Acronym</th> | ||
<th>Trait</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
|
||
<input type="hidden" id="trial_id" value="<% $trial_id %>" /> | ||
|
||
</div> | ||
|
||
|
||
|
||
</&> |