Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / breeders_toolbox / upload_crosses_confirm_spreadsheet.mas
blobaefce696cf387558d209955ff4cf7256fefd45f9
1 <%args>
2 $number_of_crosses_added => undef
3 $number_of_unique_parents => undef
4 $upload_data_ref => undef
5 </%args>
7 <& /util/import_javascript.mas, classes => [ 'jquery', 'jqueryui' ] &>
11 <article>
12   <header>
13     <h1>Upload cross file verification</h1>
14   </header>
15 </article>
16 <a id="return_to_home"  href="/breeders/home" >Return to breeders tools</button>
20 <div id="verify_uploaded_data_dialog"  class="ui-widget" >
21 <%perl>
22 print "<br><b>Number of crosses added:</b> $number_of_crosses_added<br>";
23 print "<b>Number of unique parents in added crosses</b>: $number_of_unique_parents<br><br>";
24 </%perl>
25 <button id="view_uploaded_data_link" >View uploaded data</button>
26 </div>
28 <div id="display_uploaded_data_dialog"  class="ui-widget" >
29 <table border ="1">
30 <%perl>
31 my %upload_data = %{$upload_data_ref};
32 print "<tr><th>cross_unique_id</th><th>maternal_parent</th><th>paternal_parent</th><th>trial</th><th>location</th><th>number_of_progeny</th><th>prefix</th><th>suffix</th><th>number_of_flowers</th><th>number_of_seeds</th></tr>";
33 foreach my $key (sort { $a <=> $b} keys %upload_data) {
34   my %cross = %{$upload_data{$key}};
35   print "<tr><td>".$cross{'cross_unique_id'}."</td><td>".$cross{'maternal_parent'}."</td><td>".$cross{'paternal_parent'}."</td><td>".$cross{'cross_trial'}."</td><td>".$cross{'cross_location'}."</td>";
36   if ($cross{'number_of_progeny'}) {
37     print "<td>".$cross{'number_of_progeny'}."</td>";
38   }
39   else {
40     print "<td></td>";
41   }
42   if ($cross{'prefix'}) {
43     print "<td>".$cross{'prefix'}."</td>";
44   }
45   else {
46     print "<td></td>";
47   }
48   if ($cross{'suffix'}) {
49     print "<td>".$cross{'suffix'}."</td>";
50   }
51   else {
52     print "<td></td>";
53   }
54   if ($cross{'number_of_flowers'}) {
55     print "<td>".$cross{'number_of_flowers'}."</td>";
56   }
57   else {
58     print "<td></td>";
59   }
60   if ($cross{'number_of_seeds'}) {
61     print "<td>".$cross{'number_of_seeds'}."</td>";
62   }
63   else {
64     print "<td></td>";
65   }
66   print "</tr>";
68 </%perl>
69 </table>
70 </div>
73 <script defer="defer">
75    jQuery("#verify_uploaded_data_dialog").dialog( {
76       autoOpen: true,
77       buttons: { "Close" :  function() { jQuery("#verify_uploaded_data_dialog").dialog("close"); }},
78       modal: true,
79       width: 600,
80       height: 250
81     });
83     jQuery("#view_uploaded_data_link").click( function () {
84       autoOpen: false,
85      jQuery("#display_uploaded_data_dialog" ).dialog("open");
86     })
88    jQuery("#display_uploaded_data_dialog").dialog( {
89       autoOpen: false,
90       buttons: { "OK" :  function() { jQuery("#display_uploaded_data_dialog").dialog("close"); },},
91       modal: true,
92       width: 1000,
93       height: 300
94     });
96     function submit_cross_upload() {
97     }
99 </script>
101 <%perl>
102 if ($number_of_crosses_added) {
103   print '<object id="view_uploaded_data_link"></object>';
105 </%perl>