diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 7b56520ce09..a3cdb4b4b4a 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -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 diff --git a/lib/galaxy/web/controllers/root.py b/lib/galaxy/web/controllers/root.py index 357d1511c2d..bc2986a7442 100644 --- a/lib/galaxy/web/controllers/root.py +++ b/lib/galaxy/web/controllers/root.py @@ -492,24 +492,24 @@ class RootController( BaseController ): except: return trans.show_error_message( "

Failed to make secondary dataset primary.

" ) - @web.expose - def masthead( self, trans, active_view=None ): - brand = trans.app.config.get( "brand", "" ) - if brand: - brand ="/%s" % 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 ="/%s" % 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 ): diff --git a/static/june_2007_style/blue/panel_layout.css b/static/june_2007_style/blue/panel_layout.css index e48f52009af..c5e47fb9df1 100644 --- a/static/june_2007_style/blue/panel_layout.css +++ b/static/june_2007_style/blue/panel_layout.css @@ -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; -} \ No newline at end of file +} + + +#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; +} diff --git a/static/june_2007_style/blue/reset.css b/static/june_2007_style/blue/reset.css index 0eb970e56bf..1c958c2a9b6 100644 --- a/static/june_2007_style/blue/reset.css +++ b/static/june_2007_style/blue/reset.css @@ -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;}*/ diff --git a/static/june_2007_style/panel_layout.css.tmpl b/static/june_2007_style/panel_layout.css.tmpl index 016b228a0e0..63d0d607107 100644 --- a/static/june_2007_style/panel_layout.css.tmpl +++ b/static/june_2007_style/panel_layout.css.tmpl @@ -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; -} \ No newline at end of file +} + +## ---- 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; +} diff --git a/static/june_2007_style/reset.css.tmpl b/static/june_2007_style/reset.css.tmpl index 0eb970e56bf..a13abe4b1c2 100644 --- a/static/june_2007_style/reset.css.tmpl +++ b/static/june_2007_style/reset.css.tmpl @@ -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;}*/ diff --git a/templates/base_panels.mako b/templates/base_panels.mako index 08516467652..bbd3d642daf 100644 --- a/templates/base_panels.mako +++ b/templates/base_panels.mako @@ -51,25 +51,141 @@ ## Scripts can be loaded later since they progressively add features to ## the panels, but do not change layout + ## Masthead <%def name="masthead()"> - + +
+ + + + Galaxy + %if app.config.brand: + /${app.config.brand} + %endif +
+ +
+
+ + <%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;" + %> + ${display} + + + ${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 ) ) )} + + + Help + + + + + Account + <% + if trans.user: + user_email = trans.user.email + style1 = "display: none;" + style2 = ""; + else: + user_email = "" + style1 = "" + style2 = "display: none;" + %> + + + +
+
+ ## Messagebox diff --git a/templates/message.mako b/templates/message.mako index 3e6783245e5..5d1ff043ff7 100644 --- a/templates/message.mako +++ b/templates/message.mako @@ -4,11 +4,20 @@ ${parent.javascripts()}