galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
July 2013
- 1 participants
- 83 discussions
commit/galaxy-central: greg: Fix for generating the repository type select list, and fix a related typo in my last commit.
by commits-noreply@bitbucket.org 11 Jul '13
by commits-noreply@bitbucket.org 11 Jul '13
11 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0a6c263dd428/
Changeset: 0a6c263dd428
User: greg
Date: 2013-07-11 21:16:08
Summary: Fix for generating the repository type select list, and fix a related typo in my last commit.
Affected #: 2 files
diff -r 5a41d725197d2d42475f80282a57b0b364898671 -r 0a6c263dd4284d3aed1b59db91c16ca5e4c4a7a0 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -666,7 +666,7 @@
# Update repository files for browsing.
suc.update_repository( repo )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
- repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
+ repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repository=repository,
metadata=metadata,
@@ -1017,7 +1017,7 @@
action='view_repository',
message=message,
id=trans.security.encode_id( repository.id ) ) )
- repository_type_select_field = rt_util.build_repository_type_select_fiels( trans )
+ repository_type_select_field = rt_util.build_repository_type_select_field( trans )
return trans.fill_template( '/webapps/tool_shed/repository/create_repository.mako',
name=name,
description=description,
@@ -2185,7 +2185,7 @@
else:
message += malicious_error
status = 'error'
- repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
+ repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
malicious_check_box = CheckboxField( 'malicious', checked=is_malicious )
skip_tool_tests_check_box = CheckboxField( 'skip_tool_tests', checked=skip_tool_tests_checked )
categories = suc.get_categories( trans )
@@ -2365,7 +2365,7 @@
display_reviews = util.string_as_bool( kwd.get( 'display_reviews', False ) )
rra = self.get_user_item_rating( trans.sa_session, trans.user, repository, webapp_model=trans.model )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
- repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
+ repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/rate_repository.mako',
repository=repository,
metadata=metadata,
@@ -2565,7 +2565,7 @@
else:
message = "Select at least 1 file to delete from the repository before clicking <b>Delete selected files</b>."
status = "error"
- repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
+ repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repo=repo,
repository=repository,
@@ -2991,7 +2991,7 @@
message += malicious_error
status = 'error'
containers_dict = container_util.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
- repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
+ repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/view_repository.mako',
repo=repo,
repository=repository,
diff -r 5a41d725197d2d42475f80282a57b0b364898671 -r 0a6c263dd4284d3aed1b59db91c16ca5e4c4a7a0 lib/tool_shed/repository_types/util.py
--- a/lib/tool_shed/repository_types/util.py
+++ b/lib/tool_shed/repository_types/util.py
@@ -8,13 +8,13 @@
types = [ GENERIC, TOOL_DEPENDENCY_DEFINITION ]
-def build_repository_type_select_fiels( trans, repository=None, name='repository_type' ):
+def build_repository_type_select_field( trans, repository=None, name='repository_type' ):
"""Called from the Tool Shed to generate the current list of supported repository types."""
if repository:
selected_type = str( repository.type )
else:
selected_type = None
- repository_type_select_fiels = SelectField( name=name )
+ repository_type_select_field = SelectField( name=name )
for type_label, type_class in trans.app.repository_types_registry.repository_types_by_label.items():
option_label = str( type_class.label )
option_value = str( type_class.type )
@@ -23,8 +23,10 @@
else:
selected = False
if repository:
- if type_class.is_valid_for_type( trans.app, repository ):
- repository_type_select_fiels.add_option( option_label, option_value, selected=selected )
+ if repository.type == option_value:
+ repository_type_select_field.add_option( option_label, option_value, selected=selected )
+ elif type_class.is_valid_for_type( trans.app, repository ):
+ repository_type_select_field.add_option( option_label, option_value, selected=selected )
else:
- repository_type_select_fiels.add_option( option_label, option_value, selected=selected )
- return repository_type_select_fiels
+ repository_type_select_field.add_option( option_label, option_value, selected=selected )
+ return repository_type_select_field
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.
1
0
commit/galaxy-central: greg: Add support for categorizing repositories in the tool shed by type, with the first 2 supported types being "generic" and "tool_dependency_definition". Repositories of type "tool_dependency_definition" can always contain only a single file named "tool_dependencies.xml", and the only metadata revision for these types of repositories will be the changelog tip.
by commits-noreply@bitbucket.org 11 Jul '13
by commits-noreply@bitbucket.org 11 Jul '13
11 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5a41d725197d/
Changeset: 5a41d725197d
User: greg
Date: 2013-07-11 20:59:27
Summary: Add support for categorizing repositories in the tool shed by type, with the first 2 supported types being "generic" and "tool_dependency_definition". Repositories of type "tool_dependency_definition" can always contain only a single file named "tool_dependencies.xml", and the only metadata revision for these types of repositories will be the changelog tip.
Affected #: 20 files
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/galaxy/webapps/tool_shed/app.py
--- a/lib/galaxy/webapps/tool_shed/app.py
+++ b/lib/galaxy/webapps/tool_shed/app.py
@@ -7,6 +7,7 @@
from galaxy.openid.providers import OpenIDProviders
from galaxy.web import security
from galaxy.tags.tag_handler import CommunityTagHandler
+import tool_shed.repository_types.registry
class UniverseApplication( object ):
"""Encapsulates the state of a Universe application"""
@@ -20,6 +21,8 @@
# Set up datatypes registry
self.datatypes_registry = galaxy.datatypes.registry.Registry()
self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
+ # Set up the repository_types registry.
+ self.repository_types_registry = tool_shed.repository_types.registry.Registry()
# Determine the database url
if self.config.database_connection:
db_url = self.config.database_connection
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -35,6 +35,7 @@
import galaxy.tools
import tool_shed.grids.repository_grids as repository_grids
import tool_shed.grids.util as grids_util
+import tool_shed.repository_types.util as rt_util
from galaxy import eggs
eggs.require('mercurial')
@@ -665,10 +666,12 @@
# Update repository files for browsing.
suc.update_repository( repo )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
+ repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repository=repository,
metadata=metadata,
commit_message=commit_message,
+ repository_type_select_field=repository_type_select_field,
message=message,
status=status )
@@ -961,6 +964,7 @@
long_description = kwd.get( 'long_description', '' )
category_ids = util.listify( kwd.get( 'category_id', '' ) )
selected_categories = [ trans.security.decode_id( id ) for id in category_ids ]
+ repository_type = kwd.get( 'repository_type', rt_util.GENERIC )
if kwd.get( 'create_repository_button', False ):
error = False
message = self.__validate_repository_name( name, trans.user )
@@ -974,6 +978,7 @@
else:
# Add the repository record to the db
repository = trans.app.model.Repository( name=name,
+ type=repository_type,
description=description,
long_description=long_description,
user_id=trans.user.id )
@@ -1001,7 +1006,7 @@
if category_ids:
# Create category associations
for category_id in category_ids:
- category = trans.sa_session.query(model.Category).get( trans.security.decode_id( category_id ) )
+ category = trans.sa_session.query( model.Category ).get( trans.security.decode_id( category_id ) )
rca = trans.app.model.RepositoryCategoryAssociation( repository, category )
trans.sa_session.add( rca )
flush_needed = True
@@ -1012,12 +1017,14 @@
action='view_repository',
message=message,
id=trans.security.encode_id( repository.id ) ) )
+ repository_type_select_field = rt_util.build_repository_type_select_fiels( trans )
return trans.fill_template( '/webapps/tool_shed/repository/create_repository.mako',
name=name,
description=description,
long_description=long_description,
selected_categories=selected_categories,
categories=categories,
+ repository_type_select_field=repository_type_select_field,
message=message,
status=status )
@@ -1985,6 +1992,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository = suc.get_repository_in_tool_shed( trans, id )
+ repository_type = kwd.get( 'repository_type', str( repository.type ) )
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
repo_name = kwd.get( 'repo_name', repository.name )
@@ -2016,6 +2024,9 @@
id=id,
message=message,
status='error' ) )
+ if repository_type != repository.type:
+ repository.type = repository_type
+ flush_needed = True
if description != repository.description:
repository.description = description
flush_needed = True
@@ -2174,6 +2185,7 @@
else:
message += malicious_error
status = 'error'
+ repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
malicious_check_box = CheckboxField( 'malicious', checked=is_malicious )
skip_tool_tests_check_box = CheckboxField( 'skip_tool_tests', checked=skip_tool_tests_checked )
categories = suc.get_categories( trans )
@@ -2202,6 +2214,7 @@
skip_tool_tests_check_box=skip_tool_tests_check_box,
skip_tool_test=skip_tool_test,
malicious_check_box=malicious_check_box,
+ repository_type_select_field=repository_type_select_field,
message=message,
status=status )
@@ -2352,6 +2365,7 @@
display_reviews = util.string_as_bool( kwd.get( 'display_reviews', False ) )
rra = self.get_user_item_rating( trans.sa_session, trans.user, repository, webapp_model=trans.model )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
+ repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/rate_repository.mako',
repository=repository,
metadata=metadata,
@@ -2359,6 +2373,7 @@
display_reviews=display_reviews,
num_ratings=num_ratings,
rra=rra,
+ repository_type_select_field=repository_type_select_field,
message=message,
status=status )
@@ -2550,10 +2565,12 @@
else:
message = "Select at least 1 file to delete from the repository before clicking <b>Delete selected files</b>."
status = "error"
+ repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repo=repo,
repository=repository,
commit_message=commit_message,
+ repository_type_select_field=repository_type_select_field,
message=message,
status=status )
@@ -2974,6 +2991,7 @@
message += malicious_error
status = 'error'
containers_dict = container_util.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
+ repository_type_select_field = rt_util.build_repository_type_select_fiels( trans, repository=repository )
return trans.fill_template( '/webapps/tool_shed/repository/view_repository.mako',
repo=repo,
repository=repository,
@@ -2987,6 +3005,7 @@
changeset_revision=changeset_revision,
changeset_revision_select_field=changeset_revision_select_field,
revision_label=revision_label,
+ repository_type_select_field=repository_type_select_field,
message=message,
status=status )
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/galaxy/webapps/tool_shed/model/__init__.py
--- a/lib/galaxy/webapps/tool_shed/model/__init__.py
+++ b/lib/galaxy/webapps/tool_shed/model/__init__.py
@@ -5,6 +5,7 @@
from galaxy.util.bunch import Bunch
from galaxy.util.hash_util import new_secure_hash
from galaxy.model.item_attrs import APIItem
+import tool_shed.repository_types.util as rt_util
from galaxy import eggs
eggs.require( 'mercurial' )
@@ -130,18 +131,20 @@
class Repository( object, APIItem ):
- api_collection_visible_keys = ( 'id', 'name', 'description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated' )
- api_element_visible_keys = ( 'id', 'name', 'description', 'long_description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated' )
+ api_collection_visible_keys = ( 'id', 'name', 'type', 'description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated' )
+ api_element_visible_keys = ( 'id', 'name', 'type', 'description', 'long_description', 'user_id', 'private', 'deleted', 'times_downloaded',
+ 'deprecated' )
file_states = Bunch( NORMAL = 'n',
NEEDS_MERGING = 'm',
MARKED_FOR_REMOVAL = 'r',
MARKED_FOR_ADDITION = 'a',
NOT_TRACKED = '?' )
- def __init__( self, id=None, name=None, description=None, long_description=None, user_id=None, private=False, deleted=None, email_alerts=None,
- times_downloaded=0, deprecated=False ):
+ def __init__( self, id=None, name=None, type=None, description=None, long_description=None, user_id=None, private=False, deleted=None,
+ email_alerts=None, times_downloaded=0, deprecated=False ):
self.id = id
self.name = name or "Unnamed repository"
+ self.type = type
self.description = description
self.long_description = long_description
self.user_id = user_id
@@ -154,6 +157,24 @@
def as_dict( self, value_mapper=None ):
return self.get_api_value( view='element', value_mapper=value_mapper )
+ def can_change_type( self, app ):
+ # Allow changing the type only if the repository has no contents, has never been installed, or has never been changed from
+ # the default type.
+ if self.is_new( app ):
+ return True
+ if self.times_downloaded == 0:
+ return True
+ if self.type == rt_util.DEFAULT:
+ return True
+ return False
+
+ def can_change_type_to( self, app, new_type_label ):
+ if self.can_change_type( app ):
+ new_type = app.repository_types_registry.get_class_by_label( new_type_label )
+ if new_type.is_valid_for_type( self ):
+ return True
+ return False
+
def get_api_value( self, view='collection', value_mapper=None ):
if value_mapper is None:
value_mapper = {}
@@ -173,6 +194,13 @@
rval[ 'owner' ] = self.user.username
return rval
+ def get_changesets_for_setting_metadata( self, app ):
+ type_class = self.get_type_class( app )
+ return type_class.get_changesets_for_setting_metadata( app, self )
+
+ def get_type_class( self, app ):
+ return app.repository_types_registry.get_class_by_label( self.type )
+
def repo_path( self, app ):
return app.hgweb_config_manager.get_entry( os.path.join( "repos", self.user.username, self.name ) )
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/galaxy/webapps/tool_shed/model/mapping.py
--- a/lib/galaxy/webapps/tool_shed/model/mapping.py
+++ b/lib/galaxy/webapps/tool_shed/model/mapping.py
@@ -106,6 +106,7 @@
Column( "create_time", DateTime, default=now ),
Column( "update_time", DateTime, default=now, onupdate=now ),
Column( "name", TrimmedString( 255 ), index=True ),
+ Column( "type", TrimmedString( 255 ), index=True ),
Column( "description" , TEXT ),
Column( "long_description" , TEXT ),
Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True ),
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/galaxy/webapps/tool_shed/model/migrate/versions/0020_add_repository_type_column.py
--- /dev/null
+++ b/lib/galaxy/webapps/tool_shed/model/migrate/versions/0020_add_repository_type_column.py
@@ -0,0 +1,46 @@
+"""Migration script to add the type column to the repository table."""
+
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+
+# Need our custom types, but don't import anything else from model
+from galaxy.model.custom_types import *
+
+import sys, logging
+log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
+
+metadata = MetaData()
+
+def upgrade( migrate_engine ):
+ print __doc__
+ metadata.bind = migrate_engine
+ metadata.reflect()
+ Repository_table = Table( "repository", metadata, autoload=True )
+ c = Column( "type", TrimmedString( 255 ), index=True )
+ try:
+ # Create
+ c.create( Repository_table, index_name="ix_repository_type" )
+ assert c is Repository_table.c.type
+ except Exception, e:
+ print "Adding type column to the repository table failed: %s" % str( e )
+ # Update the type column to have the default generic value.
+ cmd = "UPDATE repository SET type = 'generic'"
+ migrate_engine.execute( cmd )
+
+def downgrade( migrate_engine ):
+ metadata.bind = migrate_engine
+ metadata.reflect()
+ # Drop type column from repository table.
+ Repository_table = Table( "repository", metadata, autoload=True )
+ try:
+ Repository_table.c.type.drop()
+ except Exception, e:
+ print "Dropping column type from the repository table failed: %s" % str( e )
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/tool_shed/repository_types/generic.py
--- /dev/null
+++ b/lib/tool_shed/repository_types/generic.py
@@ -0,0 +1,20 @@
+import logging
+import tool_shed.repository_types.util as rt_util
+from tool_shed.repository_types.metadata import Metadata
+
+log = logging.getLogger( __name__ )
+
+
+class Generic( Metadata ):
+
+ def __init__( self ):
+ self.type = rt_util.GENERIC
+ self.label = 'Generic'
+
+ def is_valid_for_type( self, app, repository, revisions_to_check=None ):
+ """A repository's type can only be changed to the generic type if it is new or has never been installed."""
+ if repository.is_new( app ):
+ return True
+ if repository.times_downloaded == 0:
+ return True
+ return False
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/tool_shed/repository_types/metadata.py
--- /dev/null
+++ b/lib/tool_shed/repository_types/metadata.py
@@ -0,0 +1,32 @@
+import logging
+import tool_shed.repository_types.util as rt_util
+
+from galaxy import eggs
+eggs.require( 'mercurial' )
+from mercurial import hg
+from mercurial import ui
+
+log = logging.getLogger( __name__ )
+
+
+class Metadata( object ):
+
+ def __init__( self ):
+ self.type = None
+
+ def get_changesets_for_setting_metadata( self, app, repository ):
+ repo = hg.repository( ui.ui(), repository.repo_path( app ) )
+ return repo.changelog
+
+ def is_valid_for_type( self, repository, revisions_to_check=None ):
+ raise "Unimplemented Method"
+
+
+class TipOnly( Metadata ):
+
+ def __init__( self ):
+ self.type = None
+
+ def get_changesets_for_setting_metadata( self, app, repository ):
+ repo = hg.repository( ui.ui(), repository.repo_path( app ) )
+ return [ repo.changelog.tip() ]
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/tool_shed/repository_types/registry.py
--- /dev/null
+++ b/lib/tool_shed/repository_types/registry.py
@@ -0,0 +1,17 @@
+import logging
+import generic
+import tool_dependency_definition
+from galaxy.util.odict import odict
+
+log = logging.getLogger( __name__ )
+
+
+class Registry( object ):
+
+ def __init__( self ):
+ self.repository_types_by_label = odict()
+ self.repository_types_by_label[ 'generic' ] = generic.Generic()
+ self.repository_types_by_label[ 'tool_dependency_definition' ] = tool_dependency_definition.ToolDependencyDefinition()
+
+ def get_class_by_label( self, label ):
+ return self.repository_types_by_label.get( label, None )
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/tool_shed/repository_types/tool_dependency_definition.py
--- /dev/null
+++ b/lib/tool_shed/repository_types/tool_dependency_definition.py
@@ -0,0 +1,43 @@
+import logging
+from tool_shed.repository_types.metadata import TipOnly
+import tool_shed.repository_types.util as rt_util
+import tool_shed.util.shed_util_common as suc
+
+from galaxy import eggs
+eggs.require( 'mercurial' )
+from mercurial import hg
+from mercurial import ui
+
+log = logging.getLogger( __name__ )
+
+class ToolDependencyDefinition( TipOnly ):
+
+ def __init__( self ):
+ self.type = rt_util.TOOL_DEPENDENCY_DEFINITION
+ self.label = 'Tool dependency definition'
+ self.valid_file_names = [ 'tool_dependencies.xml' ]
+
+ def is_valid_for_type( self, app, repository, revisions_to_check=None ):
+ """
+ Inspect the received repository's contents to determine if they abide by the rules defined for the contents of this type.
+ If the received revisions_to_check is a list of changeset revisions, then inspection will be restricted to the revisions
+ in the list.
+ """
+ repo = hg.repository( ui.ui(), repository.repo_path( app ) )
+ if revisions_to_check:
+ changeset_revisions = revisions_to_check
+ else:
+ changeset_revisions = repo.changelog
+ for changeset in changeset_revisions:
+ changeset_revision = str( repo.changectx( changeset ) )
+ ctx = repo.changectx( changeset )
+ # Inspect all files in the changeset (in sorted order) to make sure there is only one and it is named tool_dependencies.xml.
+ files_changed_in_changeset = ctx.files()
+ if len( files_changed_in_changeset ) > 1:
+ return False
+ for file_path in files_changed_in_changeset:
+ file_name = suc.strip_path( file_path )
+ if file_name not in self.valid_file_names:
+ return False
+ return True
+
\ No newline at end of file
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/tool_shed/repository_types/util.py
--- /dev/null
+++ b/lib/tool_shed/repository_types/util.py
@@ -0,0 +1,30 @@
+import logging
+from galaxy.web.form_builder import SelectField
+
+log = logging.getLogger( __name__ )
+
+GENERIC = 'generic'
+TOOL_DEPENDENCY_DEFINITION = 'tool_dependency_definition'
+
+types = [ GENERIC, TOOL_DEPENDENCY_DEFINITION ]
+
+def build_repository_type_select_fiels( trans, repository=None, name='repository_type' ):
+ """Called from the Tool Shed to generate the current list of supported repository types."""
+ if repository:
+ selected_type = str( repository.type )
+ else:
+ selected_type = None
+ repository_type_select_fiels = SelectField( name=name )
+ for type_label, type_class in trans.app.repository_types_registry.repository_types_by_label.items():
+ option_label = str( type_class.label )
+ option_value = str( type_class.type )
+ if selected_type and selected_type == option_value:
+ selected = True
+ else:
+ selected = False
+ if repository:
+ if type_class.is_valid_for_type( trans.app, repository ):
+ repository_type_select_fiels.add_option( option_label, option_value, selected=selected )
+ else:
+ repository_type_select_fiels.add_option( option_label, option_value, selected=selected )
+ return repository_type_select_fiels
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -12,6 +12,7 @@
from galaxy.web import url_for
from galaxy.webapps.tool_shed.util import container_util
import tool_shed.util.shed_util_common as suc
+from tool_shed.repository_types.metadata import TipOnly
from tool_shed.util import common_util
from tool_shed.util import common_install_util
from tool_shed.util import readme_util
@@ -65,7 +66,7 @@
trans.sa_session.delete( repository_metadata )
trans.sa_session.flush()
-def compare_changeset_revisions( ancestor_changeset_revision, ancestor_metadata_dict, current_changeset_revision, current_metadata_dict ):
+def compare_changeset_revisions( trans, ancestor_changeset_revision, ancestor_metadata_dict, current_changeset_revision, current_metadata_dict ):
"""Compare the contents of two changeset revisions to determine if a new repository metadata revision should be created."""
# The metadata associated with ancestor_changeset_revision is ancestor_metadata_dict. This changeset_revision is an ancestor of
# current_changeset_revision which is associated with current_metadata_dict. A new repository_metadata record will be created only
@@ -104,11 +105,11 @@
# Uncomment the following if we decide that README files should affect how installable repository revisions are defined. See the NOTE in the
# compare_readme_files() method.
# readme_file_comparision = compare_readme_files( ancestor_readme_files, current_readme_files )
- repository_dependency_comparison = compare_repository_dependencies( ancestor_repository_dependencies, current_repository_dependencies )
- tool_dependency_comparison = compare_tool_dependencies( ancestor_tool_dependencies, current_tool_dependencies )
- workflow_comparison = compare_workflows( ancestor_workflows, current_workflows )
- datatype_comparison = compare_datatypes( ancestor_datatypes, current_datatypes )
- data_manager_comparison = compare_data_manager( ancestor_data_manager, current_data_manager )
+ repository_dependency_comparison = compare_repository_dependencies( trans, ancestor_repository_dependencies, current_repository_dependencies )
+ tool_dependency_comparison = compare_tool_dependencies( trans, ancestor_tool_dependencies, current_tool_dependencies )
+ workflow_comparison = compare_workflows( trans, ancestor_workflows, current_workflows )
+ datatype_comparison = compare_datatypes( trans, ancestor_datatypes, current_datatypes )
+ data_manager_comparison = compare_data_manager( trans, ancestor_data_manager, current_data_manager )
# Handle case where all metadata is the same.
if ancestor_guids == current_guids and \
repository_dependency_comparison == EQUAL and \
@@ -134,7 +135,7 @@
return SUBSET
return NOT_EQUAL_AND_NOT_SUBSET
-def compare_data_manager( ancestor_metadata, current_metadata ):
+def compare_data_manager( trans, ancestor_metadata, current_metadata ):
"""Determine if ancestor_metadata is the same as or a subset of current_metadata for data_managers."""
def __data_manager_dict_to_tuple_list( metadata_dict ):
# we do not check tool_guid or tool conf file name
@@ -149,7 +150,7 @@
return SUBSET
return NOT_EQUAL_AND_NOT_SUBSET
-def compare_datatypes( ancestor_datatypes, current_datatypes ):
+def compare_datatypes( trans, ancestor_datatypes, current_datatypes ):
"""Determine if ancestor_datatypes is the same as or a subset of current_datatypes."""
# Each datatype dict looks something like: {"dtype": "galaxy.datatypes.images:Image", "extension": "pdf", "mimetype": "application/pdf"}
if len( ancestor_datatypes ) <= len( current_datatypes ):
@@ -193,7 +194,7 @@
return SUBSET
return NOT_EQUAL_AND_NOT_SUBSET
-def compare_repository_dependencies( ancestor_repository_dependencies, current_repository_dependencies ):
+def compare_repository_dependencies( trans, ancestor_repository_dependencies, current_repository_dependencies ):
"""Determine if ancestor_repository_dependencies is the same as or a subset of current_repository_dependencies."""
# The list of repository_dependencies looks something like: [["http://localhost:9009", "emboss_datatypes", "test", "ab03a2a5f407", False]].
# Create a string from each tuple in the list for easier comparison.
@@ -211,14 +212,18 @@
found_in_current = True
break
if not found_in_current:
- return NOT_EQUAL_AND_NOT_SUBSET
+ # In some cases, the only difference between a dependency definition in the lists is the changeset_revision value. We'll
+ # check to see if this is the case, and if the defined dependency is a repository that has metadata set only on it's tip.
+ if not different_revision_defines_tip_only_repository_dependency( ancestor_tup, current_repository_dependencies ):
+ return NOT_EQUAL_AND_NOT_SUBSET
+ return SUBSET
if len( ancestor_repository_dependencies ) == len( current_repository_dependencies ):
return EQUAL
else:
return SUBSET
return NOT_EQUAL_AND_NOT_SUBSET
-def compare_tool_dependencies( ancestor_tool_dependencies, current_tool_dependencies ):
+def compare_tool_dependencies( trans, ancestor_tool_dependencies, current_tool_dependencies ):
"""Determine if ancestor_tool_dependencies is the same as or a subset of current_tool_dependencies."""
# The tool_dependencies dictionary looks something like:
# {'bwa/0.5.9': {'readme': 'some string', 'version': '0.5.9', 'type': 'package', 'name': 'bwa'}}
@@ -238,7 +243,7 @@
return SUBSET
return NOT_EQUAL_AND_NOT_SUBSET
-def compare_workflows( ancestor_workflows, current_workflows ):
+def compare_workflows( trans, ancestor_workflows, current_workflows ):
"""Determine if ancestor_workflows is the same as current_workflows or if ancestor_workflows is a subset of current_workflows."""
if len( ancestor_workflows ) <= len( current_workflows ):
for ancestor_workflow_tup in ancestor_workflows:
@@ -341,6 +346,21 @@
break
return repository_metadata
+def different_revision_defines_tip_only_repository_dependency( rd_tup, repository_dependencies ):
+ """
+ Determine if the only difference between rd_tup and a dependency definition in the list of repository_dependencies is the changeset_revision value.
+ """
+ new_metadata_required = False
+ rd_tool_shed, rd_name, rd_owner, rd_changeset_revision, rd_prior_installation_required = suc.parse_repository_dependency_tuple( rd_tup )
+ for repository_dependency in repository_dependencies:
+ tool_shed, name, owner, changeset_revision, prior_installation_required = suc.parse_repository_dependency_tuple( repository_dependency )
+ if rd_tool_shed == tool_shed and rd_name == name and rd_owner == owner:
+ # Determine if the repository represented by the dependency tuple is an instance of the repository type TipOnly.
+ required_repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
+ repository_type_class = trans.app.repository_types_registry.get_class_by_label( required_repository.type )
+ return isinstance( repository_type_class, TipOnly )
+ return False
+
def generate_data_manager_metadata( app, repository, repo_dir, data_manager_config_filename, metadata_dict, shed_config_dict=None ):
"""Update the received metadata_dict with information from the parsed data_manager_config_filename."""
if data_manager_config_filename is None:
@@ -1308,7 +1328,10 @@
# The saved metadata must be a subset of the new metadata.
for saved_repository_dependency in saved_repository_dependencies:
if saved_repository_dependency not in new_repository_dependencies:
- return True
+ # In some cases, the only difference between a dependency definition in the lists is the changeset_revision value. We'll
+ # check to see if this is the case, and if the defined dependency is a repository that has metadata set only on it's tip.
+ if not different_revision_defines_tip_only_repository_dependency( saved_repository_dependency, new_repository_dependencies ):
+ return True
return False
else:
# The repository_dependencies.xml file must have been deleted, so create a new repository_metadata record so we always have
@@ -1588,7 +1611,7 @@
ancestor_metadata_dict = None
invalid_file_tups = []
home_dir = os.getcwd()
- for changeset in repo.changelog:
+ for changeset in repository.get_changesets_for_setting_metadata( trans.app ):
work_dir = tempfile.mkdtemp( prefix="tmp-toolshed-ramorits" )
current_changeset_revision = str( repo.changectx( changeset ) )
ctx = repo.changectx( changeset )
@@ -1619,7 +1642,8 @@
# EQUAL - ancestor metadata is equivalent to current metadata, so continue from current
# SUBSET - ancestor metadata is a subset of current metadata, so continue from current
# NOT_EQUAL_AND_NOT_SUBSET - ancestor metadata is neither equal to nor a subset of current metadata, so persist ancestor metadata.
- comparison = compare_changeset_revisions( ancestor_changeset_revision,
+ comparison = compare_changeset_revisions( trans,
+ ancestor_changeset_revision,
ancestor_metadata_dict,
current_changeset_revision,
current_metadata_dict )
@@ -1752,7 +1776,9 @@
persist=False )
if metadata_dict:
repository_metadata = None
- if new_metadata_required_for_utilities( trans, repository, metadata_dict ):
+ repository_type_class = trans.app.repository_types_registry.get_class_by_label( repository.type )
+ tip_only = isinstance( repository_type_class, TipOnly )
+ if not tip_only and new_metadata_required_for_utilities( trans, repository, metadata_dict ):
# Create a new repository_metadata table row.
repository_metadata = create_or_update_repository_metadata( trans, encoded_id, repository, repository.tip( trans.app ), metadata_dict )
# If this is the first record stored for this repository, see if we need to send any email alerts.
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/admin/index.mako
--- a/templates/webapps/tool_shed/admin/index.mako
+++ b/templates/webapps/tool_shed/admin/index.mako
@@ -46,7 +46,7 @@
<div class="unified-panel-header" unselectable="on"><div class='unified-panel-header-inner'>Administration</div></div>
- <div class="unified-panel-body" style="padding: 10px; overflow: auto;">
+ <div class="unified-panel-body"><div class="toolMenu"><div class="toolSectionList"><div class="toolSectionTitle">
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/index.mako
--- a/templates/webapps/tool_shed/index.mako
+++ b/templates/webapps/tool_shed/index.mako
@@ -46,7 +46,7 @@
<div class="unified-panel-header" unselectable="on"><div class='unified-panel-header-inner'>${trans.app.shed_counter.valid_tools | h} valid tools on ${trans.app.shed_counter.generation_time | h}</div></div>
- <div class="unified-panel-body" style="padding: 10px; overflow: auto;">
+ <div class="unified-panel-body"><div class="toolMenu"><div class="toolSectionList">
%if user_id or repository_id:
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/repository/browse_repository.mako
--- a/templates/webapps/tool_shed/repository/browse_repository.mako
+++ b/templates/webapps/tool_shed/repository/browse_repository.mako
@@ -46,6 +46,7 @@
${render_clone_str( repository )}
</div>
%endif
+ ${render_repository_type_select_field( repository_type_select_field, render_help=False )}
%if can_push:
<form name="select_files_to_delete" id="select_files_to_delete" action="${h.url_for( controller='repository', action='select_files_to_delete', id=trans.security.encode_id( repository.id ))}" method="post" ><div class="form-row" >
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -163,6 +163,46 @@
</script></%def>
+<%def name="render_repository_type_select_field( repository_type_select_field, render_help=True )">
+ <div class="form-row">
+ <label>Repository type:</label>
+ <%
+ from tool_shed.repository_types import util
+ options = repository_type_select_field.options
+ repository_types = []
+ for option_tup in options:
+ repository_types.append( option_tup[ 1 ] )
+ render_as_text = len( options ) == 1
+ if render_as_text:
+ repository_type = options[ 0 ][ 0 ]
+ %>
+ %if render_as_text:
+ ${repository_type | h}
+ %if render_help:
+ <div class="toolParamHelp" style="clear: both;">
+ This repository's type cannot be changed because it's contents are valid only for it's current type or it has been cloned.
+ </div>
+ %endif
+ %else:
+ ${repository_type_select_field.get_html()}
+ %if render_help:
+ <div class="toolParamHelp" style="clear: both;">
+ Select the repository type based on the following criteria.
+ <ul>
+ %if util.GENERIC in repository_types:
+ <li><b>Generic</b> - contents can be any set of valid Galaxy utilities
+ %endif
+ %if util.TOOL_DEPENDENCY_DEFINITION in repository_types:
+ <li><b>Tool dependency definition</b> - contents will always be restricted to one file named tool_dependencies.xml
+ %endif
+ </ul>
+ </div>
+ %endif
+ %endif
+ <div style="clear: both"></div>
+ </div>
+</%def>
+
<%def name="render_sharable_str( repository, changeset_revision=None )"><%
from tool_shed.util.shed_util_common import generate_sharable_link_for_repository_in_tool_shed
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/repository/create_repository.mako
--- a/templates/webapps/tool_shed/repository/create_repository.mako
+++ b/templates/webapps/tool_shed/repository/create_repository.mako
@@ -1,5 +1,6 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="render_repository_type_select_field" /><%def name="javascripts()">
${parent.javascripts()}
@@ -23,6 +24,7 @@
<input name="name" type="textfield" value="${name | h}" size="40"/><div style="clear: both"></div></div>
+ ${render_repository_type_select_field( repository_type_select_field, render_help=True )}
<div class="form-row"><label>Synopsis:</label><input name="description" type="textfield" value="${description | h}" size="80"/>
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/repository/manage_repository.mako
--- a/templates/webapps/tool_shed/repository/manage_repository.mako
+++ b/templates/webapps/tool_shed/repository/manage_repository.mako
@@ -151,6 +151,7 @@
</div><div style="clear: both"></div></div>
+ ${render_repository_type_select_field( repository_type_select_field, render_help=True )}
<div class="form-row"><label>Synopsis:</label><input name="description" type="textfield" value="${description | h}" size="80"/>
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/repository/rate_repository.mako
--- a/templates/webapps/tool_shed/repository/rate_repository.mako
+++ b/templates/webapps/tool_shed/repository/rate_repository.mako
@@ -44,6 +44,7 @@
${render_clone_str( repository )}
</div>
%endif
+ ${render_repository_type_select_field( repository_type_select_field, render_help=False )}
<div class="toolFormBody"><div class="form-row"><label>Description:</label>
diff -r 92225a7b6e5ecd87410f1da567b9e320b965be50 -r 5a41d725197d2d42475f80282a57b0b364898671 templates/webapps/tool_shed/repository/view_repository.mako
--- a/templates/webapps/tool_shed/repository/view_repository.mako
+++ b/templates/webapps/tool_shed/repository/view_repository.mako
@@ -100,6 +100,7 @@
${repository.name | h}
%endif
</div>
+ ${render_repository_type_select_field( repository_type_select_field, render_help=False )}
<div class="form-row"><label>Synopsis:</label>
${repository.description | h}
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.
1
0
commit/galaxy-central: carlfeberhard: Admin left panel: small bump down
by commits-noreply@bitbucket.org 11 Jul '13
by commits-noreply@bitbucket.org 11 Jul '13
11 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/92225a7b6e5e/
Changeset: 92225a7b6e5e
User: carlfeberhard
Date: 2013-07-11 18:25:34
Summary: Admin left panel: small bump down
Affected #: 1 file
diff -r 238988fc5d2a963685e7ab12a0282f89a8bca430 -r 92225a7b6e5ecd87410f1da567b9e320b965be50 templates/webapps/galaxy/admin/index.mako
--- a/templates/webapps/galaxy/admin/index.mako
+++ b/templates/webapps/galaxy/admin/index.mako
@@ -22,7 +22,7 @@
overflow: auto;
}
.toolMenu {
- margin-left: 10px;
+ margin: 8px 0 0 10px;
}
</style></%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.
1
0
commit/galaxy-central: carlfeberhard: Fix deleted check in api/histories.delete, better error reporting in base controller get_object
by commits-noreply@bitbucket.org 11 Jul '13
by commits-noreply@bitbucket.org 11 Jul '13
11 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/238988fc5d2a/
Changeset: 238988fc5d2a
User: carlfeberhard
Date: 2013-07-11 18:18:51
Summary: Fix deleted check in api/histories.delete, better error reporting in base controller get_object
Affected #: 2 files
diff -r 4cc057df762c219406af27dd04ac725a07a5a6eb -r 238988fc5d2a963685e7ab12a0282f89a8bca430 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -113,21 +113,25 @@
try:
decoded_id = trans.security.decode_id( id )
except:
- raise MessageException( "Malformed %s id ( %s ) specified, unable to decode" % ( class_name, str( id ) ), type='error' )
+ raise MessageException( "Malformed %s id ( %s ) specified, unable to decode"
+ % ( class_name, str( id ) ), type='error' )
try:
item_class = self.get_class( class_name )
assert item_class is not None
item = trans.sa_session.query( item_class ).get( decoded_id )
assert item is not None
- except:
- log.exception( "Invalid %s id ( %s ) specified" % ( class_name, id ) )
+ except Exception, exc:
+ log.exception( "Invalid %s id ( %s ) specified: %s" % ( class_name, id, str( exc ) ) )
raise MessageException( "Invalid %s id ( %s ) specified" % ( class_name, id ), type="error" )
+
if check_ownership or check_accessible:
self.security_check( trans, item, check_ownership, check_accessible )
if deleted == True and not item.deleted:
- raise ItemDeletionException( '%s "%s" is not deleted' % ( class_name, getattr( item, 'name', id ) ), type="warning" )
+ raise ItemDeletionException( '%s "%s" is not deleted'
+ % ( class_name, getattr( item, 'name', id ) ), type="warning" )
elif deleted == False and item.deleted:
- raise ItemDeletionException( '%s "%s" is deleted' % ( class_name, getattr( item, 'name', id ) ), type="warning" )
+ raise ItemDeletionException( '%s "%s" is deleted'
+ % ( class_name, getattr( item, 'name', id ) ), type="warning" )
return item
# this should be here - but catching errors from sharable item controllers that *should* have SharableItemMixin
@@ -190,11 +194,11 @@
check_ownership=check_ownership, check_accessible=check_accessible, deleted=deleted )
except ItemDeletionException, e:
- raise HTTPBadRequest( detail="Invalid %s id ( %s ) specified" % ( class_name, str( id ) ) )
+ raise HTTPBadRequest( detail="Invalid %s id ( %s ) specified: %s" % ( class_name, str( id ), str( e ) ) )
except MessageException, e:
raise HTTPBadRequest( detail=e.err_msg )
except Exception, e:
- log.exception( "Execption in get_object check for %s %s:" % ( class_name, str( id ) ) )
+ log.exception( "Execption in get_object check for %s %s: %s" % ( class_name, str( id ), str( e ) ) )
raise HTTPInternalServerError( comment=str( e ) )
def validate_in_users_and_groups( self, trans, payload ):
@@ -280,8 +284,10 @@
def get_history( self, trans, id, check_ownership=True, check_accessible=False, deleted=None ):
"""Get a History from the database by id, verifying ownership."""
- history = self.get_object( trans, id, 'History', check_ownership=check_ownership, check_accessible=check_accessible, deleted=deleted )
- return self.security_check( trans, history, check_ownership, check_accessible )
+ history = self.get_object( trans, id, 'History',
+ check_ownership=check_ownership, check_accessible=check_accessible, deleted=deleted )
+ history = self.security_check( trans, history, check_ownership, check_accessible )
+ return history
def get_history_datasets( self, trans, history, show_deleted=False, show_hidden=False, show_purged=False ):
""" Returns history's datasets. """
diff -r 4cc057df762c219406af27dd04ac725a07a5a6eb -r 238988fc5d2a963685e7ab12a0282f89a8bca430 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -2,6 +2,10 @@
API operations on a history.
"""
+import pkg_resources
+pkg_resources.require( "Paste" )
+from paste.httpexceptions import HTTPBadRequest
+
from galaxy import web
from galaxy.util import string_as_bool, restore_text
from galaxy.util.sanitize_html import sanitize_html
@@ -75,9 +79,13 @@
history_data = self.get_history_dict( trans, history )
history_data[ 'contents_url' ] = url_for( 'history_contents', history_id=history_id )
+ except HTTPBadRequest, bad_req:
+ trans.response.status = 400
+ return str( bad_req )
+
except Exception, e:
msg = "Error in history API at showing history detail: %s" % ( str( e ) )
- log.error( msg, exc_info=True )
+ log.exception( msg, exc_info=True )
trans.response.status = 500
return msg
@@ -117,7 +125,7 @@
purge = string_as_bool( kwd['payload'].get( 'purge', False ) )
try:
- history = self.get_history( trans, history_id, check_ownership=True, check_accessible=False, deleted=True )
+ history = self.get_history( trans, history_id, check_ownership=True, check_accessible=False )
except Exception, e:
return str( e )
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.
1
0
commit/galaxy-central: carlfeberhard: Fix unified-panel css in history/view.mako when used with/without 'use_panels'
by commits-noreply@bitbucket.org 09 Jul '13
by commits-noreply@bitbucket.org 09 Jul '13
09 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4cc057df762c/
Changeset: 4cc057df762c
User: carlfeberhard
Date: 2013-07-09 21:32:57
Summary: Fix unified-panel css in history/view.mako when used with/without 'use_panels'
Affected #: 1 file
diff -r 0fa860b8ee41897a63c7c66581a16c360f48b11a -r 4cc057df762c219406af27dd04ac725a07a5a6eb templates/webapps/galaxy/history/view.mako
--- a/templates/webapps/galaxy/history/view.mako
+++ b/templates/webapps/galaxy/history/view.mako
@@ -24,12 +24,9 @@
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "history", "autocomplete_tagging" )}
+
<style type="text/css">
- .historyItemContainer {
- padding-right: 3px;
- border-right-style: solid;
- border-right-color: #66AA66;
- }
+
.page-body
{
padding: 10px;
@@ -46,9 +43,18 @@
border: 2px solid #DDDDDD;
border-top: 4px solid #DDDDDD;
}
- </style>
- <style>
+ div.unified-panel-body {
+ position: relative;
+ top: 0px;
+ width: auto;
+ }
+
+ .historyItemContainer {
+ padding-right: 3px;
+ border-right-style: solid;
+ border-right-color: #66AA66;
+ }
.historyItemBody {
display: none;
}
@@ -86,11 +92,13 @@
href_to_user_histories = h.url_for( controller='/history', action='list_published' )##should this instead be be None or empty string?
%>
+ %if context.get( 'use_panels' ):
<div class="unified-panel-header" unselectable="on"></div>
+ %endif
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div class="wrapping" style="overflow: auto; height: 100%;">
## Render view of history.
<div id="top-links" class="historyLinks" style="padding: 0px 0px 5px 0px">
%if not history.purged:
@@ -117,11 +125,9 @@
%endif
%if not datasets:
-
<div class="infomessagesmall" id="emptyHistoryMessage">
%else:
-
## Render requested datasets, ordered from newest to oldest
%for data in datasets:
%if data.visible:
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.
1
0
commit/galaxy-central: greg: Apply changes recently made to the left panel in Galaxy to the left panel in the Tool Shed.
by commits-noreply@bitbucket.org 09 Jul '13
by commits-noreply@bitbucket.org 09 Jul '13
09 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0fa860b8ee41/
Changeset: 0fa860b8ee41
User: greg
Date: 2013-07-09 20:13:12
Summary: Apply changes recently made to the left panel in Galaxy to the left panel in the Tool Shed.
Affected #: 2 files
diff -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a -r 0fa860b8ee41897a63c7c66581a16c360f48b11a templates/webapps/tool_shed/admin/index.mako
--- a/templates/webapps/tool_shed/admin/index.mako
+++ b/templates/webapps/tool_shed/admin/index.mako
@@ -1,7 +1,7 @@
<%inherit file="/webapps/tool_shed/base_panels.mako"/><%namespace file="/message.mako" import="render_msg" />
-<%def name="stylesheets()">
+<%def name="stylesheets()">
## Include "base.css" for styling tool menu and forms (details)
${h.css( "base", "autocomplete_tagging", "tool_menu" )}
@@ -13,6 +13,12 @@
#left {
background: #C1C9E5 url(${h.url_for('/static/style/menu_bg.png')}) top repeat-x;
}
+ .unified-panel-body {
+ overflow: auto;
+ }
+ .toolMenu {
+ margin-left: 10px;
+ }
</style></%def>
diff -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a -r 0fa860b8ee41897a63c7c66581a16c360f48b11a templates/webapps/tool_shed/index.mako
--- a/templates/webapps/tool_shed/index.mako
+++ b/templates/webapps/tool_shed/index.mako
@@ -2,7 +2,6 @@
<%namespace file="/message.mako" import="render_msg" /><%def name="stylesheets()">
- ${parent.stylesheets()}
## Include "base.css" for styling tool menu and forms (details)
${h.css( "base", "autocomplete_tagging", "tool_menu" )}
@@ -14,6 +13,12 @@
#left {
background: #C1C9E5 url(${h.url_for('/static/style/menu_bg.png')}) top repeat-x;
}
+ .unified-panel-body {
+ overflow: auto;
+ }
+ .toolMenu {
+ margin-left: 10px;
+ }
</style></%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.
1
0
commit/galaxy-central: guerler: Scratchbook: Update, fix tooltip, re-factor code
by commits-noreply@bitbucket.org 09 Jul '13
by commits-noreply@bitbucket.org 09 Jul '13
09 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1f63dbb2ed28/
Changeset: 1f63dbb2ed28
User: guerler
Date: 2013-07-09 19:32:58
Summary: Scratchbook: Update, fix tooltip, re-factor code
Affected #: 7 files
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -123,8 +123,8 @@
this.event_initialize();
// add
- //$(".galaxy-frame-active").tooltip({title: "Enable/Disable Scratchbook"});
- //$(".galaxy-frame-load").tooltip({title: "Show/Hide Scratchbook"});
+ $(".galaxy-frame-active").tooltip({title: "Enable/Disable Scratchbook"});
+ $(".galaxy-frame-load").tooltip({title: "Show/Hide Scratchbook"});
// catch window resize event
var self = this;
@@ -731,8 +731,7 @@
this.visible = false;
// hide
- for (var i in this.frame_list)
- $(this.frame_list[i].id).fadeOut('fast');
+ $(".galaxy-frame").fadeOut('fast');
// add class
$(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");
@@ -748,8 +747,7 @@
this.visible = true;
// show
- for (var i in this.frame_list)
- $(this.frame_list[i].id).fadeIn('fast');
+ $(".galaxy-frame").fadeIn('fast');
// add class
$(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");
@@ -800,59 +798,68 @@
if (!this.active)
{
// load frame in main window
- if (options.center)
+ if (options.location == 'center')
{
var galaxy_main = $( window.parent.document ).find( 'iframe#galaxy_main' );
galaxy_main.attr( 'src', options.content );
} else
window.location = options.content;
-
+
// stop
return;
}
-
+
+ // check for number of frames
+ if (this.frame_counter > this.options.frame_max)
+ {
+ alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
+ return;
+ }
+
// generate frame identifier
var frame_id = '#galaxy-frame-' + (this.frame_counter_id++);
// check if frame exists
- if ($(frame_id).length === 0 && this.options.frame_max > this.frame_counter)
+ if ($(frame_id).length !== 0)
{
- // reset top
- this.top = this.options.top_min;
+ alert("This frame already exists. This page might contain multiple frame managers.");
+ return;
+ }
+
+ // reset top
+ this.top = this.options.top_min;
+
+ // append
+ $(this.el).append(this.frame_template(frame_id.substring(1), options.title, options.type, options.content));
- // set dimensions
- options.width = this.to_pixel_coord('width', this.options.frame.cols);
- options.height = this.to_pixel_coord('height', this.options.frame.rows);
+ // construct a new frame
+ var frame = {
+ id : frame_id,
+ screen_location : {},
+ grid_location : {},
+ grid_rank : null,
+ grid_lock : false
+ };
+
+ // set dimensions
+ options.width = this.to_pixel_coord('width', this.options.frame.cols);
+ options.height = this.to_pixel_coord('height', this.options.frame.rows);
+
+ // add to frame list
+ this.frame_list[frame_id] = frame;
+
+ // increase frame counter
+ this.frame_counter++;
+
+ // resize
+ this.frame_resize(frame, {width: options.width, height: options.height});
- // append
- $(this.el).append(this.frame_template(frame_id.substring(1), options.title, options.type, options.content));
+ // place frame
+ this.frame_insert(frame, {top: 0, left: 0}, true);
- // construct a new frame
- var frame = {
- id : frame_id,
- screen_location : {},
- grid_location : {},
- grid_rank : null,
- grid_lock : false
- };
-
- // increase frame counter
- this.frame_counter++;
-
- // add to frame list
- this.frame_list[frame_id] = frame;
-
- // resize
- this.frame_resize(frame, {width: options.width, height: options.height});
-
- // place frame
- this.frame_insert(frame, {top: 0, left: 0}, true);
-
- // show frames if hidden
- if (!this.visible)
- this.panel_show_hide();
- } else
- alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
+ // show frames if hidden
+ if (!this.visible)
+ this.panel_show_hide();
},
// frame insert at given location
@@ -922,7 +929,7 @@
// panel menu
this.menu_refresh();
},
-
+
// naive frame place
frame_place: function(frame, animate)
{
@@ -1052,7 +1059,7 @@
'<span class="f-title">' + title + '</span>' +
'<span class="f-icon f-pin fa-icon-pushpin"></span>' +
'<span class="f-icon f-close fa-icon-trash"></span>' +
- '</div>' +
+ '</div>' +
'<div class="f-content f-corner">' + content +
'<div class="f-cover"></div>' +
'</div>' +
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -237,7 +237,7 @@
} else {
displayBtnData.title = _l( 'View data' );
- displayBtnData.href = "javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', center: true, content: '" + this.urls.display + "'});";
+ displayBtnData.href = "javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', location: 'center', content: '" + this.urls.display + "'});";
}
this.displayButton = new IconButtonView({ model : new IconButton( displayBtnData ) });
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a static/scripts/packed/galaxy.frame.js
--- a/static/scripts/packed/galaxy.frame.js
+++ b/static/scripts/packed/galaxy.frame.js
@@ -1,1 +1,1 @@
-define(["utils/galaxy.css","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el:"#everything",el_header:"#masthead",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:10},cols:0,top:0,top_max:0,frame_counter:0,frame_counter_id:0,frame_list:[],galaxy_frame_shadow:null,visible:false,active:false,initialize:function(d){b.load_file(d.url.styles+"/galaxy.frame.css");if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;$(this.el).append(this.frame_template_background());$(this.el).append(this.frame_template_menu());$(this.el_header).append(this.frame_template_header());var e="#galaxy-frame-shadow";$(this.el).append(this.frame_template_shadow(e.substring(1)));this.galaxy_frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.galaxy_frame_shadow,{width:0,height:0});this.frame_list[e]=this.galaxy_frame_shadow;this.panel_refresh();this.event_initialize();var c=this;$(window).resize(function(){c.panel_refresh()});window.onbeforeunload=function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}},is_mobile:function(){return navigator.userAgent.match(/mobile|(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)},event:{type:null,target:null,xy:null},event_initialize:function(){this.events={mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .galaxy-frame":"event_frame_mouse_down","mousedown .galaxy-frame-active":"event_panel_active","mousedown .galaxy-frame-load":"event_panel_load","mousedown .galaxy-frame-background":"event_panel_load","mousedown .galaxy-frame-scroll-up":"event_panel_scroll_up","mousedown .galaxy-frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"};this.delegateEvents(this.events)},event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.galaxy_frame_shadow,h);this.frame_insert(this.galaxy_frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.galaxy_frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("f-toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("f-toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_show_hide()},event_panel_active:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_active_disable()},event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".galaxy-frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.galaxy_frame_shadow,c);this.frame_grid(this.galaxy_frame_shadow,d.grid_location);d.grid_location=null;$(this.galaxy_frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.galaxy_frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.galaxy_frame_shadow.grid_location,true);this.galaxy_frame_shadow.grid_location=null;$(this.galaxy_frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){$(".galaxy-frame-load .number").text(this.frame_counter);if(this.frame_counter==0){$(".galaxy-frame-load").hide()}else{$(".galaxy-frame-load").show()}if(this.top==this.options.top_min){$(".galaxy-frame-scroll-up").hide()}else{$(".galaxy-frame-scroll-up").show()}if(this.top==this.top_max){$(".galaxy-frame-scroll-down").hide()}else{$(".galaxy-frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".galaxy-frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;for(var c in this.frame_list){$(this.frame_list[c].id).fadeOut("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-open");$(".galaxy-frame-background").hide();$(".galaxy-frame-menu").hide()}else{this.visible=true;for(var c in this.frame_list){$(this.frame_list[c].id).fadeIn("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-close");$(this.galaxy_frame_shadow.id).hide();$(".galaxy-frame-background").show();this.menu_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;$(".galaxy-frame-active .icon").removeClass("f-toggle");if(this.visible){this.panel_show_hide()}}else{this.active=true;$(".galaxy-frame-active .icon").addClass("f-toggle")}},frame_new:function(d){if(!this.active){if(d.center){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}var e="#galaxy-frame-"+(this.frame_counter_id++);if($(e).length===0&&this.options.frame_max>this.frame_counter){this.top=this.options.top_min;d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);$(this.el).append(this.frame_template(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_counter++;this.frame_list[e]=f;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}}else{alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").")}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=parseInt(b.get_attribute("galaxy-frame","z-index"))+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},frame_template:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="galaxy-frame f-corner"><div class="f-header f-corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content f-corner">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon f-corner fa-icon-resize-full"></span></div>'},frame_template_shadow:function(c){return'<div id="'+c+'" class="galaxy-frame-shadow f-corner"></div>'},frame_template_background:function(){return'<div class="galaxy-frame-background"></div>'},frame_template_header:function(){return'<div class="galaxy-frame-load f-corner"><div class="number f-corner">0</div><div class="icon fa-icon-2x"></div></div><div class="galaxy-frame-active f-corner" style="position: absolute; top: 8px;"><div class="icon fa-icon-2x fa-icon-th"></div></div>'},frame_template_menu:function(){return'<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
+define(["utils/galaxy.css","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el:"#everything",el_header:"#masthead",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:10},cols:0,top:0,top_max:0,frame_counter:0,frame_counter_id:0,frame_list:[],galaxy_frame_shadow:null,visible:false,active:false,initialize:function(d){b.load_file(d.url.styles+"/galaxy.frame.css");if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;$(this.el).append(this.frame_template_background());$(this.el).append(this.frame_template_menu());$(this.el_header).append(this.frame_template_header());var e="#galaxy-frame-shadow";$(this.el).append(this.frame_template_shadow(e.substring(1)));this.galaxy_frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.galaxy_frame_shadow,{width:0,height:0});this.frame_list[e]=this.galaxy_frame_shadow;this.panel_refresh();this.event_initialize();$(".galaxy-frame-active").tooltip({title:"Enable/Disable Scratchbook"});$(".galaxy-frame-load").tooltip({title:"Show/Hide Scratchbook"});var c=this;$(window).resize(function(){c.panel_refresh()});window.onbeforeunload=function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}},is_mobile:function(){return navigator.userAgent.match(/mobile|(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)},event:{type:null,target:null,xy:null},event_initialize:function(){this.events={mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .galaxy-frame":"event_frame_mouse_down","mousedown .galaxy-frame-active":"event_panel_active","mousedown .galaxy-frame-load":"event_panel_load","mousedown .galaxy-frame-background":"event_panel_load","mousedown .galaxy-frame-scroll-up":"event_panel_scroll_up","mousedown .galaxy-frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"};this.delegateEvents(this.events)},event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.galaxy_frame_shadow,h);this.frame_insert(this.galaxy_frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.galaxy_frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("f-toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("f-toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_show_hide()},event_panel_active:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_active_disable()},event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".galaxy-frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.galaxy_frame_shadow,c);this.frame_grid(this.galaxy_frame_shadow,d.grid_location);d.grid_location=null;$(this.galaxy_frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.galaxy_frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.galaxy_frame_shadow.grid_location,true);this.galaxy_frame_shadow.grid_location=null;$(this.galaxy_frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){$(".galaxy-frame-load .number").text(this.frame_counter);if(this.frame_counter==0){$(".galaxy-frame-load").hide()}else{$(".galaxy-frame-load").show()}if(this.top==this.options.top_min){$(".galaxy-frame-scroll-up").hide()}else{$(".galaxy-frame-scroll-up").show()}if(this.top==this.top_max){$(".galaxy-frame-scroll-down").hide()}else{$(".galaxy-frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".galaxy-frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;$(".galaxy-frame").fadeOut("fast");$(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-open");$(".galaxy-frame-background").hide();$(".galaxy-frame-menu").hide()}else{this.visible=true;$(".galaxy-frame").fadeIn("fast");$(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-close");$(this.galaxy_frame_shadow.id).hide();$(".galaxy-frame-background").show();this.menu_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;$(".galaxy-frame-active .icon").removeClass("f-toggle");if(this.visible){this.panel_show_hide()}}else{this.active=true;$(".galaxy-frame-active .icon").addClass("f-toggle")}},frame_new:function(d){if(!this.active){if(d.location=="center"){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}if(this.frame_counter>this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#galaxy-frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this.frame_template(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);this.frame_list[e]=f;this.frame_counter++;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=parseInt(b.get_attribute("galaxy-frame","z-index"))+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},frame_template:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="galaxy-frame f-corner"><div class="f-header f-corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content f-corner">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon f-corner fa-icon-resize-full"></span></div>'},frame_template_shadow:function(c){return'<div id="'+c+'" class="galaxy-frame-shadow f-corner"></div>'},frame_template_background:function(){return'<div class="galaxy-frame-background"></div>'},frame_template_header:function(){return'<div class="galaxy-frame-load f-corner"><div class="number f-corner">0</div><div class="icon fa-icon-2x"></div></div><div class="galaxy-frame-active f-corner" style="position: absolute; top: 8px;"><div class="icon fa-icon-2x fa-icon-th"></div></div>'},frame_template_menu:function(){return'<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(c,d){var b=_.without(_.keys(d.changes),"display_apps","display_types");if(b.length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var a={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("View data");a.href="javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', center: true, content: '"+this.urls.display+"'});"}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]};
\ No newline at end of file
+var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(c,d){var b=_.without(_.keys(d.changes),"display_apps","display_types");if(b.length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var a={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("View data");a.href="javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', location: 'center', content: '"+this.urls.display+"'});"}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]};
\ No newline at end of file
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a static/style/blue/galaxy.frame.css
--- a/static/style/blue/galaxy.frame.css
+++ b/static/style/blue/galaxy.frame.css
@@ -13,6 +13,11 @@
color: #BCC800;
}
+.bs-tooltip
+{
+ z-index: 34010;
+}
+
/*
galaxy-frames
*/
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a static/style/blue/galaxy.frame.masthead.css
--- a/static/style/blue/galaxy.frame.masthead.css
+++ b/static/style/blue/galaxy.frame.masthead.css
@@ -16,4 +16,9 @@
#right
{
top: 0 !important;
+}
+
+#left
+{
+ top: 0 !important;
}
\ No newline at end of file
diff -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 -r 1f63dbb2ed28333e0b6ad7f930199dceacf5766a templates/webapps/galaxy/base_panels.mako
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -117,8 +117,8 @@
${tab( "analysis", _("Analyze Data"), h.url_for( controller='/root', action='index' ) )}
## Workflow tab.
- ${tab( "workflow", _("Workflow"), h.url_for( controller='/workflow', action='index' ) )}
-
+ ${tab( "workflow", _("Workflow"), "javascript:frame_manager.frame_new({title: 'Workflow', type: 'url', content: '" + h.url_for( controller='/workflow', action='index' ) + "'});")}
+
## 'Shared Items' or Libraries tab.
<%
menu_options = [
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.
1
0
commit/galaxy-central: carlfeberhard: Fix admin left panel scrollbar
by commits-noreply@bitbucket.org 09 Jul '13
by commits-noreply@bitbucket.org 09 Jul '13
09 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/62d88237b1f2/
Changeset: 62d88237b1f2
User: carlfeberhard
Date: 2013-07-09 18:20:19
Summary: Fix admin left panel scrollbar
Affected #: 1 file
diff -r 5e9d00b4d205b834fffd9568fde2055032267499 -r 62d88237b1f23c26ff76565ee047b5c9f6ca1cb1 templates/webapps/galaxy/admin/index.mako
--- a/templates/webapps/galaxy/admin/index.mako
+++ b/templates/webapps/galaxy/admin/index.mako
@@ -17,6 +17,13 @@
#left {
background: #C1C9E5 url(${h.url_for('/static/style/menu_bg.png')}) top repeat-x;
}
+
+ .unified-panel-body {
+ overflow: auto;
+ }
+ .toolMenu {
+ margin-left: 10px;
+ }
</style></%def>
@@ -36,7 +43,7 @@
<div class="unified-panel-header" unselectable="on"><div class='unified-panel-header-inner'>Administration</div></div>
- <div class="unified-panel-body" style="padding: 10px; overflow: auto;">
+ <div class="unified-panel-body"><div class="toolMenu"><div class="toolSectionList"><div class="toolSectionTitle">Security</div>
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.
1
0
commit/galaxy-central: carlfeberhard: Fix form url in history permissions form
by commits-noreply@bitbucket.org 09 Jul '13
by commits-noreply@bitbucket.org 09 Jul '13
09 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5e9d00b4d205/
Changeset: 5e9d00b4d205
User: carlfeberhard
Date: 2013-07-09 18:10:59
Summary: Fix form url in history permissions form
Affected #: 1 file
diff -r 9e985bee20419c0cdbf76fadbe2448400820cbb9 -r 5e9d00b4d205b834fffd9568fde2055032267499 templates/webapps/galaxy/history/permissions.mako
--- a/templates/webapps/galaxy/history/permissions.mako
+++ b/templates/webapps/galaxy/history/permissions.mako
@@ -4,5 +4,6 @@
%if trans.user:
<% history = trans.get_history() %>
- ${render_permission_form( history, history.name, h.url_for(controller='root'), trans.user.all_roles() )}
+ ${render_permission_form( history, history.name,
+ h.url_for( controller='root', action='history_set_default_permissions' ), trans.user.all_roles() )}
%endif
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.
1
0
commit/galaxy-central: greg: Fixes for repairing an installed tool shed repository.
by commits-noreply@bitbucket.org 09 Jul '13
by commits-noreply@bitbucket.org 09 Jul '13
09 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9e985bee2041/
Changeset: 9e985bee2041
User: greg
Date: 2013-07-09 17:54:49
Summary: Fixes for repairing an installed tool shed repository.
Affected #: 4 files
diff -r 86efa5ac1fae6fb46e7af9804e036a7ab44b0e26 -r 9e985bee20419c0cdbf76fadbe2448400820cbb9 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -589,14 +589,6 @@
else:
kwd[ 'message' ] = 'All selected tool shed repositories are already installed.'
kwd[ 'status' ] = 'error'
- elif operation == "repair":
- # In this case, tsridslist is ordered.
- repositories_for_repair = []
- for tsr_id in tsridslist:
- repository = trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
- repositories_for_repair.append( repository )
- ordered_repo_info_dicts = kwd.get( 'ordered_repo_info_dicts', [] )
- self.repair_tool_shed_repositories( trans, repositories_for_repair, ordered_repo_info_dicts )
return self.repository_installation_grid( trans, **kwd )
@web.expose
@@ -1159,23 +1151,29 @@
status=status ) )
tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
if kwd.get( 'repair_repository_button', False ):
- repair_dict = kwd.get( 'repair_dict', None )
+ encoded_repair_dict = kwd.get( 'repair_dict', None )
+ if encoded_repair_dict:
+ repair_dict = encoding_util.tool_shed_decode( encoded_repair_dict )
+ else:
+ repair_dict = None
if not repair_dict:
repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
- ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
- ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
- if ordered_tsr_ids and ordered_repo_info_dicts:
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='manage_repositories',
- operation='repair',
- ordered_tsr_ids=ordered_tsr_ids,
- ordered_repo_info_dicts=ordered_repo_info_dicts ) )
+ ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
+ ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
+ if ordered_tsr_ids and ordered_repo_info_dicts:
+ repositories_for_repair = []
+ for tsr_id in ordered_tsr_ids:
+ repository = trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
+ repositories_for_repair.append( repository )
+ return self.repair_tool_shed_repositories( trans, repositories_for_repair, ordered_repo_info_dicts )
tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
+ encoded_repair_dict = encoding_util.tool_shed_encode( repair_dict )
ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
return trans.fill_template( 'admin/tool_shed_repository/repair_repository.mako',
repository=tool_shed_repository,
+ encoded_repair_dict=encoded_repair_dict,
repair_dict=repair_dict,
message=message,
status=status )
diff -r 86efa5ac1fae6fb46e7af9804e036a7ab44b0e26 -r 9e985bee20419c0cdbf76fadbe2448400820cbb9 lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -110,9 +110,9 @@
installed_repositories.append( installed_repository )
for rd_val in rd_vals:
try:
- tool_shed, name, owner, changeset_revision, prior_installation_required = container_util.get_components_from_key( rd_key )
+ tool_shed, name, owner, changeset_revision, prior_installation_required = rd_val
except:
- tool_shed, name, owner, changeset_revision = container_util.get_components_from_key( rd_val )
+ tool_shed, name, owner, changeset_revision = rd_val
installed_repository = suc.get_tool_shed_repository_by_shed_name_owner_changeset_revision( trans.app, tool_shed, name, owner, changeset_revision )
if installed_repository not in installed_repositories:
installed_repositories.append( installed_repository )
@@ -182,6 +182,7 @@
# tsr_ids to ensure all repositories are repaired in the required order.
tsr_ids = []
repo_info_dicts = []
+ tool_panel_section_keys = []
for installed_repository in installed_repositories:
tsr_ids.append( trans.security.encode_id( installed_repository.id ) )
repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, installed_repository )
@@ -189,8 +190,36 @@
metadata = installed_repository.metadata
if metadata:
tool_dependencies = metadata.get( 'tool_dependencies', None )
+ tool_panel_section_dict = metadata.get( 'tool_panel_section', None )
+ if tool_panel_section_dict:
+ # The installed_repository must be in the uninstalled state. The structure of tool_panel_section_dict is:
+ # {<tool guid> : [{ 'id':<section id>, 'name':<section name>, 'version':<section version>, 'tool_config':<tool config file name> }]}
+ # Here is an example:
+ # {"localhost:9009/repos/test/filter/Filter1/1.1.0":
+ # [{"id": "filter_and_sort", "name": "Filter and Sort", "tool_config": "filtering.xml", "version": ""}]}
+ # Currently all tools contained within an installed tool shed repository must be loaded into the same section in the tool panel, so we can
+ # get the section id of the first guid in the tool_panel_section_dict. In the future, we'll have to handle different sections per guid.
+ guid = tool_panel_section_dict.keys()[ 0 ]
+ section_dicts = tool_panel_section_dict[ guid ]
+ section_dict = section_dicts[ 0 ]
+ tool_panel_section_id = section_dict[ 'id' ]
+ tool_panel_section_name = section_dict[ 'name' ]
+ if tool_panel_section_id:
+ tool_panel_section_key, tool_panel_section = tool_util.get_or_create_tool_section( trans,
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section=tool_panel_section_name )
+ tool_panel_section_keys.append( tool_panel_section_key )
+ else:
+ # The tools will be loaded outside of any sections in the tool panel.
+ tool_panel_section_keys.append( None )
+ else:
+ # The installed_repository must be in the installed state, so we can skip determining if it has tools that are displayed in a tool panel section
+ # since no changes will be made to it.
+ tool_panel_section_keys.append( None )
else:
tool_dependencies = None
+ # The tools will be loaded outside of any sections in the tool panel.
+ tool_panel_section_keys.append( None )
repo_info_dict = create_repo_info_dict( trans=trans,
repository_clone_url=repository_clone_url,
changeset_revision=installed_repository.changeset_revision,
@@ -202,11 +231,11 @@
tool_dependencies=tool_dependencies,
repository_dependencies=repository_dependencies )
repo_info_dicts.append( repo_info_dict )
- # We don't consider tool_panel_section_keys since the repository database records already exist.
- ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys = order_components_for_installation( trans,
- tsr_ids,
- repo_info_dicts,
- tool_panel_section_keys=None )
+ ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys = \
+ order_components_for_installation( trans,
+ tsr_ids,
+ repo_info_dicts,
+ tool_panel_section_keys=tool_panel_section_keys )
repair_dict[ 'ordered_tsr_ids' ] = ordered_tsr_ids
repair_dict[ 'ordered_repo_info_dicts' ] = ordered_repo_info_dicts
repair_dict[ 'ordered_tool_panel_section_keys' ] = ordered_tool_panel_section_keys
@@ -245,7 +274,7 @@
repository_dependencies=None )
return repo_info_dict, includes_tools, includes_tool_dependencies, includes_tools_for_display_in_tool_panel, has_repository_dependencies
-def get_repository_components_for_installation( encoded_tsr_id, encoded_tsr_ids, repo_info_dicts, tool_panel_section_keys=None ):
+def get_repository_components_for_installation( encoded_tsr_id, encoded_tsr_ids, repo_info_dicts, tool_panel_section_keys ):
"""
The received encoded_tsr_ids, repo_info_dicts, and tool_panel_section_keys are 3 lists that contain associated elements at each location in
the list. This method will return the elements from repo_info_dicts and tool_panel_section_keys associated with the received encoded_tsr_id
@@ -254,10 +283,7 @@
for index, tsr_id in enumerate( encoded_tsr_ids ):
if tsr_id == encoded_tsr_id:
repo_info_dict = repo_info_dicts[ index ]
- if tool_panel_section_keys:
- tool_panel_section_key = tool_panel_section_keys[ index ]
- else:
- tool_panel_section_key = None
+ tool_panel_section_key = tool_panel_section_keys[ index ]
return repo_info_dict, tool_panel_section_key
return None, None
@@ -684,7 +710,7 @@
lock.release()
return new_containers_dict
-def order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys=None ):
+def order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys ):
"""
Some repositories may have repository dependencies that are required to be installed before the dependent repository. This method will inspect the list of
repositories about to be installed and make sure to order them appropriately. For each repository about to be installed, if required repositories are not
@@ -713,16 +739,14 @@
tool_panel_section_keys=tool_panel_section_keys )
ordered_tsr_ids.append( prior_install_required_id )
ordered_repo_info_dicts.append( prior_repo_info_dict )
- if tool_panel_section_keys:
- ordered_tool_panel_section_keys.append( prior_tool_panel_section_key )
+ ordered_tool_panel_section_keys.append( prior_tool_panel_section_key )
repo_info_dict, tool_panel_section_key = get_repository_components_for_installation( tsr_id,
tsr_ids,
repo_info_dicts,
tool_panel_section_keys=tool_panel_section_keys )
ordered_tsr_ids.append( tsr_id )
ordered_repo_info_dicts.append( repo_info_dict )
- if tool_panel_section_keys:
- ordered_tool_panel_section_keys.append( tool_panel_section_key )
+ ordered_tool_panel_section_keys.append( tool_panel_section_key )
return ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys
def populate_containers_dict_for_new_install( trans, tool_shed_url, tool_path, readme_files_dict, installed_repository_dependencies, missing_repository_dependencies,
@@ -785,11 +809,11 @@
shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository )
# Reset the repository attributes to the New state for installation.
if metadata:
- tool_panel_section_key = tool_util.handle_tool_panel_selection( trans,
- metadata,
- no_changes_checked=True,
- tool_panel_section=None,
- new_tool_panel_section=None )
+ tool_section, new_tool_panel_section, tool_panel_section_key = tool_util.handle_tool_panel_selection( trans,
+ metadata,
+ no_changes_checked=True,
+ tool_panel_section=None,
+ new_tool_panel_section=None )
else:
# The tools will be loaded outside of any sections in the tool panel.
tool_panel_section_key = None
diff -r 86efa5ac1fae6fb46e7af9804e036a7ab44b0e26 -r 9e985bee20419c0cdbf76fadbe2448400820cbb9 lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -639,8 +639,7 @@
if 'tools' in metadata:
# This forces everything to be loaded into the same section (or no section) in the tool panel.
if no_changes_checked:
- # Make sure the no_changes check box overrides the new_tool_panel_section if the user checked the check box and entered something
- # into the field.
+ # Make sure the no_changes check box overrides the new_tool_panel_section if the user checked the check box and entered something into the field.
new_tool_panel_section = None
if 'tool_panel_section' in metadata:
tool_panel_dict = metadata[ 'tool_panel_section' ]
@@ -649,7 +648,7 @@
else:
tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] )
if tool_panel_dict:
- #tool_panel_dict is empty when tools exist but are not installed into a tool panel
+ # The tool_panel_dict is empty when tools exist but are not installed into a tool panel section.
tool_section_dicts = tool_panel_dict[ tool_panel_dict.keys()[ 0 ] ]
tool_section_dict = tool_section_dicts[ 0 ]
original_section_id = tool_section_dict[ 'id' ]
diff -r 86efa5ac1fae6fb46e7af9804e036a7ab44b0e26 -r 9e985bee20419c0cdbf76fadbe2448400820cbb9 templates/admin/tool_shed_repository/repair_repository.mako
--- a/templates/admin/tool_shed_repository/repair_repository.mako
+++ b/templates/admin/tool_shed_repository/repair_repository.mako
@@ -25,7 +25,7 @@
<div class="toolForm"><div class="toolFormTitle">Repair tool shed repository '${repository.name}'</div><br/><br/>
- <form name="repair_repository" id="repair_repository" action="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ), repair_dict=repair_dict )}" method="post" >
+ <form name="repair_repository" id="repair_repository" action="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ), repair_dict=encoded_repair_dict )}" method="post" ><% ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] ) %><table class="grid"><tr><th bgcolor="#D8D8D8">Name</th><th bgcolor="#D8D8D8">Owner</th><th bgcolor="#D8D8D8">Changeset revision</th></tr>
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.
1
0