Merge branch 'master' into topic/brapi_observations_call
[sgn.git] / mason / breeders_toolbox / add_accessions_dialogs.mas
blob12494f9629cf1ff7f33e5e30908fb5bb54f4fed4
1 <%args>
2 $preferred_species => ""
3 $editable_stock_props => {}
4 </%args>
6 <div class="modal fade" id="add_accessions_dialog" name="add_accessions_dialog" tabindex="-1" role="dialog" aria-labelledby="addAccessionsDialog" data-backdrop="static" data-keyboard="false">
7   <div class="modal-dialog modal-lg" role="document">
8     <div class="modal-content">
9       <div class="modal-header">
10         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
11         <h4 class="modal-title" id="addAccessionsDialog">Add Accessions</h4>
12       </div>
13       <div class="modal-body">
14         <div class="container-fluid">
16             <ul class="nav nav-pills nav-justified" id="add_new_accessions_tab_select">
17                 <li class="active" id="add_new_accessions_list_tab"><a data-toggle="tab" href="#with_list_tab">Using Lists</a></li>
18                 <li id="add_new_accessions_file_tab"><a data-toggle="tab" href="#with_file_tab">Uploading a File</a></li>
19             </ul>
21             <div class="tab-content">
23                 <div id="with_list_tab" class="tab-pane fade in active">
24                     <hr>
25                     <form class="form-horizontal" role="form" name="new_accessions_form" id="new_accessions_form">
26                         <div class="form-group">
27                             <label class="col-sm-4 control-label">Choose a List of Accessions to Add: </label>
28                             <div class="col-sm-8" id="list_div" name="list_div">
29                             </div>
30                         </div>
31                         <div class="form-group">
32                             <label class="col-sm-4 control-label"></label>
33                             <div class="col-sm-8">
34                                 <button name="lists_link" class="btn btn-info btn-sm" style="margin:6px 0px 0px 0px" type="button" >Manage Lists</button>
35                             </div>
36                         </div>
37                         <div class="form-group">
38                             <label class="col-sm-4 control-label">Use Fuzzy Search: </label>
39                             <div class="col-sm-8">
40                                 <input type="checkbox" id="fuzzy_check" name="fuzzy_check" checked></input>
41                                 <br/>
42                                 <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>
43                             </div>
44                         </div>
45                     </form>
46                 </div>
48                 <div id="with_file_tab" class="tab-pane fade">
49                     <hr>
50                     <&| /page/explanation.mas, title=>'Template information' &>
51                         <p>
52                             <b>File format information</b>
53                             <br>
54                             <a id="accessions_upload_spreadsheet_format_info">Spreadsheet format</a>
55                         </p>
56                     </&>
58                     <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_new_accessions_form" name="upload_new_accessions_form">
59                         <div class="form-group">
60                             <label class="col-sm-3 control-label">Upload File: </label>
61                             <div class="col-sm-9" >
62                                 <input type="file" name="new_accessions_upload_file" id="new_accessions_upload_file" encoding="multipart/form-data" />
63                             </div>
64                         </div>
65                     </form>
67                 </div>
69             </div>
71         </div>
72       </div>
73       <div class="modal-footer">
74         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
75         <button type="button" class="btn btn-primary" name="new_accessions_submit" id="new_accessions_submit">Continue</button>
76       </div>
77     </div>
78   </div>
79 </div>
81 <div class="modal fade" id="accessions_upload_spreadsheet_format_modal" name="accessions_upload_spreadsheet_format_modal" tabindex="-1" role="dialog" aria-labelledby="uploadAccessionsInfoDialog">
82     <div class="modal-dialog modal-xl" role="document">
83         <div class="modal-content">
84             <div class="modal-header" style="text-align: center">
85                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
86                 <h4 class="modal-title" id="uploadAccessionsInfoDialog">Upload Accessions Template Information</h4>
87             </div>
88             <div class="modal-body">
89                 <div class="container-fluid">
90                     <b>Accessions may be uploaded in an Excel file (.xls)</b>
91                     <br />
92                     (.xlsx format not supported)
93                     <br /><br />
94                     <b>Header:</b>
95                     <br>
96                     The first row (header) should contain the following:
97                     <br />
99                     <table class="table table-hover table-bordered table-condensed" >
100                         <thead></thead>
101                         <tbody>
102                             <tr>
103                                 <td>accession_name</td>
104                                 <td>species_name</td>
105                                 <td>population_name</td>
106                                 <td>organization_name(s)</td>
107                                 <td>synonym(s)</td>
108 % if (exists($editable_stock_props->{'location_code'})){
109                                 <td>location_code(s)</td>
110 % }
111 % if (exists($editable_stock_props->{'ploidy_level'})){
112                                 <td>ploidy_level(s)</td>
113 % }
114 % if (exists($editable_stock_props->{'genome_structure'})){
115                                 <td>genome_structure(s)</td>
116 % }
117 % if (exists($editable_stock_props->{'variety'})){
118                                 <td>variety(s)</td>
119 % }
120 % if (exists($editable_stock_props->{'donor'})){
121                                 <td>donor(s)</td>
122 % }
123 % if (exists($editable_stock_props->{'donor institute'})){
124                                 <td>donor_institute(s)</td>
125 % }
126 % if (exists($editable_stock_props->{'donor PUI'})){
127                                 <td>donor_PUI(s)</td>
128 % }
129 % if (exists($editable_stock_props->{'country of origin'})){
130                                 <td>country_of_origin(s)</td>
131 % }
132 % if (exists($editable_stock_props->{'state'})){
133                                 <td>state(s)</td>
134 % }
135 % if (exists($editable_stock_props->{'institute code'})){
136                                 <td>institute_code(s)</td>
137 % }
138 % if (exists($editable_stock_props->{'institute name'})){
139                                 <td>institute_name(s)</td>
140 % }
141 % if (exists($editable_stock_props->{'biological status of accession code'})){
142                                 <td>biological_status_of_accession_code(s)</td>
143 % }
144 % if (exists($editable_stock_props->{'notes'})){
145                                 <td>notes(s)</td>
146 % }
147 % if (exists($editable_stock_props->{'accession number'})){
148                                 <td>accession_number(s)</td>
149 % }
150 % if (exists($editable_stock_props->{'PUI'})){
151                                 <td>PUI(s)</td>
152 % }
153 % if (exists($editable_stock_props->{'seed source'})){
154                                 <td>seed_source(s)</td>
155 % }
156 % if (exists($editable_stock_props->{'type of germplasm storage code'})){
157                                 <td>type_of_germplasm_storage_code(s)</td>
158 % }
159 % if (exists($editable_stock_props->{'acquisition date'})){
160                                 <td>acquisition_date(s)</td>
161 % }
162 % if (exists($editable_stock_props->{'transgenic'})){
163                                 <td>transgenic</td>
164 % }
165 % if (exists($editable_stock_props->{'introgression_parent'})){
166                                 <td>introgression_parent</td>
167 % }
168 % if (exists($editable_stock_props->{'introgression_backcross_parent'})){
169                                 <td>introgression_backcross_parent</td>
170 % }
171 % if (exists($editable_stock_props->{'introgression_map_version'})){
172                                 <td>introgression_map_version</td>
173 % }
174 % if (exists($editable_stock_props->{'introgression_chromosome'})){
175                                 <td>introgression_chromosome</td>
176 % }
177 % if (exists($editable_stock_props->{'introgression_start_position_bp'})){
178                                 <td>introgression_start_position_bp</td>
179 % }
180 % if (exists($editable_stock_props->{'introgression_end_position_bp'})){
181                                 <td>introgression_end_position_bp</td>
182 % }
183                             </tr>
184                         </tbody>
185                     </table>
187                     <b>Required fields:</b>
188                     <ul>
189                     <li>accession_name (must be unique)</li>
190                     <li>species_name (must exist in the database)</li>
191                     </ul>
192                     <b>Optional fields:</b>
193                     <ul>
194                     <li>population_name (a population is a grouping of accessions. if the population already exists in the database, the accession will be added into it, otherwise, the new population will be created.)</li>
195                     <li>organization_names (the name(s) of the organization(s) which use this accession. multiple organizations can be given with comma separation (e.g. NARO,IITA))</li>
196                     <li>synonyms (an accession can be known by many names including local popular names. a synonym name can be used instead of the accession_name throughout the database; because of this, synonyms must themselves be unique. multiple synonyms can be given with comma separation (e.g. accession_synonym1,accession_synonym001))</li>
197 % if (exists($editable_stock_props->{'location_code'})){
198                     <li>location_code(s) (location code(s) for the accession. many can be uploaded at once in comma separated list)</li>
199 % }
200 % if (exists($editable_stock_props->{'ploidy_level'})){
201                     <li>ploidy_level(s) (a number indicating the ploidy (e.g. 2 for diploid, 3 for triploid), numeric. many values can be uploaded as comma separated list.)</li>
202 % }
203 % if (exists($editable_stock_props->{'genome_structure'})){
204                     <li>genome_structure(s) (genome structure(s) for accession which take into account ploidy and ancestral genome info e.g. AAA, AB. many can be uploaded as comma separated list.)</li>
205 % }
206 % if (exists($editable_stock_props->{'variety'})){
207                     <li>variety(s) (variety can be defined as a group of individuals or plants having similar traits that can be reproduced "true to type" from generation to generation. may be uploaded as comma separated list.)</li>
208 % }
209 % if (exists($editable_stock_props->{'donor'})){
210                     <li>donor(s) (the accession_name of the donor accession. may be uploaded as comma separated list.)</li>
211 % }
212 % if (exists($editable_stock_props->{'donor institute'})){
213                     <li>donor_institute(s) (the institute of the donor accession. may be uploaded as comma separated list.)</li>
214 % }
215 % if (exists($editable_stock_props->{'donor PUI'})){
216                     <li>donor_PUI(s) (the permanent unique identifier of the donor accession. may be uploaded as comma separated list.)</li>
217 % }
218 % if (exists($editable_stock_props->{'country of origin'})){
219                     <li>country_of_origin(s) (the country of origin. may be uploaded as comma separated list.)</li>
220 % }
221 % if (exists($editable_stock_props->{'state'})){
222                     <li>state(s) (the state of origin. may be uploaded as comma separated list.)</li>
223 % }
224 % if (exists($editable_stock_props->{'institute code'})){
225                     <li>institute_code(s) (the institute code of origin. may be uploaded as comma separated list.)</li>
226 % }
227 % if (exists($editable_stock_props->{'institute name'})){
228                     <li>institute_name(s) (the institute name of origin. may be uploaded as comma separated list.)</li>
229 % }
230 % if (exists($editable_stock_props->{'biological status of accession code'})){
231                     <li>biological_status_of_accession_code(s) (code indicating the state of accession. may be uploaded as comma separated list.)</li>
232 % }
233 % if (exists($editable_stock_props->{'notes'})){
234                     <li>notes(s) (free text for notes. may be uploaded as comma separated list.)</li>
235 % }
236 % if (exists($editable_stock_props->{'accession number'})){
237                     <li>accession_number(s) (accession number for accession from germplasm bank. may be uploaded as comma separated list.)</li>
238 % }
239 % if (exists($editable_stock_props->{'PUI'})){
240                     <li>PUI(s) (permanent unique identifier of the accession. may be uploaded as comma separated list.)</li>
241 % }
242 % if (exists($editable_stock_props->{'seed source'})){
243                     <li>seed_source(s) (origin of seed source. may be uploaded as comma separated list.)</li>
244 % }
245 % if (exists($editable_stock_props->{'type of germplasm storage code'})){
246                     <li>type_of_germplasm_storage_code(s) (code indicating the type of germplasm storage. may be uploaded as comma separated list.)</li>
247 % }
248 % if (exists($editable_stock_props->{'acquisition date'})){
249                     <li>acquisition_date(s) (date(s) of acquisition YYYYMMDD for accession. may be uploaded as comma separated list.)</li>
250 % }
251 % if (exists($editable_stock_props->{'transgenic'})){
252                     <li>transgenic (indicates if accession is transgenic. Please indicate 1 if transgenic and empty if otherwise.)</li>
253 % }
254 % if (exists($editable_stock_props->{'introgression_parent'})){
255                     <li>introgression_parent (if the accession you are adding has an introgression that originated from one of the parents, you can specify the parent here)</li>
256 % }
257 % if (exists($editable_stock_props->{'introgression_backcross_parent'})){
258                     <li>introgression_backcross_parent (the backcross parent for introducing an introgression into the accession being added)</li>
259 % }
260 % if (exists($editable_stock_props->{'introgression_map_version'})){
261                     <li>introgression_map_version (the map version for identifying the start and stop position of the introgression. e.g. AGPv2)</li>
262 % }
263 % if (exists($editable_stock_props->{'introgression_chromosome'})){
264                     <li>introgression_chromosome (the chromosome number that the introgression is on.)</li>
265 % }
266 % if (exists($editable_stock_props->{'introgression_start_position_bp'})){
267                     <li>introgression_start_position_bp (the start position of the introgression in base pairs)</li>
268 % }
269 % if (exists($editable_stock_props->{'introgression_end_position_bp'})){
270                     <li>introgression_start_position_bp (the end position of the introgression in base pairs)</li>
271 % }
272                     </ul>
273                 </div>
274             </div>
275             <div class="modal-footer">
276                 <button id="close_trial_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
277             </div>
278         </div>
279     </div>
280 </div>
282 <div class="modal fade" id="review_absent_dialog" name="review_absent_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewAbsentDialog" data-backdrop="static" data-keyboard="false">
283   <div class="modal-dialog modal-xl" role="document">
284     <div class="modal-content ui-front">
285       <div class="modal-header">
286         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
287         <h4 class="modal-title" id="reviewAbsentDialog">Accessions to be Added</h4>
288       </div>
289       <div class="modal-body">
290         <div class="container-fluid">
291             <div id="add_accessions_using_list_inputs" style="display:none">
292                 <label for="species_name_input">Species name for added accessions</label>
293                 <input class="form-control" type="text" id="species_name_input" value="<% $preferred_species %>"></input>
294                 <br><br>
295                 <label for="population_name_input">Population name for added accessions (optional)</label>
296                 <input class="form-control" type="text" id="population_name_input"></input>
297                 <br><br>
298                 <label for="organization_name_input">Organization name for added accessions (optional)</label>
299                 <input class="form-control" type="text" id="organization_name_input"></input>
300                 <br><br>
301                 <b>The following accessions are new and will be added to the database:</b>
302                 <div id="count_of_absent_accessions"></div>
303                 <br>
304                 <div id="view_absent"></div>
305             </div>
306             <div id="view_infoToAdd"></div>
307         </div>
308       </div>
309       <div class="modal-footer">
310         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
311         <button type="button" class="btn btn-primary" name="review_absent_accessions_submit" id="review_absent_accessions_submit">Add Accessions</button>
312       </div>
313     </div>
314   </div>
315 </div>
317 <div class="modal fade" id="review_fuzzy_matches_dialog" name="review_fuzzy_matches_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewFuzzyDialog" data-backdrop="static" data-keyboard="false">
318   <div class="modal-dialog modal-xl" role="document">
319     <div class="modal-content">
320       <div class="modal-header">
321         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
322         <h4 class="modal-title" id="reviewFuzzyDialog">Fuzzy Matches</h4>
323       </div>
324       <div class="modal-body">
325         <div class="container-fluid">
326           <b>Accessions were found with similar names.</b>
327           <br/><br/>
328           <div id="view_fuzzy_matches"></div>
329         </div>
330       </div>
331       <div class="modal-footer">
332         <button type="button" class="btn btn-default" name="review_fuzzy_matches_download" id="review_fuzzy_matches_download">Download Fuzzy Matches</button>
333         <button type="button" class="btn btn-primary" name="review_fuzzy_matches_continue" id="review_fuzzy_matches_continue" data-dismiss="modal">Make Changes and Continue</button>
334       </div>
335     </div>
336   </div>
337 </div>
339 <div class="modal fade" id="review_found_matches_dialog" name="review_found_matches_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewFoundDialog" data-backdrop="static" data-keyboard="false">
340   <div class="modal-dialog modal-xl" role="document">
341     <div class="modal-content">
342       <div class="modal-header">
343         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
344         <h4 class="modal-title" id="reviewFoundDialog">Found Accessions</h4>
345       </div>
346       <div class="modal-body">
347         <div class="container-fluid">
348           <b>The following accessions already exist in the database:</b>
349           <div id="count_of_found_accessions"></div>
350           <br/>
351           <div id="view_found_matches"></div>
352         </div>
353       </div>
354       <div class="modal-footer">
355         <button type="button" class="btn btn-primary" name="review_found_matches_hide" id="review_found_matches_hide" data-dismiss="modal">Continue</button>
356       </div>
357     </div>
358   </div>
359 </div>
361 <div class="modal fade" id="add_accessions_saved_message_modal" name="add_accessions_saved_message_modal" tabindex="-1" role="dialog" aria-labelledby="addAccessionsSavedDialog">
362     <div class="modal-dialog" role="document">
363         <div class="modal-content">
364             <div class="modal-header" style="text-align: center">
365                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
366                 <h4 class="modal-title" id="addAccessionsSavedDialog">Accessions Saved</h4>
367             </div>
368             <div class="modal-body">
369                 <div class="container-fluid">
370                     <div id="add_accessions_saved_message"></div>
371                 </div>
372             </div>
373             <div class="modal-footer">
374                 <button id="close_add_accessions_saved_message_modal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
375             </div>
376         </div>
377     </div>
378 </div>
380 <form id="add_accession_fuzzy_match_download" method="post" action="/ajax/accession_list/fuzzy_download" target="TheWindow">
381     <input type="hidden" name="fuzzy_response" value="" />
382 </form>
384 <style>
385 .ui-autocomplete {
386   max-height: 100px;
387   overflow-y: auto;
388   /* prevent horizontal scrollbar */
389   overflow-x: hidden;
392 /* IE 6 doesn't support max-height
393 * we use height instead, but this forces the menu to always be this tall
395 * html .ui-autocomplete {
396   height: 100px;
398 </style>