1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/10ffe462c024/ changeset: 10ffe462c024 user: greg date: 2012-03-21 20:50:48 summary: Tool shed masthead fixes due to new Galaxy styles. affected #: 1 file diff -r 243ad28621be905cdd09625520f3fe0ec0424f6d -r 10ffe462c0243fca53df78a3fdc83d8941dff9b4 templates/webapps/community/base_panels.mako --- a/templates/webapps/community/base_panels.mako +++ b/templates/webapps/community/base_panels.mako @@ -3,97 +3,127 @@ ## Default title <%def name="title()">Galaxy Tool Shed</%def> +<%def name="javascripts()"> + ${parent.javascripts()} + ${h.js( "jquery.tipsy" )} +</%def> + ## Masthead <%def name="masthead()"> ## Tab area, fills entire width - <div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center"> + <div style="position: relative; right: -50%; float: left;"> + <div style="display: block; position: relative; right: 50%;"> + + <ul class="nav" border="0" cellspacing="0"> - <table class="tab-group" border="0" cellspacing="0" style="margin: auto;"> - <tr> - - <%def name="tab( id, display, href, target='_parent', visible=True, extra_class='' )"> - <% - cls = "tab" - if extra_class: - cls += " " + extra_class - if self.active_view == id: - cls += " active" - style = "" - if not visible: - style = "display: none;" - %> - <td class="${cls}" style="${style}"><a target="${target}" href="${href}">${display}</a></td> - </%def> + <%def name="tab( id, display, href, target='_parent', visible=True, extra_class='', menu_options=None )"> + <% + cls = "" + a_cls = "" + extra = "" + if extra_class: + cls += " " + extra_class + if self.active_view == id: + cls += " active" + if menu_options: + cls += " dropdown" + a_cls += " dropdown-toggle" + extra = "<b class='caret'></b>" + style = "" + if not visible: + style = "display: none;" + %> + <li class="${cls}" style="${style}"> + %if href: + <a class="${a_cls}" data-toggle="dropdown" target="${target}" href="${href}">${display}${extra}</a> + %else: + <a class="${a_cls}" data-toggle="dropdown">${display}${extra}</a> + %endif + %if menu_options: + <ul class="dropdown-menu"> + %for menu_item in menu_options: + %if not menu_item: + <li class="divider"></li> + %else: + <li> + %if len ( menu_item ) == 1: + ${menu_item[0]} + %elif len ( menu_item ) == 2: + <% name, link = menu_item %> + <a href="${link}">${name}</a> + %else: + <% name, link, target = menu_item %> + <a target="${target}" href="${link}">${name}</a> + %endif + </li> + %endif + %endfor + </ul> + %endif + </li> + </%def> - ${tab( "repositories", "Repositories", h.url_for( controller='/repository', action='index', webapp='community' ) )} - ${tab( "admin", "Admin", h.url_for( controller='/admin', action='index', webapp='community' ), extra_class="admin-only", visible=( trans.user and app.config.is_admin_user( trans.user ) ) )} - - <td class="tab"> - <a>Help</a> - <div class="submenu"> - <ul> - <li><a target="_blank" href="${app.config.get( "support_url", "http://wiki.g2.bx.psu.edu/Support" )}">Support</a></li> - <li><a target="_blank" href="${app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/Tool%20Shed" )}">Tool shed wiki</a></li> - <li><a target="_blank" href="${app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/" )}">Galaxy wiki</a></li> - <li><a target="_blank" href="${app.config.get( "screencasts_url", "http://galaxycast.org" )}">Video tutorials (screencasts)</a></li> - <li><a target="_blank" href="${app.config.get( "citation_url", "http://wiki.g2.bx.psu.edu/Citing%20Galaxy" )}">How to Cite Galaxy</a></li> - </ul> + ## Repositories tab. + ${tab( "repositories", "Repositories", h.url_for( controller='/repository', action='index', webapp='community' ) )} + + ## Admin tab. + ${tab( "admin", "Admin", h.url_for( controller='/admin', action='index', webapp='community' ), extra_class="admin-only", visible=( trans.user and app.config.is_admin_user( trans.user ) ) )} + + ## Help tab. + <% + menu_options = [ + [_('Support'), app.config.get( "support_url", "http://wiki.g2.bx.psu.edu/Support" ), "_blank" ], + [_('Tool shed wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/Tool%20Shed" ), "_blank" ], + [_('Galaxy wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/" ), "_blank" ], + [_('Video tutorials (screencasts)'), app.config.get( "screencasts_url", "http://galaxycast.org" ), "_blank" ], + [_('How to Cite Galaxy'), app.config.get( "citation_url", "http://wiki.g2.bx.psu.edu/Citing%20Galaxy" ), "_blank" ] + ] + tab( "help", _("Help"), None, menu_options=menu_options) + %> + + ## User tabs. + <% + # Menu for user who is not logged in. + menu_options = [ [ _("Login"), h.url_for( controller='/user', action='login', webapp='community' ), "galaxy_main" ] ] + if app.config.allow_user_creation: + menu_options.append( [ _("Register"), h.url_for( controller='/user', action='create', cntrller='user', webapp='community' ), "galaxy_main" ] ) + extra_class = "loggedout-only" + visible = ( trans.user == None ) + tab( "user", _("User"), None, visible=visible, menu_options=menu_options ) + # Menu for user who is logged in. + if trans.user: + email = trans.user.email + else: + email = "" + menu_options = [ [ '<a>Logged in as <span id="user-email">%s</span></a>' % email ] ] + if app.config.use_remote_user: + if app.config.remote_user_logout_href: + menu_options.append( [ _('Logout'), app.config.remote_user_logout_href, "_top" ] ) + else: + menu_options.append( [ _('Preferences'), h.url_for( controller='/user', action='index', cntrller='user', webapp='community' ), "galaxy_main" ] ) + logout_url = h.url_for( controller='/user', action='logout', webapp='community' ) + menu_options.append( [ 'Logout', logout_url, "_top" ] ) + menu_options.append( None ) + if app.config.use_remote_user: + menu_options.append( [ _('Public Name'), h.url_for( controller='/user', action='edit_username', cntrller='user', webapp='community' ), "galaxy_main" ] ) + + extra_class = "loggedin-only" + visible = ( trans.user != None ) + tab( "user", "User", None, visible=visible, menu_options=menu_options ) + %> + </ul></div> - </td> - - ## User tab. - <% - cls = "tab" - if self.active_view == 'user': - cls += " active" - %> - <td class="${cls}"> - <a>User</a> - <% - if trans.user: - user_email = trans.user.email - style1 = "display: none;" - style2 = ""; - else: - user_email = "" - style1 = "" - style2 = "display: none;" - %> - <div class="submenu"> - <ul class="loggedout-only" style="${style1}"> - <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='login', webapp='community' )}">Login</a></li> - %if app.config.allow_user_creation: - <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='create', cntrller='user', webapp='community' )}">Register</a></li> - %endif - </ul> - <ul class="loggedin-only" style="${style2}"> - %if app.config.use_remote_user: - %if app.config.remote_user_logout_href: - <li><a href="${app.config.remote_user_logout_href}" target="_top">Logout</a></li> - %endif - %else: - <li>Logged in as <span id="user-email">${user_email}</span></li> - <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='index', cntrller='user', webapp='community' )}">Preferences</a></li> - <% logout_url = h.url_for( controller='/user', action='logout', webapp='community' ) %> - <li><a target="_top" href="${logout_url}">Logout</a></li> - %endif - </ul> - </div> - </td> - </tr> - </table></div> ## Logo, layered over tabs to be clickable - <div class="title" style="position: absolute; top: 0; left: 0;"> + <div class="title" style="position: absolute; top: 0; left: 0; white-space: nowrap;"><a href="${app.config.get( 'logo_url', '/' )}"> - <img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;"> + <img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="display: inline; width: 26px; vertical-align: top;"> Galaxy Tool Shed %if app.config.brand: <span class='brand'>/ ${app.config.brand}</span> %endif </a></div> - </%def> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.