[2] | 1 | <%inherit file="/base_panels.mako"/> |
---|
| 2 | |
---|
| 3 | ## Default title |
---|
| 4 | <%def name="title()">Galaxy</%def> |
---|
| 5 | |
---|
| 6 | ## Masthead |
---|
| 7 | <%def name="masthead()"> |
---|
| 8 | |
---|
| 9 | ## Tab area, fills entire width |
---|
| 10 | <div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center"> |
---|
| 11 | |
---|
| 12 | <table class="tab-group" border="0" cellspacing="0" style="margin: auto;"> |
---|
| 13 | <tr> |
---|
| 14 | |
---|
| 15 | <%def name="tab( id, display, href, target='_parent', visible=True, extra_class='', menu_options=None )"> |
---|
| 16 | ## Create a tab at the top of the panels. menu_options is a list of 2-elements lists of [name, link] |
---|
| 17 | ## that are options in the menu. |
---|
| 18 | |
---|
| 19 | <% |
---|
| 20 | cls = "tab" |
---|
| 21 | if extra_class: |
---|
| 22 | cls += " " + extra_class |
---|
| 23 | if self.active_view == id: |
---|
| 24 | cls += " active" |
---|
| 25 | style = "" |
---|
| 26 | if not visible: |
---|
| 27 | style = "display: none;" |
---|
| 28 | %> |
---|
| 29 | <td class="${cls}" style="${style}"> |
---|
| 30 | %if href: |
---|
| 31 | <a target="${target}" href="${href}">${display}</a> |
---|
| 32 | %else: |
---|
| 33 | <a>${display}</a> |
---|
| 34 | %endif |
---|
| 35 | %if menu_options: |
---|
| 36 | <div class="submenu"> |
---|
| 37 | <ul> |
---|
| 38 | %for menu_item in menu_options: |
---|
| 39 | <li> |
---|
| 40 | %if not menu_item: |
---|
| 41 | <hr style="color: inherit; background-color: gray"/></li> |
---|
| 42 | %else: |
---|
| 43 | %if len ( menu_item ) == 1: |
---|
| 44 | ${menu_item[0]} |
---|
| 45 | %elif len ( menu_item ) == 2: |
---|
| 46 | <% name, link = menu_item %> |
---|
| 47 | <a href="${link}">${name}</a></li> |
---|
| 48 | %else: |
---|
| 49 | <% name, link, target = menu_item %> |
---|
| 50 | <a target="${target}" href="${link}">${name}</a></li> |
---|
| 51 | %endif |
---|
| 52 | %endif |
---|
| 53 | %endfor |
---|
| 54 | </ul> |
---|
| 55 | </div> |
---|
| 56 | %endif |
---|
| 57 | </td> |
---|
| 58 | </%def> |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | ## Analyze data tab. |
---|
| 62 | ${tab( "analysis", "Analyze Data", h.url_for( controller='/root', action='index' ) )} |
---|
| 63 | |
---|
| 64 | ## Workflow tab. |
---|
| 65 | ${tab( "workflow", "Workflow", h.url_for( controller='/workflow', action='index' ) )} |
---|
| 66 | |
---|
| 67 | ## 'Shared Items' or Libraries tab. |
---|
| 68 | <% |
---|
| 69 | menu_options = [ |
---|
| 70 | [ 'Data Libraries', h.url_for( controller='/library', action='index') ], |
---|
| 71 | None, |
---|
| 72 | [ 'Published Histories', h.url_for( controller='/history', action='list_published' ) ], |
---|
| 73 | [ 'Published Workflows', h.url_for( controller='/workflow', action='list_published' ) ], |
---|
| 74 | [ 'Published Visualizations', h.url_for( controller='/visualization', action='list_published' ) ], |
---|
| 75 | [ 'Published Pages', h.url_for( controller='/page', action='list_published' ) ] |
---|
| 76 | ] |
---|
| 77 | tab( "shared", "Shared Data", h.url_for( controller='/library', action='index'), menu_options=menu_options ) |
---|
| 78 | %> |
---|
| 79 | |
---|
| 80 | ## Lab menu. |
---|
| 81 | <% |
---|
| 82 | menu_options = [ |
---|
| 83 | [ 'Sequencing Requests', h.url_for( controller='/requests', action='index' ) ], |
---|
| 84 | [ 'Find Samples', h.url_for( controller='/requests', action='find_samples_index' ) ], |
---|
| 85 | [ 'Help', app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rkchak/p/sts" ), "galaxy_main" ] |
---|
| 86 | ] |
---|
| 87 | tab( "lab", "Lab", None, menu_options=menu_options, visible=( trans.user and trans.user.requests ) ) |
---|
| 88 | %> |
---|
| 89 | |
---|
| 90 | ## Visualization menu. |
---|
| 91 | %if app.config.get_bool( 'enable_tracks', False ): |
---|
| 92 | <% |
---|
| 93 | menu_options = [ |
---|
| 94 | ['New Track Browser', h.url_for( controller='/tracks', action='index' ) ], |
---|
| 95 | ['Saved Visualizations', h.url_for( controller='/visualization', action='list' ) ] |
---|
| 96 | ] |
---|
| 97 | tab( "visualization", "Visualization", h.url_for( controller='/visualization', action='list'), menu_options=menu_options ) |
---|
| 98 | %> |
---|
| 99 | %endif |
---|
| 100 | |
---|
| 101 | ## Admin tab. |
---|
| 102 | ${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 ) ) )} |
---|
| 103 | |
---|
| 104 | ## Help tab. |
---|
| 105 | <% |
---|
| 106 | menu_options = [ |
---|
| 107 | ['Email comments, bug reports, or suggestions', app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" ) ], |
---|
| 108 | ['Galaxy Wiki', app.config.get( "wiki_url", "http://bitbucket.org/galaxy/galaxy-central/wiki" ), "_blank" ], |
---|
| 109 | ['Video tutorials (screencasts)', app.config.get( "screencasts_url", "http://galaxycast.org" ), "_blank" ], |
---|
| 110 | ['How to Cite Galaxy', app.config.get( "screencasts_url", "http://bitbucket.org/galaxy/galaxy-central/wiki/Citations" ), "_blank" ] |
---|
| 111 | ] |
---|
| 112 | tab( "help", "Help", None, menu_options=menu_options) |
---|
| 113 | %> |
---|
| 114 | |
---|
| 115 | ## User tabs. |
---|
| 116 | <% |
---|
| 117 | # Menu for user who is not logged in. |
---|
| 118 | menu_options = [ [ "Login", h.url_for( controller='/user', action='login' ), "galaxy_main" ] ] |
---|
| 119 | if app.config.allow_user_creation: |
---|
| 120 | menu_options.append( [ "Register", h.url_for( controller='/user', action='create' ), "galaxy_main" ] ) |
---|
| 121 | extra_class = "loggedout-only" |
---|
| 122 | visible = ( trans.user == None ) |
---|
| 123 | tab( "user", "User", None, visible=visible, menu_options=menu_options ) |
---|
| 124 | |
---|
| 125 | # Menu for user who is logged in. |
---|
| 126 | if trans.user: |
---|
| 127 | email = trans.user.email |
---|
| 128 | else: |
---|
| 129 | email = "" |
---|
| 130 | menu_options = [ [ '<li>Logged in as <span id="user-email">%s</span></li>' % email ] ] |
---|
| 131 | if app.config.use_remote_user: |
---|
| 132 | if app.config.remote_user_logout_href: |
---|
| 133 | menu_options.append( [ 'Logout', app.config.remote_user_logout_href, "galaxy_main" ] ) |
---|
| 134 | else: |
---|
| 135 | menu_options.append( [ 'Preferences', h.url_for( controller='/user', action='index' ), "galaxy_main" ] ) |
---|
| 136 | if app.config.get_bool( 'enable_tracks', False ): |
---|
| 137 | menu_options.append( [ 'Custom Builds', h.url_for( controller='/user', action='dbkeys' ), "galaxy_main" ] ) |
---|
| 138 | if app.config.require_login: |
---|
| 139 | logout_url = h.url_for( controller='/root', action='index', m_c='user', m_a='logout' ) |
---|
| 140 | else: |
---|
| 141 | logout_url = h.url_for( controller='/user', action='logout' ) |
---|
| 142 | menu_options.append( [ 'Logout', logout_url, "_top" ] ) |
---|
| 143 | menu_options.append( None ) |
---|
| 144 | menu_options.append( [ 'Saved Histories', h.url_for( controller='/history', action='list' ), "galaxy_main" ] ) |
---|
| 145 | menu_options.append( [ 'Saved Datasets', h.url_for( controller='/dataset', action='list' ), "galaxy_main" ] ) |
---|
| 146 | if app.config.get_bool( 'enable_pages', False ): |
---|
| 147 | menu_options.append( [ 'Saved Pages', h.url_for( controller='/page', action='list' ), "_top" ] ) |
---|
| 148 | if app.config.enable_api: |
---|
| 149 | menu_options.append( [ 'API Keys', h.url_for( controller='/user', action='api_keys' ), "galaxy_main" ] ) |
---|
| 150 | |
---|
| 151 | extra_class = "loggedin-only" |
---|
| 152 | visible = ( trans.user != None ) |
---|
| 153 | tab( "user", "User", None, visible=visible, menu_options=menu_options ) |
---|
| 154 | %> |
---|
| 155 | |
---|
| 156 | </tr> |
---|
| 157 | </table> |
---|
| 158 | |
---|
| 159 | </div> |
---|
| 160 | |
---|
| 161 | ## Logo, layered over tabs to be clickable |
---|
| 162 | <div class="title" style="position: absolute; top: 0; left: 0;"> |
---|
| 163 | <a href="${app.config.get( 'logo_url', '/' )}"> |
---|
| 164 | <img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;"> |
---|
| 165 | Galaxy |
---|
| 166 | %if app.config.brand: |
---|
| 167 | <span class='brand'>/ ${app.config.brand}</span> |
---|
| 168 | %endif |
---|
| 169 | </a> |
---|
| 170 | </div> |
---|
| 171 | |
---|
| 172 | </%def> |
---|