8 <& /util/import_javascript.mas, classes => [ 'jquery.iframe-post-form', 'jstree.dist.jstree', 'CXGN.TrialTreeFolders'] &>
10 <& /util/import_css.mas, paths => ['/static/documents/inc/jstree_theme/jstree-bstheme-min.css'] &>
12 <& /breeders_toolbox/genotyping_trials/upload_genotyping_data_dialogs.mas, facilities => $facilities &>
13 <& /breeders_toolbox/genotyping_trials/create_genotyping_trial_dialogs.mas, facilities => $facilities &>
14 <& /breeders_toolbox/genotyping_data_project/create_genotyping_project_dialog.mas, facilities => $facilities &>
15 <& /breeders_toolbox/folder/folder_set.mas, project_type=>'genotyping_project' &>
16 <& /breeders_toolbox/folder/folder_new.mas, project_type=>'genotyping_project' &>
17 <& /breeders_toolbox/folder/folder_move.mas, project_type=>'genotyping_project' &>
18 <& /breeders_toolbox/folder/folders_edit.mas, folder_tree_type => 'genotyping_project', folder_tree_identifier => 'genotyping_project_list', folder_tree_refresh_name => 'refresh_genotyping_project_jstree_html' &>
20 <table class="table table-bordered">
24 <th>Breeding Programs -- Folders -- Genotyping Projects <button class="btn btn-sm btn-default" id="refresh_genotyping_project_jstree_html_button" name="refresh_genotyping_project_jstree_html">Refresh</button></th>
31 <input type="text" class="form-control input-sm" id="genotyping_project_tree_search" placeholder="Search" />
34 <h5><i>Double click<br />genotyping project ( <span class="glyphicon glyphicon-align-left text-warning"></span> ) or folder ( <span class="glyphicon glyphicon-folder-open text-danger"></span> )<br/>to view detail page.</i></h5>
35 <h5><i>Breeding programs ( <span class="glyphicon glyphicon-briefcase text-info"></span> )</i></h5>
38 <button class="btn btn-sm btn-default" id="new_folder_dialog_link">Create new folder</button><br/><br/>
39 <button class="btn btn-sm btn-default" id="open_folder_dialog_link">Move genotyping project(s) to folder</button><br/><br/>
40 <button class="btn btn-sm btn-default" id="move_folder_dialog_link">Move folder</button>
42 <div id="folder_edit_options" style="display:none">
44 <h5><i>Select multiple folders by holding 'Ctrl'.</i></h5>
45 <button class="btn btn-primary" id="edit_folders_button" title="First Select Folder(s) to Edit">Edit Folder(s)</button>
49 <!--<button id="delete" disabled="disabled" >Delete</button -->
53 <div id="genotyping_project_list" >[loading...]</div>
64 jQuery(document).ready(function($) {
67 url: '/ajax/breeders/get_trials_with_folders_cached?type=genotyping_project',
68 success: function(response) {
69 var html = '<ul>'+response.html+'</ul>';
71 jQuery('#genotyping_project_list').html(html);
73 jQuery('#genotyping_project_list').jstree( {
74 "core": { 'themes': { 'name': 'proton', 'responsive': true}},
75 "valid_children" : [ "folder", "breeding_program", "genotyping_project"],
77 "breeding_program" : {
78 "icon": 'glyphicon glyphicon-briefcase text-info',
81 "icon": 'glyphicon glyphicon-folder-open text-danger',
83 "genotyping_project" : {
84 "icon": 'glyphicon glyphicon-align-left text-warning',
88 "case_insensitive" : true,
90 "plugins" : ["html_data","types","search"],
93 error: function(response) {
94 alert("An error occurred while loading the genotyping projects.");
98 jQuery("#genotyping_project_tree_search").keyup(function() {
99 var v = jQuery("#genotyping_project_tree_search").val();
100 jQuery("#genotyping_project_list").jstree(true).search(v);
103 jQuery("#genotyping_project_list").delegate("li", "dblclick", function(event){
104 var node = $("#genotyping_project_list").jstree("get_node", this);
105 if (node.id.substr(0,1) !== 'j') {
106 if (node.type == 'folder') {
107 window.open('/folder/'+node.id);
108 event.stopPropagation();
109 } else if (node.type == 'genotyping_project') {
110 window.open('/breeders_toolbox/trial/'+node.id);
111 event.stopPropagation();