on trialtree download only shows for trials
[sgn.git] / mason / breeders_toolbox / trialtreefolders.mas
blob76b3de5784021542e60a5aeef60449bf78487036
2 <%args>
3 @locations => ()
4 @roles => ()
5 $breeding_programs
6 </%args>
8 <& /util/import_javascript.mas, classes => [ 'jquery.iframe-post-form','CXGN.BreedersToolbox.AddTrial','CXGN.BreedersToolbox.UploadTrial','CXGN.BreedersToolbox.Trial', 'jstree.dist.jstree', 'CXGN.Trial', 'CXGN.BreedersToolbox.HTMLSelect' ] &>
10 <& /breeders_toolbox/folder/folder_set.mas &>
11 <& /breeders_toolbox/folder/folder_new.mas &>
13 <table class="table table-bordered">
14   <thead>
15     <tr>
16       <th>Information</th>
17       <th>Breeding Programs -- -- Trials</th>
18     </tr>
19   </thead>
20   <tbody>
21   <tr>
22     <td>
23       <h4>Download Trial</h4>
24       <button class="btn btn-primary" id="download_button" disabled="disabled" title="First Select a Trial to Download">Excel</button>
25       <button class="btn btn-primary" id="download_button_csv" disabled="disabled" title="First Select a Trial to Download">CSV</button><br />
26       <hr>
27       <h5><i>Double click<br />trial to view</i></h5>
28       <hr>
29       <h4>Folders</h4>
30       <button class="btn btn-sm btn-primary" id="new_folder_dialog_link">Create new folder</button>
31       <button class="btn btn-sm btn-primary" id="open_folder_dialog_link">Add trial to folder</button>
32       <br/>
34       <!--<button id="delete" disabled="disabled" >Delete</button -->
35       <br />
36     </td>
37     <td>
38       <div id="trial_list" >[loading...]</div>
39     </td>
40   </tr>
41   </tbody>
42 </table>
43 <script>
45   jQuery.noConflict();
47   jQuery(document).ready(function($) {
49     jQuery.ajax( {
50       url: '/ajax/breeders/get_trials_with_folders',
51       success: function(response) {
52         var html = '<ul>'+response.html+'</ul>';
54         jQuery('#trial_list').html(html);
55         //console.log(html);
56         jQuery('#trial_list').jstree( {
57             "valid_children" : [ "folder", "trial", "breeding_program" ],
58             "types" : {
59                 "breeding_program" : {
60                     "icon": 'glyphicon glyphicon-briefcase text-info',
61                 },
62                 "folder" : {
63                     "icon": 'glyphicon glyphicon-folder-open text-danger',
64                 },
65                 "trial" : {
66                     "icon": 'glyphicon glyphicon-leaf text-success',
67                 }
68             },
69           "plugins" : ["html_data","types"]
71         });
73       },
74       error: function(response) {
75         alert("An error occurred while loading the trial data.");
76       }
77   });
81   $('#trial_list').on("changed.jstree", function (e, data) {
82     //console.log(data);
83        if ($('#trial_list').jstree('is_leaf', data.node) && data.node.data.jstree.type == 'trial') {
84          $('#download_button').removeAttr('disabled');
85          $('#download_button_csv').removeAttr('disabled');
86        }
87        else {
88          $('#download_button').attr('disabled', 'disabled');
89          $('#download_button_csv').attr('disabled', 'disabled');
90        }
93          // }
94     });
96     $('#download_button').on('click', function () {
97         var selected = $('#trial_list').jstree('get_bottom_selected');
98         if (selected.length !== 0) {
99           window.open('/breeders/trials/phenotype/download/'+selected.join(","));
100         }
101         else { alert("No leaf nodes selected for download."); }
103     });
105     $('#download_button_csv').on('click', function () {
106         var selected = $('#trial_list').jstree('get_bottom_selected');
107         if (selected.length !== 0) {
108           window.open('/breeders/trials/phenotype/download/'+selected.join(",")+'?format=csv');
109         }
110         else { alert("No leaf nodes selected for download."); }
112     });
114     $("#trial_list").delegate("li", "dblclick", function(){
115       var node = $("#trial_list").jstree("get_node", this);
116       //console.log(node);
117       if (node.id.substr(0,1) !== 'j') {
118         if (node.type == 'folder') {
119           window.open('/folder/'+node.id);
120         } else if (node.type == 'trial') {
121           window.open('/breeders_toolbox/trial/'+node.id);
122         }
123       }
124     });
125   });
127 </script>
129 <div class="modal fade" id="add_project_dialog" name="add_project_dialog" tabindex="-1" role="dialog" aria-labelledby="addProjectDialog">
130   <div class="modal-dialog modal-lg" role="document">
131     <div class="modal-content">
132       <div class="modal-header">
133         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
134         <h4 class="modal-title" id="addProjectDialog">Add New Trial</h4>
135       </div>
136       <div class="modal-body">
137         <div class="container-fluid">
138           <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="create_new_trial_form" name="create_new_trial_form">
139             <div class="form-group">
140               <label class="col-sm-3 control-label">Trial Name: </label>
141               <div class="col-sm-9">
142                 <input class="form-control" id="new_trial_name" name="new_trial_name" type="text" />
143               </div>
144             </div>
145             <div class="form-group">
146               <label class="col-sm-3 control-label">Year(s): </label>
147               <div class="col-sm-9">
148                 <input class="form-control" id="add_project_year" name="add_project_year" type="text" />
149               </div>
150             </div>
151             <div class="form-group">
152               <label class="col-sm-3 control-label">Location: </label>
153               <div class="col-sm-9">
154                 <select class="form-control" id="add_project_location" name="add_project_location">
155                 <%perl>foreach my $location (@locations) { print "
156                   <option value=".'"'.@$location[1].'"'.">".@$location[1]."</option>"; }
157                 </%perl>
158                 </select>
159               </div>
160             </div>
161             <div class="form-group">
162               <label class="col-sm-3 control-label">Breeding Program: </label>
163               <div class="col-sm-9">
164                 <select class="form-control" id="select_breeding_program" name="select_breeding_program">
165                 <%perl>foreach my $program (@$breeding_programs) {
166                   print "<option value=".@$program[1].">".@$program[1]."</option>"; }
167                 </%perl>
168                 </select>
169               </div>
170             </div>
171             <div class="form-group">
172               <label class="col-sm-3 control-label">Description: </label>
173               <div class="col-sm-9">
174                 <textarea class="form-control" id="add_project_description" name="add_project_description" form="create_new_trial_form" ></textarea>
175               </div>
176             </div>
177             <div id="format_type_radio" style="display: none">
178               <div class="form-group">
179                 <label class="col-sm-2 control-label">Create Using Trial Design Tool: </label>
180                 <div class="col-sm-10">
181                   <input type="radio" class="format_type" id="format_radio3" name="radio" value="create_with_design_tool" checked="checked" />
182                 </div>
183               </div>
184               <div class="form-group">
185                 <label class="col-sm-2 control-label">Create From Uploaded File: </label>
186                 <div class="col-sm-10">
187                   <input type="radio" class="format_type" id="format_radio2" name="radio" value="create_with_upload" />
188                 </div>
189               </div>
190               <div class="form-group">
191                 <label class="col-sm-2 control-label">Create Empty Trial: </label>
192                 <div class="col-sm-10">
193                   <input type="radio" class="format_type" id="format_radio1" name="radio" value="empty" />
194                 </div>
195               </div>
196             </div>
197             <div id="get_file_upload_data" style="display: none">
198               <div class="form-group">
199                 <label class="col-sm-2 control-label">Upload File: </label>
200                 <div class="col-sm-10">
201                   <input type="file" name="trial_upload_file" id="trial_upload_file" encoding="multipart/form-data" />
202                 </div>
203               </div>
204             </div>
205             <div id="trial_design_info" style="display: none">
206               <hr>
207               <div class="form-group">
208                 <label class="col-sm-3 control-label">Design Type: </label>
209                 <div class="col-sm-9">
210                   <select class="form-control" id="select_design_method" name="select_design_method">
211                     <option title="generates completely a randomized design with equal or different repetition, using the methods of random number generation in R." value=CRD>Completely Randomized</option>
212                     <option title="generates Randomized Complete Block Design, using the methods of random number generation in R." value=RCBD>Complete Block</option>
213                     <option title="creates alpha designs starting from the alpha design fixing under the 4 series formulated by Patterson and Williams." value=Alpha>Alpha Lattice</option>
214                     <option title="some  treatments  (checks)  are  replicate  r  times  and  other  treatments  (new)  are replicated once." value=Augmented>Augmented</option>
215                     <option title="Adjustments are calculated using data from all checks" value=MAD>Modified Augmented Design </option>
217                     <!--<option value=MADIII>MADIII</option>-->
218                     <!--<option value=MADIV>MADIV</option>-->
219                     <!--<option value=MADV>MADV</option>-->
220                   </select>
221                 </div>
222               </div>
223             </div>
224             <div id="trial_design_more_info" style="display: none">
225               <div class="form-group form-group-sm" >
226                 <label class="col-sm-7 control-label">List of Stocks to Include (Required): <br/><button name="lists_link" class="btn btn-info btn-sm" style="margin:6px 0px 0px 0px" type="button" >Manage Lists</button></label>
227                 <div class="col-sm-5" id="select_list" name="select_list">
228                 </div>
229               </div>
230               <div class="form-group form-group-sm" id="show_list_of_checks_section" style="display: none" >
231                 <label class="col-sm-7 control-label">List of Checks to Include (Required): </label>
232                 <div class="col-sm-5" id="list_of_checks_section" >
233                 </div>
234               </div>
235               <div id="design_info" name="design_info">
236                 <div class="form-group form-group-sm" id="rep_count_section" style="display: none">
237                   <label class="col-sm-7 control-label">Number of Replicates (Required): </label>
238                   <div class="col-sm-5" >
239                     <input class="form-control" id="rep_count" name="rep_count" />
240                   </div>
241                 </div>
242                 <div class="form-group form-group-sm" id="block_number_section" style="display: none">
243                   <label class="col-sm-7 control-label">Number of Blocks (Required): </label>
244                   <div class="col-sm-5" >
245                     <input class="form-control" id="block_number" name="block_number" />
246                   </div>
247                 </div>
248                 <div class="form-group form-group-sm" id="row_number_section" style="display: none">
249                   <label class="col-sm-7 control-label">Number of Field Rows (Required): </label>
250                   <div class="col-sm-5" >
251                     <input class="form-control" id="row_number" name="row_number" />
252                   </div>
253                 </div>
254                 <div class="form-group form-group-sm" id="row_number_per_block_section" style="display: none">
255                   <label class="col-sm-7 control-label">Number of Rows Per Block (Optional): </label>
256                   <div class="col-sm-5" >
257                     <input class="form-control" id="row_number_per_block" name="row_number_per_block" />
258                   </div>
259                 </div>
260                 <div id="other_parameter_section" style="display:none">
261                   <hr>
262                   <div class="form-group">
263                     <label class="col-sm-4 control-label">Show Optional Parameters: </label>
264                     <div class="col-sm-8" >
265                       <input type="checkbox" id="show_other_parameter_options" />
266                     </div>
267                   </div>
268                   <div id="other_parameter_options" style="display:none">
269                     <div class="form-group form-group-sm">
270                       <label class="col-sm-7 control-label">Column Number Per Block: </label>
271                       <div class="col-sm-5" >
272                         <input type="text" class="form-control" id="col_number_per_block" name="col_number_per_block" />
273                       </div>
274                     </div>
275                     <div class="form-group form-group-sm">
276                       <label class="col-sm-7 control-label">Number of Field Columns: </label>
277                       <div class="col-sm-5" >
278                         <input type="text" class="form-control" id="col_number" name="col_number" />
279                       </div>
280                     </div>
281                   </div>
282                 </div>
283                 <div class="form-group form-group-sm" id="block_size_section" style="display: none">
284                   <label class="col-sm-7 control-label">Block Size (Required): </label>
285                   <div class="col-sm-5" >
286                     <input type="text" class="form-control" id="block_size" name="block_size" />
287                   </div>
288                 </div>
289                 <div class="form-group form-group-sm" id="max_block_size_section" style="display: none">
290                   <label class="col-sm-7 control-label">Maximum Block Size (Required): </label>
291                   <div class="col-sm-5" >
292                     <input type="text" class="form-control" id="max_block_size" name="block_size" />
293                   </div>
294                 </div>
295                 <hr>
296                 <div class="form-group" >
297                   <label class="col-sm-4 control-label">Custom Plot Naming/Numbering: </label>
298                   <div class="col-sm-8" >
299                     <input type="checkbox" id="show_plot_naming_options" />
300                   </div>
301                 </div>
302                 <div id="plot_naming_options" style="display: none">
303                   <div class="form-group form-group-sm" >
304                     <label class="col-sm-7 control-label">Plot Prefix: </label>
305                     <div class="col-sm-5" >
306                       <input type="text" class="form-control" id="plot_prefix" name="plot_prefix" />
307                     </div>
308                   </div>
309                   <div class="form-group form-group-sm" >
310                     <label class="col-sm-7 control-label">Plot Start Number: </label>
311                     <div class="col-sm-5" >
312                       <input type="text" class="form-control" id="start_number" name="start_number" />
313                     </div>
314                   </div>
315                   <div class="form-group form-group-sm" >
316                     <label class="col-sm-7 control-label">Plot Number Increment: </label>
317                     <div class="col-sm-5" >
318                       <input type="text" class="form-control" id="increment" name="increment" />
319                     </div>
320                   </div>
321                 </div>
322               </div>
323             </div>
324           </form>
325         </div>
326       </div>
327       <div class="modal-footer">
328         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
329         <button type="button" class="btn btn-primary" name="new_trial_submit" id="new_trial_submit">Add Trial</button>
330       </div>
331     </div>
332   </div>
333 </div>
335 <!--
336 <div id="add_project_dialog" class="ui-widget">
337   <form method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="create_new_trial_form" name="create_new_trial_form">
338     <label for="new_trial_name" style="display: inline-block; width: 100px;">Trial name:</label>
339     <input id="new_trial_name" name="new_trial_name" />
340     <br>
341     <label for="add_project_year" style="display: inline-block; width: 100px;">Year(s):</label>
342     <input id="add_project_year" name="add_project_year" />
343     <br>
344     <label for="add_project_location" style="display: inline-block; width: 100px;">Location:</label>
345     <select id="add_project_location" name="add_project_location">
346       <%perl>foreach my $location (@locations) { print "
347       <option value=".'"'.@$location[1].'"'.">".@$location[1]."</option>"; }
348       </%perl>
349     </select>
350     <br>
351     <label for="select_breeding_program" style="display: inline-block; width: 100px;">Breeding Program:</label>
352     <select id="select_breeding_program" name="select_breeding_program">
353       <%perl>
354       foreach my $program (@$breeding_programs) {
355          print "<option value=".@$program[1].">".@$program[1]."</option>";
356       }
357       </%perl>
358     </select>
359     <br>
361     <label for="add_project_description" style="display: inline-block; vertical-align:top; width: 100px;">Description:</label>
362     <textarea id="add_project_description" name="add_project_description" form="create_new_trial_form" cols="40"></textarea>
363     <div id="format_type_radio" style="display: none">
364       <input type="radio" id="format_radio3" name="radio" class="format_type" value="create_with_design_tool" checked="checked" />
365       <label for="radio3">Create using trial design tool</label>
366       <br>
367       <input type="radio" id="format_radio2" name="radio" class="format_type" value="create_with_upload" style="display: none"/>
368       <label for="radio2" style="display: none">Create from uploaded file</label>
369       <br>
370       <input type="radio" id="format_radio1" name="radio" class="format_type" value="empty" style="display: none"/>
371       <label for="radio1" style="display: none">Create empty trial</label>
372       <br>
373     </div>
374     <div id="get_file_upload_data" style="display: none">
375       <hr>
376       <label for="trial_upload_file" style="display: inline-block; width: 100px;">Upload file:</label>
377       <input type="file" name="trial_upload_file" id="trial_upload_file" encoding="multipart/form-data" />
378     </div>
381     <div id="trial_design_info" style="display: none">
382       <hr>
383       <label for="select_design_method" style="display: inline-block; width: 300px;">Design type:</label>
384       <select id="select_design_method" name="select_design_method">
385         <option value=CRD>Completely Randomized</option>
386         <option value=RCBD>Complete Block</option>
387         <option value=Alpha>Alpha Lattice</option>
388         <option value=Augmented>Augmented</option>
389         <option value=MAD>Modified Augmented Design </option>
391         <option value=MADIII>MADIII</option>
392         <option value=MADIV>MADIV</option>
393         <option value=MADV>MADV</option>
394       </select>
395       <br>
396       <br>
397       <br>
400        <%doc>
401        </%doc>
403       <div id="trial_design_more_info" style="display: none">
405       <div id="select_list" name="select_list">
406         <label id="select_list_label" for="select_list_list_select" style="display: inline-block; width: 300px;">List of stocks to include:<br>
407         (required parameter)
408         </label>
409       </div>
411       <div id="list_of_checks_section" style="display: none">
412         <label id="select_list_of_checks_label" for="select_list_of_checks_list_select" style="display: inline-block; width: 300px;">List of checks:<br>
413         (required parameter)
414         </label>
415       </div>
417       <br>
418       <div id="design_info" name="design_info">
419         <div id="rep_count_section" style="display: none">
420           <label for="rep_count" style="display: inline-block; width: 300px;">Number of replicates:<br>
421             (required parameter)
422           </label>
423           <input id="rep_count" name="rep_count" />
424           <br>
425         </div>
427         <div id="block_number_section" style="display: none">
428           <label for="block_number" style="display: inline-block; width: 300px;">Number of blocks:<br>
429             (required parameter)
430           </label>
431           <input id="block_number" name="block_number" />
432           <br>
433         </div>
435         <div id="row_number_section" style="display: none">
436           <label for="row_number" style="display: inline-block; width: 300px;">Number of field rows:<br>
437             (required parameter)
438           </label>
439           <input id="row_number" name="row_number" />
440         </div>
441         <br>
443         <div id="row_number_per_block_section" style="display: none">
444           <label for="row_number_per_block" style="display: inline-block; width: 300px;">Row Number Per Block:<br>
445             (Optional parameter)
446           </label>
447           <input id="row_number_per_block" name="row_number_per_block" />
448           <br>
449         </div>
451         <div id="other_parameter_section" style="display:none">
452         <label for="show_other_parameter_options">Other optional parameters</label>
453         <input type="checkbox" id="show_other_parameter_options">
454         <div id="other_parameter_options" style="display:none">
455           <hr>
456           <label for="col_number_per_block" style="display: inline-block; width: 300px;">Col Number Per Block:</label>
457           <input id="col_number_per_block" name="col_number_per_block" />
458           <br>
459           <label for="col_number" style="display: inline-block; width: 300px;">Number of field columns:</label>
460           <input id="col_number" name="col_number" />
461           <br>
462         </div>
463         </div>
465         <div id="block_size_section" style="display: none">
466           <label for="block_size" style="display: inline-block; width: 300px;">Block size:<br>
467             (required parameter)
468           </label>
469           <input id="block_size" name="block_size" />
470           <br>
471         </div>
473         <div id="max_block_size_section" style="display: none">
474           <label for="max_block_size" style="display: inline-block; width: 300px;">Maximum block size:<br>
475             (required parameter)
476           </label>
477           <input id="max_block_size" name="block_size" />
478           <br>
479         </div>
482         <br>
483         <label for="show_plot_naming_options">Custom plot naming/numbering</label>
484         <input type="checkbox" id="show_plot_naming_options">
486         <div id="plot_naming_options" style="display: none">
487           <hr>
488           <label for="plot_prefix" style="display: inline-block; width: 300px;">Plot name prefix:</label>
489           <input id="plot_prefix" name="plot_prefix" />
490           <br>
491           <label for="start_number" style="display: inline-block; width: 300px;">Plot start number:</label>
492           <input id="start_number" name="start_number" />
493           <br>
494           <label for="increment" style="display: inline-block; width: 300px;">Plot number increment:</label>
495           <input id="increment" name="increment" />
496           <br>
497        </div>
499      </div>
500     </div>
501     </div>
502   </form>
503 </div>
506 <div class="modal fade" id="upload_trial_error_display" name="upload_trial_error_display" tabindex="-1" role="dialog" aria-labelledby="uploadTrialErrorDialog">
507   <div class="modal-dialog modal-lg" role="document">
508     <div class="modal-content">
509       <div class="modal-header">
510         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
511         <h4 class="modal-title" id="uploadTrialErrorDialog">Errors In Uploaded File</h4>
512       </div>
513       <div class="modal-body">
514         <div class="container-fluid">
515           <table>
516           <tbody></tbody>
517           </table>
518         </div>
519       </div>
520       <div class="modal-footer">
521         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
522       </div>
523     </div>
524   </div>
525 </div>
527 <!--
528 <div id="upload_trial_error_display" class="ui-widget">
529   <table>
530     <tbody></tbody>
531   </table>
532 </div>
535 <div class="modal fade" id="trial_design_confirm" name="trial_design_confirm" tabindex="-1" role="dialog" aria-labelledby="addTrialConfirmDialog">
536   <div class="modal-dialog modal-lg" role="document">
537     <div class="modal-content">
538       <div class="modal-header">
539         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
540         <h4 class="modal-title" id="addTrialConfirmDialog">Confirm Trial Design</h4>
541       </div>
542       <div class="modal-body">
543         <div class="container-fluid">
544           <p><span class="ui-icon ui-icon-check"></span>Trial Is Valid<br>The following trial will be added</p>
545           <button class="btn btn-info btn-sm" id="view_trial_layout_button" >View Trial Layout</button>
546           <hr>
547           <div id="trial_design_information">
548           </div>
549         </div>
550       </div>
551       <div class="modal-footer">
552         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
553         <button type="button" class="btn btn-primary" name="new_trial_confirm_submit" id="new_trial_confirm_submit">Confirm</button>
554       </div>
555     </div>
556   </div>
557 </div>
559 <!--
560 <div id="trial_design_confirm" title="Confirm trial design">
561   <p><span class="ui-icon ui-icon-check"></span>Trial is valid<br>The following trial will be added</p>
562   <button id="view_trial_layout_button" class="ui-widget">View trial layout</button>
563   <hr>
564   <div id="trial_design_information" class="ui-widget"></div>
565 </div>
568 <div class="modal fade" id="trial_design_view_layout" name="trial_design_view_layout" tabindex="-1" role="dialog" aria-labelledby="addTrialDesignViewDialog">
569   <div class="modal-dialog modal-lg" role="document">
570     <div class="modal-content">
571       <div class="modal-header">
572         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
573         <h4 class="modal-title" id="addTrialDesignViewDialog">Trial Design Layout</h4>
574       </div>
575       <div class="modal-body">
576         <div class="container-fluid">
577           <p><span class="ui-icon ui-icon-info"></span>Trial Layout</p>
578           <div id="trial_design_view_layout_return">
579           </div>
580         </div>
581       </div>
582       <div class="modal-footer">
583         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
584       </div>
585     </div>
586   </div>
587 </div>
589 <!--
590 <div id="trial_design_view_layout" title="Trial design layout">
591   <p><span class="ui-icon ui-icon-info"></span>Trial layout</p>
592 </div>
595 <!--
596 <div id="trial_saving_dialog" title="Saving">
597   <p>
598     Saving trial<br>
599     <span style="float: center;"><img src="/img/wheel.gif"/></span>
600   </p>
601 </div>
604 <style>
605 #progressbar .ui-progressbar-value {
606 background-color: #ccc;
608 </style>
610 <div class="modal fade" id="trial_saved_dialog_message" name="trial_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="addTrialSavedDialog">
611   <div class="modal-dialog modal-lg" role="document">
612     <div class="modal-content">
613       <div class="modal-header">
614         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
615         <h4 class="modal-title" id="addTrialSavedDialog">Trial Saved</h4>
616       </div>
617       <div class="modal-body">
618         <div class="container-fluid">
619           <p>
620           <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
621           The trial was saved successfully
622           </p>
623         </div>
624       </div>
625       <div class="modal-footer">
626         <button id="trial_saved_dialog_message_ok_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
627       </div>
628     </div>
629   </div>
630 </div>
632 <!--
633 <div id="trial_saved_dialog_message" title="Trial saved">
634   <p>
635     <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
636     The trial was saved successfully
637   </p>
638 </div>
641 <div class="modal fade" id="upload_trial_dialog" name="upload_trial_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadTrialDialog">
642   <div class="modal-dialog " role="document">
643     <div class="modal-content">
644       <div class="modal-header">
645         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
646         <h4 class="modal-title" id="uploadTrialDialog">Upload Trial</h4>
647       </div>
648       <div class="modal-body">
649         <div class="container-fluid">
650           <&| /page/explanation.mas, title=>'Template information' &>
651             <p>
652             <b>File format information</b>
653             <br>
654             <a id="trial_upload_spreadsheet_format_info">Spreadsheet format</a>
655             </p>
656           </&>
658           <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_trial_form" name="upload_trial_form">
659             <div class="form-group">
660               <label class="col-sm-3 control-label">Breeding Program: </label>
661               <div class="col-sm-9">
662                 <select class="form-control" id="trial_upload_breeding_program" name="trial_upload_breeding_program">
663                 <%perl>
664                   foreach my $program (@$breeding_programs) {
665                     print "<option value=".@$program[1].">".@$program[1]."</option>";
666                   }
667                 </%perl>
668                 </select>
669               </div>
670             </div>
671             <div class="form-group form-group-sm">
672               <label class="col-sm-3 control-label">Location: </label>
673               <div class="col-sm-9" >
674                 <select class="form-control" id="trial_upload_location" name="trial_upload_location">
675                 <%perl>foreach my $location (@locations) { print "
676                   <option value=".'"'.@$location[1].'"'.">".@$location[1]."</option>"; }
677                 </%perl>
678                 </select>
679               </div>
680             </div>
681             <div class="form-group form-group-sm">
682               <label class="col-sm-3 control-label">Trial Name: </label>
683               <div class="col-sm-9" >
684                 <input type="text" class="form-control" id="trial_upload_name" name="trial_upload_name" />
685               </div>
686             </div>
687             <div class="form-group form-group-sm">
688               <label class="col-sm-3 control-label">Year(s): </label>
689               <div class="col-sm-9" >
690                 <input type="text" class="form-control" id="trial_upload_year" name="trial_upload_year" />
691               </div>
692             </div>
693             <div class="form-group form-group-sm">
694               <label class="col-sm-3 control-label">Description: </label>
695               <div class="col-sm-9" >
696                 <textarea class="form-control" id="trial_upload_description" name="trial_upload_description" form="upload_trial_form" ></textarea>
697               </div>
698             </div>
699             <div class="form-group form-group-sm">
700               <label class="col-sm-3 control-label">Design Type: </label>
701               <div class="col-sm-9" >
702                 <select class="form-control" id="trial_upload_design_method" name="trial_upload_design_method">
703                   <option value=CRD>Completely Randomized</option>
704                   <option value=RCBD>Complete Block</option>
705                   <option value=Alpha>Alpha Lattice</option>
706                   <option value=Augmented>Augmented</option>
707                   <option value=MAD>Modified Augmented Design</option>
709                   <!--  <option value=MADIII>MADIII</option>   -->
710                   <!--  <option value=MADIV>MADIV</option> -->
711                   <!--  <option value=MADV>MADV</option> -->
712                 </select>
713               </div>
714             </div>
715             <div class="form-group form-group-sm">
716               <label class="col-sm-3 control-label">Upload File: </label>
717               <div class="col-sm-9" >
718                 <input type="file" name="trial_uploaded_file" id="trial_uploaded_file" encoding="multipart/form-data" />
719               </div>
720             </div>
721           </form>
722         </div>
723       </div>
724       <div class="modal-footer">
725         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
726         <button type="button" class="btn btn-primary" name="upload_trial_submit" id="upload_trial_submit">Upload Trial</button>
727       </div>
728     </div>
729   </div>
730 </div>
732 <!--
733 <div id="upload_trial_dialog" title="Upload trial">
735   <&| /page/explanation.mas, title=>'Template information' &>
736     <p>
737       <b>File format information</b>
738       <br>
739       <a id="trial_upload_spreadsheet_format_info">Spreadsheet format</a>
740     </p>
741   </&>
743   <form method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_trial_form" name="upload_trial_form">
745     <label for="trial_upload_breeding_program" style="display: inline-block; width: 100px;">Breeding Program:</label>
746     <select id="trial_upload_breeding_program" name="trial_upload_breeding_program">
747       <%perl>
748       foreach my $program (@$breeding_programs) {
749          print "<option value=".@$program[1].">".@$program[1]."</option>";
750       }
751       </%perl>
752     </select>
753     <br>
755     <label for="trial_upload_location" style="display: inline-block; width: 100px;">Location:</label>
756     <select id="trial_upload_location" name="trial_upload_location">
757       <%perl>foreach my $location (@locations) { print "
758         <option value=".'"'.@$location[1].'"'.">".@$location[1]."</option>"; }
759       </%perl>
760     </select>
761     <br>
763     <label for="trial_upload_name" style="display: inline-block; width: 100px;">Trial name:</label>
764     <input id="trial_upload_name" name="trial_upload_name" />
765     <br>
767     <label for="trial_upload_year" style="display: inline-block; width: 100px;">Year(s):</label>
768     <input id="trial_upload_year" name="trial_upload_year" />
769     <br>
771     <label for="trial_upload_description" style="display: inline-block; vertical-align:top; width: 100px;">Description:</label>
772     <textarea id="trial_upload_description" name="trial_upload_description" form="upload_trial_form" cols="40"></textarea>
773     <br>
775     <label for="trial_upload_design_method" style="display: inline-block; width: 100px;">Design type:</label>
776     <select id="trial_upload_design_method" name="trial_upload_design_method">
777       <option value=CRD>Completely Randomized</option>
778       <option value=RCBD>Complete Block</option>
779       <option value=Alpha>Alpha Lattice</option>
780       <option value=Augmented>Augmented</option>
781       <option value=MAD>Modified Augmented Design</option>
784     <option value=MADIII>MADIII</option>
785     <option value=MADIV>MADIV</option>
786     <option value=MADV>MADV</option>
787     </select>
788     <br>
789     <br>
791     <label for="trial_uploaded_file" style="display: inline-block; width: 100px;">Upload file:</label>
792     <input type="file" name="trial_uploaded_file" id="trial_uploaded_file" encoding="multipart/form-data" />
794     </form>
796 </div>
799 <div class="modal fade" id="trial_upload_spreadsheet_info_dialog" name="trial_upload_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadTrialInfoDialog">
800   <div class="modal-dialog modal-lg" role="document">
801     <div class="modal-content">
802       <div class="modal-header">
803         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
804         <h4 class="modal-title" id="uploadTrialInfoDialog">Upload Template Information</h4>
805       </div>
806       <div class="modal-body">
807         <div class="container-fluid">
808           <&| /breeders_toolbox/trial/trial_spreadsheet_upload_format_info.mas &>
809           </&>
810         </div>
811       </div>
812       <div class="modal-footer">
813         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
814       </div>
815     </div>
816   </div>
817 </div>
819 <!--
820 <div id="trial_upload_spreadsheet_info_dialog" title="Format for uploading trials in a spreadsheet">
821   <&| /breeders_toolbox/trial/trial_spreadsheet_upload_format_info.mas &>
822   </&>
823 </div>
826 <div class="modal fade" id="trial_upload_success_dialog_message" name="trial_upload_success_dialog_message" tabindex="-1" role="dialog" aria-labelledby="uploadTrialSuccessDialog">
827   <div class="modal-dialog modal-lg" role="document">
828     <div class="modal-content">
829       <div class="modal-header">
830         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
831         <h4 class="modal-title" id="uploadTrialSuccessDialog">Upload Successful</h4>
832       </div>
833       <div class="modal-body">
834         <div class="container-fluid">
835           <p>
836           <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
837           The trial file was uploaded successfully
838           </p>
839         </div>
840       </div>
841       <div class="modal-footer">
842         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
843       </div>
844     </div>
845   </div>
846 </div>
847 <!--
848 <div id="trial_upload_success_dialog_message" title="Trial file uploaded">
849   <p>
850     <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
851     The trial file was uploaded successfully
852   </p>
853 </div>