Merge pull request #5205 from solgenomics/topic/generic_trial_upload
[sgn.git] / mason / solgs / population / traits_list.mas
blob0e66db8d10d570130b59130765aec268626919dc
1 <%doc>
3 =head1 NAME
5 /solgs/population/traits_list.mas - displays training population traits available for GS modeling
7 =AUTHOR
9 Isaak Y Tecle (iyt2@cornell.edu)
11 =cut
13 </%doc>
15 <%args>
18 $training_pop_id
19 $training_pop_traits_details
20 $genotyping_protocol_id
21 $data_set_type => ''
24 </%args>
26 <%perl>
27 my $traits_list;
29 foreach my $trait_detail (@$training_pop_traits_details)
31     my $id = $trait_detail->[0];
32     my $trait = $trait_detail->[1];
33     my $acronym = $trait_detail->[2];
34     my $path;
35     if ($data_set_type =~ /combined/) {
36         $path = "/solgs/model/combined/trials/$training_pop_id/trait/$id/gp/$genotyping_protocol_id";
37     } else {
38         $path = "/solgs/trait/$id/population/$training_pop_id/gp/$genotyping_protocol_id";
39     }
41      my $trait_link   = qq | <a href="$path" onclick="solGS.waitPage(this.href); return false;">$trait</a> |;
42      my $row          = <<ROW;
43      <tr>
44        <td>
45          <input type  = "checkbox"
46            class      = "trait_id"
47            name       = "trait_id"
48            value      = $id > $trait_link
49        </td>
50      </tr>
51 ROW
53         $traits_list .=  $row;
57 </%perl>
59 % if ($traits_list) {
60  <div id="traits_selection_div">
62   <table  class="table-condensed" id="population_traits_list">
63    <% $traits_list %>
64      <tr>
65        <td>
66          <input class   = "button"
67                 type    = "submit"
68                         id      = "runGS"
69                 value   = "Build model"
70                 name    = "runGS"
71                 >
72        </td>
73      </tr>
74    </table>
76 </div>
77 %} else {
79 <div id="traits_list_message"  class="message">
80 <p>There are no phenotyped traits for this population.</p>
81 </div>