diff --git a/LICENSE.txt b/LICENSE.txt index 69978e57efb..23e45c00eae 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -17,4 +17,9 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Some icons found in Galaxy are from the Silk Icons set, available under +the Creative Commons Attribution 2.5 License, from: + +http://www.famfamfam.com/lab/icons/silk/ diff --git a/datatypes_conf.xml.sample b/datatypes_conf.xml.sample index 7db33f2e7d7..23974aab8b6 100644 --- a/datatypes_conf.xml.sample +++ b/datatypes_conf.xml.sample @@ -140,6 +140,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + both are always True (is sqlite actually storing a string here, which is always true when not empty?) + except sqlalchemy.exceptions.OperationalError, e: + print_warning( "adding column 'deleted' failed: %s" % ( e ) ) + try: + app.model.session.execute( "ALTER TABLE 'galaxy_user' ADD COLUMN 'purged' BOOLEAN default 0" ) + except sqlalchemy.exceptions.OperationalError, e: + print_warning( "adding column 'purged' failed: %s" % ( e ) ) + else: + try: + app.model.session.execute( "ALTER TABLE galaxy_user ADD COLUMN deleted BOOLEAN default false" ) + except ( sqlalchemy.exceptions.ProgrammingError, sqlalchemy.exceptions.OperationalError ), e: #Postgres and MySQL raise different Exceptions for this same failure. + print_warning( "adding column 'deleted' failed: %s" % ( e ) ) + try: + app.model.session.execute( "ALTER TABLE galaxy_user ADD COLUMN purged BOOLEAN default false" ) + except ( sqlalchemy.exceptions.ProgrammingError, sqlalchemy.exceptions.OperationalError ), e: + print_warning( "adding column 'purged' failed: %s" % ( e ) ) + + #these alters are the same, regardless if we are using sqlite + #hda table + try: + app.model.session.execute( "ALTER TABLE history_dataset_association ADD COLUMN copied_from_library_folder_dataset_association_id INTEGER" ) + except ( sqlalchemy.exceptions.ProgrammingError, sqlalchemy.exceptions.OperationalError ), e: + print_warning( "adding column 'copied_from_library_folder_dataset_association_id' failed: %s" % ( e ) ) + + #MetadataFile table + try: + app.model.session.execute( "ALTER TABLE metadata_file ADD COLUMN lda_id INTEGER" ) + except ( sqlalchemy.exceptions.ProgrammingError, sqlalchemy.exceptions.OperationalError ), e: + print_warning( "adding column 'lda_id' failed: %s" % ( e ) ) + + + #now create indexes for new columns in user and metadata file tables + try: + i = sqlalchemy.Index( 'ix_galaxy_user_deleted', app.model.User.table.c.deleted ) + i.create() + except Exception, e: + print_warning( "Adding index failed: %s" % ( e ) ) + try: + i = sqlalchemy.Index( 'ix_galaxy_user_purged', app.model.User.table.c.purged ) + i.create() + except Exception, e: + print_warning( "Adding index failed: %s" % ( e ) ) + try: + i = sqlalchemy.Index( 'ix_metadata_file_lda_id', app.model.MetadataFile.table.c.lda_id ) + i.create() + except Exception, e: + print_warning( "Adding index failed: %s" % ( e ) ) + + + #Now we shutdown the app + app.shutdown() + del app + print + print "Columns added to tables, restarting app, with database_create_tables=True" + + #We restart the app, this time with create_tables == True + configuration['database_create_tables'] = True + app = galaxy.app.UniverseApplication( global_conf = ini_file, **configuration ) + + ##Now we add foreign key constraints as necessary for columns added above + print "Adding foreign key constraints" + if dialect != "sqlite": + try: + app.model.session.execute( "ALTER TABLE history_dataset_association ADD FOREIGN KEY (copied_from_library_folder_dataset_association_id) REFERENCES library_folder_dataset_association(id)" ) + except Exception, e: + print_warning( "Adding foreign key constraint to table has failed for an unknown reason: %s" % ( e ) ) + try: + app.model.session.execute( "ALTER TABLE metadata_file ADD FOREIGN KEY (lda_id) REFERENCES library_folder_dataset_association(id)" ) + except Exception, e: + print_warning( "Adding foreign key constraint to table has failed for an unknown reason: %s" % ( e ) ) + + else: + #Can't do this in SQLite + #SQLite ignores (but parses on initial table creation) foreign key constraints anyway, see: http://www.sqlite.org/omitted.html (there is someway to set up behavior using triggers) + print_warning( "Adding foreign key constraints to table is not supported in SQLite." ) + + #create default permisions for users, histories, etc + print "creating private roles and setting defaults for existing users and their histories and datasets" + + #Setup each user with a private role and then set their default permisions and set permisions on existing histories and datasets + for user in app.model.User.query().all(): + print "Setting up user: %s." % user.email + if not app.model.security_agent.get_private_user_role( user ): + app.model.security_agent.create_private_user_role( user ) + else: + print_warning( "user (%s) already has a private role, (re)setting defaults anyway" % ( user.email ) ) + #set default permissions and permissions on existing items + #we will do this even if a role for the user already exists (slower, but safer) + app.model.security_agent.user_set_default_permissions( user, history=True, dataset=True, bypass_manage_permission=True ) + + app.model.flush() + + app.shutdown() + print + print "Update finished, please review output for warnings and errors." + empty_xml.close() #close tempfile, it will automatically be deleted off system + + +if __name__ == "__main__": + main() diff --git a/scripts/update_database/update_database_with_security_libraries.sh b/scripts/update_database/update_database_with_security_libraries.sh new file mode 100644 index 00000000000..65013437651 --- /dev/null +++ b/scripts/update_database/update_database_with_security_libraries.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# This script must be executed from the $UNIVERSE_HOME directory +# e.g., sh ./scripts/update_database/update_database_with_security_libraries.sh + +. ./scripts/get_python.sh +. ./setup_paths.sh + +$GALAXY_PYTHON ./scripts/update_database/update_database_with_security_libraries.py ./universe_wsgi.ini $@ diff --git a/static/images/silk/book.png b/static/images/silk/book.png new file mode 100644 index 00000000000..b0f4dd7928c Binary files /dev/null and b/static/images/silk/book.png differ diff --git a/static/images/silk/book_open.png b/static/images/silk/book_open.png new file mode 100644 index 00000000000..7d863f94974 Binary files /dev/null and b/static/images/silk/book_open.png differ diff --git a/static/images/silk/folder.png b/static/images/silk/folder.png new file mode 100644 index 00000000000..784e8fa4823 Binary files /dev/null and b/static/images/silk/folder.png differ diff --git a/static/images/silk/folder_page.png b/static/images/silk/folder_page.png new file mode 100644 index 00000000000..1ef6e11438f Binary files /dev/null and b/static/images/silk/folder_page.png differ diff --git a/static/images/silk/resultset_bottom.png b/static/images/silk/resultset_bottom.png new file mode 100644 index 00000000000..22848b0061c Binary files /dev/null and b/static/images/silk/resultset_bottom.png differ diff --git a/static/images/silk/resultset_next.png b/static/images/silk/resultset_next.png new file mode 100644 index 00000000000..e252606d3e6 Binary files /dev/null and b/static/images/silk/resultset_next.png differ diff --git a/static/images/welcomePhoto.jpg b/static/images/welcomePhoto.jpg index 91abdf31496..33fc6a470df 100644 Binary files a/static/images/welcomePhoto.jpg and b/static/images/welcomePhoto.jpg differ diff --git a/static/june_2007_style/base.css.tmpl b/static/june_2007_style/base.css.tmpl index a8fba0e69c0..28a0f87f546 100644 --- a/static/june_2007_style/base.css.tmpl +++ b/static/june_2007_style/base.css.tmpl @@ -283,6 +283,11 @@ table.colored tr background: $table_row_bg; } +table.colored tr.odd_row +{ + background: $odd_row_bg; +} + div.debug { margin: 10px; @@ -350,6 +355,16 @@ ul.toolParameterExpandableCollapsable list-style: none; } +ul.manage-table-actions { + float: right; + margin-top: -2.5em; +} +ul.manage-table-actions li { + display: block; + float: left; + margin-left: 0.5em; +} + .action-button { background: #eeeeee; color: #333; @@ -416,4 +431,8 @@ div.popupmenu-item:hover { .popup-arrow:hover { color: black; -} \ No newline at end of file +} + +div.permissionContainer { + padding-left: 20px; +} diff --git a/static/june_2007_style/blue/base.css b/static/june_2007_style/blue/base.css index 4de4530b076..74a7b7c68ec 100644 --- a/static/june_2007_style/blue/base.css +++ b/static/june_2007_style/blue/base.css @@ -16,6 +16,7 @@ img border: 0; } + a:link, a:visited, a:active { color: #303030; @@ -282,6 +283,11 @@ table.colored tr background: white; } +table.colored tr.odd_row +{ + background: #DADFEF; +} + div.debug { margin: 10px; @@ -293,7 +299,7 @@ div.debug div.odd_row { - background: #FFFF99; + background: #DADFEF; } #footer { @@ -348,6 +354,16 @@ ul.toolParameterExpandableCollapsable list-style: none; } +ul.manage-table-actions { + float: right; + margin-top: -2.5em; +} +ul.manage-table-actions li { + display: block; + float: left; + margin-left: 0.5em; +} + .action-button { background: #eeeeee; color: #333; @@ -414,4 +430,8 @@ div.popupmenu-item:hover { .popup-arrow:hover { color: black; -} \ No newline at end of file +} + +div.permissionContainer { + padding-left: 20px; +} diff --git a/static/june_2007_style/blue/history.css b/static/june_2007_style/blue/history.css index 3a2243bf20d..1dd55a464cd 100644 --- a/static/june_2007_style/blue/history.css +++ b/static/june_2007_style/blue/history.css @@ -80,6 +80,13 @@ div.historyItem-running */ } +div.historyItem-noPermission +{ + filter: alpha(opacity=60); + -moz-opacity: .60; + opacity: .60; +} + div.historyItem-queued { } @@ -101,4 +108,4 @@ pre.peek th { color: white; background: #023858; -} \ No newline at end of file +} diff --git a/static/june_2007_style/blue/library.css b/static/june_2007_style/blue/library.css new file mode 100644 index 00000000000..76f589af067 --- /dev/null +++ b/static/june_2007_style/blue/library.css @@ -0,0 +1,65 @@ +.libraryRow { + background-color: #d2c099; +} + +.datasetHighlighted { + background-color: #C1C9E5; +} + +div.historyItemBody { + padding: 4px 4px 2px 4px; +} + +li.folderRow, +li.datasetRow +{ + border-top: solid 1px #ddd; +} + +li.folderRow:hover, +li.datasetRow:hover +{ + background-color: #C1C9E5; +} + +img.expanderIcon { + padding-right: 4px; +} + +input.datasetCheckbox, +li, ul +{ + padding: 0; + margin: 0; +} + +.rowTitle +{ + padding: 2px; +} + +ul { + list-style: none; +} + +.libraryTitle th { + text-align: left; +} + +pre.peek +{ + background: white; + color: black; + width: 100%; + overflow: auto; +} + +pre.peek th +{ + color: white; + background: #023858; +} + +a.expandLink { + text-decoration: none; +} diff --git a/static/june_2007_style/blue/masthead.css b/static/june_2007_style/blue/masthead.css index f206e7f1b44..b89faddb0a8 100644 --- a/static/june_2007_style/blue/masthead.css +++ b/static/june_2007_style/blue/masthead.css @@ -7,6 +7,7 @@ body margin: 3px; margin-right: 5px; margin-left: 5px; + overflow: hidden; } div.pageTitle @@ -24,3 +25,38 @@ a:link, a:visited, a:active { color: #eeeeee; } + +#tab-bar-bottom +{ + z-index: -1; + position:absolute; + top:27px; left: 0; + width: 100%; + height: 100%; + background: #222532; +} + +span.link-group +{ + margin: 0; + padding: 0; + display: inline; + padding-bottom: 10px; + margin-bottom: -10px; +} + +span.link-group span +{ + margin: 0; + padding: 0; + display: inline; +} + +span.link-group span.active-link +{ + background: #222532; + padding-left: 3px; padding-right: 3px; + margin-left: -3px; margin-right: -3px; + padding-bottom: 10px; + margin-bottom: -10px; +} \ No newline at end of file diff --git a/static/june_2007_style/blue/panel_layout.css b/static/june_2007_style/blue/panel_layout.css index b7ec445bc43..7dda79706a8 100644 --- a/static/june_2007_style/blue/panel_layout.css +++ b/static/june_2007_style/blue/panel_layout.css @@ -45,6 +45,19 @@ body font-weight: bold; } +#messagebox +{ + position:absolute; + top:33px; + left:0; + width:100%; + height:24px !important; + overflow: hidden; + border-bottom: solid #999 1px; + font-size: 90%; +} + + #left, #left-border, #center, #right-border, #right { position: absolute; @@ -146,7 +159,6 @@ table.column-layout .unified-panel-header { height: 2em; - overflow: hidden; z-index: 1000; background: #cccccc; background-image: url(panel_header_bg.png); @@ -160,18 +172,17 @@ table.column-layout color: #333; font-weight: bold; } - + .unified-panel-header-inner { padding-top: 0.45em; } - + .menu-bg { background: #C1C9E5 url(menu_bg.png) top repeat-x; } div.unified-panel-body { position: absolute; - z-index: 1; top: 2em; bottom: 0; width: 100%; @@ -197,6 +208,7 @@ div.unified-panel-body { color: black; background: #aaaaaa; } + .panel-header-button:active { color: white; background: #aaaaaa; @@ -240,7 +252,7 @@ div.popupmenu-item:hover { } #overlay { - position: absolute; + position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 20000; } @@ -271,6 +283,34 @@ div.popupmenu-item:hover { padding: 5px; } -.dialog-box body { - overflow: scroll; + +.panel-error-message, .panel-warning-message, .panel-done-message, .panel-info-message +{ + height: 24px; + line-height: 24px; + color: #303030; + padding: 0px; + padding-left: 26px; + background-color: #FFCCCC; + background-image: url(error_small.png); + background-repeat: no-repeat; + background-position: 6px 50%; +} + +.panel-warning-message +{ + background-image: url(warn_small.png); + background-color: #FFFFCC; +} + +.panel-done-message +{ + background-image: url(done_small.png); + background-color: #CCFFCC; +} + +.panel-info-message +{ + background-image: url(info_small.png); + background-color: #CCCCFF; } \ No newline at end of file diff --git a/static/june_2007_style/blue_colors.ini b/static/june_2007_style/blue_colors.ini index 447ca3f98bc..5b9f320b296 100644 --- a/static/june_2007_style/blue_colors.ini +++ b/static/june_2007_style/blue_colors.ini @@ -15,7 +15,7 @@ form_border=#d8b365 #form_body_bg=#FFFFFF form_body_bg_top=#FFFFFF form_body_bg_bottom=#FFFFFF -odd_row_bg=#FFFF99 +odd_row_bg=#DADFEF # Messages error_message_border=#AA6666 error_message_bg=#FFCCCC @@ -48,6 +48,7 @@ masthead_bg=#2C3143 masthead_text=#eeeeee masthead_bg_hatch=- masthead_link=#eeeeee +masthead_active_tab_bg=#222532 # ---- Layout ----------------------------------------------------------------- # Overall background color (including space between panels) layout_bg=#eee diff --git a/static/june_2007_style/history.css.tmpl b/static/june_2007_style/history.css.tmpl index 30c285b20fb..362cc3a3b23 100644 --- a/static/june_2007_style/history.css.tmpl +++ b/static/june_2007_style/history.css.tmpl @@ -80,6 +80,13 @@ div.historyItem-running */ } +div.historyItem-noPermission +{ + filter: alpha(opacity=60); + -moz-opacity: .60; + opacity: .60; +} + div.historyItem-queued { } @@ -101,4 +108,4 @@ pre.peek th { color: white; background: $peek_table_header; -} \ No newline at end of file +} diff --git a/static/june_2007_style/library.css.tmpl b/static/june_2007_style/library.css.tmpl new file mode 100644 index 00000000000..5b4a736a70d --- /dev/null +++ b/static/june_2007_style/library.css.tmpl @@ -0,0 +1,65 @@ +.libraryRow { + background-color: $form_title_bg_bottom; +} + +.datasetHighlighted { + background-color: $menu_bg_over; +} + +div.historyItemBody { + padding: 4px 4px 2px 4px; +} + +li.folderRow, +li.datasetRow +{ + border-top: solid 1px #ddd; +} + +li.folderRow:hover, +li.datasetRow:hover +{ + background-color: $menu_bg_over; +} + +img.expanderIcon { + padding-right: 4px; +} + +input.datasetCheckbox, +li, ul +{ + padding: 0; + margin: 0; +} + +.rowTitle +{ + padding: 2px; +} + +ul { + list-style: none; +} + +.libraryTitle th { + text-align: left; +} + +pre.peek +{ + background: white; + color: black; + width: 100%; + overflow: auto; +} + +pre.peek th +{ + color: white; + background: $peek_table_header; +} + +a.expandLink { + text-decoration: none; +} diff --git a/static/june_2007_style/make_style.py b/static/june_2007_style/make_style.py index 4ba96651c52..1bc2adf9212 100755 --- a/static/june_2007_style/make_style.py +++ b/static/june_2007_style/make_style.py @@ -1,5 +1,9 @@ #!/usr/bin/env python +from galaxy import eggs +import pkg_resources +pkg_resources.require("Cheetah") + import sys from Cheetah.Template import Template import string @@ -13,8 +17,8 @@ def run( cmd ): templates = [ ( "base.css.tmpl", "base.css" ), ( "panel_layout.css.tmpl", "panel_layout.css" ), - ( "panel_layout_ie.css.tmpl", "panel_layout_ie.css" ), ( "masthead.css.tmpl", "masthead.css"), + ( "library.css.tmpl", "library.css"), ( "history.css.tmpl", "history.css" ), ( "tool_menu.css.tmpl", "tool_menu.css" ), ( "reset.css.tmpl", "reset.css" ) ] @@ -64,7 +68,8 @@ for line in open( vars ): for input, output in templates: print input ,"->", output open( os.path.join( out_dir, output ), "w" ).write( str( Template( file=input, searchList=[context] ) ) ) - + +""" for rule, output in images: t = string.Template( rule ).substitute( context ) print t, "->", output @@ -74,3 +79,4 @@ for src, bg, out in shared_images: t = "./png_over_color.py shared_images/%s %s %s" % ( src, context[bg], os.path.join( out_dir, out ) ) print t run( t.split() ) +""" diff --git a/static/june_2007_style/masthead.css.tmpl b/static/june_2007_style/masthead.css.tmpl index 0c759f2aba6..a6d3b7ea5c7 100644 --- a/static/june_2007_style/masthead.css.tmpl +++ b/static/june_2007_style/masthead.css.tmpl @@ -7,6 +7,7 @@ body margin: 3px; margin-right: 5px; margin-left: 5px; + overflow: hidden; } div.pageTitle @@ -24,3 +25,38 @@ a:link, a:visited, a:active { color: $masthead_link; } + +#tab-bar-bottom +{ + z-index: -1; + position:absolute; + top:27px; left: 0; + width: 100%; + height: 100%; + background: $masthead_active_tab_bg; +} + +span.link-group +{ + margin: 0; + padding: 0; + display: inline; + padding-bottom: 10px; + margin-bottom: -10px; +} + +span.link-group span +{ + margin: 0; + padding: 0; + display: inline; +} + +span.link-group span.active-link +{ + background: $masthead_active_tab_bg; + padding-left: 3px; padding-right: 3px; + margin-left: -3px; margin-right: -3px; + padding-bottom: 10px; + margin-bottom: -10px; +} \ No newline at end of file diff --git a/static/june_2007_style/panel_layout.css.tmpl b/static/june_2007_style/panel_layout.css.tmpl index 0479767977b..4df44dba18a 100644 --- a/static/june_2007_style/panel_layout.css.tmpl +++ b/static/june_2007_style/panel_layout.css.tmpl @@ -45,6 +45,19 @@ body font-weight: bold; } +#messagebox +{ + position:absolute; + top:33px; + left:0; + width:100%; + height:24px !important; + overflow: hidden; + border-bottom: solid #999 1px; + font-size: 90%; +} + + #left, #left-border, #center, #right-border, #right { position: absolute; @@ -268,4 +281,37 @@ div.popupmenu-item:hover { .dialog-box .body, .dialog-box .buttons { padding: 5px; +} + +## Messages for message box, slightly different style + +.panel-error-message, .panel-warning-message, .panel-done-message, .panel-info-message +{ + height: 24px; + line-height: 24px; + color: $base_text; + padding: 0px; + padding-left: 26px; + background-color: $error_message_bg; + background-image: url(error_small.png); + background-repeat: no-repeat; + background-position: 6px 50%; +} + +.panel-warning-message +{ + background-image: url(warn_small.png); + background-color: $warn_message_bg; +} + +.panel-done-message +{ + background-image: url(done_small.png); + background-color: $done_message_bg; +} + +.panel-info-message +{ + background-image: url(info_small.png); + background-color: $info_message_bg; } \ No newline at end of file diff --git a/static/scripts/galaxy.panels.js b/static/scripts/galaxy.panels.js index 7463991fbf9..efe2ccb0a2a 100644 --- a/static/scripts/galaxy.panels.js +++ b/static/scripts/galaxy.panels.js @@ -79,7 +79,12 @@ function make_left_panel( panel_el, center_el, border_el ) { } } ).find( "div" ).show();; - + var force_panel = function( op ) { + if ( ( hidden && op == 'show' ) || ( ! hidden && op == 'hide' ) ) { + toggle(); + } + } + return { force_panel: force_panel }; }; function make_right_panel( panel_el, center_el, border_el ) { @@ -173,7 +178,12 @@ function make_right_panel( panel_el, center_el, border_el ) { } } ).find( "div" ).show(); - return { handle_minwidth_hint: handle_minwidth_hint }; + var force_panel = function( op ) { + if ( ( hidden && op == 'show' ) || ( ! hidden && op == 'hide' ) ) { + toggle(); + } + } + return { handle_minwidth_hint: handle_minwidth_hint, force_panel: force_panel }; }; // Modal dialog boxes @@ -234,4 +244,4 @@ function make_popupmenu( button_element, options ) { } ); }; $( button_element ).click( click ); -}; \ No newline at end of file +}; diff --git a/static/scripts/packed/galaxy.panels.js b/static/scripts/packed/galaxy.panels.js index 241d997a112..fd71a3f43d6 100644 --- a/static/scripts/packed/galaxy.panels.js +++ b/static/scripts/packed/galaxy.panels.js @@ -1 +1 @@ -var hidden_width=7;var border_tweak=9;var jq=jQuery;function ensure_dd_helper(){if(jq("#DD-helper").length==0){$("
").css({background:"white",opacity:0,zIndex:9000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_left_panel(E,A,B){var D=false;var C=null;resize=function(F){var G=F;if(F<0){F=0}jq(E).css("width",F);jq(B).css("left",G);jq(A).css("left",F+7);if(document.recalc){document.recalc()}};toggle=function(){if(D){jq(B).removeClass("hover");jq(B).animate({left:C},"fast");jq(E).css("left",-C).show().animate({left:0},"fast",function(){resize(C);jq(B).removeClass("hidden")});D=false}else{C=jq(B).position().left;jq(A).css("left",hidden_width);if(document.recalc){document.recalc()}jq(B).removeClass("hover");jq(E).animate({left:-C},"fast");jq(B).animate({left:-1},"fast",function(){jq(this).addClass("hidden")});D=true}};jq(B).hover(function(){jq(this).addClass("hover")},function(){jq(this).removeClass("hover")}).draggable({start:function(F,G){jq("#DD-helper").show()},stop:function(F,G){jq("#DD-helper").hide();return false},drag:function(F,G){x=G.position.left;x=Math.min(400,Math.max(100,x));if(D){jq(E).css("left",0);jq(B).removeClass("hidden");D=false}resize(x);G.position.left=x;G.position.top=$(this).data("draggable").originalPosition.top},click:function(){toggle()}}).find("div").show()}function make_right_panel(A,E,G){var I=false;var F=false;var C=null;var D=function(J){jq(A).css("width",J);jq(E).css("right",J+9);jq(G).css("right",J).css("left","");if(document.recalc){document.recalc()}};var H=function(){if(I){jq(G).removeClass("hover");jq(G).animate({right:C},"fast");jq(A).css("right",-C).show().animate({right:0},"fast",function(){D(C);jq(G).removeClass("hidden")});I=false}else{C=jq(document).width()-jq(G).position().left-border_tweak;jq(E).css("right",hidden_width+1);if(document.recalc){document.recalc()}jq(G).removeClass("hover");jq(A).animate({right:-C},"fast");jq(G).animate({right:-1},"fast",function(){jq(this).addClass("hidden")});I=true}F=false};var B=function(J){var K=jq(E).width()-(I?C:0);if(K").text(F).click(G));A.append(" ")});A.show()}else{A.hide()}var A=$(".dialog-box").find(".extra_buttons").html("");if(C){$.each(C,function(F,G){A.append($("

