1 | <%inherit file="/base.mako"/> |
---|
2 | <%namespace file="/message.mako" import="render_msg" /> |
---|
3 | |
---|
4 | <script type="text/javascript"> |
---|
5 | $(document).ready(function(){ |
---|
6 | //hide the all of the element with class msg_body |
---|
7 | $(".msg_body").hide(); |
---|
8 | //toggle the component with class msg_body |
---|
9 | $(".msg_head").click(function(){ |
---|
10 | $(this).next(".msg_body").slideToggle(450); |
---|
11 | }); |
---|
12 | }); |
---|
13 | |
---|
14 | function display_file_details(request_id, folder_path) |
---|
15 | { |
---|
16 | var w = document.get_data.files_list.selectedIndex; |
---|
17 | var selected_value = document.get_data.files_list.options[w].value; |
---|
18 | var cell = $("#file_details"); |
---|
19 | if(selected_value.charAt(selected_value.length-1) != '/') |
---|
20 | { |
---|
21 | // Make ajax call |
---|
22 | $.ajax( { |
---|
23 | type: "POST", |
---|
24 | url: "${h.url_for( controller='requests_admin', action='get_file_details' )}", |
---|
25 | dataType: "json", |
---|
26 | data: { id: request_id, folder_path: document.get_data.folder_path.value + selected_value }, |
---|
27 | success : function ( data ) { |
---|
28 | cell.html( '<label>'+data+'</label>' ) |
---|
29 | } |
---|
30 | }); |
---|
31 | } |
---|
32 | else |
---|
33 | { |
---|
34 | cell.html( '' ) |
---|
35 | } |
---|
36 | } |
---|
37 | |
---|
38 | function open_folder1( request_id, folder_path ) |
---|
39 | { |
---|
40 | var w = document.get_data.files_list.selectedIndex; |
---|
41 | var selected_value = document.get_data.files_list.options[w].value; |
---|
42 | var cell = $("#file_details"); |
---|
43 | if(selected_value.charAt(selected_value.length-1) == '/') |
---|
44 | { |
---|
45 | document.get_data.folder_path.value = document.get_data.folder_path.value+selected_value |
---|
46 | // Make ajax call |
---|
47 | $.ajax( { |
---|
48 | type: "POST", |
---|
49 | url: "${h.url_for( controller='requests_admin', action='open_folder' )}", |
---|
50 | dataType: "json", |
---|
51 | data: { id: request_id, folder_path: document.get_data.folder_path.value }, |
---|
52 | success : function ( data ) { |
---|
53 | document.get_data.files_list.options.length = 0 |
---|
54 | for(i=0; i<data.length; i++) |
---|
55 | { |
---|
56 | var newOpt = new Option(data[i], data[i]); |
---|
57 | document.get_data.files_list.options[i] = newOpt; |
---|
58 | } |
---|
59 | //cell.html( '<label>'+data+'</label>' ) |
---|
60 | |
---|
61 | } |
---|
62 | }); |
---|
63 | } |
---|
64 | else |
---|
65 | { |
---|
66 | cell.html( '' ) |
---|
67 | } |
---|
68 | } |
---|
69 | </script> |
---|
70 | |
---|
71 | <br/> |
---|
72 | <br/> |
---|
73 | <ul class="manage-table-actions"> |
---|
74 | <li> |
---|
75 | <a class="action-button" href="${h.url_for( controller='requests_admin', action='view_request_type', id=trans.security.encode_id( request.type.id ) )}">Sequencer configuration "${request.type.name}"</a> |
---|
76 | </li> |
---|
77 | <li> |
---|
78 | <a class="action-button" href="${h.url_for( controller='requests_common', action='manage_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Browse this request</a> |
---|
79 | </li> |
---|
80 | </ul> |
---|
81 | |
---|
82 | %if message: |
---|
83 | ${render_msg( message, status )} |
---|
84 | %endif |
---|
85 | |
---|
86 | <div class="toolForm"> |
---|
87 | <div class="toolFormTitle">Select files for transfer</div> |
---|
88 | <form name="get_data" id="get_data" action="${h.url_for( controller='requests_admin', action='get_data', cntrller=cntrller, request_id=trans.security.encode_id( request.id ))}" method="post" > |
---|
89 | <div class="form-row"> |
---|
90 | <label>Sample:</label> |
---|
91 | ${sample_id_select_field.get_html()} |
---|
92 | <div class="toolParamHelp" style="clear: both;"> |
---|
93 | Select the sample with which you want to associate the datasets |
---|
94 | </div> |
---|
95 | <br/> |
---|
96 | <label>Folder path on the sequencer:</label> |
---|
97 | <input type="text" name="folder_path" value="${folder_path}" size="100"/> |
---|
98 | <input type="submit" name="browse_button" value="List contents"/> |
---|
99 | <input type="submit" name="folder_up" value="Up"/> |
---|
100 | </div> |
---|
101 | <div class="form-row"> |
---|
102 | <select name="files_list" id="files_list" style="max-width: 60%; width: 98%; height: 150px; font-size: 100%;" ondblclick="open_folder1(${request.id}, '${folder_path}')" onChange="display_file_details(${request.id}, '${folder_path}')" multiple> |
---|
103 | %for index, f in enumerate( files ): |
---|
104 | <option value="${f}">${f}</option> |
---|
105 | %endfor |
---|
106 | </select> |
---|
107 | </div> |
---|
108 | <div class="form-row"> |
---|
109 | <div id="file_details" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div> |
---|
110 | </div> |
---|
111 | <div class="form-row"> |
---|
112 | <input type="submit" name="select_show_datasets_button" value="Select & show datasets"/> |
---|
113 | <input type="submit" name="select_more_button" value="Select more"/> |
---|
114 | </div> |
---|
115 | </form> |
---|
116 | </div> |
---|