Top level navigation now uses a dropdown menu to reclaim space. There is no longer a masthead frame, navigation is all managed by the outer frame.

This commit is contained in:
James Taylor
2009-02-22 16:57:58 -05:00
parent 0ac5009bee
commit 0692681cf5
9 changed files with 366 additions and 77 deletions
+11 -1
View File
@@ -110,7 +110,17 @@ class Configuration( object ):
for path in self.tool_config, self.datatypes_config:
if not os.path.isfile(path):
raise ConfigurationError("File not found: %s" % path )
def is_admin_user( self,user ):
"""
Determine if the provided user is listed in `admin_users`.
NOTE: This is temporary, admin users will likely be specified in the
database in the future.
"""
admin_users = self.get( "admin_users", "" ).split( "," )
return ( user is not None and user.email in admin_users )
def get_database_engine_options( kwargs ):
"""
Allow options for the SQLAlchemy database engine to be passed by using
+18 -18
View File
@@ -492,24 +492,24 @@ class RootController( BaseController ):
except:
return trans.show_error_message( "<p>Failed to make secondary dataset primary.</p>" )
@web.expose
def masthead( self, trans, active_view=None ):
brand = trans.app.config.get( "brand", "" )
if brand:
brand ="<span class='brand'>/%s</span>" % brand
wiki_url = trans.app.config.get( "wiki_url", "http://g2.trac.bx.psu.edu/" )
bugs_email = trans.app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" )
blog_url = trans.app.config.get( "blog_url", "http://g2.trac.bx.psu.edu/blog" )
screencasts_url = trans.app.config.get( "screencasts_url", "http://g2.trac.bx.psu.edu/wiki/ScreenCasts" )
admin_user = "false"
admin_users = trans.app.config.get( "admin_users", "" ).split( "," )
user = trans.get_user()
if user:
user_email = trans.get_user().email
if user_email in admin_users:
admin_user = "true"
return trans.fill_template( "/root/masthead.mako", brand=brand, wiki_url=wiki_url,
blog_url=blog_url,bugs_email=bugs_email, screencasts_url=screencasts_url, admin_user=admin_user, active_view=active_view )
# @web.expose
# def masthead( self, trans, active_view=None ):
# brand = trans.app.config.get( "brand", "" )
# if brand:
# brand ="<span class='brand'>/%s</span>" % brand
# wiki_url = trans.app.config.get( "wiki_url", "http://g2.trac.bx.psu.edu/" )
# bugs_email = trans.app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" )
# blog_url = trans.app.config.get( "blog_url", "http://g2.trac.bx.psu.edu/blog" )
# screencasts_url = trans.app.config.get( "screencasts_url", "http://g2.trac.bx.psu.edu/wiki/ScreenCasts" )
# admin_user = "false"
# admin_users = trans.app.config.get( "admin_users", "" ).split( "," )
# user = trans.get_user()
# if user:
# user_email = trans.get_user().email
# if user_email in admin_users:
# admin_user = "true"
# return trans.fill_template( "/root/masthead.mako", brand=brand, wiki_url=wiki_url,
# blog_url=blog_url,bugs_email=bugs_email, screencasts_url=screencasts_url, admin_user=admin_user, active_view=active_view )
@web.expose
def dataset_errors( self, trans, id=None, **kwd ):
+97 -22
View File
@@ -23,27 +23,6 @@ body
width: 100%;
height: 100%;
}
#masthead
{
position:absolute;
top:0;
left:0;
width:100%;
height:32px;
background: url(masthead_bg.png);
overflow: hidden;
color:#fff;
font-weight: bold;
border-bottom: solid #444 1px;
}
#masthead div.title
{
margin: 3px;
margin-right: 10px;
font-size: 182%;
font-weight: bold;
}
#messagebox
{
@@ -254,4 +233,100 @@ div.unified-panel-body {
{
background-image: url(info_small.png);
background-color: #CCCCFF;
}
}
#masthead
{
position:absolute;
top:0;
left:0;
width:100%;
height:32px;
background: url(masthead_bg.png);
color:#fff;
border-bottom: solid #444 1px;
z-index: 15000;
padding: 0;
}
#masthead a
{
color: #eeeeee;
}
#masthead .title
{
padding: 3px 10px;
font-size: 175%;
font-weight: bold;
}
#masthead a
{
text-decoration: none;
}
#masthead a:hover
{
text-decoration: underline;
}
div.tab-group
{
margin: 0;
padding: 0 10px;
height: 100%;
white-space: nowrap;
}
div.tab-group span.tab
{
position: relative;
display: inline-block;
margin: 0;
padding: 0 1em;
height: 32px;
line-height: 32px;
text-align: left;
}
div.tab-group > span.tab:hover > a
{
color: gold !important;
}
div.tab-group > span.active
{
background: rgb(1,1,1);
}
div.tab-group span.tab div.submenu {
display: none;
position: absolute;
z-index: 16000;
left: 0;
top: 32px;
padding: 1em;
margin: -1em;
padding-top: 0;
margin-top: 0;
background-color: rgba(0,0,0,0.5);
-moz-border-radius: 0 0 1em 1em;
-webkit-border-bottom-right-radius: 1em;
-webkit-border-bottom-left-radius: 1em;
}
div.tab-group span.tab div.submenu ul {
display: block;
margin: 0;
padding: 0;
list-style-type: none;
background: #2C3143;
}
div.tab-group span.tab div.submenu ul li {
display: block;
padding: 0 1em;
white-space: nowrap;
}
+2 -2
View File
@@ -1,3 +1,3 @@
/* Copyright (c) 2007, Yahoo! Inc. All rights reserved. */
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
/* Copyright (c) 2008, Yahoo! Inc. All rights reserved. */
body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
/*body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}*/
+99 -22
View File
@@ -23,27 +23,6 @@ body
width: 100%;
height: 100%;
}
#masthead
{
position:absolute;
top:0;
left:0;
width:100%;
height:32px;
background: url(masthead_bg.png);
overflow: hidden;
color:#fff;
font-weight: bold;
border-bottom: solid ${layout_masthead_border} 1px;
}
#masthead div.title
{
margin: 3px;
margin-right: 10px;
font-size: 182%;
font-weight: bold;
}
#messagebox
{
@@ -255,4 +234,102 @@ div.unified-panel-body {
{
background-image: url(info_small.png);
background-color: $info_message_bg;
}
}
## ---- Masthead styles ----
#masthead
{
position:absolute;
top:0;
left:0;
width:100%;
height:32px;
background: url(masthead_bg.png);
color:#fff;
border-bottom: solid ${layout_masthead_border} 1px;
z-index: 15000;
padding: 0;
}
#masthead a
{
color: $masthead_link;
}
#masthead .title
{
padding: 3px 10px;
font-size: 175%;
font-weight: bold;
}
#masthead a
{
text-decoration: none;
}
#masthead a:hover
{
text-decoration: underline;
}
div.tab-group
{
margin: 0;
padding: 0 10px;
height: 100%;
white-space: nowrap;
}
div.tab-group span.tab
{
position: relative;
display: inline-block;
margin: 0;
padding: 0 1em;
height: 32px;
line-height: 32px;
text-align: left;
}
div.tab-group > span.tab:hover > a
{
color: gold !important;
}
div.tab-group > span.active
{
background: rgb(1,1,1);
## ,0.5);
}
div.tab-group span.tab div.submenu {
display: none;
position: absolute;
z-index: 16000;
left: 0;
top: 32px;
padding: 1em;
margin: -1em;
padding-top: 0;
margin-top: 0;
background-color: rgba(0,0,0,0.5);
-moz-border-radius: 0 0 1em 1em;
-webkit-border-bottom-right-radius: 1em;
-webkit-border-bottom-left-radius: 1em;
}
div.tab-group span.tab div.submenu ul {
display: block;
margin: 0;
padding: 0;
list-style-type: none;
background: ${masthead_bg};
}
div.tab-group span.tab div.submenu ul li {
display: block;
padding: 0 1em;
white-space: nowrap;
}
+4 -2
View File
@@ -1,3 +1,5 @@
/* Copyright (c) 2007, Yahoo! Inc. All rights reserved. */
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
/* Copyright (c) 2008, Yahoo! Inc. All rights reserved. */
## yui fonts
body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
## yui reset... commented out???
/*body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}*/
+120 -4
View File
@@ -51,25 +51,141 @@
## Scripts can be loaded later since they progressively add features to
## the panels, but do not change layout
<script type="text/javascript" src="${h.url_for('/static/scripts/jquery.js')}"></script>
<script type="text/javascript" src="${h.url_for('/static/scripts/jquery.hoverIntent.js')}"></script>
<script type="text/javascript" src="${h.url_for('/static/scripts/jquery.ui.js')}"></script>
<script type="text/javascript" src="${h.url_for('/static/scripts/galaxy.panels.js')}"></script>
<script type="text/javascript">
ensure_dd_helper();
%if self.has_left_panel:
ensure_dd_helper();
%if self.has_left_panel:
var lp = make_left_panel( $("#left"), $("#center"), $("#left-border" ) );
force_left_panel = lp.force_panel;
%endif
%if self.has_right_panel:
%if self.has_right_panel:
var rp = make_right_panel( $("#right"), $("#center"), $("#right-border" ) );
handle_minwidth_hint = rp.handle_minwidth_hint;
force_right_panel = rp.force_panel;
%endif
$(function() {
$("span.tab").each( function() {
var submenu = $(this).children( "div.submenu" );
if ( submenu.length > 0 ) {
if ( $.browser.msie ) {
## Vile IE iframe hack -- even IE7 needs this
submenu.prepend( "<iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; filter:Alpha(Opacity='0');\"></iframe>" );
}
$(this).hoverIntent( function() { submenu.show(); }, function() { submenu.hide(); } );
submenu.click( function() { submenu.hide(); } );
}
});
});
function user_changed( user_email, is_admin ) {
if ( user_email ) {
$(".loggedin-only").show();
$(".loggedout-only").hide();
$("#user-email").text( user_email )
if ( is_admin ) {
$(".admin-only").show();
}
} else {
$(".loggedin-only").hide();
$(".loggedout-only").show();
$(".admin-only").hide();
}
}
</script>
</%def>
## Masthead
<%def name="masthead()">
<iframe name="galaxy_masthead" src="${h.url_for( controller='root', action='masthead', active_view=self.active_view )}" width="38" height="100%" frameborder="0" scroll="no" style="margin: 0; border: 0 none; width: 100%; height: 38px; overflow: hidden;"> </iframe>
<div class="title" style="float: left;">
<a target="_blank" href="${app.config.wiki_url}">
<img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;">
</a>
Galaxy
%if app.config.brand:
<span class='brand'>/${app.config.brand}</span>
%endif
</div>
<div style="position: absolute; left: 50%;">
<div class="tab-group" style="position: relative; left: -50%;">
<%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;"
%>
<span class="${cls}" style="${style}"><a target="${target}" href="${href}">${display}</a></span>
</%def>
${tab( "analysis", "Analyze Data", h.url_for( controller='root', action='index' ))}
${tab( "workflow", "Workflow", h.url_for( controller='workflow', action='index' ))}
${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 ) ) )}
<span class="tab">
<a>Help</a>
<div class="submenu">
<ul>
<li><a href="${app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" )}">Email comments, bug reports, or suggestions</a></li>
<li><a target="_blank" href="${app.config.get( "wiki_url", "http://g2.trac.bx.psu.edu/" )}">Galaxy Wiki</a></li>
<li><a target="_blank" href="${app.config.get( "screencasts_url", "http://g2.trac.bx.psu.edu/wiki/ScreenCasts" )}">Video tutorials (screencasts)</a></li>
</ul>
</div>
</span>
<span class="tab">
<a>Account</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' )}">Login</a></li>
%if app.config.allow_user_creation:
<li><a target="galaxy_main" href="${h.url_for( controller='user', action='create' )}">Create new account</a></li>
%endif
</ul>
<ul class="loggedin-only" style="${style2}">
<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' )}">Manage Account</a></li>
<%
if app.config.require_login:
logout_target = ""
logout_url = h.url_for( controller='root', action='index', m_c='user', m_a='logout' )
else:
logout_target = "galaxy_main"
logout_url = h.url_for( controller='user', action='logout' )
%>
<li><a target="${logout_target}" href="${logout_url}">Logout</a></li>
</ul>
</div>
</span>
</div>
</div>
</%def>
## Messagebox
+14 -5
View File
@@ -4,11 +4,20 @@
${parent.javascripts()}
<script type="text/javascript">
%if 'masthead' in refresh_frames:
if ( parent.frames && parent.frames.galaxy_masthead ) {
parent.frames.galaxy_masthead.location.href="${h.url_for( controller='root', action='masthead')}";
}
else if ( parent.parent && parent.parent.frames && parent.parent.frames.galaxy_masthead ) {
parent.parent.frames.galaxy_masthead.location.href="${h.url_for( controller='root', action='masthead')}";
## if ( parent.frames && parent.frames.galaxy_masthead ) {
## parent.frames.galaxy_masthead.location.href="${h.url_for( controller='root', action='masthead')}";
## }
## else if ( parent.parent && parent.parent.frames && parent.parent.frames.galaxy_masthead ) {
## parent.parent.frames.galaxy_masthead.location.href="${h.url_for( controller='root', action='masthead')}";
## }
## Refresh masthead == user changes (backward compatibility)
if ( parent.user_changed ) {
%if trans.user:
parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
%else:
parent.user_changed( null, false );
%endif
}
%endif
%if 'history' in refresh_frames:
+1 -1
View File
@@ -11,7 +11,7 @@
<body class="mastheadPage" scroll="no">
<div id="tab-bar-bottom"></div>
<table width="100%" cellspacing="0" border="0">
<table height="32" width="100%" cellspacing="0" border="0">
<tr valign="middle"><td width="26px"><a target="_blank" href="${wiki_url}">
<img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}"></a></td>
<td align="left" valign="middle"><div class="pageTitle">Galaxy${brand}</div></td>