refactor phenotypes brapi calls
[sgn.git] / mason / breeders_toolbox / upload_crosses_dialogs.mas
blob4182400ba4131d0be3c297429868f6b17f630f27
1 <%args>
2 $locations
3 </%args>
5 <div class="modal fade" id="upload_crosses_dialog" name="upload_crosses_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadCrossesDialog">
6     <div class="modal-dialog modal-xl" role="document">
7         <div class="modal-content">
8             <div class="modal-header">
9                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
10                 <h4 class="modal-title" id="uploadCrossesDialog">Upload Crosses</h4>
11             </div>
12             <div class="modal-body">
13                 <div class="container-fluid">
15                     <&| /util/workflow.mas, id=> "crosses_upload_workflow" &>
16                         <&| /util/workflow.mas:step, title=> "Intro" &>
17                             <& /page/page_title.mas, title=>"What are crosses?" &>
18                             <ul>
19                                 <li>Crosses represent any pollination that occurs.</li>
20                                 <li>Crosses can be of different types (biparental, self, open, bulk, bulk_self, bulk_open, or doubled_haploid)</li>
21                                 <li>Depending on the cross type, an individual cross can be defined as between two accessions (e.g. accession A is the female and accession B is the male in a biparental cross)</li>
22                                 <li>For an open pollinated cross, the cross can be defined as between female accession A and male population P1 (populations in the database are only defined as groups of accessions)</li>
23                                 <li>An individual cross can be linked to the specific female plot or plant, as well as the specific male plot or plant.</li>
24                                 <li>A cross can have a number of properties associated to it, such as number of flowers, pollination date, etc.</li>
25                                 <li>A cross can produce seed, which goes into a seedlot.</li>
26                                 <li>A cross can ultimately produce progeny, which then become named accessions in the database.</li>
27                             </ul>
29                             <br/><br/>
30                             <center>
31                                 <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
32                             </center>
33                         </&>
35                         <&| /util/workflow.mas:step, title=> "Crossing experiment" &>
36                             <& /page/page_title.mas, title=>"Select a crossing experiment" &>
38                             <p>Crossing experiments are for grouping crosses together. The grouping is most often done for crosses derived from the same field trial, the same year, or for crosses that have the same breeding objective.</p>
39                             <hr>
40                             <div class="form-group">
41                                 <label class="col-sm-2 control-label">You can check your crossing experiment here: </label>
42                                 <div class="col-sm-10">
43                                     <div id="upload_crosses_select_crossingtrial_1" name="upload_crosses_select_crossingtrial_1" >
44                                     </div>
45                                 </div>
46                             </div><br/><br/>
47                             <hr>
48                             <center>
49                                 <button class="btn btn-info" name="create_crossingtrial_link">If you need to create a new crossing experiment, click here</button><br/><br/>
50                                 <button class="btn btn-primary" onclick="Workflow.complete(this);">If you already have a crossing experiment, go to Next Step</button>
51                             </center>
53                         </&>
54                         <&| /util/workflow.mas:step, title=> "Upload your crosses" &>
55                             <& /page/page_title.mas, title=>"Enter basic information about the crosses and upload your file" &>
57                             <br/>
58                                 <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_crosses_form" name="upload_crosses_form">
59                                 <div class="form-group">
60                                     <label class="col-sm-2 control-label">Crossing Experiment: </label>
61                                     <div class="col-sm-10">
62                                         <div id="upload_crosses_select_crossingtrial_2" name="upload_crosses_select_crossingtrial_2" >
63                                         </div>
64                                     </div>
65                                 </div>
66                                 <!--
67                                 <div class="form-group">
68                                     <label class="col-sm-2 control-label">Location of Crosses: </label>
69                                     <div class="col-sm-10">
70                                         <select class="form-control" id="cross_upload_location" name="cross_upload_location">
71                                             <option value="">Select Location</option>
72 <%perl>
73     # foreach my $location (@locations) {
74     #     print "<option value=".'"'.@$location[1].'"'.">".@$location[1]."</option>";
75     # }
76     foreach my $location_hashref (@$locations) {
77         my $properties = exists($location_hashref->{'properties'}) ? $location_hashref->{properties} : "";
78         my $program = $properties->{'Program'};
79         my $name = $properties->{'Name'};
80         print "<option value=\"$name\" data-program=\"$program\">".$name."</option>";
81     }
82 </%perl>
83                                         </select>
84                                     </div>
85                                 </div>
86                                 -->
87                                 <div class="form-group">
88                                     <label class="col-sm-2 control-label">File Format: </label>
89                                     <div class="col-sm-9">
90                                         <select class="form-control" id="cross_file_format_option">
91                                             <option value="">Select a file format that you want to upload</option>
92                                             <option value="xls_cross_accession">Excel (.xls) file with only accession names for parents</option>
93                                             <option value="xls_cross_plot">Excel (.xls) file with accession and plot names for parents</option>
94                                             <option value="xls_cross_plant">Excel (.xls) file with accession and plant names for parents</option>
95                                         </select>
96                                     </div>
97                                 </div>
98                                 <div id="xls_cross_accession_section" style="display:none">
99                                     <h3>You want to upload crosses in an Excel file with accession names for parents</h3>
100                                     <div class="well well-sm">
101                                         <div class="row">
102                                             <div class="col-sm-4">
103                                                 <&| /page/explanation.mas, title=>'Template information' &>
104                                                     <p>
105                                                         <b>File format information</b>
106                                                         <br>
107                                                         <a id="cross_accession_info_format">Spreadsheet format</a>
108                                                     </p>
109                                                 </&>
110                                             </div>
111                                             <div class="col-sm-8">
112                                                 <br/>
113                                                 <div class="panel panel-default">
114                                                     <div class="panel-body">
115                                                         <div class="form-group">
116                                                             <label class="col-sm-6 control-label">Select an XLS File: </label>
117                                                             <div class="col-sm-6">
118                                                                 <input type="file" name="xls_crosses_simple_file" id="xls_crosses_simple_file" encoding="multipart/form-data" />
119                                                             </div>
120                                                         </div>
121                                                     </div>
122                                                 </div>
123                                             </div>
124                                         </div>
125                                     </div>
126                                 </div>
127                                 <div id="xls_cross_plot_section" style="display:none">
128                                     <h3>You want to upload crosses in an Excel file with accession and plot names for parents</h3>
129                                     <div class="well well-sm">
130                                         <div class="row">
131                                             <div class="col-sm-4">
132                                                 <&| /page/explanation.mas, title=>'Template information' &>
133                                                     <p>
134                                                         <b>File format information</b>
135                                                         <br>
136                                                         <a id="cross_plot_info_format">Spreadsheet format</a>
137                                                     </p>
138                                                 </&>
139                                             </div>
140                                             <div class="col-sm-8">
141                                                 <br/>
142                                                 <div class="panel panel-default">
143                                                     <div class="panel-body">
144                                                         <div class="form-group">
145                                                             <label class="col-sm-6 control-label">Select an XLS File: </label>
146                                                             <div class="col-sm-6">
147                                                                 <input type="file" name="xls_crosses_plots_file" id="xls_crosses_plots_file" encoding="multipart/form-data" />
148                                                             </div>
149                                                         </div>
150                                                     </div>
151                                                 </div>
152                                             </div>
153                                         </div>
154                                     </div>
155                                 </div>
156                                 <div id="xls_cross_plant_section" style="display:none">
157                                     <h3>You want to upload crosses in an Excel file with accession and plant names for parents</h3>
158                                     <div class="well well-sm">
159                                         <div class="row">
160                                             <div class="col-sm-4">
161                                                 <&| /page/explanation.mas, title=>'Template information' &>
162                                                     <p>
163                                                         <b>File format information</b>
164                                                         <br>
165                                                         <a id="cross_plant_info_format">Spreadsheet format</a>
166                                                     </p>
167                                                 </&>
168                                             </div>
169                                             <div class="col-sm-8">
170                                                 <br/>
171                                                 <div class="panel panel-default">
172                                                     <div class="panel-body">
173                                                         <div class="form-group">
174                                                             <label class="col-sm-6 control-label">Select an XLS File: </label>
175                                                             <div class="col-sm-6">
176                                                                 <input type="file" name="xls_crosses_plants_file" id="xls_crosses_plants_file" encoding="multipart/form-data" />
177                                                             </div>
178                                                         </div>
179                                                     </div>
180                                                 </div>
181                                             </div>
182                                         </div>
183                                     </div>
184                                 </div>
186                                 <!--
187                                 <hr>
188                                 <h3>Additional options:</h3>
190                                 <p>Progeny naming: <i>If generating progeny, use cross name and:</i></p>
191                                 <div class="form-group">
192                                     <label class="col-sm-2 control-label">Prefix: </label>
193                                     <div class="col-sm-10">
194                                         <input class="form-control" id="upload_prefix" name="upload_prefix" value="P" />
195                                     </div>
196                                 </div>
197                                 <div class="form-group">
198                                     <label class="col-sm-2 control-label">Suffix: </label>
199                                     <div class="col-sm-10">
200                                         <input class="form-control" id="upload_suffix" name="upload_suffix" />
201                                     </div>
202                                 </div>
203                                 -->
204                             </form>
206                             <center>
207                                 <button type="button" onclick="Workflow.complete(this, false);" class="btn btn-primary" name="upload_crosses_submit" id="upload_crosses_submit">Upload File</button>
208                             </center>
210                         </&>
211                         <&| /util/workflow.mas:complete, title=> "Complete" &>
212                             <& /page/page_title.mas, title=>"Finished! Your crosses are now in the database" &>
213                             <p>
214                                 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
215                                 The crosses file was uploaded successfully
216                             </p>
218                             <ul>
219                                 <li>You may want to proceed to the cross detail page(s) for the cross(es) you just created.</li>
220                                 <li>You can print barcodes for the crosses.</li>
221                                 <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
222                             </ul>
223                             <br/>
224                             <center>
225                             <button class="btn btn-primary" name="upload_crosses_success_complete_button">The crosses were saved to the database with no errors! Congrats Click Here</button><br/><br/>
226                             </center>
227                         </&>
229                     </&><!-- End of workflow -->
231                 </div>
232             </div>
233             <div class="modal-footer">
234                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
235             </div>
236         </div>
237     </div>
238 </div>
240 <div class="modal fade" id="upload_cross_error_display" name="upload_cross_error_display" tabindex="-1" role="dialog" aria-labelledby="uploadCrossesErrorDialog">
241   <div class="modal-dialog modal-lg" role="document">
242     <div class="modal-content">
243       <div class="modal-header">
244         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
245         <h4 class="modal-title" id="uploadCrossesErrorDialog">Upload Crosses File Error</h4>
246       </div>
247       <div class="modal-body">
248         <div class="container-fluid">
249           <table>
250           <tbody></tbody>
251           </table>
252         </div>
253       </div>
254       <div class="modal-footer">
255         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
256       </div>
257     </div>
258   </div>
259 </div>
261 % my $cross_properties = $c->config->{cross_properties};
262 % my @column_header = split ',',$cross_properties;
264 <div class="modal fade" id="cross_accession_info_dialog" name="cross_accession_info_dialog" tabindex="-1" role="dialog" aria-labelledby="crossAccessionInfoDialog">
265     <div class="modal-dialog modal-xl" role="document">
266         <div class="modal-content">
267             <div class="modal-header">
268                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
269                 <h4 class="modal-title" id="crossAccessionInfoDialog">Template Information</h4>
270             </div>
271             <div class="modal-body">
272                 <div class="container-fluid">
274                     <b>Crosses may be uploaded in an Excel file (.xls)</b>
275                     <br>
276                     (.xlsx format not supported)
278                     <br><br>
279                     <b>Header:</b>
280                     <br>
282                     The first row (header) must contain the following:
283                     <br>
285                     <table class="table table-bordered table-hover">
286                         <tbody>
287                             <tr>
288                                 <td>cross_unique_id</td>
289                                 <td>cross_combination</td>
290                                 <td>cross_type</td>
291                                 <td>female_parent</td>
292                                 <td>male_parent</td>
293 % foreach my $column_header(@column_header){
294                                 <td><% $column_header %></td>
296                             </tr>
297                         </tbody>
298                     </table>
300                     <b>Required columns:</b>
301                     <ul>
302                         <li><b>cross_unique_id</b> (must NOT exist in the database)</li>
303                         <li><b>cross_combination</b> (required in the header, but value for cross combination (female accession/male accession) may be left blank)</li>
304                         <li><b>cross_type</b> (must be one of the following: biparental, self, open, bulk, bulk_self, bulk_open, or doubled_haploid)</li>
305                         <li><b>female_parent</b> (accession names must exist in the database)</li>
306                         <li><b>male_parent</b> (required in the header, but value may be left blank for most cross types. Must be specified for biparental and bulk crosses. When specified, accession names must exist in the database)</li>
307                     </ul>
309                     <b>Optional columns (dates must be in the format YYYY/MM/DD):</b>
310                     <ul>
311 % foreach my $column_header(@column_header){
312                         <li><% $column_header %></li>
314                     </ul>
316                 </div>
317             </div>
318             <div class="modal-footer">
319                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
320             </div>
321         </div>
322     </div>
323 </div>
324 <div class="modal fade" id="cross_plot_info_dialog" name="cross_plot_info_dialog" tabindex="-1" role="dialog" aria-labelledby="crossPlotInfoDialog">
325     <div class="modal-dialog modal-xl" role="document">
326         <div class="modal-content">
327             <div class="modal-header">
328                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
329                 <h4 class="modal-title" id="crossPlotInfoDialog">Template Information</h4>
330             </div>
331             <div class="modal-body">
332                 <div class="container-fluid">
334                     <b>Crosses may be uploaded in an Excel file (.xls)</b>
335                     <br>
336                     (.xlsx format not supported)
338                     <br><br>
339                     <b>Header:</b>
340                     <br>
342                     The first row (header) must contain the following:
343                     <br>
345                     <table class="table table-bordered table-hover">
346                         <tbody>
347                             <tr>
348                                 <td>cross_unique_id</td>
349                                 <td>cross_combination</td>
350                                 <td>cross_type</td>
351                                 <td>female_parent</td>
352                                 <td>male_parent</td>
353                                 <td>female_plot</td>
354                                 <td>male_plot</td>
355 % foreach my $column_header(@column_header){
356                                 <td><% $column_header %></td>
358                             </tr>
359                         </tbody>
360                     </table>
362                     <b>Required columns:</b>
363                     <ul>
364                         <li><b>cross_unique_id</b> (must NOT exist in the database)</li>
365                         <li><b>cross_combination</b> (required in the header, but value for cross combination (female accession/male accession) may be left blank)</li>
366                         <li><b>cross_type</b> (must be one of the following: biparental, self, open, bulk, bulk_self, bulk_open, or doubled_haploid)</li>
367                         <li><b>female_parent</b> (accession names must exist in the database)</li>
368                         <li><b>male_parent</b> (required in the header, but value may be left blank for most cross types. Must be specified for biparental and bulk crosses. When specified, accession names must exist in the database)</li>
369                         <li><b>female_plot</b> (Plot names must exist in the database)</li>
370                         <li><b>male_plot</b> (Plot names must exist in the database)</li>
371                     </ul>
373                     <b>Optional columns (dates must be in the format YYYY/MM/DD):</b>
374                     <ul>
375 % foreach my $column_header(@column_header){
376                         <li><% $column_header %></li>
378                     </ul>
380                 </div>
381             </div>
382             <div class="modal-footer">
383                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
384             </div>
385         </div>
386     </div>
387 </div>
388 <div class="modal fade" id="cross_plant_info_dialog" name="cross_plant_info_dialog" tabindex="-1" role="dialog" aria-labelledby="crossPlantInfoDialog">
389     <div class="modal-dialog modal-xl" role="document">
390         <div class="modal-content">
391             <div class="modal-header">
392                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
393                 <h4 class="modal-title" id="crossPlantInfoDialog">Template Information</h4>
394             </div>
395             <div class="modal-body">
396                 <div class="container-fluid">
398                     <b>Crosses may be uploaded in an Excel file (.xls)</b>
399                     <br>
400                     (.xlsx format not supported)
402                     <br><br>
403                     <b>Header:</b>
404                     <br>
406                     The first row (header) must contain the following:
407                     <br>
409                     <table class="table table-bordered table-hover">
410                         <tbody>
411                             <tr>
412                                 <td>cross_unique_id</td>
413                                 <td>cross_combination</td>
414                                 <td>cross_type</td>
415                                 <td>female_parent</td>
416                                 <td>male_parent</td>
417                                 <td>female_plant</td>
418                                 <td>male_plant</td>
419 % foreach my $column_header(@column_header){
420                                 <td><% $column_header %></td>
422                             </tr>
423                         </tbody>
424                     </table>
426                     <b>Required columns:</b>
427                     <ul>
428                         <li><b>cross_unique_id</b> (must NOT exist in the database)</li>
429                         <li><b>cross_combination</b> (required in the header, but value for cross combination (female accession/male accession) may be left blank)</li>
430                         <li><b>cross_type</b> (must be one of the following: biparental, self, open, bulk, bulk_self, bulk_open, or doubled_haploid)</li>
431                         <li><b>female_parent</b> (accession names must exist in the database)</li>
432                         <li><b>male_parent</b> (required in the header, but value may be left blank for most cross types. Must be specified for biparental and bulk crosses. When specified, accession names must exist in the database)</li>
433                         <li><b>female_plant</b> (Plant names must exist in the database)</li>
434                         <li><b>male_plant</b> (Plant names must exist in the database)</li>
435                     </ul>
437                     <b>Optional columns (dates must be in the format YYYY/MM/DD):</b>
438                     <ul>
439 % foreach my $column_header(@column_header){
440                         <li><% $column_header %></li>
442                     </ul>
444                 </div>
445             </div>
446             <div class="modal-footer">
447                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
448             </div>
449         </div>
450     </div>
451 </div>