fix test with new description field.
[sgn.git] / mason / breeders_toolbox / manage_accessions.mas
blob2c1bf786e298ccd3584127198f6d3449d645b499
2 <%args>
3 $accessions
4 $preferred_species => ""
5 $list_id => undef
6 $editable_stock_props => {}
7 $editable_stock_props_definitions => {}
8 $show_grafting_interface => ''
9 </%args>
11 <& /util/import_javascript.mas, classes => [ 'bootstrap_min.js', 'jquery.iframe-post-form','CXGN.List','CXGN.BreedersToolbox.Accessions', 'CXGN.BreedersToolbox.UploadPedigrees', 'CXGN.BreedersToolbox.UploadGrafts', 'CXGN.BreedersToolbox.UploadRenameAccessions' ] &>
13 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
15 <& /page/page_title.mas, title=>"Manage Accessions" &>
17 <div class="container-fluid">
19 <div class="well">
21 <%perl>
22 my $grafting_button = "";
24 if ($show_grafting_interface) {
26 $grafting_button = '<button class="btn btn-default" id="upload_grafts_link" >Upload Grafts</button>';
30 my $subtitle = '<div style="margin-bottom:-10px"><button class="btn btn-default" name="add_accessions_link">Add Accessions Or Upload Accession Info</button> <button class="btn btn-default" id="upload_pedigrees_link">Upload Pedigree File</button> <button class="btn btn-default" id="upload_rename_accessions_link" name="upload_rename_accessions_link">Rename Accessions</button> '.$grafting_button.'</div>';
32 </%perl>
34 <&| /page/info_section.mas, title=>'Accessions', collapsible=>1, collapsed=>0, subtitle=> $subtitle  &>
36 <& /breeders_toolbox/accessions.mas, accessions=>$accessions &>
37 <& /breeders_toolbox/add_accessions_dialogs.mas, preferred_species=>$preferred_species, editable_stock_props=>$editable_stock_props, editable_stock_props_definitions=>$editable_stock_props_definitions &>
38 <& /breeders_toolbox/upload_pedigrees_dialogs.mas &>
39 <& /breeders_toolbox/upload_accession_rename_dialog.mas &>
40 <& /breeders_toolbox/upload_graft_dialogs.mas &>
41 <& /breeders_toolbox/manage_populations_dialogs.mas &>
43 <div>
44   </br>
45   <a href="/search/stocks">Search Accessions</a>
46 </div>
48 </&>
49 </div><!-- closes well -->
51 <div class="well">
52   <&| /page/info_section.mas, title=>"Accessions with Pedigree Information", id=> "accessions_with_pedigree", collapsible=>1, collapsed=>1&>
53     <table class="table table-hover table-bordered" id="accessions_with_pedigree_table">
54       <thead>
55         <tr>
56           <th>Accession Name</th>
57           <th>Female Parent</th>
58           <th>Male Parent</th>
59           <th>Cross Type</th>
60         </tr>
61       </thead>
62     </table>
63     <a href="/search/download_all_accessions_with_pedigree" class="btn btn-sm btn-default">Download All Accessions and Pedigree Info</a>
64     <br>
65     <br>
66     <&| /page/info_section.mas, title => 'Copy accessions to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the accession names to a new or exisiting list</i>'&>
67       <br>
68       <div style="text-align:right" id="accessions_with_pedigree_to_list_menu"></div>
69       <div id="accession_names_with_pedigree" style="display: none;"></div>
70     </&>
71   </&>
72 </div><!-- closes well -->
74 <div class="well">
75   <&| /page/info_section.mas, title=>"Accessions Missing Pedigree Information", id=> "accessions_missing_pedigree", collapsible=>1, collapsed=>1&>
76     <table class="table table-hover table-bordered" id="accessions_missing_pedigree_table">
77       <thead>
78         <tr>
79           <th>Accession Name</th>
80           <th>Submitter</th>
81         </tr>
82       </thead>
83     </table>
84     <br>
85     <br>
86     <&| /page/info_section.mas, title => 'Copy accessions to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the accession names to a new or exisiting list</i>'&>
87       <br>
88       <div style="text-align:right" id="accessions_missing_pedigree_to_list_menu"></div>
89       <div id="accession_names_missing_pedigree" style="display: none;"></div>
90     </&>
91   </&>
92 </div><!-- closes well -->
94 <div class="well">
95   <&| /page/info_section.mas, title=>'Find Trials in Common', collapsible=>1, collapsed=>0, subtitle=>'<i>Use a list of accessions to search for trials that contain them all</i>'&>
97   <& /breeders_toolbox/accessions/find_trials_by_accessions.mas &>
99   </&>
101 </div><!-- closes well -->
103 <div class="well">
104   <&| /page/info_section.mas, title=>"Populations", id=> "manage_accessions_populations", collapsible=>1, collapsed=>1, subtitle=>"<a id='manage_accessions_populations_new'>[Create Population]</a>"&>
105     <div class="panel-group" id="accordion"></div>
106   </&>
107 </div><!-- closes well -->
109 </div>
111 <style>
112   div.left {
113     float: left;
114     clear: both;
115   }
116 .ui-autocomplete {
117   max-height: 100px;
118   overflow-y: auto;
119   /* prevent horizontal scrollbar */
120   overflow-x: hidden;
123 /* IE 6 doesn't support max-height
124 * we use height instead, but this forces the menu to always be this tall
126 * html .ui-autocomplete {
127   height: 100px;
129 </style>
131 <script>
132   jQuery(document).ready(function (){
133 %  if ($list_id){
134     verify_accession_list(<% $list_id %>);
135 %  }
137     jQuery('#accessions_with_pedigree_onswitch').one("click", function(){
138         var result_table = jQuery('#accessions_with_pedigree_table').DataTable({
139             'ajax': { 'url': '/ajax/stock/accessions_with_pedigree' },
140             "fnInitComplete": function(oSettings, json) {
141                 if (!isLoggedIn()) {
142                     jQuery('#accessions_with_pedigree_to_list_menu').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
143                 } else {
144                     var html = "";
145                     for(var i=0; i<json.data.length; i++){
146                         html += json.data[i][4]+"\n";
147                     }
148                     jQuery("#accession_names_with_pedigree").html(html);
149                     addToListMenu("accessions_with_pedigree_to_list_menu", "accession_names_with_pedigree", {
150                         selectText: true,
151                         listType:'accessions'
152                     });
153                 }
154             }
155         });
156     });
158     jQuery('#accessions_missing_pedigree_onswitch').one("click", function(){
159         var result_table = jQuery('#accessions_missing_pedigree_table').DataTable({
160             'ajax': { 'url': '/ajax/stock/accessions_missing_pedigree' },
161             "fnInitComplete": function(oSettings, json) {
162                 if (!isLoggedIn()) {
163                     jQuery('#accessions_missing_pedigree_to_list_menu').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
164                 } else {
165                     var html = "";
166                     for(var i=0; i<json.data.length; i++){
167                         html += json.data[i][2]+"\n";
168                     }
169                     jQuery("#accession_names_missing_pedigree").html(html);
170                     addToListMenu("accessions_missing_pedigree_to_list_menu", "accession_names_missing_pedigree", {
171                         selectText: true,
172                         listType:'accessions'
173                     });
174                 }
175             }
176         });
177     });
183 </script>