[2] | 1 | <%! |
---|
| 2 | def inherit(context): |
---|
| 3 | if context.get('use_panels'): |
---|
| 4 | if context.get('webapp'): |
---|
| 5 | webapp = context.get('webapp') |
---|
| 6 | else: |
---|
| 7 | webapp = 'galaxy' |
---|
| 8 | return '/webapps/%s/base_panels.mako' % webapp |
---|
| 9 | else: |
---|
| 10 | return '/base.mako' |
---|
| 11 | %> |
---|
| 12 | <%inherit file="${inherit(context)}"/> |
---|
| 13 | <% _=n_ %> |
---|
| 14 | |
---|
| 15 | <%def name="init()"> |
---|
| 16 | <% |
---|
| 17 | self.has_left_panel=False |
---|
| 18 | self.has_right_panel=False |
---|
| 19 | self.active_view=active_view |
---|
| 20 | self.message_box_visible=False |
---|
| 21 | %> |
---|
| 22 | </%def> |
---|
| 23 | |
---|
| 24 | <%def name="javascripts()"> |
---|
| 25 | ${parent.javascripts()} |
---|
| 26 | <script type="text/javascript"> |
---|
| 27 | %if 'masthead' in refresh_frames: |
---|
| 28 | ## if ( parent.frames && parent.frames.galaxy_masthead ) { |
---|
| 29 | ## parent.frames.galaxy_masthead.location.href="${h.url_for( controller='root', action='masthead')}"; |
---|
| 30 | ## } |
---|
| 31 | ## else if ( parent.parent && parent.parent.frames && parent.parent.frames.galaxy_masthead ) { |
---|
| 32 | ## parent.parent.frames.galaxy_masthead.location.href="${h.url_for( controller='root', action='masthead')}"; |
---|
| 33 | ## } |
---|
| 34 | |
---|
| 35 | ## Refresh masthead == user changes (backward compatibility) |
---|
| 36 | if ( parent.user_changed ) { |
---|
| 37 | %if trans.user: |
---|
| 38 | parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} ); |
---|
| 39 | %else: |
---|
| 40 | parent.user_changed( null, false ); |
---|
| 41 | %endif |
---|
| 42 | } |
---|
| 43 | %endif |
---|
| 44 | %if 'history' in refresh_frames: |
---|
| 45 | if ( parent.frames && parent.frames.galaxy_history ) { |
---|
| 46 | parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}"; |
---|
| 47 | if ( parent.force_right_panel ) { |
---|
| 48 | parent.force_right_panel( 'show' ); |
---|
| 49 | } |
---|
| 50 | } |
---|
| 51 | %endif |
---|
| 52 | %if 'tools' in refresh_frames: |
---|
| 53 | if ( parent.frames && parent.frames.galaxy_tools ) { |
---|
| 54 | parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}"; |
---|
| 55 | if ( parent.force_left_panel ) { |
---|
| 56 | parent.force_left_panel( 'show' ); |
---|
| 57 | } |
---|
| 58 | } |
---|
| 59 | %endif |
---|
| 60 | |
---|
| 61 | if ( parent.handle_minwidth_hint ) |
---|
| 62 | { |
---|
| 63 | parent.handle_minwidth_hint( -1 ); |
---|
| 64 | } |
---|
| 65 | </script> |
---|
| 66 | </%def> |
---|
| 67 | |
---|
| 68 | ## |
---|
| 69 | ## Override methods from base.mako and base_panels.mako |
---|
| 70 | ## |
---|
| 71 | |
---|
| 72 | <%def name="center_panel()"> |
---|
| 73 | ${render_large_message( message, status )} |
---|
| 74 | </%def> |
---|
| 75 | |
---|
| 76 | <%def name="body()"> |
---|
| 77 | ${render_large_message( message, status )} |
---|
| 78 | </%def> |
---|
| 79 | |
---|
| 80 | ## Render large message. |
---|
| 81 | <%def name="render_large_message( message, status )"> |
---|
| 82 | <div class="${status}messagelarge" style="margin: 1em">${_(message)}</div> |
---|
| 83 | </%def> |
---|
| 84 | |
---|
| 85 | ## Render a message |
---|
| 86 | <%def name="render_msg( msg, status='done' )"> |
---|
| 87 | <div class="${status}message">${_(msg)}</div> |
---|
| 88 | <br/> |
---|
| 89 | </%def> |
---|
| 90 | |
---|