diff --git a/templates/dataset/edit_attributes.mako b/templates/dataset/edit_attributes.mako index 39936d24f4c..c29b77677b0 100644 --- a/templates/dataset/edit_attributes.mako +++ b/templates/dataset/edit_attributes.mako @@ -1,146 +1,195 @@ <%inherit file="/base.mako"/> -<%def name="title()">History Item Attributes +<%def name="title()">Edit Dataset Attributes <%def name="datatype( dataset, datatypes )"> - + -
-
Edit Attributes
-
-
- -
- -
- -
-
-
-
- -
- -
-
-
- %for name, spec in data.metadata.spec.items(): - %if spec.visible: +<% + if isinstance( data, trans.app.model.HistoryDatasetAssociation ): + id_name = 'id' + elif isinstance( data, trans.app.model.LibraryFolderDatasetAssociation ): + id_name = 'lid' +%> + +%if ( id_name == 'id' or trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_EDIT_METADATA, dataset = data ) ): +
+
Edit Attributes
+
+ +
- -
- ${data.metadata.get_html_by_name( name )} -
-
+ +
+ +
+
- %endif - %endfor -
- -
- -
- -
- -
-
- This will inspect the dataset and attempt to correct the above column values - if they are not accurate. -
-
- %if data.missing_meta(): -
Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.
- %endif -
-
- -

