tweak multiple trait models output check..
[sgn.git] / mason / breeders_toolbox / breeder_search_dataset.mas
blob290238851960ff0bba77e16859e39ba456819c82
2 <%args>
4 </%args>
6 <& /util/import_javascript.mas, classes => [ 'jqueryui', 'jquery.cookie', 'CXGN.BreederSearch', 'CXGN.List', 'CXGN.BreedersToolbox.HTMLSelect', 'spin_min', 'ladda_min', 'CXGN.Dataset' ] &>
8 <div class="modal fade" id="save_wizard_dataset_dialog" name="save_wizard_dataset_dialog" tabindex="-1" role="dialog" aria-labelledby="downloadWizardPhenotypesDialog">
9   <div class="modal-dialog" role="document">
10     <div class="modal-content">
11       <div class="modal-header">
12         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
13         <h4 class="modal-title" id="saveWizardDatasetDialog">Save Dataset</h4>
14       </div>
15       <div class="modal-body">
16         <div class="container-fluid">
18             <div class="form-group">
19                 <label class="col-sm-3 control-label">Selection Name </label>
20                 <div class="col-sm-9" >
21                     <input type="text" class="form-control" id="save_wizard_dataset_name" />                  
22                 </div>
23             </div>
24         </form><br/>
26         </div>
27       </div>
28       <div class="modal-footer">
29         
30         <button type="button" class="btn btn-default" name="save_wizard_dataset_cancel_button" id="save_wizard_dataset_cancel_button" data-target="#save_wizard_dataset_cancel_button">Cancel</button>
31         <button type="button" class="btn btn-primary" name="save_dataset_submit_button" id="wizard_save_dataset_submit_button" title="Submit">Save</button>
32       </div>
33     </div>
34   </div>
35 </div>
37 <table  alt="breeder search" border="0" ><tr>
38         <td>
39           <div>
40             <br />
41             <button class="btn btn-primary" id="wizard_save_dataset_button" data-style="expand-right" title="To save selections, you must be logged in with a filter selected">Save current selection</button>
42           </div>
43         </td>
44         <td width="30">&nbsp;</td>
45         <td width="300">
46           Retrieve stored selections<br />
47           <div id="dataset_manage_select" >
48           </div>
49           <script>
50             if (isLoggedIn()) { 
51               get_select_box('datasets','dataset_manage_select');
52             }
53             else { 
54               jQuery('#dataset_manage_select').html('(Log in to use feature)');
55             }
57           </script>
58           <button type="button" id="show_dataset_on_wizard_button" >Show on wizard</button>
59           <button type="button" id="show_dataset_metadata_button" >View metadata</button>
60           <button id="delete_dataset_button">Delete</button>
61   </td></tr>
62 </table> 
64 <div id="dataset_details_dialog" class="modal fade" role="dialog">
65   <div class="modal-dialog"> 
66     <div class="modal-content">
67       <div class="modal-header">
68         <h4>Selection Details</h4>
69       </div>
71       <div class="modal-body">
72         <div id="dataset_details_content">[loading...]</div>
73       </div>
74       <div class="modal-footer">
75         <button type="button" class="btn btn-default" id="dataset_details_dialog_close_button">Close</button>
76       </div>
77     </div>
78   </div>
79     
80 <script>
82 jQuery(document).ready(function () {
84   jQuery('#show_dataset_metadata_button').click( function() { 
85     jQuery('#dataset_details_dialog').modal('show');
86     showDatasetItems('dataset_details_content', jQuery('#dataset_manage_select').find(':selected').val());
87   });
89   jQuery('#dataset_details_dialog_close_button').click( function() { 
90     jQuery('#dataset_details_dialog').modal("hide");
91     jQuery('.modal-backdrop').remove();
92   });
94   jQuery('#save_wizard_dataset_cancel_button').click( function() { 
95     jQuery('#save_wizard_dataset_dialog').modal("hide");
96     jQuery('.modal-backddrop').remove();
97   });
99   if (!isLoggedIn()) { 
100     jQuery('#show_dataset_on_wizard_button').attr('disabled', true);
101     jQuery('#delete_dataset_button').attr('disabled', true);
102     jQuery('#show_dataset_metadata_button').attr('disabled', true);
103     jQuery('#wizard_save_dataset_button').attr('disabled', true);
104   } 
106   jQuery('#show_dataset_on_wizard_button').click(function() { 
107     var d = new CXGN.Dataset();
108     var dataset_id = jQuery('#dataset_manage_select').find(':selected').val();
109     replay_dataset_info(dataset_id, 1);    
110   });
112   jQuery('#delete_dataset_button').click(function() { 
113     var dataset_name = jQuery('#dataset_manage_select').find(':selected').text();
114     var dataset_id = jQuery('#dataset_manage_select').find(':selected').val();
115     
116     if (confirm('Would you really like to delete the dataset "'+dataset_name+'"? This operation cannot be undone.')) { 
117       var d = new CXGN.Dataset();
118       d.deleteDataset(dataset_id);
119       get_select_box('datasets','dataset_manage_select');
120     }
121       
122   });
126 </script>