Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / breeders_toolbox / upload_nirs_spreadsheet.mas
blob71206d674c41e5994ec22831d2eec726ed7d438f
2 <%args>
3 </%args>
5 <& /util/import_javascript.mas, classes => [ 'jquery', 'jqueryui', 'jquery.iframe-post-form', 'CXGN.BreedersToolbox.UploadPhenotype', 'CXGN.BreederSearch', 'CXGN.Trial' ] &>
7 <div class="modal fade" id="upload_phenotype_spreadsheet_dialog" name="upload_phenotype_spreadsheet_dialog" tabindex="-1" role="dialog" aria-labelledby="addSpreadsheetNIRSDialog">
8   <div class="modal-dialog" role="document">
9     <div class="modal-content">
10       <div class="modal-header">
11         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
12         <h4 class="modal-title" id="addSpreadsheetNIRSDialog">Upload NIRS Spreadsheet</h4>
13       </div>
14       <div class="modal-body">
15         <div class="container-fluid">
17             <&| /page/explanation.mas, title=>'Template Information' &>
18                 <p>
19                 <b>File format information</b>
20                 <br>
21                 <a id="phenotype_upload_spreadsheet_format_info">Spreadsheet Format</a>
22                 </p>
23             </&>
25             <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_spreadsheet_phenotype_file_form" name="upload_spreadsheet_phenotype_file_form">
26                 <div class="form-group">
27                     <label class="col-sm-3 control-label">Spreadsheet Format: </label>
28                     <div class="col-sm-9" >
29                         <select class="form-control" id="upload_spreadsheet_phenotype_file_format" name="upload_spreadsheet_phenotype_file_format">
30                             <option value="nirs">Simple NIRS</option>
31                             <option value="scio">SCiO NIRS</option>
32                         </select>
33                     </div>
34                 </div>
35                 <div class="form-group">
36                     <label class="col-sm-3 control-label">Timestamps Included: </label>
37                     <div class="col-sm-9" >
38                         <input type="checkbox" id="upload_spreadsheet_phenotype_timestamp_checkbox" name="upload_spreadsheet_phenotype_timestamp_checkbox" />
39                     </div>
40                 </div>
41                 <div id="upload_spreadsheet_phenotype_data_level_div">
42                     <div class="form-group">
43                         <label class="col-sm-3 control-label">Data Level: </label>
44                         <div class="col-sm-9" >
45                             <select class="form-control" id="upload_spreadsheet_phenotype_data_level" name="upload_spreadsheet_phenotype_data_level">
46                                 <option value="plots">Plots</option>
47                                 <option value="plants">Plants</option>
48                                 <option value="subplots">Subplots</option>
49                                 <option value="tissue_samples">Tissue Samples</option>
50                             </select>
51                         </div>
52                     </div>
53                 </div>
54                 <div class="form-group">
55                     <label class="col-sm-3 control-label">NIRS Spreadsheet: </label>
56                     <div class="col-sm-9" >
57                         <input type="file" id="upload_spreadsheet_phenotype_file_input" name="upload_spreadsheet_phenotype_file_input" encoding="multipart/form-data" />
58                     </div>
59                 </div>
62                 <div id="upload_phenotype_spreadsheet_verify_status"></div>
63                 </div>
64             </form><br/>
66         </div>
68         <div class="modal-footer">
69             <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
70             <button type="button" class="btn btn-info" name="upload_spreadsheet_phenotype_submit_verify" id="upload_spreadsheet_phenotype_submit_verify">Verify</button>
71             <button disabled type="button" class="btn btn-primary" name="upload_spreadsheet_phenotype_submit_store" id="upload_spreadsheet_phenotype_submit_store" title="First Verify Your File">Store</button>
72         </div>
74     </div>
75   </div>
76 </div>
78 <div class="modal fade" id="phenotype_upload_spreadsheet_info_dialog" name="phenotype_upload_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="phenotypeUploadInfoDialog">
79   <div class="modal-dialog" role="document">
80     <div class="modal-content">
81       <div class="modal-header">
82         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
83         <h4 class="modal-title" id="phenotypeUploadInfoDialog">Template Information</h4>
84       </div>
85       <div class="modal-body">
86         <div class="container-fluid">
88             <h4>NIRS spreadsheet must be uploaded in .xls excel file format</h4>
89             <p>(tab-delimited text formats are NOT supported)</p>
91             <hr>
92             <button class="btn btn-primary" name="create_spreadsheet_link">Create Phenotyping Spreadsheet for Trial</button>
93             <hr>
95             <h4>Required Data:</h4>
96             <ul>
97                 <li>Please click the above button to generate the required phenotype spreadsheet</li>
98             </ul>
100             <h4>Notes:</h4>
101             <ul>
102                 <li>For <i>"sprouting proportion"</i>, <i>"trait name|trait id"</i><br> should be written as <i>"sprouting proportion|CO_334:0000008"</i>.</li>
103                 <li>If spreadsheet file was not generated from the database, </br>consult the <i>Trait Ontology</i> to ensure you have the correct trait id.</li>
104                 <li>Two or more traits can be uploaded at the same time.</li>
105             </ul>
107             <h4>Simple and Detailed Spreadsheet Format:</h4>
108             <ul>
109                 <li>The "Simple" format requires only a column called 'observationunit_name' followed by your trait columns.</li>
110                 <li>The "Detailed" format includes a special header as well as additional columns for design information.</li>
111                 <li>The "NIRS" format is built on top of the simple format - a column called 'observationunit_name' followed by trait columns derived from the NIR spectra, followed by columns of NIR spectra data themselves. Trait column names must come form the trait ontology but NIR spectra column names should simply be copied from whateve standard output file the NIR device produces.
113             <h4>Timestamps:</h4>
114             <ul>
115                 <li>To include timestamp information for your measurements, click the checkbox "Includes Timestamps".</li>
116                 <li>For timestamps, values should be recorded as <i>"Value,Timestamp"</i>.<br/>For no timestamps, values should be recorded as <i>"Value"</i>.</li>
117                 <li>Timestamp format must be YYYY-MM-DD HH:MM:SS-0000 or YYYY-MM-DD HH:MM:SS+0000</li><br/>
118                 <li>Example with timestamps: <br/><br/>
119                 <table class="table table-hover table-bordered">
120                     <thead>
121                         <tr>
122                             <th>sprouting proportion|CO_334:0000008</th>
123                         </tr>
124                     </thead>
125                     <tbody>
126                         <tr>
127                             <td>20,2016-04-28 16:30:40-0500</td>
128                         </tr>
129                     </tbody>
130                 </table>
131                 </li>
132                 <li>Example without timestamps: <br/><br/>
133                 <table class="table table-hover table-bordered">
134                     <thead>
135                         <tr>
136                             <th>sprouting proportion|CO_334:0000008</th>
137                         </tr>
138                     </thead>
139                     <tbody>
140                         <tr>
141                             <td>20</td>
142                         </tr>
143                     </tbody>
144                 </table>
145                 </li>
146             </ul>
148         </div>
149       </div>
150       <div class="modal-footer">
151         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
152       </div>
153     </div>
154   </div>
155 </div>
158 <script defer="defer">
160 jQuery(document).ready(function() {
162     jQuery('#upload_spreadsheet_phenotypes_link').click( function() {
163         jQuery('#upload_phenotype_spreadsheet_dialog').modal("show");
164     });
166     jQuery("#phenotype_upload_spreadsheet_format_info").click( function () {
167         jQuery("#phenotype_upload_spreadsheet_info_dialog" ).modal("show");
168     });
172 </script>