- - <% converters = data.get_converter_types() %> - %if len( converters ) > 0: -

-
Convert to new format
-
-
- -
- +
+ +
+ +
+
+
+ %for name, spec in data.metadata.spec.items(): + %if spec.visible: +
+ +
+ ${data.metadata.get_html_by_name( name )} +
+
+
+ %endif + %endfor +
+ +
+ +
+
- +
-
- This will create a new dataset with the contents of this - dataset converted to a new format. + This will inspect the dataset and attempt to correct the above column values if they are not accurate.
+
+ %if data.missing_meta(): +
Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.
+ %endif +
+
+

+ %if id_name == 'id': + <% converters = data.get_converter_types() %> + %if len( converters ) > 0: +

+
Convert to new format
+
+
+ +
+ +
+ +
+
+ This will create a new dataset with the contents of this dataset converted to a new format. +
+
+
+
+ +
+
+
+
+

+ %endif + %endif +

+
Change data type
+
+
+ +
+ +
+ ${datatype( data, datatypes )} +
+
+ This will change the datatype of the existing dataset + but not modify its contents. Use this if Galaxy + has incorrectly guessed the type of your dataset. +
+
+
+
+ +
+
+
+
+

+%else: +

+
View Attributes
+
+
+ Name: ${data.name}
-
-
- -
- -
-
- -

