Merge pull request #4106 from solgenomics/topic/wishlist
[sgn.git] / mason / analyses / detail.mas
blob61a4fb7ad5f44fcd885a7427716f35d6ef3e5e35
2 <%doc>
4 =head1 NAME
6 /mason/analyses/detail.mas
8 =head1 DESCRIPTION
10 Displays a detail page for an analysis.
12 Requires the parameter analysis_id
14 =head1 AUTHOR
16 Lukas Mueller <lam87@cornell.edu>
18 =cut
20 </%doc>
22 <%args>
23 $analysis_id
24 $analysis_name
25 $analysis_description
26 $user_can_modify => undef
27 $breeding_program_name
28 $breeding_program_id
29 $year
30 $trial_stock_type
31 $trial_phenotype_stock_type
32 $identifier_prefix
33 $analysis_metadata
34 $has_col_and_row_numbers
35 </%args>
37 <& /util/import_javascript.mas, entries => ['analyses'], classes => [ 'jquery', 'jquery.dataTables', 'CXGN.Trial' ],  &>
39 <& /page/page_title.mas, title => "Analysis <span id=\"analyis_name_title\">$analysis_name</span>" &>
41 <& /page/detail_page_2_col_section.mas, info_section_collapsed => 0, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Analysis Details</h4>", info_section_subtitle => 'View basic information about the analysis.', buttons_html => '', icon_class => "glyphicon glyphicon-dashboard", info_section_id => "analysis_details", trial_name => $analysis_name, trial_description => $analysis_description, breeding_program_name => $breeding_program_name, breeding_program_id => $breeding_program_id, year => $year, identifier_prefix => $identifier_prefix, trial_stock_type => $trial_stock_type, analysis_metadata => $analysis_metadata &>
43 <& /page/detail_page_2_col_section.mas, info_section_collapsed => 1, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Model Details</h4>", info_section_subtitle => 'View basic information about the model.', buttons_html => '', icon_class => "glyphicon glyphicon-option-horizontal", info_section_id => "model_details", trial_name => $analysis_name, analysis_metadata => $analysis_metadata &>
45 <& /page/detail_page_2_col_section.mas, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Analysis Results</h4>", info_section_subtitle => 'View and download phenotype data.', buttons_html => "<button class='btn btn-sm btn-primary' style='margin:3px' id='trial_download_phenotypes_button'>Download Analysis Data</button>", icon_class => "glyphicon glyphicon-equalizer", info_section_id => "trial_detail_traits_assayed", trial_name => $analysis_name, trial_stock_type => $trial_phenotype_stock_type &>
47 % my $subtitle = 'View and edit the spatial layout of the experiment. Also view a heatmap for phenotyped traits.';
48 % my $layout_buttons = '';
49 % if ($has_col_and_row_numbers){
50 %     $layout_buttons = '<h3><span class="glyphicon glyphicon-ok-sign text-success"></span>&nbsp;&nbsp;&nbsp;This experiment has spatial layout info uploaded!</h3><button class="btn btn-primary" style="margin:3px" id="trial_fieldmap_download_layout_button">Download Spatial Layout</button> <button class="btn btn-danger" id="delete_field_map_hm_link" style="margin:3px">Delete Spatial Layout</button>';
51 % } else {
52 %    $layout_buttons = '<h3><span class="glyphicon glyphicon-remove-sign text-danger"></span>&nbsp;&nbsp;&nbsp;This experiment does not have spatial layout info!</h3><button class="btn btn-primary" style="margin:3px" id="heatmap_upload_trial_coords_link">Upload Spatial Layout</button>';
53 % }
55 <& /page/detail_page_2_col_section.mas, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Field Layout Tools and Phenotype Heatmap</h4>", info_section_subtitle => $subtitle, buttons_html => $layout_buttons, icon_class => "glyphicon glyphicon-th", info_section_id => "pheno_heatmap" &>
57 <& /page/detail_page_2_col_section.mas, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Analysis Tools</h4>", info_section_subtitle => 'Run analyses', icon_class => "glyphicon glyphicon-signal", info_section_id => "analysis_page_analysis_tools" &>
59 <& /page/detail_page_2_col_section.mas, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Upload Data Files</h4>", info_section_subtitle => 'Also upload any additional files for this analysis.', icon_class => "glyphicon glyphicon-cloud-upload", info_section_id => "trial_upload_files", trial_stock_type => $trial_stock_type, for_analysis_page => 1, data_level => 'analysis_instance' &>
61 <& /page/detail_page_2_col_section.mas, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Delete Experiment Data</h4>", info_section_subtitle => 'Delete phenotypes, layout, and/or the entire experiment from the database.', icon_class => "glyphicon glyphicon-trash", info_section_id => "trial_deletion_section" &>
63 % my $data_agreement_link = '<button class="btn btn-sm btn-primary" disabled style="margin:3px">Add/edit data agreement</button>';
64 % if ($user_can_modify) { $data_agreement_link = '<button class="btn btn-sm btn-primary" style="margin:3px" id="add_data_agreement">Add/edit data agreement</button>'; }
66 <& /page/detail_page_2_col_section.mas, trial_id => $analysis_id, info_section_title => "<h4 style='display:inline'>Data Agreement License</h4>", info_section_subtitle => 'View and edit the public data agreement on this experiment.', icon_class => "glyphicon glyphicon-inbox", info_section_id => "trial_data_agreement_section", buttons_html => $data_agreement_link &>
68 <& /breeders_toolbox/trial/download_phenotypes_dialog.mas, trial_ids => $analysis_id, dialog_name => $analysis_name, dialog_type => 'Analysis' &>
70 <& /breeders_toolbox/upload_phenotype_spreadsheet.mas &>
72 <& /breeders_toolbox/trial/create_spreadsheet_dialog.mas, trial_id => $analysis_id, trial_name => $analysis_name, trial_stock_type => $trial_stock_type &>
73 <& /breeders_toolbox/trial/set_phenotypes_fully_uploaded.mas, trial_id => $analysis_id &>
75 <& /breeders_toolbox/add_data_agreement_dialogs.mas, trial_id => $analysis_id &>
77 <div id="trialIDDiv" class="trialIDDivClass" style="display:none;">
78 % print $analysis_id;
79 </div>
81 <script>
82 jQuery(document).ready(function(){
84     trial_detail_page_setup_dialogs();
86     //jQuery.ajax({
87     //    type: 'GET',
88     //    url : '/ajax/analysis/<% $analysis_id %>/retrieve',
89     //    beforeSend: function() {
90     //        jQuery('#working_modal').modal('show');
91     //    },
92     //    success: function(response){
93     //        jQuery('#working_modal').modal('hide');
94     //        console.log(response);
95     //        if (response.error) {
96     //            alert(response.error);
97     //        }
98     //    },
99     //    error: function(response){
100     //        jQuery('#working_modal').modal('hide');
101     //        alert('Error getting analysis details!');
102     //    }
103     //});
106 </script>