upload fieldbook from manage phenotyping
[sgn.git] / mason / breeders_toolbox / manage_accessions.mas
blob5a02911a46c55bca9a5cb1dee781e6cf40f121e4
2 <%args>
3 $accessions
4 $preferred_species => ""
5 </%args>
7 <& /util/import_javascript.mas, classes => [ 'bootstrap_min.js', 'jquery.iframe-post-form','CXGN.List','CXGN.BreedersToolbox.Accessions', 'CXGN.BreedersToolbox.UploadPedigrees', 'jquery.dataTables-bootstrap-min' ] &>
9 <& /page/page_title.mas, title=>"Manage Accessions" &>
11 <div class="container-fluid">
13 <&| /page/info_section.mas, title=>'Accessions', collapsible=>1, collapsed=>0, subtitle=>'[<a id="add_accessions_link">Add</a>] [<a id="upload_pedigrees_link">Upload Pedigree File</a>]' &>
15 <& /breeders_toolbox/accessions.mas, accessions=>$accessions &>
17 <div>
18   </br>
19   <a href="/search/stocks">Search Accessions</a>
20 </div>
22 </&>
24 <&| /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>'&>
26 <& /breeders_toolbox/accessions/find_trials_by_accessions.mas &>
28 </&>
30 <&| /page/info_section.mas, title=>"Populations", id=> "manage_accessions_populations", collapsible=>1, collapsed=>1, subtitle=>"<i>Maximize to see population info</i>"&>
31 <div class="panel-group" id="accordion"></div>
32 </&>
34 </div>
36 <& /breeders_toolbox/accessions/pedigree_spreadsheet_upload_format_info.mas &>
38 <!-- Modal Dialogs Below Here -->
40 <div class="modal fade" id="add_accessions_dialog" name="add_accessions_dialog" tabindex="-1" role="dialog" aria-labelledby="addAccessionsDialog">
41   <div class="modal-dialog" role="document">
42     <div class="modal-content">
43       <div class="modal-header">
44         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
45         <h4 class="modal-title" id="addAccessionsDialog">Add Accessions</h4>
46       </div>
47       <div class="modal-body">
48         <div class="container-fluid">
49           <form class="form-horizontal" role="form" name="new_accessions_form" id="new_accessions_form">
50             <div class="form-group">
51               <label class="col-sm-6 control-label">Choose a List of Accessions to Add: </label>
52               <div class="col-sm-6" id="list_div" name="list_div">
53               </div>
54             </div>
55             <div class="form-group">
56               <label class="col-sm-6 control-label"></label>
57               <div class="col-sm-6">
58                 <button name="lists_link" class="btn btn-info btn-sm" style="margin:6px 0px 0px 0px" type="button" >Manage Lists</button>
59               </div>
60             </div>
61             <div class="form-group">
62               <label class="col-sm-6 control-label">Use Fuzzy Search: </label>
63               <div class="col-sm-6">
64                 <input type="checkbox" id="fuzzy_check" name="fuzzy_check"></input>
65                 <br/>
66                 <small>Note: Use the fuzzy search to match similar names to prevent uploading of duplicate accessions. Fuzzy searching is much slower than regular search.</small>
67               </div>
68             </div>
69           </form>
70         </div>
71       </div>
72       <div class="modal-footer">
73         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
74         <button type="button" class="btn btn-primary" name="new_accessions_submit" id="new_accessions_submit">Add Accessions</button>
75       </div>
76     </div>
77   </div>
78 </div>
80 <div class="modal fade" id="review_absent_dialog" name="review_absent_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewAbsentDialog">
81   <div class="modal-dialog" role="document">
82     <div class="modal-content ui-front">
83       <div class="modal-header">
84         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
85         <h4 class="modal-title" id="reviewAbsentDialog">Accessions to be Added</h4>
86       </div>
87       <div class="modal-body">
88         <div class="container-fluid">
89           <label for="species_name_input">Species name for added accessions</label>
90           <input class="form-control" type="text" id="species_name_input" value="<% $preferred_species %>"></input>
91           <br><br>
92           <label for="population_name_input">Population name for added accessions (optional)</label>
93           <input class="form-control" type="text" id="population_name_input"></input>
94           <br><br>
95           <b>The following accessions will be added to the database:</b>
96           <div id="count_of_absent_accessions"></div>
97           <br>
98           <div id="view_absent"></div>
99         </div>
100       </div>
101       <div class="modal-footer">
102         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
103         <button type="button" class="btn btn-primary" name="review_absent_accessions_submit" id="review_absent_accessions_submit">Add Accessions</button>
104       </div>
105     </div>
106   </div>
107 </div>
109 <div class="modal fade" id="review_fuzzy_matches_dialog" name="review_fuzzy_matches_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewFuzzyDialog">
110   <div class="modal-dialog" role="document">
111     <div class="modal-content">
112       <div class="modal-header">
113         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
114         <h4 class="modal-title" id="reviewFuzzyDialog">Fuzzy Matches</h4>
115       </div>
116       <div class="modal-body">
117         <div class="container-fluid">
118           <b>Accessions were found with similar names.</b>
119           <br/><br/>
120           <div id="view_fuzzy_matches"></div>
121         </div>
122       </div>
123       <div class="modal-footer">
124         <button id="review_fuzzy_matches_hide" type="button" class="btn btn-default" data-dismiss="modal">OK</button>
125       </div>
126     </div>
127   </div>
128 </div>
130 <div class="modal fade" id="review_found_matches_dialog" name="review_found_matches_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewFoundDialog">
131   <div class="modal-dialog" role="document">
132     <div class="modal-content">
133       <div class="modal-header">
134         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
135         <h4 class="modal-title" id="reviewFoundDialog">Found Accessions</h4>
136       </div>
137       <div class="modal-body">
138         <div class="container-fluid">
139           <b>The following accessions already exist and cannot be added:</b>
140           <div id="count_of_found_accessions"></div>
141           <br/>
142           <div id="view_found_matches"></div>
143         </div>
144       </div>
145       <div class="modal-footer">
146         <button id="review_found_matches_hide" type="button" class="btn btn-default" data-dismiss="modal">OK</button>
147       </div>
148     </div>
149   </div>
150 </div>
152 <!--
153 <div id="review_fuzzy_matches_dialog" class="ui-widget" title="Fuzzy matches">
154   <b>Accessions were found with similar names.</b>
155   <br><br>
156   <div id="view_fuzzy_matches">
157   </div>
158 </div>
161 <!--
162 <div id="review_found_matches_dialog" class="ui-widget" title="Found accessions">
163   <b>The following accessions already exist and cannot be added:</b>
164   <div id="count_of_found_accessions"></div>
165   <br>
166   <div class="left"> <b>Searched name</b> </div>
167   <div class="right"> <b>Unique name for synonym</b> </div>
168   <div id="view_found_matches">
169   </div>
170 </div>
173 <!--
174 <div id="review_absent_dialog" class="ui-widget" title="Accessions to be added">
175   <label for="species_name_input">Species name for added accessions</label>
176   <input type="text" id="species_name_input"></input>
177   <br><br>
178   <b>The following accessions will be added to the database:</b>
179   <div id="count_of_absent_accessions"></div>
180   <br>
181   <div id="view_absent">
182   </div>
183 </div>
186 <div class="modal fade" id="upload_pedigrees_error_display" name="upload_pedigrees_error_display" tabindex="-1" role="dialog" aria-labelledby="uploadPedigreesErrorDialog">
187   <div class="modal-dialog" role="document">
188     <div class="modal-content">
189       <div class="modal-header">
190         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
191         <h4 class="modal-title" id="uploadPedigreesErrorDialog">Errors During Upload</h4>
192       </div>
193       <div class="modal-body">
194         <div class="container-fluid">
195           <table class="table table-hover">
196             <tbody></tbody>
197           </table>
198         </div>
199       </div>
200       <div class="modal-footer">
201         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
202       </div>
203     </div>
204   </div>
205 </div>
207 <!--
208 <div id="upload_pedigrees_error_display" class="ui-widget">
209   <table>
210     <tbody></tbody>
211   </table>
212 </div>
215 <div class="modal fade" id="pedigrees_upload_success_dialog_message" name="pedigrees_upload_success_dialog_message" tabindex="-1" role="dialog" aria-labelledby="uploadPedigreesSuccessDialog">
216   <div class="modal-dialog" role="document">
217     <div class="modal-content">
218       <div class="modal-header">
219         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
220         <h4 class="modal-title" id="uploadPedigreesSuccessDialog">Upload Successful</h4>
221       </div>
222       <div class="modal-body">
223         <div class="container-fluid">
224           <h2>The Pedigree Upload Finished With No Errors.</h2>
225         </div>
226       </div>
227       <div class="modal-footer">
228         <button type="button" id="pedigrees_upload_success_dismiss" class="btn btn-default" data-dismiss="modal">Close</button>
229       </div>
230     </div>
231   </div>
232 </div>
234 <!--
235 <div id="pedigrees_upload_success_dialog_message" class="ui-widget">
236   The pedigree upload finished.
237 </div>
240 <div class="modal fade" id="upload_pedigrees_dialog" name="upload_pedigrees_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadPedigreesDialog">
241   <div class="modal-dialog" 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="uploadPedigreesDialog">Upload Pedigrees</h4>
246       </div>
247       <div class="modal-body">
248         <div class="container-fluid">
249           <&| /page/explanation.mas, title=>'Template Information' &>
250           <p>
251           <b>File format information</b>
252           <br>
253           <a id="pedigrees_upload_spreadsheet_format_info">Spreadsheet Format</a>
254           </p>
255           </&>
257           <form method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_pedigrees_form" name="upload_pedigrees_form">
258             <label for="pedigrees_uploaded_file" style="display: inline-block; width: 100px;">Upload Pedigree File:</label>
259             <input type="file" name="pedigrees_uploaded_file" id="pedigrees_uploaded_file" encoding="multipart/form-data" />
260           </form>
261         </div>
262       </div>
263       <div class="modal-footer">
264         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
265         <button type="button" class="btn btn-primary" name="upload_pedigrees_dialog_submit" id="upload_pedigrees_dialog_submit">Submit File</button>
266       </div>
267     </div>
268   </div>
269 </div>
271 <!--
272 <div id="upload_pedigrees_dialog" title="Upload pedigrees">
274   <&| /page/explanation.mas, title=>'Template information' &>
275     <p>
276       <b>File format information</b>
277       <br>
278       <a id="pedigrees_upload_spreadsheet_format_info">Spreadsheet format</a>
279     </p>
280   </&>
282   <form method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_pedigrees_form" name="upload_pedigrees_form">
284     <label for="pedigrees_uploaded_file" style="display: inline-block; width: 100px;">Upload pedigree file:</label>
285     <input type="file" name="pedigrees_uploaded_file" id="pedigrees_uploaded_file" encoding="multipart/form-data" />
287     </form>
288 </div>
291 <style>
292   div.left {
293     float: left;
294     clear: both;
295   }
296 .ui-autocomplete {
297   max-height: 100px;
298   overflow-y: auto;
299   /* prevent horizontal scrollbar */
300   overflow-x: hidden;
303 /* IE 6 doesn't support max-height
304 * we use height instead, but this forces the menu to always be this tall
306 * html .ui-autocomplete {
307   height: 100px;
309 </style>