- %endif + Info: ${data.info} +

+ Data Format: ${data.ext} +
+ %for name, spec in data.metadata.spec.items(): + %if spec.visible: + ${spec.desc}: + %if spec.unwrap( spec.get( name ) ): + ${spec.unwrap( spec.get( name ) )} + %else: + ${spec.no_value} + %endif +
+ %endif + %endfor +
+
+
+

+%endif - -

-
Change data type
-
-
- -
- -
- ${datatype( data, datatypes )} +%if trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_MANAGE_PERMISSIONS, dataset = data ): + <%namespace file="/dataset/security_common.mako" import="render_permission_form" /> + ${render_permission_form( data.dataset, data.name, h.url_for( action='edit' ), id_name, data.id, trans.user.all_roles() )} +%elif trans.user: +
+
View permissions
+
+
+ %if data.dataset.actions: +
    + %for action, roles in trans.app.security_agent.get_dataset_permissions( data.dataset ).items(): + %if roles: +
  • ${action.description}
  • +
      + %for role in roles: +
    • ${role.description}
    • + %endfor +
    + %endif + %endfor +
+ %else: +

This dataset is accessible by everyone (it is public).

+ %endif
- -
- This will change the datatype of the existing dataset - but not modify its contents. Use this if Galaxy - has incorrectly guessed the type of your dataset. -
-
-
-
- -
- -
-
- -

