1 | <%inherit file="/webapps/galaxy/base_panels.mako"/> |
---|
2 | |
---|
3 | <%def name="late_javascripts()"> |
---|
4 | ${parent.late_javascripts()} |
---|
5 | <script type="text/javascript"> |
---|
6 | // Set up GalaxyAsync object. |
---|
7 | var galaxy_async = new GalaxyAsync(); |
---|
8 | galaxy_async.set_func_url(galaxy_async.set_user_pref, "${h.url_for( controller='user', action='set_user_pref_async' )}"); |
---|
9 | |
---|
10 | $(function(){ |
---|
11 | // Init history options. |
---|
12 | $("#history-options-button").css( "position", "relative" ); |
---|
13 | make_popupmenu( $("#history-options-button"), { |
---|
14 | "History Lists": null, |
---|
15 | "Saved Histories": function() { |
---|
16 | galaxy_main.location = "${h.url_for( controller='history', action='list')}"; |
---|
17 | }, |
---|
18 | "Histories Shared with Me": function() { |
---|
19 | galaxy_main.location = "${h.url_for( controller='history', action='list_shared')}"; |
---|
20 | }, |
---|
21 | "Current History": null, |
---|
22 | "Create New": function() { |
---|
23 | galaxy_history.location = "${h.url_for( controller='root', action='history_new' )}"; |
---|
24 | }, |
---|
25 | "Clone": function() { |
---|
26 | galaxy_main.location = "${h.url_for( controller='history', action='clone')}"; |
---|
27 | }, |
---|
28 | "Share or Publish": function() { |
---|
29 | galaxy_main.location = "${h.url_for( controller='history', action='sharing' )}"; |
---|
30 | }, |
---|
31 | "Extract Workflow": function() { |
---|
32 | galaxy_main.location = "${h.url_for( controller='workflow', action='build_from_current_history' )}"; |
---|
33 | }, |
---|
34 | "Dataset Security": function() { |
---|
35 | galaxy_main.location = "${h.url_for( controller='root', action='history_set_default_permissions' )}"; |
---|
36 | }, |
---|
37 | "Show Deleted Datasets": function() { |
---|
38 | galaxy_history.location = "${h.url_for( controller='root', action='history', show_deleted=True)}"; |
---|
39 | }, |
---|
40 | "Show Hidden Datasets": function() { |
---|
41 | galaxy_history.location = "${h.url_for( controller='root', action='history', show_hidden=True)}"; |
---|
42 | }, |
---|
43 | "Show structure": function() { |
---|
44 | galaxy_main.location = "${h.url_for( controller='history', action='display_structured' )}"; |
---|
45 | }, |
---|
46 | "Export to File": function() { |
---|
47 | galaxy_main.location = "${h.url_for( controller='history', action='export_archive' )}"; |
---|
48 | }, |
---|
49 | "Delete": function() |
---|
50 | { |
---|
51 | if ( confirm( "Really delete the current history?" ) ) |
---|
52 | { |
---|
53 | galaxy_main.location = "${h.url_for( controller='history', action='delete_current' )}"; |
---|
54 | } |
---|
55 | }, |
---|
56 | ##"Other Actions": null, |
---|
57 | ##"Import from File": function() { |
---|
58 | ## galaxy_main.location = "${h.url_for( controller='history', action='import_archive' )}"; |
---|
59 | ##} |
---|
60 | }); |
---|
61 | |
---|
62 | // Init tool options. |
---|
63 | make_popupmenu( $("#tools-options-button"), { |
---|
64 | ## Search tools menu item. |
---|
65 | %if trans.app.toolbox_search.enabled: |
---|
66 | <% |
---|
67 | show_tool_search = False |
---|
68 | if trans.user: |
---|
69 | show_tool_search = trans.user.preferences.get( "show_tool_search", "False" ) |
---|
70 | |
---|
71 | if show_tool_search == "True": |
---|
72 | initial_text = "Hide Search" |
---|
73 | else: |
---|
74 | initial_text = "Search Tools" |
---|
75 | %> |
---|
76 | "${initial_text}": function() { |
---|
77 | // Show/hide menu and update vars, user preferences. |
---|
78 | var menu = $("#galaxy_tools").contents().find('#tool-search'); |
---|
79 | if (menu.is(":visible")) |
---|
80 | { |
---|
81 | // Hide menu. |
---|
82 | pref_value = "False"; |
---|
83 | menu_option_text = "Search Tools"; |
---|
84 | menu.toggle(); |
---|
85 | |
---|
86 | // Reset search. |
---|
87 | reset_tool_search(true); |
---|
88 | } |
---|
89 | else |
---|
90 | { |
---|
91 | // Show menu. |
---|
92 | pref_value = "True"; |
---|
93 | menu_option_text = "Hide Search"; |
---|
94 | menu.toggle(); |
---|
95 | } |
---|
96 | |
---|
97 | // Update menu option. |
---|
98 | $("#tools-options-button-menu").find("li").eq(0).text(menu_option_text); |
---|
99 | |
---|
100 | galaxy_async.set_user_pref("show_tool_search", pref_value); |
---|
101 | }, |
---|
102 | %endif |
---|
103 | ## Recently used tools menu. |
---|
104 | %if trans.user: |
---|
105 | <% |
---|
106 | if trans.user.preferences.get( 'show_recently_used_menu', 'False' ) == 'True': |
---|
107 | action = "Hide" |
---|
108 | else: |
---|
109 | action = "Show" |
---|
110 | %> |
---|
111 | "${action} Recently Used": function() { |
---|
112 | // Show/hide menu. |
---|
113 | var ru_menu = $('#galaxy_tools').contents().find('#recently_used_wrapper'); |
---|
114 | var ru_menu_body = ru_menu.find(".toolSectionBody"); |
---|
115 | var pref_value = null; |
---|
116 | var menu_option_text = null; |
---|
117 | if (ru_menu.hasClass("user_pref_visible")) |
---|
118 | { |
---|
119 | // Hide menu. |
---|
120 | ru_menu_body.slideUp(); |
---|
121 | ru_menu.slideUp(); |
---|
122 | |
---|
123 | // Set vars used below and in tool menu frame. |
---|
124 | pref_value = "False"; |
---|
125 | menu_option_text = "Show Recently Used"; |
---|
126 | } |
---|
127 | else |
---|
128 | { |
---|
129 | // "Show" menu. |
---|
130 | if (!$('#galaxy_tools').contents().find('#tool-search-query').hasClass("search_active")) |
---|
131 | // Default. |
---|
132 | ru_menu.slideDown(); |
---|
133 | else |
---|
134 | // Search active: tf there are matching tools in RU menu, show menu. |
---|
135 | if ( ru_menu.find(".toolTitle.search_match").length != 0 ) |
---|
136 | { |
---|
137 | ru_menu.slideDown(); |
---|
138 | ru_menu_body.slideDown(); |
---|
139 | } |
---|
140 | |
---|
141 | // Set vars used below and in tool menu frame. |
---|
142 | pref_value = "True"; |
---|
143 | menu_option_text = "Hide Recently Used"; |
---|
144 | } |
---|
145 | |
---|
146 | // Update menu class and option. |
---|
147 | ru_menu.toggleClass("user_pref_hidden user_pref_visible"); |
---|
148 | $("#tools-options-button-menu").find("li").eq(1).text(menu_option_text); |
---|
149 | |
---|
150 | galaxy_async.set_user_pref("show_recently_used_menu", pref_value); |
---|
151 | } |
---|
152 | %endif |
---|
153 | }); |
---|
154 | }); |
---|
155 | </script> |
---|
156 | </%def> |
---|
157 | |
---|
158 | <%def name="init()"> |
---|
159 | <% |
---|
160 | if trans.app.config.cloud_controller_instance: |
---|
161 | self.has_left_panel=False |
---|
162 | self.has_right_panel=False |
---|
163 | self.active_view="cloud" |
---|
164 | else: |
---|
165 | self.has_left_panel=True |
---|
166 | self.has_right_panel=True |
---|
167 | self.active_view="analysis" |
---|
168 | %> |
---|
169 | %if trans.app.config.require_login and not trans.user: |
---|
170 | <script type="text/javascript"> |
---|
171 | if ( window != top ) { |
---|
172 | top.location.href = location.href; |
---|
173 | } |
---|
174 | </script> |
---|
175 | %endif |
---|
176 | </%def> |
---|
177 | |
---|
178 | <%def name="left_panel()"> |
---|
179 | <div class="unified-panel-header" unselectable="on"> |
---|
180 | <div class='unified-panel-header-inner'> |
---|
181 | <div style="float: right"> |
---|
182 | <a class='panel-header-button popup' id="tools-options-button" href="#">${_('Options')}</a> |
---|
183 | </div> |
---|
184 | ${n_('Tools')} |
---|
185 | </div> |
---|
186 | </div> |
---|
187 | <div class="unified-panel-body" style="overflow: hidden;"> |
---|
188 | <iframe name="galaxy_tools" id="galaxy_tools" src="${h.url_for( controller='root', action='tool_menu' )}" frameborder="0" style="position: absolute; margin: 0; border: 0 none; height: 100%; width: 100%;"> </iframe> |
---|
189 | </div> |
---|
190 | </%def> |
---|
191 | |
---|
192 | <%def name="center_panel()"> |
---|
193 | |
---|
194 | ## If a specific tool id was specified, load it in the middle frame |
---|
195 | <% |
---|
196 | if trans.app.config.require_login and not trans.user: |
---|
197 | center_url = h.url_for( controller='user', action='login' ) |
---|
198 | elif tool_id is not None: |
---|
199 | center_url = h.url_for( 'tool_runner', tool_id=tool_id, from_noframe=True ) |
---|
200 | elif workflow_id is not None: |
---|
201 | center_url = h.url_for( controller='workflow', action='run', id=workflow_id ) |
---|
202 | elif m_c is not None: |
---|
203 | center_url = h.url_for( controller=m_c, action=m_a ) |
---|
204 | elif trans.app.config.cloud_controller_instance: |
---|
205 | center_url = h.url_for( controller='cloud', action='list' ) |
---|
206 | else: |
---|
207 | center_url = h.url_for( '/static/welcome.html' ) |
---|
208 | %> |
---|
209 | |
---|
210 | <iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"> </iframe> |
---|
211 | |
---|
212 | </%def> |
---|
213 | |
---|
214 | <%def name="right_panel()"> |
---|
215 | <div class="unified-panel-header" unselectable="on"> |
---|
216 | <div class="unified-panel-header-inner"> |
---|
217 | <div style="float: right"> |
---|
218 | <a id="history-options-button" class='panel-header-button popup' href="${h.url_for( controller='root', action='history_options' )}" target="galaxy_main">${_('Options')}</a> |
---|
219 | </div> |
---|
220 | <div class="panel-header-text">${_('History')}</div> |
---|
221 | </div> |
---|
222 | </div> |
---|
223 | <div class="unified-panel-body" style="overflow: hidden;"> |
---|
224 | <iframe name="galaxy_history" width="100%" height="100%" frameborder="0" style="position: absolute; margin: 0; border: 0 none; height: 100%;" src="${h.url_for( controller='root', action='history' )}"></iframe> |
---|
225 | </div> |
---|
226 | </%def> |
---|