comment out large section of breeding program details - this info should be on the...
[sgn.git] / mason / breeders_toolbox / manage_phenotyping.mas
blobdcef6737eb264de237496a4e44d8aad9c553ce54
2 <%args>
3 $phenotype_files => undef
4 $deleted_phenotype_files => undef
5 $locations => undef
6 </%args>
8 <& /util/import_javascript.mas, classes => [ 'CXGN.BreedersToolbox.Trial','CXGN.BreedersToolbox.FieldBook','CXGN.BreedersToolbox.UploadPhenotype', 'CXGN.BreedersToolbox.UploadImages', 'CXGN.BreederSearch', 'CXGN.Trial' ] &>
10 <& /page/page_title.mas, title=>"Manage Phenotypic Data" &>
12 <div class="container-fluid">
14 <!--button class="btn btn-info" onclick=location.href="/search/stocks">Phenotype Search</button><br /><br /-->
16 <& /fieldbook/create_fieldbook_dialog.mas &>
17 <& /fieldbook/create_trait_file_dialog.mas &>
18 <& /fieldbook/upload_phenotype_fieldbook.mas &>
19 <& /breeders_toolbox/upload_phenotype_spreadsheet.mas &>
20 <& /breeders_toolbox/upload_images.mas &>
21 <& /breeders_toolbox/trial/create_spreadsheet_dialog.mas &>
23 <div class="well">
25 <&| /page/info_section.mas, title=>'Your Uploaded Files', is_subsection=>1, subtitle=>'[<a id="upload_spreadsheet_phenotypes_link" >Upload Phenotype Spreadsheet</a>] [<a id="upload_images_link" >Upload Images</a>] <br/> [<a name="create_spreadsheet_link" >Create Phenotype Spreadsheet</a>]' &>
26   <br/>
27   <& /breeders_toolbox/file_list.mas, files=>$phenotype_files, allow_delete=>1 &>
29 </&>
31 </div>
32 <div class="well">
34 <&| /page/info_section.mas, title=>'Your Obsoleted Files', subtitle=>'These files will not be shown anywhere else on the website', is_subsection=>1 &>
36   <& /breeders_toolbox/file_list.mas, files=>$deleted_phenotype_files, allow_delete=>0 &>
38 </&>
40 </div>
42 </div>
44 <script>
46 jQuery(document).ready(function() {
48     jQuery('button[name=delete_pheno_file_link]').click( function() {
49         var delete_phenotypes_file_id = jQuery(this).data('file_id');
50         if (confirm('Are you sure you want to delete all phenotype values related to this file from the database and make this file obsolete?')){
51             jQuery.ajax ( {
52                 url : '/ajax/breeders/phenotyping/delete/'+delete_phenotypes_file_id,
53                 beforeSend : function() {
54                     jQuery('#working_modal').modal('show');
55                 },
56                 success: function(response){
57                     jQuery('#working_modal').modal('hide');
58                     alert('Made phenotype file obsolete and deleted all related phenotype values in the database!');
59                     location.reload();
60                 },
61                 error: function(response){
62                     jQuery('#working_modal').modal('hide');
63                     alert("Error deleting file and phenotypes!");
64                 }
65             });
66         }
67     });
69 });
71 </script>