commit/galaxy-central: greg: Enhanced Galaxy instance <=> Galaxy tool shed integration:
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/6c8695c2a949/ changeset: 6c8695c2a949 user: greg date: 2011-10-19 22:47:25 summary: Enhanced Galaxy instance <=> Galaxy tool shed integration: 1. All accessible tool sheds are now displayed in a mako template in teh Admin view rather than the left tool panel 2. From Galaxy you can now search for tools by id, name, version in a selected Galaxy tool shed. 3. Tools found using the above search can now be installed in the local Galaxy instance. affected #: 18 files (-1 bytes) --- a/lib/galaxy/web/controllers/admin.py Wed Oct 19 10:14:51 2011 -0400 +++ b/lib/galaxy/web/controllers/admin.py Wed Oct 19 16:47:25 2011 -0400 @@ -688,20 +688,28 @@ return self.repository_list_grid( trans, **kwd ) @web.expose @web.require_admin + def browse_tool_sheds( self, trans, **kwd ): + params = util.Params( kwd ) + message = util.restore_text( params.get( 'message', '' ) ) + status = params.get( 'status', 'done' ) + return trans.fill_template( '/webapps/galaxy/admin/tool_sheds.mako', + webapp='galaxy', + message=message, + status='error' ) + @web.expose + @web.require_admin + def find_tools_in_tool_shed( self, trans, **kwd ): + tool_shed_url = kwd[ 'tool_shed_url' ] + galaxy_url = trans.request.host + url = '%s/repository/find_tools?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url ) + return trans.response.send_redirect( url ) + @web.expose + @web.require_admin def browse_tool_shed( self, trans, **kwd ): tool_shed_url = kwd[ 'tool_shed_url' ] galaxy_url = trans.request.host - url = '%s/repository/browse_downloadable_repositories?galaxy_url=%s&webapp=community' % ( tool_shed_url, galaxy_url ) + url = '%s/repository/browse_downloadable_repositories?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url ) return trans.response.send_redirect( url ) - def _decode( self, value ): - # Extract and verify hash - a, b = value.split( ":" ) - value = binascii.unhexlify( b ) - test = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value ) - assert a == test - # Restore from string - values = json_fix( simplejson.loads( value ) ) - return values @web.expose @web.require_admin def install_tool_shed_repository( self, trans, **kwd ): @@ -728,7 +736,7 @@ section_key = 'section_%s' % kwd[ 'tool_panel_section' ] tool_section = trans.app.toolbox.tool_panel[ section_key ] # Decode the encoded repo_info_dict param value. - repo_info_dict = self._decode( repo_info_dict ) + repo_info_dict = self.__decode( repo_info_dict ) # Clone the repository to the configured location. current_working_dir = os.getcwd() for name, repo_info_tuple in repo_info_dict.items(): @@ -846,7 +854,7 @@ galaxy_url = trans.request.host # Send a request to the relevant tool shed to see if there are any updates. # TODO: support https in the following url. - url = 'http://%s/repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s&webapp=community' % \ + url = 'http://%s/repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \ ( repository.tool_shed, galaxy_url, repository.name, repository.owner, repository.changeset_revision ) return trans.response.send_redirect( url ) @web.expose @@ -1149,6 +1157,15 @@ section_str += ' </tool>\n' section_str += ' </section>\n' return section_str + def __decode( self, value ): + # Extract and verify hash + a, b = value.split( ":" ) + value = binascii.unhexlify( b ) + test = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value ) + assert a == test + # Restore from string + values = json_fix( simplejson.loads( value ) ) + return values ## ---- Utility methods ------------------------------------------------------- --- a/lib/galaxy/webapps/community/controllers/repository.py Wed Oct 19 10:14:51 2011 -0400 +++ b/lib/galaxy/webapps/community/controllers/repository.py Wed Oct 19 16:47:25 2011 -0400 @@ -283,13 +283,14 @@ class InstallMatchedRepositoryListGrid( MatchedRepositoryListGrid ): # Grid definition - title = "Repositories with required tools" - operations = [ grids.GridOperation( "Install tools", - url_args = dict( controller='repository', - action='find_tools', - webapp='community' ), - allow_multiple=True, - async_compatible=False ) ] + title = "Repositories that contain tools matching search criteria" + columns = [ col for col in MatchedRepositoryListGrid.columns ] + # Override the NameColumn + columns[ 0 ] = MatchedRepositoryListGrid.NameColumn( "Name", + link=( lambda item: dict( operation="view_or_manage_repository", + id=item.id, + webapp="galaxy" ) ), + attach_popup=True ) class RepositoryController( BaseUIController, ItemRatings ): @@ -340,6 +341,7 @@ return self.category_list_grid( trans, **kwd ) @web.expose def browse_downloadable_repositories( self, trans, **kwd ): + webapp = kwd.get( 'webapp', 'community' ) galaxy_url = kwd.get( 'galaxy_url', None ) if galaxy_url: trans.set_cookie( galaxy_url, name='toolshedgalaxyurl' ) @@ -366,12 +368,14 @@ if repository.tip != v: return trans.response.send_redirect( web.url_for( controller='repository', action='preview_tools_in_changeset', + webapp=webapp, repository_id=trans.security.encode_id( repository.id ), changeset_revision=v ) ) url_args = dict( action='browse_downloadable_repositories', operation='preview_tools_in_changeset', + webapp=webapp, repository_id=repository_id ) - self.downloadable_repository_list_grid.operations = [ grids.GridOperation( "Preview and install tools", + self.downloadable_repository_list_grid.operations = [ grids.GridOperation( "Preview and install", url_args=url_args, allow_multiple=False, async_compatible=False ) ] @@ -396,18 +400,18 @@ repository = get_repository( trans, repository_id ) kwd[ 'id' ] = repository_id kwd[ 'changeset_revision' ] = repository_metadata.changeset_revision - if is_admin or repository.user == trans.user: + if webapp == 'community' and ( is_admin or repository.user == trans.user ): a = 'manage_repository' else: a = 'view_repository' return trans.response.send_redirect( web.url_for( controller='repository', action=a, **kwd ) ) - if operation == "install tools": + if operation == "install": repo_info_dict = {} galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' ) # TODO: support https in the following url. - url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s' % ( galaxy_url, trans.request.host ) + url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s' % ( galaxy_url, trans.request.host, webapp ) repository_metadata_ids = util.listify( kwd[ 'id' ] ) for repository_metadata_id in repository_metadata_ids: repository_metadata = get_repository_metadata_by_id( trans, repository_metadata_id ) @@ -416,7 +420,7 @@ changeset_revision = repository_metadata.changeset_revision repository_clone_url = generate_clone_url( trans, repository_id ) repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, changeset_revision ) - encoded_repo_info_dict = self._encode( repo_info_dict ) + encoded_repo_info_dict = self.__encode( repo_info_dict ) url += '&repo_info_dict=%s' % encoded_repo_info_dict return trans.response.send_redirect( url ) tool_ids = [ item.lower() for item in util.listify( kwd.get( 'tool_id', '' ) ) ] @@ -427,17 +431,19 @@ match_tuples = [] ok = True if tool_ids or tool_names or tool_versions: - ok, match_tuples = self._search_repository_metadata( trans, tool_ids, tool_names, tool_versions, exact_matches_checked ) + ok, match_tuples = self.__search_repository_metadata( trans, tool_ids, tool_names, tool_versions, exact_matches_checked ) if ok: kwd[ 'match_tuples' ] = match_tuples # Render the list view - if galaxy_url: - # Our request originated from a Galaxy instance, so we're listing tools - # that have been found for a workflow in Galaxy. + if webapp == 'galaxy': + # Our request originated from a Galaxy instance. + install_url_args = dict( controller='repository', action='find_tools', webapp=webapp ) + operations = [ grids.GridOperation( "Install", url_args=install_url_args, allow_multiple=True, async_compatible=False ) ] + self.install_matched_repository_list_grid.operations = operations return self.install_matched_repository_list_grid( trans, **kwd ) else: kwd[ 'message' ] = "tool id: <b>%s</b><br/>tool name: <b>%s</b><br/>tool version: <b>%s</b><br/>exact matches only: <b>%s</b>" % \ - ( self._stringify( tool_ids ), self._stringify( tool_names ), self._stringify( tool_versions ), str( exact_matches_checked ) ) + ( self.__stringify( tool_ids ), self.__stringify( tool_names ), self.__stringify( tool_versions ), str( exact_matches_checked ) ) return self.matched_repository_list_grid( trans, **kwd ) else: message = "No search performed - each field must contain the same number of comma-separated items." @@ -445,13 +451,13 @@ exact_matches_check_box = CheckboxField( 'exact_matches', checked=exact_matches_checked ) return trans.fill_template( '/webapps/community/repository/find_tools.mako', webapp=webapp, - tool_id=self._stringify( tool_ids ), - tool_name=self._stringify( tool_names ), - tool_version=self._stringify( tool_versions ), + tool_id=self.__stringify( tool_ids ), + tool_name=self.__stringify( tool_names ), + tool_version=self.__stringify( tool_versions ), exact_matches_check_box=exact_matches_check_box, message=message, status=status ) - def _search_repository_metadata( self, trans, tool_ids, tool_names, tool_versions, exact_matches_checked ): + def __search_repository_metadata( self, trans, tool_ids, tool_names, tool_versions, exact_matches_checked ): match_tuples = [] ok = True for repository_metadata in trans.sa_session.query( model.RepositoryMetadata ): @@ -460,38 +466,38 @@ for tool_dict in tools: if tool_ids and not tool_names and not tool_versions: for tool_id in tool_ids: - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) elif tool_names and not tool_ids and not tool_versions: for tool_name in tool_names: - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) elif tool_versions and not tool_ids and not tool_names: for tool_version in tool_versions: - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_version=tool_version ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_version=tool_version ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) elif tool_ids and tool_names and not tool_versions: if len( tool_ids ) == len( tool_names ): - match_tuples = self._search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ) + match_tuples = self.__search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ) elif len( tool_ids ) == 1 or len( tool_names ) == 1: - tool_ids, tool_names = self._make_same_length( tool_ids, tool_names ) - match_tuples = self._search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ) + tool_ids, tool_names = self.__make_same_length( tool_ids, tool_names ) + match_tuples = self.__search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ) else: ok = False elif tool_ids and tool_versions and not tool_names: if len( tool_ids ) == len( tool_versions ): - match_tuples = self._search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ) + match_tuples = self.__search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ) elif len( tool_ids ) == 1 or len( tool_versions ) == 1: - tool_ids, tool_versions = self._make_same_length( tool_ids, tool_versions ) - match_tuples = self._search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ) + tool_ids, tool_versions = self.__make_same_length( tool_ids, tool_versions ) + match_tuples = self.__search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ) else: ok = False elif tool_versions and tool_names and not tool_ids: if len( tool_versions ) == len( tool_names ): - match_tuples = self._search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ) + match_tuples = self.__search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ) elif len( tool_versions ) == 1 or len( tool_names ) == 1: - tool_versions, tool_names = self._make_same_length( tool_versions, tool_names ) - match_tuples = self._search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ) + tool_versions, tool_names = self.__make_same_length( tool_versions, tool_names ) + match_tuples = self.__search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ) else: ok = False elif tool_versions and tool_names and tool_ids: @@ -499,12 +505,12 @@ for i, tool_version in enumerate( tool_versions ): tool_name = tool_names[ i ] tool_id = tool_ids[ i ] - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name, tool_version=tool_version ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name, tool_version=tool_version ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) else: ok = False return ok, match_tuples - def _in_tool_dict( self, tool_dict, exact_matches_checked, tool_id=None, tool_name=None, tool_version=None ): + def __in_tool_dict( self, tool_dict, exact_matches_checked, tool_id=None, tool_name=None, tool_version=None ): found = False if tool_id and not tool_name and not tool_version: tool_dict_tool_id = tool_dict[ 'id' ].lower() @@ -545,13 +551,13 @@ tool_dict_tool_name.find( tool_name ) >= 0 and \ tool_dict_tool_id.find( tool_id ) >= 0 ) return found - def _stringify( self, list ): + def __stringify( self, list ): if list: return ','.join( list ) return '' - def _make_same_length( self, list1, list2 ): + def __make_same_length( self, list1, list2 ): # If either list is 1 item, we'll append to it until its - #length is the same as the other. + # length is the same as the other. if len( list1 ) == 1: for i in range( 1, len( list2 ) ): list1.append( list1[ 0 ] ) @@ -559,25 +565,25 @@ for i in range( 1, len( list1 ) ): list2.append( list2[ 0 ] ) return list1, list2 - def _search_ids_names( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ): + def __search_ids_names( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ): for i, tool_id in enumerate( tool_ids ): tool_name = tool_names[ i ] - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) return match_tuples - def _search_ids_versions( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ): + def __search_ids_versions( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ): for i, tool_id in enumerate( tool_ids ): tool_version = tool_versions[ i ] - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_version=tool_version ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_version=tool_version ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) return match_tuples - def _search_names_versions( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ): + def __search_names_versions( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ): for i, tool_name in enumerate( tool_names ): tool_version = tool_versions[ i ] - if self._in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name, tool_version=tool_version ): + if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name, tool_version=tool_version ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) return match_tuples - def _encode( self, repo_info_dict ): + def __encode( self, repo_info_dict ): value = simplejson.dumps( repo_info_dict ) a = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value ) b = binascii.hexlify( value ) @@ -587,6 +593,7 @@ params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) + webapp = params.get( 'webapp', 'community' ) repository = get_repository( trans, repository_id ) changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) ) repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision ) @@ -605,7 +612,7 @@ revision_label=revision_label, changeset_revision_select_field=changeset_revision_select_field, metadata=metadata, - display_for_install=True, + webapp=webapp, message=message, status=status ) @web.expose @@ -631,7 +638,7 @@ name = params.get( 'name', None ) owner = params.get( 'owner', None ) changeset_revision = params.get( 'changeset_revision', None ) - webapp = params.get( 'webapp', None ) + webapp = params.get( 'webapp', 'community' ) # Start building up the url to redirect back to the calling Galaxy instance. # TODO: support https in the following url. url = 'http://%s/admin/update_to_changeset_revision?tool_shed_url=%s' % ( galaxy_url, trans.request.host ) @@ -713,6 +720,8 @@ # We add params to the keyword dict in this method in order to rename the param # with an "f-" prefix, simulating filtering by clicking a search link. We have # to take this approach because the "-" character is illegal in HTTP requests. + if 'webapp' not in kwd: + kwd[ 'webapp' ] = 'community' if 'operation' in kwd: operation = kwd['operation'].lower() if operation == "view_or_manage_repository": @@ -855,6 +864,7 @@ message = "Repository '%s' has been created." % repository.name trans.response.send_redirect( web.url_for( controller='repository', action='view_repository', + webapp='community', message=message, id=trans.security.encode_id( repository.id ) ) ) return trans.fill_template( '/webapps/community/repository/create_repository.mako', @@ -945,6 +955,7 @@ params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) + webapp = params.get( 'webapp', 'community' ) commit_message = util.restore_text( params.get( 'commit_message', 'Deleted selected files' ) ) repository = get_repository( trans, id ) repo = hg.repository( get_configured_ui(), repository.repo_path ) @@ -957,6 +968,7 @@ repository=repository, commit_message=commit_message, is_malicious=is_malicious, + webapp=webapp, message=message, status=status ) @web.expose @@ -1098,6 +1110,7 @@ message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) repository = get_repository( trans, id ) + webapp = params.get( 'webapp', 'community' ) repo = hg.repository( get_configured_ui(), repository.repo_path ) avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model ) changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) ) @@ -1155,6 +1168,7 @@ changeset_revision_select_field=changeset_revision_select_field, revision_label=revision_label, is_malicious=is_malicious, + webapp=webapp, message=message, status=status ) @web.expose @@ -1191,6 +1205,7 @@ return trans.response.send_redirect( web.url_for( controller='repository', action='view_repository', id=id, + webapp='community', message=message, status=status ) ) if repo_name != repository.name: @@ -1482,7 +1497,7 @@ params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) - display_for_install = util.string_as_bool( params.get( 'display_for_install', False ) ) + webapp = params.get( 'webapp', 'community' ) repository = get_repository( trans, repository_id ) repo = hg.repository( get_configured_ui(), repository.repo_path ) try: @@ -1523,12 +1538,12 @@ tool=tool, tool_state=tool_state, is_malicious=is_malicious, - display_for_install=display_for_install, + webapp=webapp, message=message, status=status ) except Exception, e: message = "Error loading tool: %s. Click <b>Reset metadata</b> to correct this error." % str( e ) - if display_for_install: + if webapp == 'galaxy': return trans.response.send_redirect( web.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=repository_id, @@ -1558,7 +1573,7 @@ params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) - display_for_install = util.string_as_bool( params.get( 'display_for_install', False ) ) + webapp = params.get( 'webapp', 'community' ) repository = get_repository( trans, repository_id ) metadata = {} tool = None @@ -1587,7 +1602,7 @@ revision_label=revision_label, changeset_revision_select_field=changeset_revision_select_field, is_malicious=is_malicious, - display_for_install=display_for_install, + webapp=webapp, message=message, status=status ) @web.expose --- a/lib/galaxy/webapps/community/controllers/upload.py Wed Oct 19 10:14:51 2011 -0400 +++ b/lib/galaxy/webapps/community/controllers/upload.py Wed Oct 19 16:47:25 2011 -0400 @@ -138,6 +138,7 @@ action='browse_repository', id=repository_id, commit_message='Deleted selected files', + webapp='community', message=message, status=status ) ) else: --- a/templates/webapps/community/repository/browse_repository.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/browse_repository.mako Wed Oct 19 16:47:25 2011 -0400 @@ -71,13 +71,13 @@ %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a> %endif %if can_upload: <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a> %endif %if can_rate: <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a> --- a/templates/webapps/community/repository/common.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/common.mako Wed Oct 19 16:47:25 2011 -0400 @@ -83,7 +83,7 @@ hg clone <a href="${clone_str}">${clone_str}</a></%def> -<%def name="render_repository_tools_and_workflows( metadata, can_set_metadata=False, display_for_install=False )"> +<%def name="render_repository_tools_and_workflows( metadata, can_set_metadata=False, webapp='community' )"> %if metadata or can_set_metadata: <p/><div class="toolForm"> @@ -111,12 +111,12 @@ <tr><td><div style="float: left; margin-left: 1px;" class="menubutton split popup" id="tool-${tool_dict[ 'id' ].replace( ' ', '_' )}-popup"> - <a class="view-info" href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( repository.id ), tool_config=tool_dict[ 'tool_config' ], changeset_revision=changeset_revision, display_for_install=display_for_install )}"> + <a class="view-info" href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( repository.id ), tool_config=tool_dict[ 'tool_config' ], changeset_revision=changeset_revision, webapp=webapp )}"> ${tool_dict[ 'name' ]} </a></div><div popupmenu="tool-${tool_dict[ 'id' ].replace( ' ', '_' )}-popup"> - <a class="action-button" href="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision, tool_id=tool_dict[ 'id' ], display_for_install=display_for_install )}">View tool metadata</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision, tool_id=tool_dict[ 'id' ], webapp=webapp )}">View tool metadata</a></div></td><td>${tool_dict[ 'description' ]}</td> --- a/templates/webapps/community/repository/contact_owner.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/contact_owner.mako Wed Oct 19 16:47:25 2011 -0400 @@ -37,16 +37,16 @@ %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ) )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ) )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View repository</a> %endif %if can_upload: <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">${browse_label}</a> %endif %if can_download: <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, file_type='gz' )}">Download as a .tar.gz file</a> --- a/templates/webapps/community/repository/find_tools.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/find_tools.mako Wed Oct 19 16:47:25 2011 -0400 @@ -18,9 +18,10 @@ <div class="toolFormTitle">Search repositories for valid tools</div><div class="toolFormBody"><div class="form-row"> - Valid tools are those that properly load in Galaxy. Enter any combination of the following tool attributes to locate matching valid tools. + Valid tools are those that properly load in Galaxy. Enter any combination of the following tool attributes to find repositories that contain + valid tools matching the search criteria.<br/><br/> Comma-separated strings may be entered in each field to expand search criteria. Each field must contain the same number of comma-separated - strings if these types of strings are entered in more than one field. + strings if these types of search strings are entered in more than one field. </div><div style="clear: both"></div><form name="find_tools" id="find_tools" action="${h.url_for( controller='repository', action='find_tools', webapp=webapp )}" method="post" > --- a/templates/webapps/community/repository/manage_repository.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/manage_repository.mako Wed Oct 19 16:47:25 2011 -0400 @@ -77,13 +77,13 @@ <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a> %endif %if can_rate: <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">${browse_label}</a> %endif %if can_contact_owner: <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> @@ -290,7 +290,7 @@ <div class="toolFormBody"> %if display_reviews: <div class="form-row"> - <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=False )}"><label>Hide Reviews</label></a> + <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=False, webapp='community' )}"><label>Hide Reviews</label></a></div><table class="grid"><thead> @@ -317,7 +317,7 @@ </table> %else: <div class="form-row"> - <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=True )}"><label>Display Reviews</label></a> + <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=True, webapp='community' )}"><label>Display Reviews</label></a></div> %endif </div> --- a/templates/webapps/community/repository/preview_tools_in_changeset.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/preview_tools_in_changeset.mako Wed Oct 19 16:47:25 2011 -0400 @@ -64,7 +64,7 @@ <br/><br/><ul class="manage-table-actions"> - <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp='community', changeset_revision=changeset_revision )}">Install to local Galaxy</a> + <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a></ul> %if message: @@ -98,4 +98,4 @@ </div></div><p/> -${render_repository_tools_and_workflows( metadata, display_for_install=display_for_install )} +${render_repository_tools_and_workflows( metadata, webapp=webapp )} --- a/templates/webapps/community/repository/rate_repository.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/rate_repository.mako Wed Oct 19 16:47:25 2011 -0400 @@ -78,16 +78,16 @@ %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a> %endif %if can_upload: <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">${browse_label}</a> %endif %if can_contact_owner: <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> --- a/templates/webapps/community/repository/tool_form.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/tool_form.mako Wed Oct 19 16:47:25 2011 -0400 @@ -110,33 +110,33 @@ <br/><br/><ul class="manage-table-actions"> - %if display_for_install: - <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp='community', changeset_revision=changeset_revision )}">Install to local Galaxy</a> + %if webapp == 'galaxy': + <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a> %else: %if is_new: - <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> + <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a> %else: <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"> %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp=webapp )}">View repository</a> %endif %if can_upload: - <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> + <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">${browse_label}</a> %endif %if can_rate: <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a> %endif %if can_contact_owner: - <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> + <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp=webapp )}">Contact repository owner</a> %endif %if can_download: <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='gz' )}">Download as a .tar.gz file</a> --- a/templates/webapps/community/repository/upload.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/upload.mako Wed Oct 19 16:47:25 2011 -0400 @@ -50,13 +50,13 @@ %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">Browse or delete repository files</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">Browse or delete repository files</a> %endif </div></ul> --- a/templates/webapps/community/repository/view_changelog.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/view_changelog.mako Wed Oct 19 16:47:25 2011 -0400 @@ -49,13 +49,13 @@ %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a> %endif %if can_rate: <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">${browse_label}</a> %endif %if can_contact_owner: <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> --- a/templates/webapps/community/repository/view_changeset.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/view_changeset.mako Wed Oct 19 16:47:25 2011 -0400 @@ -50,16 +50,16 @@ %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a> %endif %if can_rate: <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">${browse_label}</a> %endif %if can_contact_owner: <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> --- a/templates/webapps/community/repository/view_repository.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/view_repository.mako Wed Oct 19 16:47:25 2011 -0400 @@ -11,8 +11,8 @@ can_rate = not is_new and trans.user and repository.user != trans.user can_upload = can_push can_download = not is_new and ( not is_malicious or can_push ) - can_browse_contents = not is_new - can_view_change_log = not is_new + can_browse_contents = webapp == 'community' and not is_new + can_view_change_log = webapp == 'community' and not is_new if can_push: browse_label = 'Browse or delete repository files' else: @@ -65,32 +65,36 @@ <br/><br/><ul class="manage-table-actions"> - %if is_new and can_upload: - <li><a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a></li> + %if webapp == 'community': + %if is_new and can_upload: + <li><a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a></li> + %else: + <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li> + <div popupmenu="repository-${repository.id}-popup"> + %if can_upload: + <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a> + %endif + %if can_view_change_log: + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a> + %endif + %if can_rate: + <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">Rate repository</a> + %endif + %if can_browse_contents: + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">${browse_label}</a> + %endif + %if can_contact_owner: + <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp=webapp )}">Contact repository owner</a> + %endif + %if can_download: + <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='gz', webapp=webapp )}">Download as a .tar.gz file</a> + <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='bz2', webapp=webapp )}">Download as a .tar.bz2 file</a> + <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='zip', webapp=webapp )}">Download as a zip file</a> + %endif + </div> + %endif %else: - <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li> - <div popupmenu="repository-${repository.id}-popup"> - %if can_upload: - <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> - %endif - %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> - %endif - %if can_rate: - <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a> - %endif - %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> - %endif - %if can_contact_owner: - <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> - %endif - %if can_download: - <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='gz' )}">Download as a .tar.gz file</a> - <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='bz2' )}">Download as a .tar.bz2 file</a> - <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='zip' )}">Download as a zip file</a> - %endif - </div> + <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a> %endif </ul> @@ -102,7 +106,7 @@ <div class="toolForm"><div class="toolFormTitle">Repository revision</div><div class="toolFormBody"> - <form name="change_revision" id="change_revision" action="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ) )}" method="post" > + <form name="change_revision" id="change_revision" action="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), webapp=webapp )}" method="post" ><div class="form-row"><% if changeset_revision == repository.tip: @@ -132,7 +136,7 @@ <div class="form-row"><label>Name:</label> %if can_browse_contents: - <a href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${repository.name}</a> + <a href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">${repository.name}</a> %else: ${repository.name} %endif @@ -151,7 +155,7 @@ <div class="form-row"><label>Revision:</label> %if can_view_change_log: - <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${revision_label}</a> + <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">${revision_label}</a> %else: ${revision_label} %endif @@ -176,7 +180,7 @@ %endif </div></div> -${render_repository_tools_and_workflows( metadata )} +${render_repository_tools_and_workflows( metadata, webapp=webapp )} %if repository.categories: <p/><div class="toolForm"> @@ -191,12 +195,12 @@ </div></div> %endif -%if trans.user and trans.app.config.smtp_server: +%if webapp == 'community' and trans.user and trans.app.config.smtp_server: <p/><div class="toolForm"><div class="toolFormTitle">Notification on update</div><div class="toolFormBody"> - <form name="receive_email_alerts" id="receive_email_alerts" action="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ) )}" method="post" > + <form name="receive_email_alerts" id="receive_email_alerts" action="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), webapp=webapp )}" method="post" ><div class="form-row"><label>Receive email alerts:</label> ${alerts_check_box.get_html()} @@ -233,7 +237,7 @@ <div class="toolFormBody"> %if display_reviews: <div class="form-row"> - <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=False )}"><label>Hide Reviews</label></a> + <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=False, webapp=webapp )}"><label>Hide Reviews</label></a></div><table class="grid"><thead> @@ -260,7 +264,7 @@ </table> %else: <div class="form-row"> - <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=True )}"><label>Display Reviews</label></a> + <a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=True, webapp=webapp )}"><label>Display Reviews</label></a></div> %endif </div> --- a/templates/webapps/community/repository/view_tool_metadata.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/community/repository/view_tool_metadata.mako Wed Oct 19 16:47:25 2011 -0400 @@ -12,10 +12,10 @@ can_push = trans.app.security_agent.can_push( trans.user, repository ) can_upload = can_push can_download = not is_new and ( not is_malicious or can_push ) - can_browse_contents = not is_new + can_browse_contents = webapp == 'community' and not is_new can_rate = repository.user != trans.user can_manage = is_admin or repository.user == trans.user - can_view_change_log = not is_new + can_view_change_log = webapp == 'community' and not is_new if can_push: browse_label = 'Browse or delete repository files' else: @@ -33,30 +33,30 @@ <br/><br/><ul class="manage-table-actions"> - %if display_for_install: - <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp='community', changeset_revision=changeset_revision )}">Install to local Galaxy</a> + %if webapp == 'galaxy': + <a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a> %else: %if is_new: - <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> + <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a> %else: <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"> %if can_manage: <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Manage repository</a> %else: - <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">View repository</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp=webapp )}">View repository</a> %endif %if can_upload: - <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a> + <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a> %endif %if can_view_change_log: - <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a> + <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a> %endif %if can_browse_contents: - <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a> + <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">${browse_label}</a> %endif %if can_contact_owner: - <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp='community' )}">Contact repository owner</a> + <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp=webapp )}">Contact repository owner</a> %endif %if can_download: <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='gz' )}">Download as a .tar.gz file</a> @@ -76,7 +76,7 @@ <div class="toolFormTitle">Repository revision</div><div class="toolFormBody"> %if len( changeset_revision_select_field.options ) > 1: - <form name="change_revision" id="change_revision" action="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), tool_id=metadata[ 'id' ], display_for_install=display_for_install )}" method="post" > + <form name="change_revision" id="change_revision" action="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), tool_id=metadata[ 'id' ], webapp=webapp )}" method="post" ><div class="form-row"><% if changeset_revision == repository.tip: @@ -124,7 +124,7 @@ <div class="toolFormBody"><div class="form-row"><label>Name:</label> - <a href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( repository.id ), tool_config=metadata[ 'tool_config' ], changeset_revision=changeset_revision )}">${metadata[ 'name' ]}</a> + <a href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( repository.id ), tool_config=metadata[ 'tool_config' ], changeset_revision=changeset_revision, webapp=webapp )}">${metadata[ 'name' ]}</a><div style="clear: both"></div></div> %if 'description' in metadata: --- a/templates/webapps/galaxy/admin/index.mako Wed Oct 19 10:14:51 2011 -0400 +++ b/templates/webapps/galaxy/admin/index.mako Wed Oct 19 16:47:25 2011 -0400 @@ -73,10 +73,7 @@ <div class="toolSectionTitle">Tool sheds</div><div class="toolSectionBody"><div class="toolSectionBg"> - %for name, url in trans.app.tool_shed_registry.tool_sheds.items(): - <div class="toolTitle"><a href="${h.url_for( controller='admin', action='browse_tool_shed', tool_shed_url=url )}" target="galaxy_main">${name}</a></div> - %endfor - </div> + <div class="toolTitle"><a href="${h.url_for( controller='admin', action='browse_tool_sheds' )}" target="galaxy_main">Browse tool sheds</a></div></div></div> %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.
participants (1)
-
Bitbucket