1 | from mako import runtime, filters, cache |
---|
2 | UNDEFINED = runtime.UNDEFINED |
---|
3 | __M_dict_builtin = dict |
---|
4 | __M_locals_builtin = locals |
---|
5 | _magic_number = 5 |
---|
6 | _modified_time = 1287725326.7917881 |
---|
7 | _template_filename=u'templates/webapps/galaxy/base_panels.mako' |
---|
8 | _template_uri=u'/webapps/galaxy/base_panels.mako' |
---|
9 | _template_cache=cache.Cache(__name__, _modified_time) |
---|
10 | _source_encoding=None |
---|
11 | _exports = ['masthead', 'title'] |
---|
12 | |
---|
13 | |
---|
14 | def _mako_get_namespace(context, name): |
---|
15 | try: |
---|
16 | return context.namespaces[(__name__, name)] |
---|
17 | except KeyError: |
---|
18 | _mako_generate_namespaces(context) |
---|
19 | return context.namespaces[(__name__, name)] |
---|
20 | def _mako_generate_namespaces(context): |
---|
21 | pass |
---|
22 | def _mako_inherit(template, context): |
---|
23 | _mako_generate_namespaces(context) |
---|
24 | return runtime._inherit_from(context, u'/base_panels.mako', _template_uri) |
---|
25 | def render_body(context,**pageargs): |
---|
26 | context.caller_stack._push_frame() |
---|
27 | try: |
---|
28 | __M_locals = __M_dict_builtin(pageargs=pageargs) |
---|
29 | __M_writer = context.writer() |
---|
30 | # SOURCE LINE 1 |
---|
31 | __M_writer(u'\n\n') |
---|
32 | # SOURCE LINE 4 |
---|
33 | __M_writer(u'\n\n') |
---|
34 | # SOURCE LINE 172 |
---|
35 | __M_writer(u'\n') |
---|
36 | return '' |
---|
37 | finally: |
---|
38 | context.caller_stack._pop_frame() |
---|
39 | |
---|
40 | |
---|
41 | def render_masthead(context): |
---|
42 | context.caller_stack._push_frame() |
---|
43 | try: |
---|
44 | h = context.get('h', UNDEFINED) |
---|
45 | app = context.get('app', UNDEFINED) |
---|
46 | trans = context.get('trans', UNDEFINED) |
---|
47 | def tab(id,display,href,target='_parent',visible=True,extra_class='',menu_options=None): |
---|
48 | context.caller_stack._push_frame() |
---|
49 | try: |
---|
50 | self = context.get('self', UNDEFINED) |
---|
51 | len = context.get('len', UNDEFINED) |
---|
52 | __M_writer = context.writer() |
---|
53 | # SOURCE LINE 15 |
---|
54 | __M_writer(u'\n') |
---|
55 | # SOURCE LINE 18 |
---|
56 | __M_writer(u' \n ') |
---|
57 | # SOURCE LINE 19 |
---|
58 | |
---|
59 | cls = "tab" |
---|
60 | if extra_class: |
---|
61 | cls += " " + extra_class |
---|
62 | if self.active_view == id: |
---|
63 | cls += " active" |
---|
64 | style = "" |
---|
65 | if not visible: |
---|
66 | style = "display: none;" |
---|
67 | |
---|
68 | |
---|
69 | # SOURCE LINE 28 |
---|
70 | __M_writer(u'\n <td class="') |
---|
71 | # SOURCE LINE 29 |
---|
72 | __M_writer(unicode(cls)) |
---|
73 | __M_writer(u'" style="') |
---|
74 | __M_writer(unicode(style)) |
---|
75 | __M_writer(u'">\n') |
---|
76 | # SOURCE LINE 30 |
---|
77 | if href: |
---|
78 | # SOURCE LINE 31 |
---|
79 | __M_writer(u' <a target="') |
---|
80 | __M_writer(unicode(target)) |
---|
81 | __M_writer(u'" href="') |
---|
82 | __M_writer(unicode(href)) |
---|
83 | __M_writer(u'">') |
---|
84 | __M_writer(unicode(display)) |
---|
85 | __M_writer(u'</a>\n') |
---|
86 | # SOURCE LINE 32 |
---|
87 | else: |
---|
88 | # SOURCE LINE 33 |
---|
89 | __M_writer(u' <a>') |
---|
90 | __M_writer(unicode(display)) |
---|
91 | __M_writer(u'</a>\n') |
---|
92 | # SOURCE LINE 35 |
---|
93 | if menu_options: |
---|
94 | # SOURCE LINE 36 |
---|
95 | __M_writer(u' <div class="submenu">\n <ul>\n') |
---|
96 | # SOURCE LINE 38 |
---|
97 | for menu_item in menu_options: |
---|
98 | # SOURCE LINE 39 |
---|
99 | __M_writer(u' <li>\n') |
---|
100 | # SOURCE LINE 40 |
---|
101 | if not menu_item: |
---|
102 | # SOURCE LINE 41 |
---|
103 | __M_writer(u' <hr style="color: inherit; background-color: gray"/></li>\n') |
---|
104 | # SOURCE LINE 42 |
---|
105 | else: |
---|
106 | # SOURCE LINE 43 |
---|
107 | if len ( menu_item ) == 1: |
---|
108 | # SOURCE LINE 44 |
---|
109 | __M_writer(u' ') |
---|
110 | __M_writer(unicode(menu_item[0])) |
---|
111 | __M_writer(u'\n') |
---|
112 | # SOURCE LINE 45 |
---|
113 | elif len ( menu_item ) == 2: |
---|
114 | # SOURCE LINE 46 |
---|
115 | __M_writer(u' ') |
---|
116 | name, link = menu_item |
---|
117 | |
---|
118 | __M_writer(u'\n <a href="') |
---|
119 | # SOURCE LINE 47 |
---|
120 | __M_writer(unicode(link)) |
---|
121 | __M_writer(u'">') |
---|
122 | __M_writer(unicode(name)) |
---|
123 | __M_writer(u'</a></li>\n') |
---|
124 | # SOURCE LINE 48 |
---|
125 | else: |
---|
126 | # SOURCE LINE 49 |
---|
127 | __M_writer(u' ') |
---|
128 | name, link, target = menu_item |
---|
129 | |
---|
130 | __M_writer(u'\n <a target="') |
---|
131 | # SOURCE LINE 50 |
---|
132 | __M_writer(unicode(target)) |
---|
133 | __M_writer(u'" href="') |
---|
134 | __M_writer(unicode(link)) |
---|
135 | __M_writer(u'">') |
---|
136 | __M_writer(unicode(name)) |
---|
137 | __M_writer(u'</a></li>\n') |
---|
138 | # SOURCE LINE 54 |
---|
139 | __M_writer(u' </ul>\n </div>\n') |
---|
140 | # SOURCE LINE 57 |
---|
141 | __M_writer(u' </td>\n ') |
---|
142 | return '' |
---|
143 | finally: |
---|
144 | context.caller_stack._pop_frame() |
---|
145 | __M_writer = context.writer() |
---|
146 | # SOURCE LINE 7 |
---|
147 | __M_writer(u'\n\n') |
---|
148 | # SOURCE LINE 10 |
---|
149 | __M_writer(u' <div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center">\n \n <table class="tab-group" border="0" cellspacing="0" style="margin: auto;">\n <tr>\n \n ') |
---|
150 | # SOURCE LINE 58 |
---|
151 | __M_writer(u'\n \n\n') |
---|
152 | # SOURCE LINE 62 |
---|
153 | __M_writer(u' ') |
---|
154 | __M_writer(unicode(tab( "analysis", "Analyze Data", h.url_for( controller='/root', action='index' ) ))) |
---|
155 | __M_writer(u'\n \n') |
---|
156 | # SOURCE LINE 65 |
---|
157 | __M_writer(u' ') |
---|
158 | __M_writer(unicode(tab( "workflow", "Workflow", h.url_for( controller='/workflow', action='index' ) ))) |
---|
159 | __M_writer(u'\n \n') |
---|
160 | # SOURCE LINE 68 |
---|
161 | __M_writer(u' ') |
---|
162 | |
---|
163 | menu_options = [ |
---|
164 | [ 'Data Libraries', h.url_for( controller='/library', action='index') ], |
---|
165 | None, |
---|
166 | [ 'Published Histories', h.url_for( controller='/history', action='list_published' ) ], |
---|
167 | [ 'Published Workflows', h.url_for( controller='/workflow', action='list_published' ) ], |
---|
168 | [ 'Published Visualizations', h.url_for( controller='/visualization', action='list_published' ) ], |
---|
169 | [ 'Published Pages', h.url_for( controller='/page', action='list_published' ) ] |
---|
170 | ] |
---|
171 | tab( "shared", "Shared Data", h.url_for( controller='/library', action='index'), menu_options=menu_options ) |
---|
172 | |
---|
173 | |
---|
174 | # SOURCE LINE 78 |
---|
175 | __M_writer(u'\n \n') |
---|
176 | # SOURCE LINE 81 |
---|
177 | __M_writer(u' ') |
---|
178 | |
---|
179 | menu_options = [ |
---|
180 | [ 'Sequencing Requests', h.url_for( controller='/requests', action='index' ) ], |
---|
181 | [ 'Find Samples', h.url_for( controller='/requests', action='find_samples_index' ) ], |
---|
182 | [ 'Help', app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rkchak/p/sts" ), "galaxy_main" ] |
---|
183 | ] |
---|
184 | tab( "lab", "Lab", None, menu_options=menu_options, visible=( trans.user and trans.user.requests ) ) |
---|
185 | |
---|
186 | |
---|
187 | # SOURCE LINE 88 |
---|
188 | __M_writer(u'\n\n') |
---|
189 | # SOURCE LINE 91 |
---|
190 | if app.config.get_bool( 'enable_tracks', False ): |
---|
191 | # SOURCE LINE 92 |
---|
192 | __M_writer(u' ') |
---|
193 | |
---|
194 | menu_options = [ |
---|
195 | ['New Track Browser', h.url_for( controller='/tracks', action='index' ) ], |
---|
196 | ['Saved Visualizations', h.url_for( controller='/visualization', action='list' ) ] |
---|
197 | ] |
---|
198 | tab( "visualization", "Visualization", h.url_for( controller='/visualization', action='list'), menu_options=menu_options ) |
---|
199 | |
---|
200 | |
---|
201 | # SOURCE LINE 98 |
---|
202 | __M_writer(u'\n') |
---|
203 | # SOURCE LINE 100 |
---|
204 | __M_writer(u'\n') |
---|
205 | # SOURCE LINE 102 |
---|
206 | __M_writer(u' ') |
---|
207 | __M_writer(unicode(tab( "admin", "Admin", h.url_for( controller='/admin', action='index' ), extra_class="admin-only", visible=( trans.user and app.config.is_admin_user( trans.user ) ) ))) |
---|
208 | __M_writer(u'\n \n') |
---|
209 | # SOURCE LINE 105 |
---|
210 | __M_writer(u' ') |
---|
211 | |
---|
212 | menu_options = [ |
---|
213 | ['Email comments, bug reports, or suggestions', app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" ) ], |
---|
214 | ['Galaxy Wiki', app.config.get( "wiki_url", "http://bitbucket.org/galaxy/galaxy-central/wiki" ), "_blank" ], |
---|
215 | ['Video tutorials (screencasts)', app.config.get( "screencasts_url", "http://galaxycast.org" ), "_blank" ], |
---|
216 | ['How to Cite Galaxy', app.config.get( "screencasts_url", "http://bitbucket.org/galaxy/galaxy-central/wiki/Citations" ), "_blank" ] |
---|
217 | ] |
---|
218 | tab( "help", "Help", None, menu_options=menu_options) |
---|
219 | |
---|
220 | |
---|
221 | # SOURCE LINE 113 |
---|
222 | __M_writer(u'\n \n') |
---|
223 | # SOURCE LINE 116 |
---|
224 | __M_writer(u' ') |
---|
225 | |
---|
226 | # Menu for user who is not logged in. |
---|
227 | menu_options = [ [ "Login", h.url_for( controller='/user', action='login' ), "galaxy_main" ] ] |
---|
228 | if app.config.allow_user_creation: |
---|
229 | menu_options.append( [ "Register", h.url_for( controller='/user', action='create' ), "galaxy_main" ] ) |
---|
230 | extra_class = "loggedout-only" |
---|
231 | visible = ( trans.user == None ) |
---|
232 | tab( "user", "User", None, visible=visible, menu_options=menu_options ) |
---|
233 | |
---|
234 | # Menu for user who is logged in. |
---|
235 | if trans.user: |
---|
236 | email = trans.user.email |
---|
237 | else: |
---|
238 | email = "" |
---|
239 | menu_options = [ [ '<li>Logged in as <span id="user-email">%s</span></li>' % email ] ] |
---|
240 | if app.config.use_remote_user: |
---|
241 | if app.config.remote_user_logout_href: |
---|
242 | menu_options.append( [ 'Logout', app.config.remote_user_logout_href, "galaxy_main" ] ) |
---|
243 | else: |
---|
244 | menu_options.append( [ 'Preferences', h.url_for( controller='/user', action='index' ), "galaxy_main" ] ) |
---|
245 | if app.config.get_bool( 'enable_tracks', False ): |
---|
246 | menu_options.append( [ 'Custom Builds', h.url_for( controller='/user', action='dbkeys' ), "galaxy_main" ] ) |
---|
247 | if app.config.require_login: |
---|
248 | logout_url = h.url_for( controller='/root', action='index', m_c='user', m_a='logout' ) |
---|
249 | else: |
---|
250 | logout_url = h.url_for( controller='/user', action='logout' ) |
---|
251 | menu_options.append( [ 'Logout', logout_url, "_top" ] ) |
---|
252 | menu_options.append( None ) |
---|
253 | menu_options.append( [ 'Saved Histories', h.url_for( controller='/history', action='list' ), "galaxy_main" ] ) |
---|
254 | menu_options.append( [ 'Saved Datasets', h.url_for( controller='/dataset', action='list' ), "galaxy_main" ] ) |
---|
255 | if app.config.get_bool( 'enable_pages', False ): |
---|
256 | menu_options.append( [ 'Saved Pages', h.url_for( controller='/page', action='list' ), "_top" ] ) |
---|
257 | if app.config.enable_api: |
---|
258 | menu_options.append( [ 'API Keys', h.url_for( controller='/user', action='api_keys' ), "galaxy_main" ] ) |
---|
259 | |
---|
260 | extra_class = "loggedin-only" |
---|
261 | visible = ( trans.user != None ) |
---|
262 | tab( "user", "User", None, visible=visible, menu_options=menu_options ) |
---|
263 | |
---|
264 | |
---|
265 | # SOURCE LINE 154 |
---|
266 | __M_writer(u'\n \n </tr>\n </table>\n \n </div>\n \n') |
---|
267 | # SOURCE LINE 162 |
---|
268 | __M_writer(u' <div class="title" style="position: absolute; top: 0; left: 0;">\n <a href="') |
---|
269 | # SOURCE LINE 163 |
---|
270 | __M_writer(unicode(app.config.get( 'logo_url', '/' ))) |
---|
271 | __M_writer(u'">\n <img border="0" src="') |
---|
272 | # SOURCE LINE 164 |
---|
273 | __M_writer(unicode(h.url_for('/static/images/galaxyIcon_noText.png'))) |
---|
274 | __M_writer(u'" style="width: 26px; vertical-align: top;">\n Galaxy\n') |
---|
275 | # SOURCE LINE 166 |
---|
276 | if app.config.brand: |
---|
277 | # SOURCE LINE 167 |
---|
278 | __M_writer(u" <span class='brand'>/ ") |
---|
279 | __M_writer(unicode(app.config.brand)) |
---|
280 | __M_writer(u'</span>\n') |
---|
281 | # SOURCE LINE 169 |
---|
282 | __M_writer(u' </a>\n </div>\n \n') |
---|
283 | return '' |
---|
284 | finally: |
---|
285 | context.caller_stack._pop_frame() |
---|
286 | |
---|
287 | |
---|
288 | def render_title(context): |
---|
289 | context.caller_stack._push_frame() |
---|
290 | try: |
---|
291 | __M_writer = context.writer() |
---|
292 | # SOURCE LINE 4 |
---|
293 | __M_writer(u'Galaxy') |
---|
294 | return '' |
---|
295 | finally: |
---|
296 | context.caller_stack._pop_frame() |
---|
297 | |
---|
298 | |
---|