-

-
Copy History Item
-
- Click here to make a copy of this history item. -
-
-

+
+
+%endif diff --git a/templates/dataset/security_common.mako b/templates/dataset/security_common.mako new file mode 100644 index 00000000000..517836f18d4 --- /dev/null +++ b/templates/dataset/security_common.mako @@ -0,0 +1,87 @@ +<%def name="render_select( current_actions, action_key, action, all_roles )"> + <% + in_roles = [] + for a in current_actions: + if a.action == action.action: + in_roles.append( a.role ) + out_roles = filter( lambda x: x not in in_roles, all_roles ) + %> +

${action.description}

+
+
+ Roles associated:
+
+
+
+
+ Roles not associated:
+
+ +
+
+ + +<%def name="render_permission_form( obj, obj_name, form_url, id_name, id, all_roles )"> + <% + if isinstance( obj, trans.app.model.User ): + current_actions = obj.default_permissions + obj_str = 'user %s' % obj_name + elif isinstance( obj, trans.app.model.History ): + current_actions = obj.default_permissions + obj_str = 'history %s' % obj_name + elif isinstance( obj, trans.app.model.Dataset ): + current_actions = obj.actions + obj_str = obj_name + else: + current_actions = obj.dataset.actions + obj_str = 'unknown object %s' %obj_name + %> + +
+
Manage permissions and role associations for ${obj_str}
+
+
+ +
+ %for k, v in trans.app.model.Dataset.permitted_actions.items(): +
+ ${render_select( current_actions, k, v, all_roles )} +
+ %endfor +
+ +
+
+
+
+

