treatment detail page
[sgn.git] / mason / breeders_toolbox / treatment.mas
blobf335da65ea97d71c7849091248d72e69aa1f2d21
2 <%doc>
4 =head1 NAME
6 /breeders_toolbox/treatment.mas - a mason component to display a treatment detail page
8 =head1 AUTHOR
11 =cut
13 </%doc>
15 <%args>
16 $trial_id
17 $trial_name
18 $breeding_program_id
19 $breeding_program_name
20 $location_id
21 $location_name
22 $year => undef
23 $trial_type => undef
24 $planting_date => undef
25 $harvest_date => undef
26 $trial_description => undef
27 $user_can_modify => undef
28 $has_plant_entries => undef
29 $has_subplot_entries => undef
30 $hidap_enabled => undef
31 $folder_name => undef
32 $folder_id => undef
33 $plants_per_plot => undef
34 $has_expression_atlas => undef
35 $expression_atlas_url => undef
36 $site_project_name => undef
37 $trial_phenotype_files => undef
38 $sgn_session_id => undef
39 $user_name => undef
40 $design_name => undef
41 $phenotypes_fully_uploaded => undef
42 $identifier_prefix => 'SGN'
43 </%args>
45 <style>
47 @media (min-width: 1200px) {
48     .affix {
49         top:100px;
50         right:0;
51         position:fixed;
52     }
55 </style>
57 <& /util/import_javascript.mas, classes => [ 'jquery.iframe-post-form', 'CXGN.Trial' , 'jstree/dist/jstree', 'CXGN.BreedersToolbox.HTMLSelect', 'moment_min', 'daterangepicker' ] &>
59 <%perl>
60   use Data::Dumper;
61 my $start_time = time();
63 #print STDERR "Check 7 (mason) : ".(time() - $start_time)."\n";
65 </%perl>
67 <br/>
70 <& /page/page_title.mas, title=>"Treatment detail for ".$trial_name &>
72 <&| /page/info_section.mas, title=>"Trial details",  collapsible => 1 &>
75 <div class="panel panel-default">
76 <table class="table table-hover" >
78 <tr>
79 <td><b>Treatment Name</b></td>
80 <td>
81 <div id="trial_name">
82 % if ($trial_name) {
83 %   print "$trial_name";
84 % } else {
85 %   print "[No Trial Name]";
86 % }
87 </div>
88 </td>
89 </tr>
91 </table>
92 </div>
95 </&>
98 <!--<style>
99   div.left {
100     float: left;
101     clear: both;
102   }
103 .ui-autocomplete {
104   max-height: 100px;
105   overflow-y: auto;
106   /* prevent horizontal scrollbar */
107   overflow-x: hidden;
110 </style> -->
112 <&| /page/info_section.mas, id => "trial_design_section", title=>"Design", collapsible=>1, collapsed=>0 &>
114 <div class="well well-sm">
116 <&| /page/info_section.mas, id => "trial_accessions", title=>"Accessions", is_subsection => 1, collapsible=>1, collapsed=>1 &>
118 <& /breeders_toolbox/trial/trial_accessions.mas, trial_id => $trial_id &>
120 </&>
122 <&| /page/info_section.mas, id => "trial_controls", title=>"Controls",  is_subsection => 1, collapsible=>1, collapsed=>1 &>
124 <& /breeders_toolbox/trial/trial_controls.mas, trial_id => $trial_id &>
126 </&>
128 <&| /page/info_section.mas, id => "trial_plots", title=>"Plots",  is_subsection => 1, collapsible=>1, collapsed=>1 &>
130 <& /breeders_toolbox/trial/trial_plots.mas, trial_id => $trial_id &>
132 </&>
134 % if ($has_subplot_entries) {
136 <&| /page/info_section.mas, id => "trial_subplots", title=>"Subplots",  is_subsection => 1, collapsible=>1, collapsed=>1 &>
138 <& /breeders_toolbox/trial/trial_subplots.mas, trial_id => $trial_id &>
140 </&>
142 % }
144 % if ($has_plant_entries) {
146 <&| /page/info_section.mas, id => "trial_plants", title=>"Plant Entries", is_subsection => 1, collapsible=> 1, collapsed=>1 &>
148 <& /breeders_toolbox/trial/trial_plants.mas, trial_id => $trial_id &>
150 </&>
152 % }
154 </div><!-- closes well -->
156 </&>
158 <& /breeders_toolbox/trial/download_phenotypes_dialog.mas, trial_ids => $trial_id, dialog_name => $trial_name, dialog_type => 'Trial' &>
161 <&| /page/info_section.mas, id=> "trial_detail_traits_assayed", title => "Traits assayed", collapsible=>1, collapsed=>1, hide_if_empty=>1, subtitle=>"[<a id='trial_download_phenotypes_button'>Download Phenotype Data</a>]" &>
163 <& /breeders_toolbox/trial/phenotype_summary.mas, trial_id => $trial_id &>
165 </&>
168 <&| /page/info_section.mas, title=>"Files", collapsible=>1, collapsed=>0 &>
170 <div class="well well-sm">
172   <&| /page/info_section.mas, title=>"Uploaded Phenotyping Files", is_subsection => 1, collapsible=>1, collapsed=>0 &>
174   <table class="table table-bordered files_datatables" alt="">
175   <thead>
176     <tr><th>Filename</th><th>Date Uploaded</th><th>Uploaded By</th><th>File Type</th><th>Options</th></tr>
177   </thead>
178   <tbody>
179 % foreach my $f (@$trial_phenotype_files) {
180     <tr>
181       <td><% $f->[4] %></td>
182       <td><% $f->[1] %></td>
183       <td><a href="/solpeople/profile/<% $f->[2] %>"><% $f->[3] %></a></td>
184       <td><% $f->[6] %></td>
185       <td><a href="/breeders/phenotyping/view/<% $f->[0] %>">View</a> | <a href="/breeders/phenotyping/download/<% $f->[0] %>">Download</a></td>
186     </tr>
187 % }
188   </tbody>
189   </table>
191   </&><!-- closes uploaded file section -->
193 </div><!-- closes well -->
195 </&><!-- closes entire phenotyping file section -->
197 % my $data_agreement_link = "Add/edit data agreement";
198 % if ($user_can_modify) { $data_agreement_link = '[<a id="add_data_agreement">Add/edit data agreement</a>]'; }
199 <&| /page/info_section.mas, title=>"Data Agreement", is_subsection => 0, collapsible=>1, collapsed=>0,  subtitle=> $data_agreement_link  &>
201 <& /breeders_toolbox/data_agreement.mas, trial_id => $trial_id &>
203 </&>
206 <div id="trialIDDiv" class="trialIDDivClass" style="display:none;">
207 % print $trial_id;
208 </div>
210 <script defer="defer">
212 jQuery(document).ready(function () {
214   trial_detail_page_setup_dialogs();
218 </script>