+ diff --git a/templates/form.mako b/templates/form.mako index c003de02585..9fe2a413884 100644 --- a/templates/form.mako +++ b/templates/form.mako @@ -10,6 +10,10 @@ $(function(){ +%if header: + ${header} +%endif +

${form.title}
@@ -21,9 +25,11 @@ $(function(){ cls += " form-row-error" %>
+ %if input.use_label: + %endif
diff --git a/templates/history/options.mako b/templates/history/options.mako index dfe3ffd9d09..14b3e981455 100644 --- a/templates/history/options.mako +++ b/templates/history/options.mako @@ -18,6 +18,7 @@ %endif
  • Construct workflow from the current history
  • Share current history
  • +
  • Change default permissions for the current history
  • %endif
  • Show deleted datasets in history
  • Delete current history
  • diff --git a/templates/history/permissions.mako b/templates/history/permissions.mako new file mode 100644 index 00000000000..a189523440d --- /dev/null +++ b/templates/history/permissions.mako @@ -0,0 +1,7 @@ +<%inherit file="/base.mako"/> +<%def name="title()">Change Default Permissions on New Datasets in This History +<%namespace file="/dataset/security_common.mako" import="render_permission_form" /> + +%if trans.user: + ${render_permission_form( trans.history, trans.history.name, h.url_for(), 'id', None, trans.user.all_roles() )} +%endif diff --git a/templates/history/share.mako b/templates/history/share.mako index 5e64e66756a..8728587cb45 100644 --- a/templates/history/share.mako +++ b/templates/history/share.mako @@ -1,6 +1,7 @@ <%inherit file="/base.mako"/> <%def name="title()">Share histories +%if not can_change and not cannot_change:
    Share Histories
    @@ -27,4 +28,90 @@
    -
    \ No newline at end of file +
    +%else: + +
    + %for history in histories: + + %endfor + +
    + The history or histories you've chosen to share contain datasets that the user you're sharing with does not have permission to access. These datasets are shown below. Datasets which the user already has permission to access are not shown. +
    +

    + %if can_change: +

    + The following datasets can be shared with ${email} by updating their permissions: +

    + + + %for history, datasets in can_change.items(): + + + + + %endfor +
    HistoriesDatasets
    ${history.name} + %for dataset in datasets: + ${dataset.name}
    + %endfor +
    +

    +

    + %endif + %if cannot_change: +

    + The following datasets cannot be shared with ${email} because you do not have permission to change the permissions on them. +

    + + + %for history, datasets in cannot_change.items(): + + + + + %endfor +
    HistoriesDatasets
    ${history.name} + %for dataset in datasets: + ${dataset.name}
    + %endfor +
    +

    +

    + %endif +

    + How would you like to proceed? +

    + %if can_change: + Set datasets above to public access + %if cannot_change: + (where possible) + %endif +
    + Set datasets above to private access for me and the user(s) with whom I am sharing + %if cannot_change: + (where possible) + %endif +
    + %endif + Share anyway + %if can_change: + (don't change any permissions) + %endif +
    + Don't share
    +
    +
    +

    +
    +%endif diff --git a/templates/library/browser.mako b/templates/library/browser.mako new file mode 100644 index 00000000000..ba1d313b07d --- /dev/null +++ b/templates/library/browser.mako @@ -0,0 +1,171 @@ +<%inherit file="/base.mako"/> +<%namespace file="common.mako" import="render_dataset" /> +<%namespace file="/message.mako" import="render_msg" /> + +<%def name="title()">Import from Library +<%def name="stylesheets()"> + + + + +<% +def name_sorted( l ): + return sorted( l, lambda a, b: cmp( a.name.lower(), b.name.lower() ) ) +%> + + + + + + + +<%def name="render_folder( parent, parent_pad )"> + <% + if not trans.app.security_agent.check_folder_contents( trans.user, parent ): + return "" + pad = parent_pad + 20 + if parent_pad == 0: + expander = "/static/images/silk/resultset_bottom.png" + folder = "/static/images/silk/folder_page.png" + subfolder = False + else: + expander = "/static/images/silk/resultset_next.png" + folder = "/static/images/silk/folder.png" + subfolder = True + %> +
  • +
    + + ${parent.name} + %if parent.description: + - ${parent.description} + %endif +
    +
  • + %if subfolder: +
      + %else: +
        + %endif + %for folder in name_sorted( parent.active_folders ): + ${render_folder( folder, pad )} + %endfor + %for dataset in name_sorted( parent.active_datasets ): + %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.DATASET_ACCESS, dataset=dataset.dataset ): +
      • ${render_dataset( dataset )}
      • + %endif + %endfor +
      + + +

      Libraries

      + +%if msg: + ${render_msg( msg, messagetype )} +%endif + +%if not libraries: + No libraries contain datasets that you are allowed to access +%else: + <% can_access = False %> +
      +
        + %for library in libraries: + %if trans.app.security_agent.check_folder_contents( trans.user, library ): + <% can_access = True %> +
      • +
        + + + + + + + +
        + + ${library.name} + %if library.description: + - ${library.description} + %endif + FormatDbInfo
        +
        +
      • +
          + ${render_folder( library.root_folder, 0 )} +
        +
        + %endif + %endfor +
      + %if can_access: + + %else: + No libraries contain datasets that you are allowed to access + %endif +
      +%endif diff --git a/templates/library/common.mako b/templates/library/common.mako new file mode 100644 index 00000000000..ad4123da392 --- /dev/null +++ b/templates/library/common.mako @@ -0,0 +1,56 @@ +## Render the dataset `data` +<%def name="render_dataset( data )"> +
      + + ## Header row for library items (name, state, action buttons) +
      + + + + + + + +
      + + ${data.display_name()} + + + ${data.ext}${data.dbkey}${data.info}
      +
      + + ## Body for library items, extra info and actions, data "peek" +
      +
      ${data.blurb}
      +
      + %if data.has_data: + %for display_app in data.datatype.get_display_types(): + <% display_links = data.datatype.get_display_links( data, display_app, app, request.base ) %> + %if len( display_links ) > 0: + ${data.datatype.get_display_label(display_app)} + %for display_name, display_link in display_links: + ${display_name} + %endfor + %endif + %endfor + %endif +
      + %if data.peek != "no peek": +
      ${data.display_peek()}
      + %endif + ## Recurse for child datasets + %if len( data.visible_children ) > 0: +
      + There are ${len( data.visible_children )} secondary datasets. + %for idx, child in enumerate( data.visible_children ): + ${render_dataset( child )} + %endfor +
      + %endif +
      + diff --git a/templates/message.mako b/templates/message.mako index 551b60c4735..3e6783245e5 100644 --- a/templates/message.mako +++ b/templates/message.mako @@ -1,32 +1,44 @@ <%inherit file="/base.mako"/> <%def name="javascripts()"> -${parent.javascripts()} - + if ( parent.handle_minwidth_hint ) + { + parent.handle_minwidth_hint( -1 ); + } +
      ${message}
      + +## Render a message +<%def name="render_msg( msg, messagetype='done' )"> +
      ${msg}
      +
      + diff --git a/templates/no_access.mako b/templates/no_access.mako new file mode 100644 index 00000000000..031cafbaf5f --- /dev/null +++ b/templates/no_access.mako @@ -0,0 +1,15 @@ +<%inherit file="/base.mako"/> + +<%def name="javascripts()"> + ${parent.javascripts()} + + + +
      ${message}
      diff --git a/templates/root/history_common.mako b/templates/root/history_common.mako index 139bf19dfb1..f09229dbd1c 100644 --- a/templates/root/history_common.mako +++ b/templates/root/history_common.mako @@ -6,7 +6,11 @@ else: data_state = data.state %> -
      + %if not trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data.dataset ): +
      + %else: +
      + %endif %if data.deleted:
      @@ -36,7 +40,9 @@ ## Body for history items, extra info and actions, data "peek"
      - %if data_state == "queued": + %if not trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data.dataset ): +
      You do not have permission to view this dataset.
      + %elif data_state == "queued":
      Job is waiting to run
      %elif data_state == "running":
      Job is currently running
      diff --git a/templates/root/index.mako b/templates/root/index.mako index f573571162b..69c3ab49ff8 100644 --- a/templates/root/index.mako +++ b/templates/root/index.mako @@ -1,11 +1,26 @@ <%inherit file="/base_panels.mako"/> +<%def name="init()"> +<% + self.has_left_panel=True + self.has_right_panel=True + self.active_view="analysis" +%> +%if trans.app.config.require_login and not trans.user: + +%endif + + <%def name="left_panel()">
      Tools
      - +
      @@ -13,8 +28,12 @@ ## If a specific tool id was specified, load it in the middle frame <% - if tool_id is not None: + if trans.app.config.require_login and not trans.user: + center_url = h.url_for( controller='user', action='login' ) + elif tool_id is not None: center_url = h.url_for( 'tool_runner', tool_id=tool_id, from_noframe=True ) + elif workflow_id is not None: + center_url = h.url_for( controller='workflow', action='run', id=workflow_id ) elif m_c is not None: center_url = h.url_for( controller=m_c, action=m_a ) else: @@ -29,12 +48,12 @@
      History
      - +
      - \ No newline at end of file + diff --git a/templates/root/masthead.mako b/templates/root/masthead.mako index 58d8f1776db..270d9f59d3c 100644 --- a/templates/root/masthead.mako +++ b/templates/root/masthead.mako @@ -9,32 +9,65 @@ - + +
      Galaxy${brand}
      - - Info: report bugs - | wiki - | screencasts - | blog + %if not app.config.require_login or ( app.config.require_login and trans.user): + View: + analysis + | workflow + %if admin_user == "true": + | admin + %endif + + +     + %endif + + Info: report bugs + | wiki + | screencasts +     + %if app.config.use_remote_user: Logged in as ${t.user.email} %else: %if t.user: - Logged in as ${t.user.email}: manage - | logout + Logged in as ${t.user.email}: manage + %if app.config.require_login: + | logout + %else: + | logout + %endif %else: - Account: create - | login + Account: + %if app.config.allow_user_creation: + create | + %endif + login %endif %endif   +
      diff --git a/templates/root/tool_menu.mako b/templates/root/tool_menu.mako index c2d77210905..a135b6ff1f8 100644 --- a/templates/root/tool_menu.mako +++ b/templates/root/tool_menu.mako @@ -90,7 +90,7 @@
      - Manage workflows + List all of your workflows
      %if t.user: %for m in t.user.stored_workflow_menu_entries: @@ -110,4 +110,4 @@ - \ No newline at end of file + diff --git a/templates/user/index.mako b/templates/user/index.mako index 2b11262cece..04303c9b0a4 100644 --- a/templates/user/index.mako +++ b/templates/user/index.mako @@ -8,6 +8,7 @@ %else: @@ -16,4 +17,4 @@
    • Login
    • Create new account
    -%endif \ No newline at end of file +%endif diff --git a/templates/user/permissions.mako b/templates/user/permissions.mako new file mode 100644 index 00000000000..45b44795f38 --- /dev/null +++ b/templates/user/permissions.mako @@ -0,0 +1,7 @@ +<%inherit file="/base.mako"/> +<%def name="title()">Change Default Permissions on New Histories +<%namespace file="/dataset/security_common.mako" import="render_permission_form" /> + +%if trans.user: + ${render_permission_form( trans.user, trans.user.email, h.url_for(), 'id', None, trans.user.all_roles() )} +%endif diff --git a/templates/workflow/editor.mako b/templates/workflow/editor.mako index 18d7b862fed..3b3cf7ee055 100644 --- a/templates/workflow/editor.mako +++ b/templates/workflow/editor.mako @@ -1,6 +1,18 @@ <%inherit file="/base_panels.mako"/> -<%def name="title()">Galaxy Workflow Editor +<%def name="init()"> +<% + self.active_view="workflow" + self.message_box_visible=True + self.message_box_class="warning" +%> + + +<%def name="message_box_content()"> + Workflow support is currently in beta testing. + Workflows may not work with all tools, may fail unexpectedly, and may + not be compatible with future updates to Galaxy. + <%def name="late_javascripts()"> @@ -229,7 +241,7 @@ } var close_editor = function() { - <% next_url = h.url_for( controller='root', m_c='workflow' ) %> + <% next_url = h.url_for( controller='workflow', action='index' ) %> if ( workflow && workflow.has_changes ) { do_close = function() { window.onbeforeunload = undefined; @@ -301,11 +313,12 @@ <%def name="stylesheets()"> - ${parent.stylesheets()} - - ## Also include "base.css" for styling tool menu and forms (details) + ## Include "base.css" for styling tool menu and forms (details) + ## But make sure styles for the layout take precedence + ${parent.stylesheets()} +