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
May 2013
- 1 participants
- 218 discussions
commit/galaxy-central: jgoecks: Trackster: whitespace fixes.
by commits-noreply@bitbucket.org 02 May '13
by commits-noreply@bitbucket.org 02 May '13
02 May '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/72a381a4f692/
Changeset: 72a381a4f692
User: jgoecks
Date: 2013-05-02 15:41:17
Summary: Trackster: whitespace fixes.
Affected #: 1 file
diff -r fadc4b334f3e3cca07238f86d30053318215486e -r 72a381a4f692feb906e85f6cfed99c7407640282 static/scripts/viz/trackster/tracks.js
--- a/static/scripts/viz/trackster/tracks.js
+++ b/static/scripts/viz/trackster/tracks.js
@@ -2722,6 +2722,7 @@
}
};
extend(TiledTrack.prototype, Drawable.prototype, Track.prototype, {
+
action_icons_def: Track.prototype.action_icons_def.concat( [
// Show more rows when all features are not slotted.
{
@@ -2737,6 +2738,7 @@
hide: true
}
] ),
+
/**
* Returns a copy of the track. The copy uses the same data manager so that the tracks can share data.
*/
@@ -2752,6 +2754,7 @@
new_track.enabled = this.enabled;
return new_track;
},
+
/**
* Set filters manager + HTML elements.
*/
@@ -2759,6 +2762,7 @@
this.filters_manager = filters_manager;
this.header_div.after(this.filters_manager.parent_div);
},
+
/**
* Returns representation of object in a dictionary for easy saving.
* Use from_dict to recreate object.
@@ -2777,6 +2781,7 @@
tool_state: (this.tool ? this.tool.state_dict() : {})
};
},
+
/**
* Change track's mode.
*/
@@ -2789,7 +2794,8 @@
track.request_draw();
this.action_icons.mode_icon.attr("title", "Set display mode (now: " + track.mode + ")");
return track;
- },
+ },
+
/**
* Update track's buttons.
*/
@@ -2921,6 +2927,7 @@
}
});
},
+
/**
* Actions to be taken after draw has been completed. Draw is completed when all tiles have been
* drawn/fetched and shown.
@@ -3160,6 +3167,7 @@
region_str = (region !== undefined ? region.toString() : "all");
return " - region=[" + region_str + "], parameters=[" + track.tool.get_param_values().join(", ") + "]";
},
+
/**
* Returns true if data is compatible with a given mode. Defaults to true because, for many tracks,
* all data is compatible with all modes.
@@ -3167,12 +3175,14 @@
data_and_mode_compatible: function(data, mode) {
return true;
},
+
/**
* Returns true if data can be subsetted. Defaults to false to ensure data is fetched when needed.
*/
can_subset: function(data) {
return false;
},
+
/**
* Set up track to receive tool data.
*/
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: First pass at standardizing the Repository Actions menu in the tool shed.
by commits-noreply@bitbucket.org 01 May '13
by commits-noreply@bitbucket.org 01 May '13
01 May '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fadc4b334f3e/
Changeset: fadc4b334f3e
User: greg
Date: 2013-05-01 23:02:32
Summary: First pass at standardizing the Repository Actions menu in the tool shed.
Affected #: 21 files
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e 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
@@ -545,13 +545,11 @@
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
# Update repository files for browsing.
suc.update_repository( repo )
- is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repository=repository,
metadata=metadata,
commit_message=commit_message,
- is_malicious=is_malicious,
message=message,
status=status )
@@ -941,7 +939,6 @@
if message:
status = 'error'
tool_state = self.__new_state( trans )
- is_malicious = suc.changeset_is_malicious( trans, repository_id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, repository_id, changeset_revision )
try:
return trans.fill_template( "/webapps/tool_shed/repository/tool_form.mako",
@@ -950,7 +947,6 @@
changeset_revision=changeset_revision,
tool=tool,
tool_state=tool_state,
- is_malicious=is_malicious,
message=message,
status=status )
except Exception, e:
@@ -1779,7 +1775,6 @@
status = params.get( 'status', 'error' )
repository, tool, error_message = tool_util.load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
tool_state = self.__new_state( trans )
- is_malicious = suc.changeset_is_malicious( trans, repository_id, repository.tip( trans.app ) )
invalid_file_tups = []
if tool:
invalid_file_tups = tool_util.check_tool_input_params( trans.app,
@@ -1797,7 +1792,6 @@
changeset_revision=changeset_revision,
tool=tool,
tool_state=tool_state,
- is_malicious=is_malicious,
message=message,
status='error' )
except Exception, e:
@@ -2024,17 +2018,6 @@
malicious_check_box = CheckboxField( 'malicious', checked=is_malicious )
categories = suc.get_categories( trans )
selected_categories = [ rca.category_id for rca in repository.categories ]
- # Determine if the current changeset revision has been reviewed by the current user.
- reviewed_by_user = review_util.changeset_revision_reviewed_by_user( trans, trans.user, repository, changeset_revision )
- if reviewed_by_user:
- review = review_util.get_review_by_repository_id_changeset_revision_user_id( trans=trans,
- repository_id=id,
- changeset_revision=changeset_revision,
- user_id=trans.security.encode_id( trans.user.id ) )
- review_id = trans.security.encode_id( review.id )
- else:
- review_id = None
- can_browse_repository_reviews = review_util.can_browse_repository_reviews( trans, repository )
containers_dict = container_util.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
return trans.fill_template( '/webapps/tool_shed/repository/manage_repository.mako',
repo_name=repo_name,
@@ -2047,8 +2030,6 @@
containers_dict=containers_dict,
repository_metadata=repository_metadata,
changeset_revision=changeset_revision,
- reviewed_by_user=reviewed_by_user,
- review_id=review_id,
changeset_revision_select_field=changeset_revision_select_field,
revision_label=revision_label,
selected_categories=selected_categories,
@@ -2059,8 +2040,6 @@
num_ratings=num_ratings,
alerts_check_box=alerts_check_box,
malicious_check_box=malicious_check_box,
- is_malicious=is_malicious,
- can_browse_repository_reviews=can_browse_repository_reviews,
message=message,
status=status )
@@ -2214,7 +2193,6 @@
avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model )
display_reviews = util.string_as_bool( params.get( 'display_reviews', False ) )
rra = self.get_user_item_rating( trans.sa_session, trans.user, repository, webapp_model=trans.model )
- is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
return trans.fill_template( '/webapps/tool_shed/repository/rate_repository.mako',
repository=repository,
@@ -2223,7 +2201,6 @@
display_reviews=display_reviews,
num_ratings=num_ratings,
rra=rra,
- is_malicious=is_malicious,
message=message,
status=status )
@@ -2403,12 +2380,10 @@
else:
message = "Select at least 1 file to delete from the repository before clicking <b>Delete selected files</b>."
status = "error"
- is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repo=repo,
repository=repository,
commit_message=commit_message,
- is_malicious=is_malicious,
message=message,
status=status )
@@ -2679,13 +2654,11 @@
'has_metadata' : has_metadata }
# Make sure we'll view latest changeset first.
changesets.insert( 0, change_dict )
- is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
return trans.fill_template( '/webapps/tool_shed/repository/view_changelog.mako',
repository=repository,
metadata=metadata,
changesets=changesets,
- is_malicious=is_malicious,
message=message,
status=status )
@@ -2711,7 +2684,6 @@
diffs = []
for diff in patch.diff( repo, node1=ctx_parent.node(), node2=ctx.node() ):
diffs.append( suc.to_safe_string( diff, to_html=True ) )
- is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, ctx_str )
return trans.fill_template( '/webapps/tool_shed/repository/view_changeset.mako',
repository=repository,
@@ -2726,7 +2698,6 @@
ignored=ignored,
clean=clean,
diffs=diffs,
- is_malicious=is_malicious,
message=message,
status=status )
@@ -2814,18 +2785,7 @@
else:
message += malicious_error
status = 'error'
- # Determine if the current changeset revision has been reviewed by the current user.
- reviewed_by_user = review_util.changeset_revision_reviewed_by_user( trans, trans.user, repository, changeset_revision )
- if reviewed_by_user:
- review = review_util.get_review_by_repository_id_changeset_revision_user_id( trans=trans,
- repository_id=id,
- changeset_revision=changeset_revision,
- user_id=trans.security.encode_id( trans.user.id ) )
- review_id = trans.security.encode_id( review.id )
- else:
- review_id = None
containers_dict = container_util.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
- can_browse_repository_reviews = review_util.can_browse_repository_reviews( trans, repository )
return trans.fill_template( '/webapps/tool_shed/repository/view_repository.mako',
repo=repo,
repository=repository,
@@ -2837,12 +2797,8 @@
num_ratings=num_ratings,
alerts_check_box=alerts_check_box,
changeset_revision=changeset_revision,
- reviewed_by_user=reviewed_by_user,
- review_id=review_id,
changeset_revision_select_field=changeset_revision_select_field,
revision_label=revision_label,
- is_malicious=is_malicious,
- can_browse_repository_reviews=can_browse_repository_reviews,
message=message,
status=status )
@@ -2898,22 +2854,12 @@
else:
repository_metadata_id = None
metadata = None
- is_malicious = suc.changeset_is_malicious( trans, repository_id, repository.tip( trans.app ) )
changeset_revision_select_field = grids_util.build_changeset_revision_select_field( trans,
repository,
selected_value=changeset_revision,
add_id_to_name=False,
downloadable=False )
trans.app.config.tool_data_path = original_tool_data_path
- reviewed_by_user = review_util.changeset_revision_reviewed_by_user( trans, trans.user, repository, changeset_revision )
- if reviewed_by_user:
- review = review_util.get_review_by_repository_id_changeset_revision_user_id( trans=trans,
- repository_id=repository_id,
- changeset_revision=changeset_revision,
- user_id=trans.security.encode_id( trans.user.id ) )
- review_id = trans.security.encode_id( review.id )
- else:
- review_id = None
return trans.fill_template( "/webapps/tool_shed/repository/view_tool_metadata.mako",
repository=repository,
repository_metadata_id=repository_metadata_id,
@@ -2924,9 +2870,6 @@
changeset_revision=changeset_revision,
revision_label=revision_label,
changeset_revision_select_field=changeset_revision_select_field,
- is_malicious=is_malicious,
- reviewed_by_user=reviewed_by_user,
- review_id=review_id,
message=message,
status=status )
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/common/repository_actions_menu.mako
--- /dev/null
+++ b/templates/webapps/tool_shed/common/repository_actions_menu.mako
@@ -0,0 +1,142 @@
+<%inherit file="/base.mako"/>
+
+<%def name="render_tool_shed_repository_actions( repository, repo=None, metadata=None, changeset_revision=None )">
+ <%
+ from tool_shed.util.review_util import can_browse_repository_reviews, changeset_revision_reviewed_by_user, get_review_by_repository_id_changeset_revision_user_id
+ from tool_shed.util.shed_util_common import changeset_is_malicious
+
+ has_metadata = repository.metadata_revisions
+ has_readme = metadata and 'readme' in metadata
+ is_admin = trans.user_is_admin()
+ is_deprecated = repository.deprecated
+ is_new = repository.is_new( trans.app )
+ is_malicious = changeset_is_malicious( trans, trans.security.encode_id( repository.id ), repository.tip( trans.app ) )
+
+ can_browse_contents = not is_new
+ can_browse_reviews = can_browse_repository_reviews( trans, repository )
+ can_contact_owner = trans.user and trans.user != repository.user
+ can_deprecate = not is_new and trans.user and ( is_admin or repository.user == trans.user ) and not is_deprecated
+ can_push = not is_deprecated and trans.app.security_agent.can_push( trans.app, trans.user, repository )
+ can_download = not is_deprecated and not is_new and ( not is_malicious or can_push )
+ if not is_deprecated:
+ if repo and len( repo ) > 0:
+ can_reset_all_metadata = True
+ else:
+ can_reset_all_metadata = False
+ else:
+ can_reset_all_metadata = False
+ can_upload = can_push and not is_deprecated
+ can_rate = not is_new and not is_deprecated and trans.user and repository.user != trans.user
+ if changeset_revision:
+ can_review_repository = has_metadata and not is_deprecated and trans.app.security_agent.user_can_review_repositories( trans.user )
+ reviewed_by_user = changeset_revision_reviewed_by_user( trans, trans.user, repository, changeset_revision )
+ else:
+ can_review_repository = False
+ reviewed_by_user = False
+
+ # Determine if the current changeset revision has been reviewed by the current user.
+ if reviewed_by_user:
+ review = get_review_by_repository_id_changeset_revision_user_id( trans=trans,
+ repository_id=trans.security.encode_id( repository.id ),
+ changeset_revision=changeset_revision,
+ user_id=trans.security.encode_id( trans.user.id ) )
+ review_id = trans.security.encode_id( review.id )
+ else:
+ review_id = None
+
+ can_set_metadata = not is_new and not is_deprecated
+ if changeset_revision:
+ if changeset_revision == repository.tip( trans.app ):
+ changeset_revision_is_repository_tip = True
+ else:
+ changeset_revision_is_repository_tip = False
+ else:
+ changeset_revision_is_repository_tip = False
+ can_set_malicious = metadata and can_set_metadata and is_admin and changeset_revision_is_repository_tip
+ can_undeprecate = trans.user and ( is_admin or repository.user == trans.user ) and is_deprecated
+ can_manage = is_admin or repository.user == trans.user
+ can_view_change_log = not is_new
+
+ if can_push:
+ browse_label = 'Browse or delete repository tip files'
+ else:
+ browse_label = 'Browse repository tip files'
+ %>
+
+ <br/><br/>
+ <ul class="manage-table-actions">
+ %if is_new:
+ %if can_upload:
+ <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a>
+ %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_review_repository:
+ %if reviewed_by_user:
+ <a class="action-button" href="${h.url_for( controller='repository_review', action='edit_review', id=review_id )}">Manage my review of this revision</a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='repository_review', action='create_review', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Add a review to this revision</a>
+ %endif
+ %endif
+ %if can_browse_reviews:
+ <a class="action-button" href="${h.url_for( controller='repository_review', action='manage_repository_reviews', id=trans.app.security.encode_id( repository.id ) )}">Browse reviews of this 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 ) )}">Upload files to repository</a>
+ %endif
+ %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( trans.app ) )}">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( trans.app ) )}">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>
+ %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 | h}</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 ) )}">Contact repository owner</a>
+ %endif
+ %if can_reset_all_metadata:
+ <a class="action-button" href="${h.url_for( controller='repository', action='reset_all_metadata', id=trans.security.encode_id( repository.id ) )}">Reset all repository metadata</a>
+ %endif
+ %if can_deprecate:
+ <a class="action-button" href="${h.url_for( controller='repository', action='deprecate', id=trans.security.encode_id( repository.id ), mark_deprecated=True )}" confirm="Click Ok to deprecate this repository.">Mark repository as deprecated</a>
+ %endif
+ %if can_undeprecate:
+ <a class="action-button" href="${h.url_for( controller='repository', action='deprecate', id=trans.security.encode_id( repository.id ), mark_deprecated=False )}">Mark repository as not deprecated</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( trans.app ), 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=repository.tip( trans.app ), 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=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
+ %endif
+ </div>
+ %endif
+ </ul>
+</%def>
+
+<%def name="render_galaxy_repository_actions( repository=None )">
+ <br/><br/>
+ <ul class="manage-table-actions">
+ %if repository:
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Browse repository</a></li>
+ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
+ <div popupmenu="repository-${repository.id}-popup">
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a>
+ </div>
+ %else:
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a></li>
+ <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a></li>
+ %endif
+ </ul>
+</%def>
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e 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
@@ -1,23 +1,9 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
-<%
- from galaxy.web.framework.helpers import time_ago
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_upload = can_push and ( not repository.deprecated )
- can_download = not is_new and ( not is_malicious or can_push )
- can_browse_contents = not is_new
- can_rate = trans.user and repository.user != trans.user
- can_manage = is_admin or repository.user == trans.user
- can_view_change_log = not is_new
- has_readme = metadata and 'readme' in metadata
-%>
-
<%!
def inherit(context):
if context.get('use_panels'):
@@ -30,30 +16,6 @@
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "jquery.rating", "dynatree_skin/ui.dynatree" )}
- <style type="text/css">
- ul.fileBrowser,
- ul.toolFile {
- margin-left: 0;
- padding-left: 0;
- list-style: none;
- }
- ul.fileBrowser {
- margin-left: 20px;
- }
- .fileBrowser li,
- .toolFile li {
- padding-left: 20px;
- background-repeat: no-repeat;
- background-position: 0;
- min-height: 20px;
- }
- .toolFile li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white_compressed.png' )} );
- }
- .fileBrowser li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white.png' )} );
- }
- </style></%def><%def name="javascripts()">
@@ -62,35 +24,14 @@
${common_javascripts(repository)}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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=repository.tip( trans.app ) )}">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( trans.app ) )}">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 ) )}">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_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( trans.app ), 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=repository.tip( trans.app ), 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=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
- %endif
- </div>
- %endif
-</ul>
+<%
+ is_new = repository.is_new( trans.app )
+ can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
+ can_download = not is_new and ( not is_malicious or can_push )
+ can_browse_contents = not is_new
+%>
+
+${render_tool_shed_repository_actions( repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/contact_owner.mako
--- a/templates/webapps/tool_shed/repository/contact_owner.mako
+++ b/templates/webapps/tool_shed/repository/contact_owner.mako
@@ -1,23 +1,6 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
-
-<%
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_push = trans.app.security_agent.can_push( trans.app, 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_rate = repository.user != trans.user
- can_manage = is_admin or repository.user == trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- has_readme = metadata and 'readme' in metadata
-%>
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%!
def inherit(context):
@@ -28,35 +11,7 @@
%><%inherit file="${inherit(context)}"/>
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new and can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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 ) )}">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>
- %endif
- %if can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_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 | h}</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( trans.app ), 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=repository.tip( trans.app ), 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=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
- %endif
- </div>
- %endif
-</ul>
+${render_tool_shed_repository_actions( repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/find_tools.mako
--- a/templates/webapps/tool_shed/repository/find_tools.mako
+++ b/templates/webapps/tool_shed/repository/find_tools.mako
@@ -1,5 +1,6 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_galaxy_repository_actions" /><%!
def inherit(context):
@@ -11,11 +12,7 @@
<%inherit file="${inherit(context)}"/>
%if trans.webapp.name == 'galaxy':
- <br/><br/>
- <ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a></li>
- <li><a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a></li>
- </ul>
+ ${render_galaxy_repository_actions( repository=None )}
%endif
%if message:
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/find_workflows.mako
--- a/templates/webapps/tool_shed/repository/find_workflows.mako
+++ b/templates/webapps/tool_shed/repository/find_workflows.mako
@@ -1,5 +1,6 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_galaxy_repository_actions" /><%!
def inherit(context):
@@ -11,11 +12,7 @@
<%inherit file="${inherit(context)}"/>
%if trans.webapp.name == 'galaxy':
- <br/><br/>
- <ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a></li>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
- </ul>
+ ${render_galaxy_repository_actions( repository=None )}
%endif
%if message:
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e 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
@@ -2,6 +2,7 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
from galaxy.web.framework.helpers import time_ago
@@ -12,26 +13,14 @@
is_new = repository.is_new( trans.app )
is_deprecated = repository.deprecated
- can_browse_contents = not is_new
- can_contact_owner = trans.user and trans.user != repository.user
- can_deprecate = not is_new and trans.user and ( is_admin or repository.user == trans.user ) and not is_deprecated
can_push = not is_deprecated and trans.app.security_agent.can_push( trans.app, trans.user, repository )
can_download = not is_deprecated and not is_new and ( not is_malicious or can_push )
- can_rate = not is_new and not is_deprecated and trans.user and repository.user != trans.user
- can_reset_all_metadata = not is_deprecated and len( repo ) > 0
can_review_repository = has_metadata and not is_deprecated and trans.app.security_agent.user_can_review_repositories( trans.user )
can_set_metadata = not is_new and not is_deprecated
changeset_revision_is_repository_tip = changeset_revision == repository.tip( trans.app )
can_set_malicious = metadata and can_set_metadata and is_admin and changeset_revision_is_repository_tip
- can_undeprecate = trans.user and ( is_admin or repository.user == trans.user ) and is_deprecated
- can_upload = can_push
can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
-
if changeset_revision_is_repository_tip:
tip_str = 'repository tip'
sharable_link_label = 'Sharable link to this repository:'
@@ -62,57 +51,7 @@
${container_javascripts()}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new:
- %if can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a>
- %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_review_repository:
- %if reviewed_by_user:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='edit_review', id=review_id )}">Manage my review of this revision</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='create_review', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Add a review to this revision</a>
- %endif
- %endif
- %if can_browse_repository_reviews:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='manage_repository_reviews', id=trans.app.security.encode_id( repository.id ) )}">Browse reviews of this 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 ) )}">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 | h}</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 ) )}">Contact repository owner</a>
- %endif
- %if can_reset_all_metadata:
- <a class="action-button" href="${h.url_for( controller='repository', action='reset_all_metadata', id=trans.security.encode_id( repository.id ) )}">Reset all repository metadata</a>
- %endif
- %if can_deprecate:
- <a class="action-button" href="${h.url_for( controller='repository', action='deprecate', id=trans.security.encode_id( repository.id ), mark_deprecated=True )}" confirm="Click Ok to deprecate this repository.">Mark repository as deprecated</a>
- %endif
- %if can_undeprecate:
- <a class="action-button" href="${h.url_for( controller='repository', action='deprecate', id=trans.security.encode_id( repository.id ), mark_deprecated=False )}">Mark repository as not deprecated</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>
- %endif
-</ul>
+${render_tool_shed_repository_actions( repository, repo=repo, metadata=metadata, changeset_revision=changeset_revision )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/preview_tools_in_changeset.mako
--- a/templates/webapps/tool_shed/repository/preview_tools_in_changeset.mako
+++ b/templates/webapps/tool_shed/repository/preview_tools_in_changeset.mako
@@ -2,22 +2,7 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
-
-<%
- is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- 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
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- has_readme = metadata and 'readme' in metadata
-%>
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_galaxy_repository_actions" /><%!
def inherit(context):
@@ -39,16 +24,7 @@
${container_javascripts()}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li>
- <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
- <div popupmenu="repository-${repository.id}-popup">
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a>
- </div>
-</ul>
+${render_galaxy_repository_actions( repository=repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e 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
@@ -1,25 +1,13 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
from galaxy.web.framework.helpers import time_ago
- from urllib import quote_plus
- is_admin = trans.user_is_admin()
is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
can_push = trans.app.security_agent.can_push( trans.app, 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_rate = repository.user != trans.user
- can_manage = is_admin or repository.user == trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- has_readme = metadata and 'readme' in metadata
%><%!
@@ -45,38 +33,7 @@
${render_msg( message, status )}
%endif
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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=repository.tip( trans.app ) )}">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( trans.app ) )}">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 ) )}">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_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 | h}</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 ) )}">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=repository.tip( trans.app ), 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=repository.tip( trans.app ), 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=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
- %endif
- </div>
- %endif
-</ul>
+${render_tool_shed_repository_actions( repository, repo=None, metadata=None, changeset_revision=None )}
%if repository.user != trans.user:
<div class="toolForm">
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/tool_form.mako
--- a/templates/webapps/tool_shed/repository/tool_form.mako
+++ b/templates/webapps/tool_shed/repository/tool_form.mako
@@ -1,27 +1,12 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="*" /><%
from galaxy.util.expressions import ExpressionContext
from galaxy import util
from galaxy.tools.parameters.basic import DataToolParameter, ColumnListParameter, GenomeBuildParameter, SelectToolParameter
from galaxy.web.form_builder import SelectField
-
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_push = trans.app.security_agent.can_push( trans.app, 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_rate = trans.user and repository.user != trans.user
- can_manage = is_admin or repository.user == trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- has_readme = metadata and 'readme' in metadata
%><html>
@@ -119,56 +104,12 @@
</div></%def>
- <br/><br/>
- <ul class="manage-table-actions">
- %if trans.webapp.name == 'galaxy':
- <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
- <div popupmenu="repository-${repository.id}-popup">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li>
- <li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Browse repository</a></li>
- </div>
- <li><a class="action-button" id="tool_shed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
- <div popupmenu="tool_shed-${repository.id}-popup">
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a>
- </div>
- %else:
- %if is_new:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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>
- %endif
- %if can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_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_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 ) )}">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>
- %endif
- %endif
- </ul>
-
+ %if trans.webapp.name == 'galaxy':
+ ${render_galaxy_repository_actions( repository=repository )}
+ %else:
+ ${render_tool_shed_repository_actions( repository, repo=None, metadata=None, changeset_revision=None )}
+ %endif
+
%if message:
${render_msg( message, status )}
%endif
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/upload.mako
--- a/templates/webapps/tool_shed/repository/upload.mako
+++ b/templates/webapps/tool_shed/repository/upload.mako
@@ -1,14 +1,9 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
- is_admin = trans.user_is_admin()
is_new = repository.is_new( trans.app )
- can_browse_contents = not is_new
- can_browse_contents = 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
%><%!
@@ -43,23 +38,7 @@
${render_msg( message, status )}
%endif
-<br/><br/>
-<ul class="manage-table-actions">
- <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=repository.tip( trans.app ) )}">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( trans.app ) )}">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>
- %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>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository)}
<div class="toolForm"><div class="toolFormTitle">Upload a single file or a tarball</div>
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/view_changelog.mako
--- a/templates/webapps/tool_shed/repository/view_changelog.mako
+++ b/templates/webapps/tool_shed/repository/view_changelog.mako
@@ -2,23 +2,13 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="render_clone_str" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
from galaxy.web.framework.helpers import time_ago
- is_admin = trans.user_is_admin()
is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_browse_contents = not is_new
- can_manage = is_admin or trans.user == repository.user
can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = trans.user and repository.user != trans.user
- can_upload = can_push
can_download = not is_new and ( not is_malicious or can_push )
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- has_readme = metadata and 'readme' in metadata
%><%!
@@ -40,34 +30,7 @@
${h.js( "libs/jquery/jquery.rating" )}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <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 ) )}">Upload files to repository</a>
- %endif
- %if can_manage:
- <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ) )}">Manage repository</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ) )}">View repository</a>
- %endif
- %if can_rate:
- <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.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.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 ) )}">Contact repository owner</a>
- %endif
- %if can_download:
- <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), 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.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), 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.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/view_changeset.mako
--- a/templates/webapps/tool_shed/repository/view_changeset.mako
+++ b/templates/webapps/tool_shed/repository/view_changeset.mako
@@ -2,24 +2,12 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="render_clone_str" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
- from galaxy.web.framework.helpers import time_ago
- is_admin = trans.user_is_admin()
is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_browse_contents = not is_new
- can_rate = trans.user and repository.user != trans.user
- can_manage = is_admin or trans.user == repository.user
can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_view_change_log = not is_new
- can_upload = can_push
can_download = not is_new and ( not is_malicious or can_push )
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- has_readme = metadata and 'readme' in metadata
%><%!
@@ -41,37 +29,7 @@
${h.js( "libs/jquery/jquery.rating" )}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <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 ) )}">Upload files to repository</a>
- %endif
- %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( trans.app ) )}">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( trans.app ) )}">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>
- %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 ) )}">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=repository.tip( trans.app ), 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=repository.tip( trans.app ), 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=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e 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
@@ -2,34 +2,21 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="*" /><%
from galaxy.web.framework.helpers import time_ago
from tool_shed.util.shed_util_common import to_safe_string
- if metadata:
- has_readme = 'readme' in metadata
- else:
- has_readme = False
- has_metadata = repository.metadata_revisions
is_new = repository.is_new( trans.app )
is_deprecated = repository.deprecated
can_browse_contents = trans.webapp.name == 'tool_shed' and not is_new
- can_contact_owner = trans.user and trans.user != repository.user
+ can_push = not is_deprecated and trans.app.security_agent.can_push( trans.app, trans.user, repository )
can_download = not is_deprecated and not is_new and ( not is_malicious or can_push )
- can_push = not is_deprecated and trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = not is_deprecated and not is_new and trans.user and repository.user != trans.user
- can_review_repository = has_metadata and not is_deprecated and trans.app.security_agent.user_can_review_repositories( trans.user )
- can_upload = can_push
can_view_change_log = trans.webapp.name == 'tool_shed' and not is_new
changeset_revision_is_repository_tip = changeset_revision == repository.tip( trans.app )
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
-
if changeset_revision_is_repository_tip:
tip_str = 'repository tip'
sharable_link_label = 'Sharable link to this repository:'
@@ -60,58 +47,11 @@
${container_javascripts()}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- %if trans.webapp.name == 'tool_shed':
- %if is_new:
- %if can_upload:
- <li><a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a></li>
- %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_review_repository:
- %if reviewed_by_user:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='edit_review', id=review_id )}">Manage my review of this revision</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='create_review', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Add a review to this revision</a>
- %endif
- %endif
- %if can_browse_repository_reviews:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='manage_repository_reviews', id=trans.app.security.encode_id( repository.id ) )}">Browse reviews of this 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 ) )}">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 ) )}">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>
- %endif
- %else:
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li>
- <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
- <div popupmenu="repository-${repository.id}-popup">
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a>
- </div>
- %endif
-</ul>
+%if trans.webapp.name == 'tool_shed':
+ ${render_tool_shed_repository_actions( repository=repository, changeset_revision=changeset_revision )}
+%else:
+ ${render_galaxy_repository_actions( repository=repository )}
+%endif
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/view_tool_metadata.mako
--- a/templates/webapps/tool_shed/repository/view_tool_metadata.mako
+++ b/templates/webapps/tool_shed/repository/view_tool_metadata.mako
@@ -2,33 +2,14 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="*" /><%
- from galaxy.web.framework.helpers import time_ago
- from urllib import quote_plus
+ is_new = repository.is_new( trans.app )
- has_metadata = repository.metadata_revisions
- has_readme = metadata and 'readme' in metadata
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- is_deprecated = repository.deprecated
-
- can_browse_contents = trans.webapp.name == 'tool_shed' and not is_new
- can_contact_owner = trans.user and trans.user != repository.user
+ can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
can_download = not is_new and ( not is_malicious or can_push )
- can_manage = is_admin or repository.user == trans.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = repository.user != trans.user
- can_review_repository = has_metadata and not is_deprecated and trans.app.security_agent.user_can_review_repositories( trans.user )
- can_upload = can_push
can_view_change_log = trans.webapp.name == 'tool_shed' and not is_new
- # TODO: fix the following when the install and test buildbot is functional.
- #can_view_tool_test_results = tool_test_results is not None
-
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
%><%!
@@ -40,59 +21,11 @@
%><%inherit file="${inherit(context)}"/>
-<br/><br/>
-<ul class="manage-table-actions">
- %if trans.webapp.name == 'galaxy':
- <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
- <div popupmenu="repository-${repository.id}-popup">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li>
- <li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Browse repository</a></li>
- </div>
- <li><a class="action-button" id="tool_shed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
- <div popupmenu="tool_shed-${repository.id}-popup">
- <a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a>
- </div>
- %else:
- %if is_new:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_review_repository:
- %if reviewed_by_user:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='edit_review', id=review_id )}">Manage my review of this revision</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='create_review', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Add a review to this revision</a>
- %endif
- %endif
- %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>
- %endif
- %if can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_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 ) )}">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>
- %endif
- %endif
-</ul>
+%if trans.webapp.name == 'tool_shed':
+ ${render_tool_shed_repository_actions( repository=repository, changeset_revision=changeset_revision )}
+%else:
+ ${render_galaxy_repository_actions( repository=repository )}
+%endif
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository/view_workflow.mako
--- a/templates/webapps/tool_shed/repository/view_workflow.mako
+++ b/templates/webapps/tool_shed/repository/view_workflow.mako
@@ -2,27 +2,10 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
- from galaxy.web.framework.helpers import time_ago
from tool_shed.util.encoding_util import tool_shed_encode
-
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_manage = is_admin or trans.user == repository.user
- can_contact_owner = trans.user and trans.user != repository.user
- can_push = trans.app.security_agent.can_push( trans.app, 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_rate = not is_new and trans.user and repository.user != trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
-
- # <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install repository to Galaxy</a></li>
%><%!
@@ -32,6 +15,7 @@
else:
return '/base.mako'
%>
+
<%inherit file="${inherit(context)}"/><%def name="render_workflow( workflow_name, repository_metadata_id )">
@@ -39,41 +23,7 @@
<iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"></iframe></%def>
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new and can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a>
- %endif
- %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( trans.app ) )}">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( trans.app ) )}">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>
- %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 ) )}">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>
- %endif
-</ul>
+${render_tool_shed_repository_actions( repository=repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository_review/browse_review.mako
--- a/templates/webapps/tool_shed/repository_review/browse_review.mako
+++ b/templates/webapps/tool_shed/repository_review/browse_review.mako
@@ -1,12 +1,12 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
from galaxy.web.form_builder import CheckboxField
from galaxy.webapps.tool_shed.util.container_util import STRSEP
from tool_shed.util.shed_util_common import to_safe_string
- can_manage_repository = is_admin or repository.user == trans.user
%><%def name="stylesheets()">
@@ -18,17 +18,7 @@
${h.js( "libs/jquery/jquery.rating" )}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <li><a class="action-button" id="review-${review.id}-popup" class="menubutton">Review Actions</a></li>
- <div popupmenu="review-${review.id}-popup">
- %if can_manage_repository:
- <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=review.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=review.changeset_revision )}">View repository</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository, changeset_revision=review.changeset_revision )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository_review/edit_review.mako
--- a/templates/webapps/tool_shed/repository_review/edit_review.mako
+++ b/templates/webapps/tool_shed/repository_review/edit_review.mako
@@ -1,12 +1,12 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
from galaxy.web.form_builder import CheckboxField
from tool_shed.grids.util import build_approved_select_field
from galaxy.webapps.tool_shed.util.container_util import STRSEP
- can_manage_repository = is_admin or repository.user == trans.user
%><%def name="stylesheets()">
@@ -18,17 +18,7 @@
${h.js( "libs/jquery/jquery.rating" )}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <li><a class="action-button" id="review-${review.id}-popup" class="menubutton">Review Actions</a></li>
- <div popupmenu="review-${review.id}-popup">
- %if can_manage_repository:
- <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=review.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=review.changeset_revision )}">View repository</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository, changeset_revision=review.changeset_revision )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako
--- a/templates/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako
+++ b/templates/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako
@@ -2,22 +2,12 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
from tool_shed.grids.util import build_approved_select_field
from galaxy.webapps.tool_shed.util.container_util import STRSEP
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_browse_contents = not is_new
- can_contact_owner = trans.user and trans.user != repository.user
- can_manage = is_admin or repository.user == trans.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = not is_new and trans.user and repository.user != trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
+
if installable:
installable_str = 'yes'
else:
@@ -44,29 +34,7 @@
${common_javascripts(repository)}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <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>
- %endif
- %if can_view_change_log:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.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.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.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 ) )}">Contact repository owner</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository, changeset_revision=changeset_revision )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository_review/reviews_of_repository.mako
--- a/templates/webapps/tool_shed/repository_review/reviews_of_repository.mako
+++ b/templates/webapps/tool_shed/repository_review/reviews_of_repository.mako
@@ -2,26 +2,13 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_browse_contents = not is_new
- can_contact_owner = trans.user and trans.user != repository.user
- can_manage = is_admin or repository.user == trans.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = not is_new and trans.user and repository.user != trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
if mine:
title = "My reviews of repository '%s'" % repository.name
- review_revision_label = "Manage my review of this revision"
else:
title = "All reviews of repository '%s'" % repository.name
- review_revision_label = "Inspect reviews of this revision"
%><%!
@@ -39,29 +26,7 @@
${common_javascripts(repository)}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <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=repository.tip( trans.app ) )}">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( trans.app ) )}">View repository</a>
- %endif
- %if can_view_change_log:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.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.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.security.encode_id( repository.id ) )}">${browse_label | h}</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 ) )}">Contact repository owner</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository )}
%if message:
${render_msg( message, status )}
diff -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc -r fadc4b334f3e3cca07238f86d30053318215486e templates/webapps/tool_shed/repository_review/select_previous_review.mako
--- a/templates/webapps/tool_shed/repository_review/select_previous_review.mako
+++ b/templates/webapps/tool_shed/repository_review/select_previous_review.mako
@@ -2,22 +2,7 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
-
-<%
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_browse_contents = not is_new
- can_contact_owner = trans.user and trans.user != repository.user
- can_manage = is_admin or repository.user == trans.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = not is_new and trans.user and repository.user != trans.user
- can_view_change_log = not is_new
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
- can_review_repositories = trans.app.security_agent.user_can_review_repositories( trans.user )
-%>
+<%namespace file="/webapps/tool_shed/common/repository_actions_menu.mako" import="render_tool_shed_repository_actions" /><%!
def inherit(context):
@@ -38,29 +23,7 @@
${common_javascripts(repository)}
</%def>
-<br/><br/>
-<ul class="manage-table-actions">
- <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=repository.tip( trans.app ) )}">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( trans.app ) )}">View repository</a>
- %endif
- %if can_view_change_log:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.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.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.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 ) )}">Contact repository owner</a>
- %endif
- </div>
-</ul>
+${render_tool_shed_repository_actions( repository=repository )}
%if message:
${render_msg( message, status )}
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: jgoecks: Trackster: make composite track draw helper compatible with dd4b953.
by commits-noreply@bitbucket.org 01 May '13
by commits-noreply@bitbucket.org 01 May '13
01 May '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3294bcdca48f/
Changeset: 3294bcdca48f
User: jgoecks
Date: 2013-05-01 21:08:25
Summary: Trackster: make composite track draw helper compatible with dd4b953.
Affected #: 1 file
diff -r b3338ccd9c793bb44cab686645e6cdeef8976ee8 -r 3294bcdca48fad92dbc9349da0dcd5ee6721b3bc static/scripts/viz/trackster/tracks.js
--- a/static/scripts/viz/trackster/tracks.js
+++ b/static/scripts/viz/trackster/tracks.js
@@ -3349,18 +3349,26 @@
draw_helper: function(force, region, resolution, parent_element, w_scale, kwargs) {
// FIXME: this function is similar to TiledTrack.draw_helper -- can the two be merged/refactored?
+
+ // SHARED block with TiledTrack.draw_helper():
+
var track = this,
- key = this._gen_tile_cache_key(w_scale, region);
+ key = this._gen_tile_cache_key(w_scale, region),
+ is_tile = function(o) { return (o && 'track' in o); };
// Init kwargs if necessary to avoid having to check if kwargs defined.
if (!kwargs) { kwargs = {}; }
// Check tile cache, if found show existing tile in correct position
var tile = (force ? undefined : track.tile_cache.get_elt(key));
- if (tile) {
- track.show_tile(tile, parent_element, w_scale);
+ if (tile) {
+ if (is_tile(tile)) {
+ track.show_tile(tile, parent_element, w_scale);
+ }
return tile;
}
+
+ // UNIQUE block.
// Try to get drawables' data.
var all_data = [],
@@ -3447,17 +3455,20 @@
this.show_tile(tile, parent_element, w_scale);
return tile;
}
-
- // Can't draw now, so trigger another redraw when the data is ready
- var can_draw = $.Deferred(),
- track = this;
+
+ // SHARED (somewhat) block with TiledTrack.draw_helper()
+
+ // Can't draw now, so put Deferred in cache and draw tile when data is available.
+ var tile_drawn = $.Deferred();
+ track = this;
+ track.tile_cache.set_elt(key, tile_drawn);
$.when.apply($, all_data).then(function() {
- view.request_redraw(false, false, false, track);
- can_draw.resolve();
+ // Draw tile--force to clear Deferred from cache--and resolve.
+ tile = track.draw_helper(true, region, resolution, parent_element, w_scale, kwargs);
+ tile_drawn.resolve(tile);
});
- // Returned Deferred that is resolved when tile can be drawn.
- return can_draw;
+ return tile_drawn;
},
/**
@@ -3534,7 +3545,7 @@
for (var i = 0; i < tiles.length; i++) {
var tile = tiles[i];
if (tile.html_elt.find("canvas").height() !== max_height) {
- this.draw_helper(true, tile.index, tile.resolution, tile.html_elt.parent(), w_scale, { height: max_height } );
+ this.draw_helper(true, tile.region, tile.resolution, tile.html_elt.parent(), w_scale, { height: max_height } );
tile.html_elt.remove();
}
}
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: jgoecks: Visualization framework: (1) fix disappearing Y axis labels for line tracks and (2) update dataset dict to correspond with new description.
by commits-noreply@bitbucket.org 01 May '13
by commits-noreply@bitbucket.org 01 May '13
01 May '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b3338ccd9c79/
Changeset: b3338ccd9c79
User: jgoecks
Date: 2013-05-01 20:04:23
Summary: Visualization framework: (1) fix disappearing Y axis labels for line tracks and (2) update dataset dict to correspond with new description.
Affected #: 2 files
diff -r c2c22e38826b65c67202b39e2f7e789c1761c892 -r b3338ccd9c793bb44cab686645e6cdeef8976ee8 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -703,17 +703,18 @@
# -- Validate config. --
if vis.type == 'trackster':
- def unpack_track( track_json ):
+ def unpack_track( track_dict ):
""" Unpack a track from its json. """
+ dataset_dict = track_dict[ 'dataset' ]
return {
- "dataset_id": trans.security.decode_id( track_json['dataset_id'] ),
- "hda_ldda": track_json.get('hda_ldda', 'hda'),
- "name": track_json['name'],
- "track_type": track_json['track_type'],
- "prefs": track_json['prefs'],
- "mode": track_json['mode'],
- "filters": track_json['filters'],
- "tool_state": track_json['tool_state']
+ "dataset_id": trans.security.decode_id( dataset_dict['id'] ),
+ "hda_ldda": dataset_dict.get('hda_ldda', 'hda'),
+ "name": track_dict['name'],
+ "track_type": track_dict['track_type'],
+ "prefs": track_dict['prefs'],
+ "mode": track_dict['mode'],
+ "filters": track_dict['filters'],
+ "tool_state": track_dict['tool_state']
}
def unpack_collection( collection_json ):
diff -r c2c22e38826b65c67202b39e2f7e789c1761c892 -r b3338ccd9c793bb44cab686645e6cdeef8976ee8 static/scripts/viz/trackster/tracks.js
--- a/static/scripts/viz/trackster/tracks.js
+++ b/static/scripts/viz/trackster/tracks.js
@@ -2765,14 +2765,16 @@
*/
to_dict: function() {
return {
- "track_type": this.get_type(),
- "name": this.name,
- "hda_ldda": this.dataset.get('hda_ldda'),
- "dataset_id": this.dataset.id,
- "prefs": this.prefs,
- "mode": this.mode,
- "filters": this.filters_manager.to_dict(),
- "tool_state": (this.tool ? this.tool.state_dict() : {})
+ track_type: this.get_type(),
+ name: this.name,
+ dataset: {
+ id: this.dataset.id,
+ hda_ldda: this.dataset.get('hda_ldda')
+ },
+ prefs: this.prefs,
+ mode: this.mode,
+ filters: this.filters_manager.to_dict(),
+ tool_state: (this.tool ? this.tool.state_dict() : {})
};
},
/**
@@ -2943,10 +2945,13 @@
//
// If using SummaryTree tiles, show max and make it editable.
//
- this.container_div.find(".yaxislabel").remove();
var track = this,
first_tile = tiles[0];
if (first_tile instanceof SummaryTreeTile) {
+ // Remove old max.
+ this.container_div.find(".yaxislabel").remove();
+
+ // Add new max.
var max_val = (this.prefs.histogram_max ? this.prefs.histogram_max : first_tile.max_val),
max_label = $("<div/>").text(max_val).make_text_editable({
num_cols: 12,
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: Move the My invalid tools menu item in the tool shed to a grid that filters to the latest metadata revision.
by commits-noreply@bitbucket.org 01 May '13
by commits-noreply@bitbucket.org 01 May '13
01 May '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c2c22e38826b/
Changeset: c2c22e38826b
User: greg
Date: 2013-05-01 19:42:47
Summary: Move the My invalid tools menu item in the tool shed to a grid that filters to the latest metadata revision.
Affected #: 8 files
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 lib/galaxy/webapps/tool_shed/api/repositories.py
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -48,7 +48,7 @@
encoded_repository_id = trans.security.encode_id( repository.id )
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
- ordered_installable_revisions = suc.get_ordered_downloadable_changeset_revisions( repository, repo )
+ ordered_installable_revisions = suc.get_ordered_metadata_changeset_revisions( repository, repo, downloadable=True )
return ordered_installable_revisions
except Exception, e:
message = "Error in the Tool Shed repositories API in get_ordered_installable_revisions: %s" % str( e )
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 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
@@ -61,12 +61,14 @@
my_writable_repositories_grid = repository_grids.MyWritableRepositoriesGrid()
my_writable_repositories_missing_tool_test_components_grid = repository_grids.MyWritableRepositoriesMissingToolTestComponentsGrid()
my_writable_repositories_with_failing_tool_tests_grid = repository_grids.MyWritableRepositoriesWithFailingToolTestsGrid()
+ my_writable_repositories_with_invalid_tools_grid = repository_grids.MyWritableRepositoriesWithInvalidToolsGrid()
my_writable_repositories_with_no_failing_tool_tests_grid = repository_grids.MyWritableRepositoriesWithNoFailingToolTestsGrid()
repositories_by_user_grid = repository_grids.RepositoriesByUserGrid()
repositories_i_own_grid = repository_grids.RepositoriesIOwnGrid()
repositories_in_category_grid = repository_grids.RepositoriesInCategoryGrid()
repositories_missing_tool_test_components_grid = repository_grids.RepositoriesMissingToolTestComponentsGrid()
repositories_with_failing_tool_tests_grid = repository_grids.RepositoriesWithFailingToolTestsGrid()
+ repositories_with_invalid_tools_grid = repository_grids.RepositoriesWithInvalidToolsGrid()
repositories_with_no_failing_tool_tests_grid = repository_grids.RepositoriesWithNoFailingToolTestsGrid()
repository_dependencies_grid = repository_grids.RepositoryDependenciesGrid()
repository_grid = repository_grids.RepositoryGrid()
@@ -141,47 +143,6 @@
return self.deprecated_repositories_i_own_grid( trans, **kwd )
@web.expose
- def browse_invalid_tools( self, trans, **kwd ):
- params = util.Params( kwd )
- message = util.restore_text( params.get( 'message', '' ) )
- status = params.get( 'status', 'done' )
- cntrller = params.get( 'cntrller', 'repository' )
- is_admin = trans.user_is_admin()
- invalid_tools_dict = odict()
- if is_admin and cntrller == 'admin':
- for repository in trans.sa_session.query( trans.model.Repository ) \
- .filter( trans.model.Repository.table.c.deleted == False ) \
- .order_by( trans.model.Repository.table.c.name ):
- # A repository's metadata_revisions are those that ignore the value of the repository_metadata.downloadable column.
- for downloadable_revision in repository.metadata_revisions:
- metadata = downloadable_revision.metadata
- invalid_tools = metadata.get( 'invalid_tools', [] )
- for invalid_tool_config in invalid_tools:
- invalid_tools_dict[ invalid_tool_config ] = ( repository.id,
- repository.name,
- repository.user.username,
- downloadable_revision.changeset_revision )
- else:
- for repository in trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.user_id == trans.user.id ) ) \
- .order_by( trans.model.Repository.table.c.name ):
- for downloadable_revision in repository.metadata_revisions:
- metadata = downloadable_revision.metadata
- if metadata:
- invalid_tools = metadata.get( 'invalid_tools', [] )
- for invalid_tool_config in invalid_tools:
- invalid_tools_dict[ invalid_tool_config ] = ( repository.id,
- repository.name,
- repository.user.username,
- downloadable_revision.changeset_revision )
- return trans.fill_template( '/webapps/tool_shed/repository/browse_invalid_tools.mako',
- cntrller=cntrller,
- invalid_tools_dict=invalid_tools_dict,
- message=message,
- status=status )
-
- @web.expose
def browse_my_writable_repositories( self, trans, **kwd ):
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
@@ -265,6 +226,34 @@
return self.my_writable_repositories_with_failing_tool_tests_grid( trans, **kwd )
@web.expose
+ def browse_my_writable_repositories_with_invalid_tools( self, trans, **kwd ):
+ if 'operation' in kwd:
+ operation = kwd[ 'operation' ].lower()
+ if operation == "view_or_manage_repository":
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='view_or_manage_repository',
+ **kwd ) )
+ elif operation == "repositories_by_user":
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='browse_repositories_by_user',
+ **kwd ) )
+ elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]:
+ kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated'
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='deprecate',
+ **kwd ) )
+ if 'message' not in kwd:
+ message = 'This list contains repositories that match the following criteria:<br>'
+ message += '<ul>'
+ message += '<li>you are authorized to update them</li>'
+ message += '<li>the latest metadata revision contains at least 1 invalid tool</li>'
+ message += '</ul>'
+ message += 'Click the tool config file name to see why the tool is invalid.'
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = 'warning'
+ return self.my_writable_repositories_with_invalid_tools_grid( trans, **kwd )
+
+ @web.expose
def browse_my_writable_repositories_with_no_failing_tool_tests( self, trans, **kwd ):
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
@@ -492,6 +481,33 @@
return self.repositories_with_failing_tool_tests_grid( trans, **kwd )
@web.expose
+ def browse_repositories_with_invalid_tools( self, trans, **kwd ):
+ if 'operation' in kwd:
+ operation = kwd[ 'operation' ].lower()
+ if operation == "view_or_manage_repository":
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='view_or_manage_repository',
+ **kwd ) )
+ elif operation == "repositories_by_user":
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='browse_repositories_by_user',
+ **kwd ) )
+ elif operation in [ 'mark as deprecated', 'mark as not deprecated' ]:
+ kwd[ 'mark_deprecated' ] = operation == 'mark as deprecated'
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='deprecate',
+ **kwd ) )
+ if 'message' not in kwd:
+ message = 'This list contains repositories that match the following criteria:<br>'
+ message += '<ul>'
+ message += '<li>the latest metadata revision contains at least 1 invalid tool</li>'
+ message += '</ul>'
+ message += 'Click the tool config file name to see why the tool is invalid.'
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = 'warning'
+ return self.repositories_with_invalid_tools_grid( trans, **kwd )
+
+ @web.expose
def browse_repositories_with_no_failing_tool_tests( self, trans, **kwd ):
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
@@ -1976,7 +1992,7 @@
is_malicious = repository_metadata.malicious
else:
# There is no repository_metadata defined for the changeset_revision, so see if it was defined in a previous changeset in the changelog.
- previous_changeset_revision = suc.get_previous_downloadable_changeset_revision( repository, repo, changeset_revision )
+ previous_changeset_revision = suc.get_previous_metadata_changeset_revision( repository, repo, changeset_revision, downloadable=False )
if previous_changeset_revision != suc.INITIAL_CHANGELOG_HASH:
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, id, previous_changeset_revision )
if repository_metadata:
@@ -2161,7 +2177,7 @@
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
# Get the lower bound changeset revision.
- lower_bound_changeset_revision = suc.get_previous_downloadable_changeset_revision( repository, repo, changeset_revision )
+ lower_bound_changeset_revision = suc.get_previous_metadata_changeset_revision( repository, repo, changeset_revision, downloadable=True )
# Build the list of changeset revision hashes.
changeset_hashes = []
for changeset in suc.reversed_lower_upper_bounded_changelog( repo, lower_bound_changeset_revision, changeset_revision ):
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -73,48 +73,6 @@
use_paging = False
-class ValidCategoryGrid( CategoryGrid ):
-
-
- class RepositoriesColumn( grids.TextColumn ):
-
- def get_value( self, trans, grid, category ):
- if category.repositories:
- viewable_repositories = 0
- for rca in category.repositories:
- repository = rca.repository
- if not repository.deleted and not repository.deprecated and repository.downloadable_revisions:
- viewable_repositories += 1
- return viewable_repositories
- return 0
-
- title = "Categories of valid repositories"
- model_class = model.Category
- template='/webapps/tool_shed/category/valid_grid.mako'
- default_sort_key = "name"
- columns = [
- CategoryGrid.NameColumn( "Name",
- key="Category.name",
- link=( lambda item: dict( operation="valid_repositories_by_category", id=item.id ) ),
- attach_popup=False ),
- CategoryGrid.DescriptionColumn( "Description",
- key="Category.description",
- attach_popup=False ),
- # Columns that are valid for filtering but are not visible.
- RepositoriesColumn( "Valid repositories",
- model_class=model.Repository,
- attach_popup=False )
- ]
- # Override these
- default_filter = {}
- global_actions = []
- operations = []
- standard_filters = []
- num_rows_per_page = 50
- preserve_state = False
- use_paging = False
-
-
class RepositoryGrid( grids.Grid ):
@@ -248,7 +206,7 @@
NameColumn( "Name",
key="name",
link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=True ),
+ attach_popup=False ),
DescriptionColumn( "Synopsis",
key="description",
attach_popup=False ),
@@ -294,6 +252,195 @@
.outerjoin( model.Category.table )
+class EmailAlertsRepositoryGrid( RepositoryGrid ):
+ columns = [
+ RepositoryGrid.NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False ),
+ RepositoryGrid.DescriptionColumn( "Synopsis",
+ key="description",
+ attach_popup=False ),
+ RepositoryGrid.UserColumn( "Owner",
+ model_class=model.User,
+ link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ),
+ attach_popup=False,
+ key="User.username" ),
+ RepositoryGrid.EmailAlertsColumn( "Alert", attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ grids.DeletedColumn( "Deleted",
+ key="deleted",
+ visible=False,
+ filterable="advanced" )
+ ]
+ operations = []
+ global_actions = [
+ grids.GridAction( "User preferences", dict( controller='user', action='index', cntrller='repository' ) )
+ ]
+
+
+class MatchedRepositoryGrid( grids.Grid ):
+ # This grid filters out repositories that have been marked as deleted or deprecated.
+
+
+ class NameColumn( grids.TextColumn ):
+
+ def get_value( self, trans, grid, repository_metadata ):
+ return repository_metadata.repository.name
+
+
+ class DescriptionColumn( grids.TextColumn ):
+
+ def get_value( self, trans, grid, repository_metadata ):
+ return repository_metadata.repository.description
+
+
+ class RevisionColumn( grids.TextColumn ):
+
+ def get_value( self, trans, grid, repository_metadata ):
+ return repository_metadata.changeset_revision
+
+
+ class UserColumn( grids.TextColumn ):
+
+ def get_value( self, trans, grid, repository_metadata ):
+ if repository_metadata.repository.user:
+ return repository_metadata.repository.user.username
+ return 'no user'
+
+ # Grid definition
+ title = "Matching repositories"
+ model_class = model.RepositoryMetadata
+ template='/webapps/tool_shed/repository/grid.mako'
+ default_sort_key = "Repository.name"
+ columns = [
+ NameColumn( "Repository name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=True ),
+ DescriptionColumn( "Synopsis",
+ attach_popup=False ),
+ RevisionColumn( "Revision" ),
+ UserColumn( "Owner",
+ model_class=model.User,
+ attach_popup=False )
+ ]
+ operations = [ grids.GridOperation( "Install to Galaxy", allow_multiple=True ) ]
+ standard_filters = []
+ default_filter = {}
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = False
+
+ def build_initial_query( self, trans, **kwd ):
+ match_tuples = kwd.get( 'match_tuples', [] )
+ clause_list = []
+ if match_tuples:
+ for match_tuple in match_tuples:
+ repository_id, changeset_revision = match_tuple
+ clause_list.append( "%s=%d and %s='%s'" % ( model.RepositoryMetadata.table.c.repository_id,
+ int( repository_id ),
+ model.RepositoryMetadata.table.c.changeset_revision,
+ changeset_revision ) )
+ return trans.sa_session.query( model.RepositoryMetadata ) \
+ .join( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
+ model.Repository.table.c.deprecated == False ) ) \
+ .join( model.User.table ) \
+ .filter( or_( *clause_list ) ) \
+ .order_by( model.Repository.name )
+ # Return an empty query
+ return trans.sa_session.query( model.RepositoryMetadata ) \
+ .filter( model.RepositoryMetadata.id < 0 )
+
+
+class InstallMatchedRepositoryGrid( MatchedRepositoryGrid ):
+ columns = [ col for col in MatchedRepositoryGrid.columns ]
+ # Override the NameColumn
+ columns[ 0 ] = MatchedRepositoryGrid.NameColumn( "Name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False )
+
+
+class MyWritableRepositoriesGrid( RepositoryGrid ):
+ # This grid filters out repositories that have been marked as either deprecated or deleted.
+ title = 'Repositories I can change'
+ columns = [
+ RepositoryGrid.NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False ),
+ RepositoryGrid.MetadataRevisionColumn( "Metadata Revisions" ),
+ RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
+ RepositoryGrid.UserColumn( "Owner",
+ model_class=model.User,
+ link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ),
+ attach_popup=False,
+ key="User.username" )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search repository name",
+ cols_to_filter=[ columns[ 0 ] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ operations = []
+ use_paging = False
+
+ def build_initial_query( self, trans, **kwd ):
+ # TODO: improve performance by adding a db table associating users with repositories for which they have write access.
+ username = trans.user.username
+ clause_list = []
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ):
+ allow_push = repository.allow_push( trans.app )
+ if allow_push:
+ allow_push_usernames = allow_push.split( ',' )
+ if username in allow_push_usernames:
+ clause_list.append( model.Repository.table.c.id == repository.id )
+ if clause_list:
+ return trans.sa_session.query( model.Repository ) \
+ .filter( or_( *clause_list ) ) \
+ .join( model.User.table )
+ # Return an empty query.
+ return trans.sa_session.query( model.Repository ) \
+ .filter( model.Repository.table.c.id < 0 )
+
+
+class RepositoriesByUserGrid( RepositoryGrid ):
+ title = "Repositories by user"
+ columns = [
+ RepositoryGrid.NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False ),
+ RepositoryGrid.DescriptionColumn( "Synopsis",
+ key="description",
+ attach_popup=False ),
+ RepositoryGrid.MetadataRevisionColumn( "Metadata Revisions" ),
+ RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
+ RepositoryGrid.CategoryColumn( "Category",
+ model_class=model.Category,
+ key="Category.name",
+ attach_popup=False )
+ ]
+ operations = []
+ standard_filters = []
+ default_filter = dict( deleted="False" )
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = False
+
+ def build_initial_query( self, trans, **kwd ):
+ decoded_user_id = trans.security.decode_id( kwd[ 'user_id' ] )
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
+ model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.user_id == decoded_user_id ) ) \
+ .join( model.User.table ) \
+ .outerjoin( model.RepositoryCategoryAssociation.table ) \
+ .outerjoin( model.Category.table )
+
+
class RepositoriesInCategoryGrid( RepositoryGrid ):
title = "Category"
@@ -346,48 +493,13 @@
.outerjoin( model.Category.table )
-class RepositoriesByUserGrid( RepositoryGrid ):
- title = "Repositories by user"
- columns = [
- RepositoryGrid.NameColumn( "Name",
- key="name",
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=False ),
- RepositoryGrid.DescriptionColumn( "Synopsis",
- key="description",
- attach_popup=False ),
- RepositoryGrid.MetadataRevisionColumn( "Metadata Revisions" ),
- RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
- RepositoryGrid.CategoryColumn( "Category",
- model_class=model.Category,
- key="Category.name",
- attach_popup=False )
- ]
- operations = []
- standard_filters = []
- default_filter = dict( deleted="False" )
- num_rows_per_page = 50
- preserve_state = False
- use_paging = False
-
- def build_initial_query( self, trans, **kwd ):
- decoded_user_id = trans.security.decode_id( kwd[ 'user_id' ] )
- return trans.sa_session.query( model.Repository ) \
- .filter( and_( model.Repository.table.c.deleted == False,
- model.Repository.table.c.deprecated == False,
- model.Repository.table.c.user_id == decoded_user_id ) ) \
- .join( model.User.table ) \
- .outerjoin( model.RepositoryCategoryAssociation.table ) \
- .outerjoin( model.Category.table )
-
-
class RepositoriesIOwnGrid( RepositoryGrid ):
title = "Repositories I own"
columns = [
RepositoryGrid.NameColumn( "Name",
key="name",
link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=True ),
+ attach_popup=False ),
RepositoryGrid.MetadataRevisionColumn( "Metadata Revisions" ),
RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
RepositoryGrid.DeprecatedColumn( "Deprecated" )
@@ -409,110 +521,8 @@
.outerjoin( model.Category.table )
-class DeprecatedRepositoriesIOwnGrid( RepositoriesIOwnGrid ):
- title = "Deprecated repositories I own"
- columns = [
- RepositoriesIOwnGrid.NameColumn( "Name",
- key="name",
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=True ),
- RepositoriesIOwnGrid.MetadataRevisionColumn( "Metadata Revisions" ),
- RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
- RepositoriesIOwnGrid.CategoryColumn( "Category",
- model_class=model.Category,
- key="Category.name",
- attach_popup=False ),
- ]
- columns.append( grids.MulticolFilterColumn( "Search repository name",
- cols_to_filter=[ columns[0] ],
- key="free-text-search",
- visible=False,
- filterable="standard" ) )
- use_paging = False
-
- def build_initial_query( self, trans, **kwd ):
- return trans.sa_session.query( model.Repository ) \
- .filter( and_( model.Repository.table.c.deleted == False,
- model.Repository.table.c.user_id == trans.user.id,
- model.Repository.table.c.deprecated == True ) ) \
- .join( model.User.table ) \
- .outerjoin( model.RepositoryCategoryAssociation.table ) \
- .outerjoin( model.Category.table )
-
-
-class EmailAlertsRepositoryGrid( RepositoryGrid ):
- columns = [
- RepositoryGrid.NameColumn( "Name",
- key="name",
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=False ),
- RepositoryGrid.DescriptionColumn( "Synopsis",
- key="description",
- attach_popup=False ),
- RepositoryGrid.UserColumn( "Owner",
- model_class=model.User,
- link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ),
- attach_popup=False,
- key="User.username" ),
- RepositoryGrid.EmailAlertsColumn( "Alert", attach_popup=False ),
- # Columns that are valid for filtering but are not visible.
- grids.DeletedColumn( "Deleted",
- key="deleted",
- visible=False,
- filterable="advanced" )
- ]
- operations = []
- global_actions = [
- grids.GridAction( "User preferences", dict( controller='user', action='index', cntrller='repository' ) )
- ]
-
-
-class MyWritableRepositoriesGrid( RepositoryGrid ):
- # This grid filters out repositories that have been marked as either deprecated or deleted.
- title = 'Repositories I can change'
- columns = [
- RepositoryGrid.NameColumn( "Name",
- key="name",
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=True ),
- RepositoryGrid.MetadataRevisionColumn( "Metadata Revisions" ),
- RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
- RepositoryGrid.UserColumn( "Owner",
- model_class=model.User,
- link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ),
- attach_popup=False,
- key="User.username" )
- ]
- columns.append( grids.MulticolFilterColumn( "Search repository name",
- cols_to_filter=[ columns[ 0 ] ],
- key="free-text-search",
- visible=False,
- filterable="standard" ) )
- operations = []
- use_paging = False
-
- def build_initial_query( self, trans, **kwd ):
- # TODO: improve performance by adding a db table associating users with repositories for which they have write access.
- username = trans.user.username
- clause_list = []
- for repository in trans.sa_session.query( model.Repository ) \
- .filter( and_( model.Repository.table.c.deprecated == False,
- model.Repository.table.c.deleted == False ) ):
- allow_push = repository.allow_push( trans.app )
- if allow_push:
- allow_push_usernames = allow_push.split( ',' )
- if username in allow_push_usernames:
- clause_list.append( model.Repository.table.c.id == repository.id )
- if clause_list:
- return trans.sa_session.query( model.Repository ) \
- .filter( or_( *clause_list ) ) \
- .join( model.User.table )
- # Return an empty query.
- return trans.sa_session.query( model.Repository ) \
- .filter( model.Repository.table.c.id < 0 )
-
-
class RepositoriesMissingToolTestComponentsGrid( RepositoryGrid ):
+ # This grid displays only the latest installable revision of each repository.
title = "Repositories with missing tool test components"
columns = [
RepositoryGrid.NameColumn( "Name",
@@ -545,6 +555,8 @@
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.join( model.RepositoryMetadata ) \
.filter( or_( *revision_clause_list ) ) \
.join( model.User.table )
@@ -554,6 +566,7 @@
class MyWritableRepositoriesMissingToolTestComponentsGrid( RepositoriesMissingToolTestComponentsGrid ):
+ # This grid displays only the latest installable revision of each repository.
title = "Repositories I can change with missing tool test components"
columns = [ col for col in RepositoriesMissingToolTestComponentsGrid.columns ]
operations = []
@@ -576,12 +589,16 @@
# tools with missing tool test components.
revision_clause_list = []
for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.filter( or_( *user_clause_list ) ):
changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository )
if changeset_revision:
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.join( model.User.table ) \
.filter( or_( *user_clause_list ) ) \
.join( model.RepositoryMetadata ) \
@@ -591,7 +608,39 @@
.filter( model.Repository.table.c.id < 0 )
+class DeprecatedRepositoriesIOwnGrid( RepositoriesIOwnGrid ):
+ title = "Deprecated repositories I own"
+ columns = [
+ RepositoriesIOwnGrid.NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False ),
+ RepositoriesIOwnGrid.MetadataRevisionColumn( "Metadata Revisions" ),
+ RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
+ RepositoriesIOwnGrid.CategoryColumn( "Category",
+ model_class=model.Category,
+ key="Category.name",
+ attach_popup=False ),
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search repository name",
+ cols_to_filter=[ columns[0] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ use_paging = False
+
+ def build_initial_query( self, trans, **kwd ):
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
+ model.Repository.table.c.user_id == trans.user.id,
+ model.Repository.table.c.deprecated == True ) ) \
+ .join( model.User.table ) \
+ .outerjoin( model.RepositoryCategoryAssociation.table ) \
+ .outerjoin( model.Category.table )
+
+
class RepositoriesWithFailingToolTestsGrid( RepositoryGrid ):
+ # This grid displays only the latest installable revision of each repository.
title = "Repositories with failing tool tests"
columns = [
RepositoryGrid.NameColumn( "Name",
@@ -624,6 +673,8 @@
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.join( model.RepositoryMetadata ) \
.filter( or_( *revision_clause_list ) ) \
.join( model.User.table )
@@ -633,6 +684,7 @@
class MyWritableRepositoriesWithFailingToolTestsGrid( RepositoriesWithFailingToolTestsGrid ):
+ # This grid displays only the latest installable revision of each repository.
title = "Repositories I can change with failing tool tests"
columns = [ col for col in RepositoriesWithFailingToolTestsGrid.columns ]
operations = []
@@ -655,12 +707,16 @@
# tools with at least 1 failing tool test.
revision_clause_list = []
for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.filter( or_( *user_clause_list ) ):
changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_failing_tool_tests( trans, repository )
if changeset_revision:
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.join( model.User.table ) \
.filter( or_( *user_clause_list ) ) \
.join( model.RepositoryMetadata ) \
@@ -671,6 +727,7 @@
class RepositoriesWithNoFailingToolTestsGrid( RepositoryGrid ):
+ # This grid displays only the latest installable revision of each repository.
title = "Repositories with no failing tool tests"
columns = [
RepositoryGrid.NameColumn( "Name",
@@ -704,6 +761,8 @@
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.join( model.RepositoryMetadata ) \
.filter( or_( *revision_clause_list ) ) \
.join( model.User.table )
@@ -713,6 +772,7 @@
class MyWritableRepositoriesWithNoFailingToolTestsGrid( RepositoriesWithNoFailingToolTestsGrid ):
+ # This grid displays only the latest installable revision of each repository.
title = "Repositories I can change with no failing tool tests"
columns = [ col for col in RepositoriesWithNoFailingToolTestsGrid.columns ]
operations = []
@@ -735,12 +795,16 @@
# at least 1 tool, no missing tool test components, and no failing tool tests.
revision_clause_list = []
for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.filter( or_( *user_clause_list ) ):
changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_no_failing_tool_tests( trans, repository )
if changeset_revision:
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
.join( model.User.table ) \
.filter( or_( *user_clause_list ) ) \
.join( model.RepositoryMetadata ) \
@@ -750,179 +814,110 @@
.filter( model.Repository.table.c.id < 0 )
-class ValidRepositoryGrid( RepositoryGrid ):
- # This grid filters out repositories that have been marked as either deleted or deprecated.
+class RepositoriesWithInvalidToolsGrid( RepositoryGrid ):
+ # This grid displays only the latest installable revision of each repository.
- class CategoryColumn( grids.TextColumn ):
-
- def get_value( self, trans, grid, repository ):
- rval = '<ul>'
- if repository.categories:
- for rca in repository.categories:
- rval += '<li><a href="browse_repositories?operation=valid_repositories_by_category&id=%s">%s</a></li>' \
- % ( trans.security.encode_id( rca.category.id ), rca.category.name )
- else:
- rval += '<li>not set</li>'
- rval += '</ul>'
- return rval
-
-
- class RepositoryCategoryColumn( grids.GridColumn ):
-
- def filter( self, trans, user, query, column_filter ):
- """Modify query to filter by category."""
- if column_filter == "All":
- return query
- return query.filter( model.Category.name == column_filter )
-
-
- class InstallableRevisionColumn( grids.GridColumn ):
+ class InvalidToolConfigColumn( grids.GridColumn ):
def __init__( self, col_name ):
grids.GridColumn.__init__( self, col_name )
def get_value( self, trans, grid, repository ):
- """Display a SelectField whose options are the changeset_revision strings of all download-able revisions of this repository."""
- select_field = grids_util.build_changeset_revision_select_field( trans, repository, downloadable=True )
- if len( select_field.options ) > 1:
- return select_field.get_html()
- elif len( select_field.options ) == 1:
- return select_field.options[ 0 ][ 0 ]
- return ''
+ # At the time this grid is displayed we know that the received repository will have invalid tools in it's latest changeset revision
+ # that has associated metadata.
+ val = ''
+ repository_metadata = get_latest_repository_metadata_if_it_includes_invalid_tools( trans, repository )
+ metadata = repository_metadata.metadata
+ invalid_tools = metadata.get( 'invalid_tools', [] )
+ if invalid_tools:
+ for invalid_tool_config in invalid_tools:
+ href_str = '<a href="load_invalid_tool?repository_id=%s&tool_config=%s&changeset_revision=%s">%s</a>' % \
+ ( trans.security.encode_id( repository.id ), invalid_tool_config, repository_metadata.changeset_revision, invalid_tool_config )
+ val += href_str
+ val += '<br/>'
+ val = val.rstrip( '<br/>' )
+ return val
- title = "Valid repositories"
- columns = [
+ title = "Repositories with invalid tools"
+ columns = [
+ InvalidToolConfigColumn( "Tool config" ),
RepositoryGrid.NameColumn( "Name",
key="name",
- attach_popup=True ),
- RepositoryGrid.DescriptionColumn( "Synopsis",
- key="description",
- attach_popup=False ),
- InstallableRevisionColumn( "Installable Revisions" ),
- RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False ),
+ RepositoryGrid.LatestInstallableRevisionColumn( "Latest Metadata Revision" ),
RepositoryGrid.UserColumn( "Owner",
+ key="User.username",
model_class=model.User,
- attach_popup=False ),
- # Columns that are valid for filtering but are not visible.
- RepositoryCategoryColumn( "Category",
- model_class=model.Category,
- key="Category.name",
- visible=False )
+ link=( lambda item: dict( operation="repositories_by_user", id=item.id ) ),
+ attach_popup=False )
]
- columns.append( grids.MulticolFilterColumn( "Search repository name, description",
- cols_to_filter=[ columns[0], columns[1] ],
- key="free-text-search",
- visible=False,
- filterable="standard" ) )
operations = []
use_paging = False
def build_initial_query( self, trans, **kwd ):
- if 'id' in kwd:
- # The user is browsing categories of valid repositories, so filter the request by the received id, which is a category id.
+ # Filter by latest metadata revisions that contain invalid tools.
+ revision_clause_list = []
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ):
+ changeset_revision = filter_by_latest_metadata_changeset_revision_that_has_invalid_tools( trans, repository )
+ if changeset_revision:
+ revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
+ if revision_clause_list:
return trans.sa_session.query( model.Repository ) \
- .filter( and_( model.Repository.table.c.deleted == False,
- model.Repository.table.c.deprecated == False ) ) \
- .join( model.RepositoryMetadata.table ) \
- .join( model.User.table ) \
- .join( model.RepositoryCategoryAssociation.table ) \
- .join( model.Category.table ) \
- .filter( and_( model.Category.table.c.id == trans.security.decode_id( kwd[ 'id' ] ),
- model.RepositoryMetadata.table.c.downloadable == True ) )
- # The user performed a free text search on the ValidCategoryGrid.
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
+ .join( model.RepositoryMetadata ) \
+ .filter( or_( *revision_clause_list ) ) \
+ .join( model.User.table )
+ # Return an empty query.
return trans.sa_session.query( model.Repository ) \
- .filter( and_( model.Repository.table.c.deleted == False,
- model.Repository.table.c.deprecated == False ) ) \
- .join( model.RepositoryMetadata.table ) \
- .join( model.User.table ) \
- .outerjoin( model.RepositoryCategoryAssociation.table ) \
- .outerjoin( model.Category.table ) \
- .filter( model.RepositoryMetadata.table.c.downloadable == True )
+ .filter( model.Repository.table.c.id < 0 )
-class MatchedRepositoryGrid( grids.Grid ):
- # This grid filters out repositories that have been marked as deprecated.
-
-
- class NameColumn( grids.TextColumn ):
-
- def get_value( self, trans, grid, repository_metadata ):
- return repository_metadata.repository.name
-
-
- class DescriptionColumn( grids.TextColumn ):
-
- def get_value( self, trans, grid, repository_metadata ):
- return repository_metadata.repository.description
-
-
- class RevisionColumn( grids.TextColumn ):
-
- def get_value( self, trans, grid, repository_metadata ):
- return repository_metadata.changeset_revision
-
-
- class UserColumn( grids.TextColumn ):
-
- def get_value( self, trans, grid, repository_metadata ):
- if repository_metadata.repository.user:
- return repository_metadata.repository.user.username
- return 'no user'
-
- # Grid definition
- title = "Matching repositories"
- model_class = model.RepositoryMetadata
- template='/webapps/tool_shed/repository/grid.mako'
- default_sort_key = "Repository.name"
- columns = [
- NameColumn( "Repository name",
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=True ),
- DescriptionColumn( "Synopsis",
- attach_popup=False ),
- RevisionColumn( "Revision" ),
- UserColumn( "Owner",
- model_class=model.User,
- attach_popup=False )
- ]
- operations = [
- grids.GridOperation( "Install to Galaxy", allow_multiple=True )
- ]
- standard_filters = []
- default_filter = {}
- num_rows_per_page = 50
- preserve_state = False
+class MyWritableRepositoriesWithInvalidToolsGrid( RepositoriesWithInvalidToolsGrid ):
+ # This grid displays only the latest installable revision of each repository.
+ title = "Repositories I can change with invalid tools"
+ columns = [ col for col in RepositoriesWithInvalidToolsGrid.columns ]
+ operations = []
use_paging = False
def build_initial_query( self, trans, **kwd ):
- match_tuples = kwd.get( 'match_tuples', [] )
- clause_list = []
- if match_tuples:
- for match_tuple in match_tuples:
- repository_id, changeset_revision = match_tuple
- clause_list.append( "%s=%d and %s='%s'" % ( model.RepositoryMetadata.table.c.repository_id,
- int( repository_id ),
- model.RepositoryMetadata.table.c.changeset_revision,
- changeset_revision ) )
- return trans.sa_session.query( model.RepositoryMetadata ) \
- .join( model.Repository ) \
- .filter( and_( model.Repository.table.c.deleted == False,
- model.Repository.table.c.deprecated == False ) ) \
- .join( model.User.table ) \
- .filter( or_( *clause_list ) ) \
- .order_by( model.Repository.name )
- # Return an empty query
- return trans.sa_session.query( model.RepositoryMetadata ) \
- .filter( model.RepositoryMetadata.id < 0 )
-
-
-class InstallMatchedRepositoryGrid( MatchedRepositoryGrid ):
- columns = [ col for col in MatchedRepositoryGrid.columns ]
- # Override the NameColumn
- columns[ 0 ] = MatchedRepositoryGrid.NameColumn( "Name",
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=False )
+ # First get all repositories that the current user is authorized to update.
+ username = trans.user.username
+ user_clause_list = []
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ):
+ allow_push = repository.allow_push( trans.app )
+ if allow_push:
+ allow_push_usernames = allow_push.split( ',' )
+ if username in allow_push_usernames:
+ user_clause_list.append( model.Repository.table.c.id == repository.id )
+ if user_clause_list:
+ # We have the list of repositories that the current user is authorized to update, so filter further by latest metadata revisions that contain
+ # invalid tools.
+ revision_clause_list = []
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
+ .filter( or_( *user_clause_list ) ):
+ changeset_revision = filter_by_latest_metadata_changeset_revision_that_has_invalid_tools( trans, repository )
+ if changeset_revision:
+ revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
+ if revision_clause_list:
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ) \
+ .join( model.User.table ) \
+ .filter( or_( *user_clause_list ) ) \
+ .join( model.RepositoryMetadata ) \
+ .filter( or_( *revision_clause_list ) )
+ # Return an empty query.
+ return trans.sa_session.query( model.Repository ) \
+ .filter( model.Repository.table.c.id < 0 )
class RepositoryMetadataGrid( grids.Grid ):
@@ -1136,6 +1131,73 @@
.join( model.User.table )
+class DatatypesGrid( RepositoryMetadataGrid ):
+
+
+ class DatatypesColumn( grids.TextColumn ):
+
+ def get_value( self, trans, grid, repository_metadata ):
+ datatype_str = ''
+ if repository_metadata:
+ metadata = repository_metadata.metadata
+ if metadata:
+ datatype_dicts = metadata.get( 'datatypes', [] )
+ if datatype_dicts:
+ # Create tuples of the attributes we want so we can sort them by extension.
+ datatype_tups = []
+ for datatype_dict in datatype_dicts:
+ # Example: {"display_in_upload": "true", "dtype": "galaxy.datatypes.blast:BlastXml", "extension": "blastxml", "mimetype": "application/xml"}
+ extension = datatype_dict.get( 'extension', '' )
+ dtype = datatype_dict.get( 'dtype', '' )
+ mimetype = datatype_dict.get( 'mimetype', '' )
+ display_in_upload = datatype_dict.get( 'display_in_upload', False )
+ # For now we'll just display extension and dtype.
+ if extension and dtype:
+ datatype_tups.append( ( extension, dtype ) )
+ sorted_datatype_tups = sorted( datatype_tups, key=lambda datatype_tup: datatype_tup[ 0 ] )
+ num_datatype_tups = len( sorted_datatype_tups )
+ for index, datatype_tup in enumerate( sorted_datatype_tups ):
+ extension = datatype_tup[ 0 ]
+ dtype = datatype_tup[ 1 ]
+ datatype_str += '<a href="browse_datatypes?operation=view_or_manage_repository&id=%s">' % trans.security.encode_id( repository_metadata.id )
+ datatype_str += '<b>%s:</b> %s' % ( escape_html( extension ), escape_html( dtype ) )
+ datatype_str += '</a>'
+ if index < num_datatype_tups - 1:
+ datatype_str += '<br/>'
+ return datatype_str
+
+ title = "Custom datatypes in this tool shed"
+ default_sort_key = "Repository.name"
+ columns = [
+ DatatypesColumn( "Datatype extension and class",
+ attach_popup=False ),
+ RepositoryMetadataGrid.RepositoryNameColumn( "Repository name",
+ model_class=model.Repository,
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=False,
+ key="Repository.name" ),
+ RepositoryMetadataGrid.RepositoryOwnerColumn( "Owner",
+ model_class=model.User,
+ attach_popup=False,
+ key="User.username" ),
+ RepositoryMetadataGrid.ChangesetRevisionColumn( "Revision",
+ attach_popup=False )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search repository name, owner",
+ cols_to_filter=[ columns[1], columns[2] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+
+ def build_initial_query( self, trans, **kwd ):
+ return trans.sa_session.query( model.RepositoryMetadata ) \
+ .join( model.Repository ) \
+ .filter( and_( model.RepositoryMetadata.table.c.includes_datatypes == True,
+ model.Repository.table.c.deleted == False,
+ model.Repository.table.c.deprecated == False ) ) \
+ .join( model.User.table )
+
+
class ToolDependenciesGrid( RepositoryMetadataGrid ):
@@ -1275,71 +1337,137 @@
.join( model.User.table )
-class DatatypesGrid( RepositoryMetadataGrid ):
+class ValidCategoryGrid( CategoryGrid ):
- class DatatypesColumn( grids.TextColumn ):
+ class RepositoriesColumn( grids.TextColumn ):
- def get_value( self, trans, grid, repository_metadata ):
- datatype_str = ''
- if repository_metadata:
- metadata = repository_metadata.metadata
- if metadata:
- datatype_dicts = metadata.get( 'datatypes', [] )
- if datatype_dicts:
- # Create tuples of the attributes we want so we can sort them by extension.
- datatype_tups = []
- for datatype_dict in datatype_dicts:
- # Example: {"display_in_upload": "true", "dtype": "galaxy.datatypes.blast:BlastXml", "extension": "blastxml", "mimetype": "application/xml"}
- extension = datatype_dict.get( 'extension', '' )
- dtype = datatype_dict.get( 'dtype', '' )
- mimetype = datatype_dict.get( 'mimetype', '' )
- display_in_upload = datatype_dict.get( 'display_in_upload', False )
- # For now we'll just display extension and dtype.
- if extension and dtype:
- datatype_tups.append( ( extension, dtype ) )
- sorted_datatype_tups = sorted( datatype_tups, key=lambda datatype_tup: datatype_tup[ 0 ] )
- num_datatype_tups = len( sorted_datatype_tups )
- for index, datatype_tup in enumerate( sorted_datatype_tups ):
- extension = datatype_tup[ 0 ]
- dtype = datatype_tup[ 1 ]
- datatype_str += '<a href="browse_datatypes?operation=view_or_manage_repository&id=%s">' % trans.security.encode_id( repository_metadata.id )
- datatype_str += '<b>%s:</b> %s' % ( escape_html( extension ), escape_html( dtype ) )
- datatype_str += '</a>'
- if index < num_datatype_tups - 1:
- datatype_str += '<br/>'
- return datatype_str
+ def get_value( self, trans, grid, category ):
+ if category.repositories:
+ viewable_repositories = 0
+ for rca in category.repositories:
+ repository = rca.repository
+ if not repository.deleted and not repository.deprecated and repository.downloadable_revisions:
+ viewable_repositories += 1
+ return viewable_repositories
+ return 0
- title = "Custom datatypes in this tool shed"
- default_sort_key = "Repository.name"
+ title = "Categories of valid repositories"
+ model_class = model.Category
+ template='/webapps/tool_shed/category/valid_grid.mako'
+ default_sort_key = "name"
columns = [
- DatatypesColumn( "Datatype extension and class",
- attach_popup=False ),
- RepositoryMetadataGrid.RepositoryNameColumn( "Repository name",
- model_class=model.Repository,
- link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
- attach_popup=False,
- key="Repository.name" ),
- RepositoryMetadataGrid.RepositoryOwnerColumn( "Owner",
- model_class=model.User,
- attach_popup=False,
- key="User.username" ),
- RepositoryMetadataGrid.ChangesetRevisionColumn( "Revision",
- attach_popup=False )
+ CategoryGrid.NameColumn( "Name",
+ key="Category.name",
+ link=( lambda item: dict( operation="valid_repositories_by_category", id=item.id ) ),
+ attach_popup=False ),
+ CategoryGrid.DescriptionColumn( "Description",
+ key="Category.description",
+ attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ RepositoriesColumn( "Valid repositories",
+ model_class=model.Repository,
+ attach_popup=False )
]
- columns.append( grids.MulticolFilterColumn( "Search repository name, owner",
- cols_to_filter=[ columns[1], columns[2] ],
+ # Override these
+ default_filter = {}
+ global_actions = []
+ operations = []
+ standard_filters = []
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = False
+
+
+class ValidRepositoryGrid( RepositoryGrid ):
+ # This grid filters out repositories that have been marked as either deleted or deprecated.
+
+
+ class CategoryColumn( grids.TextColumn ):
+
+ def get_value( self, trans, grid, repository ):
+ rval = '<ul>'
+ if repository.categories:
+ for rca in repository.categories:
+ rval += '<li><a href="browse_repositories?operation=valid_repositories_by_category&id=%s">%s</a></li>' \
+ % ( trans.security.encode_id( rca.category.id ), rca.category.name )
+ else:
+ rval += '<li>not set</li>'
+ rval += '</ul>'
+ return rval
+
+
+ class RepositoryCategoryColumn( grids.GridColumn ):
+
+ def filter( self, trans, user, query, column_filter ):
+ """Modify query to filter by category."""
+ if column_filter == "All":
+ return query
+ return query.filter( model.Category.name == column_filter )
+
+
+ class InstallableRevisionColumn( grids.GridColumn ):
+
+ def __init__( self, col_name ):
+ grids.GridColumn.__init__( self, col_name )
+
+ def get_value( self, trans, grid, repository ):
+ """Display a SelectField whose options are the changeset_revision strings of all download-able revisions of this repository."""
+ select_field = grids_util.build_changeset_revision_select_field( trans, repository, downloadable=True )
+ if len( select_field.options ) > 1:
+ return select_field.get_html()
+ elif len( select_field.options ) == 1:
+ return select_field.options[ 0 ][ 0 ]
+ return ''
+
+ title = "Valid repositories"
+ columns = [
+ RepositoryGrid.NameColumn( "Name",
+ key="name",
+ attach_popup=False ),
+ RepositoryGrid.DescriptionColumn( "Synopsis",
+ key="description",
+ attach_popup=False ),
+ InstallableRevisionColumn( "Installable Revisions" ),
+ RepositoryGrid.ToolsFunctionallyCorrectColumn( "Tools Verified" ),
+ RepositoryGrid.UserColumn( "Owner",
+ model_class=model.User,
+ attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ RepositoryCategoryColumn( "Category",
+ model_class=model.Category,
+ key="Category.name",
+ visible=False )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search repository name, description",
+ cols_to_filter=[ columns[0], columns[1] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
+ operations = []
+ use_paging = False
def build_initial_query( self, trans, **kwd ):
- return trans.sa_session.query( model.RepositoryMetadata ) \
- .join( model.Repository ) \
- .filter( and_( model.RepositoryMetadata.table.c.includes_datatypes == True,
- model.Repository.table.c.deleted == False,
+ if 'id' in kwd:
+ # The user is browsing categories of valid repositories, so filter the request by the received id, which is a category id.
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
+ model.Repository.table.c.deprecated == False ) ) \
+ .join( model.RepositoryMetadata.table ) \
+ .join( model.User.table ) \
+ .join( model.RepositoryCategoryAssociation.table ) \
+ .join( model.Category.table ) \
+ .filter( and_( model.Category.table.c.id == trans.security.decode_id( kwd[ 'id' ] ),
+ model.RepositoryMetadata.table.c.downloadable == True ) )
+ # The user performed a free text search on the ValidCategoryGrid.
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
model.Repository.table.c.deprecated == False ) ) \
- .join( model.User.table )
+ .join( model.RepositoryMetadata.table ) \
+ .join( model.User.table ) \
+ .outerjoin( model.RepositoryCategoryAssociation.table ) \
+ .outerjoin( model.Category.table ) \
+ .filter( model.RepositoryMetadata.table.c.downloadable == True )
# ------ utility methods -------------------
@@ -1380,8 +1508,46 @@
return repository_metadata.changeset_revision
return None
+def filter_by_latest_metadata_changeset_revision_that_has_invalid_tools( trans, repository ):
+ """
+ Inspect the latest changeset revision with associated metadata for the received repository to see if it has invalid tools.
+ """
+ encoded_repository_id = trans.security.encode_id( repository.id )
+ repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ tip_ctx = str( repo.changectx( repo.changelog.tip() ) )
+ repository_metadata = get_latest_repository_metadata_if_it_includes_invalid_tools( trans, repository )
+ if repository_metadata:
+ return repository_metadata.changeset_revision
+ return None
+
+def get_latest_repository_metadata_if_it_includes_invalid_tools( trans, repository ):
+ """Return the latest repository_metadata record for the received repository that contains invalid tools if one exists."""
+ encoded_repository_id = trans.security.encode_id( repository.id )
+ repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ tip_ctx = str( repo.changectx( repo.changelog.tip() ) )
+ repository_metadata = None
+ try:
+ repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, tip_ctx )
+ if repository_metadata:
+ metadata = repository_metadata.metadata
+ if metadata and 'invalid_tools' in metadata:
+ return repository_metadata
+ return None
+ return None
+ except:
+ latest_installable_revision = suc.get_previous_metadata_changeset_revision( repository, repo, tip_ctx, downloadable=False )
+ if latest_installable_revision == suc.INITIAL_CHANGELOG_HASH:
+ return None
+ repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, latest_installable_revision )
+ if repository_metadata:
+ metadata = repository_metadata.metadata
+ if metadata and 'invalid_tools' in metadata:
+ return repository_metadata
+ return None
+ return None
+
def get_latest_installable_repository_metadata_if_it_includes_tools( trans, repository ):
- """Return the latest installable repository_metadata record for the received repository if one exists."""
+ """Return the latest installable repository_metadata record for the received repository that contains valid tools if one exists."""
encoded_repository_id = trans.security.encode_id( repository.id )
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
tip_ctx = str( repo.changectx( repo.changelog.tip() ) )
@@ -1392,7 +1558,7 @@
return repository_metadata
return None
except:
- latest_installable_revision = suc.get_previous_downloadable_changeset_revision( repository, repo, tip_ctx )
+ latest_installable_revision = suc.get_previous_metadata_changeset_revision( repository, repo, tip_ctx, downloadable=True )
if latest_installable_revision == suc.INITIAL_CHANGELOG_HASH:
return None
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, latest_installable_revision )
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -520,7 +520,7 @@
Return the installable changeset_revision in the repository changelog after the changeset to which after_changeset_revision refers. If there
isn't one, return None.
"""
- changeset_revisions = get_ordered_downloadable_changeset_revisions( repository, repo )
+ changeset_revisions = get_ordered_metadata_changeset_revisions( repository, repo, downloadable=True )
if len( changeset_revisions ) == 1:
changeset_revision = changeset_revisions[ 0 ]
if changeset_revision == after_changeset_revision:
@@ -560,10 +560,14 @@
dist_to_shed=False )
return repository
-def get_ordered_downloadable_changeset_revisions( repository, repo ):
- """Return an ordered list of changeset_revisions defined by a repository changelog."""
+def get_ordered_metadata_changeset_revisions( repository, repo, downloadable=True ):
+ """Return an ordered list of changeset_revisions that are associated with metadata where order is defined by the repository changelog."""
+ if downloadable:
+ metadata_revisions = repository.downloadable_revisions
+ else:
+ metadata_revisions = repository.metadata_revisions
changeset_tups = []
- for repository_metadata in repository.downloadable_revisions:
+ for repository_metadata in metadata_revisions:
changeset_revision = repository_metadata.changeset_revision
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
@@ -575,12 +579,12 @@
sorted_changeset_revisions = [ changeset_tup[ 1 ] for changeset_tup in sorted_changeset_tups ]
return sorted_changeset_revisions
-def get_previous_downloadable_changeset_revision( repository, repo, before_changeset_revision ):
+def get_previous_metadata_changeset_revision( repository, repo, before_changeset_revision, downloadable=True ):
"""
- Return the installable changeset_revision in the repository changelog prior to the changeset to which before_changeset_revision
- refers. If there isn't one, return the hash value of an empty repository changelog, INITIAL_CHANGELOG_HASH.
+ Return the changeset_revision in the repository changelog that has associated metadata prior to the changeset to which
+ before_changeset_revision refers. If there isn't one, return the hash value of an empty repository changelog, INITIAL_CHANGELOG_HASH.
"""
- changeset_revisions = get_ordered_downloadable_changeset_revisions( repository, repo )
+ changeset_revisions = get_ordered_metadata_changeset_revisions( repository, repo, downloadable=downloadable )
if len( changeset_revisions ) == 1:
changeset_revision = changeset_revisions[ 0 ]
if changeset_revision == before_changeset_revision:
@@ -1091,7 +1095,7 @@
"""
# To set excluded_lower_bounds_changeset_revision, calling methods should do the following, where the value of changeset_revision
# is a downloadable changeset_revision.
- # excluded_lower_bounds_changeset_revision = get_previous_downloadable_changeset_revision( repository, repo, changeset_revision )
+ # excluded_lower_bounds_changeset_revision = get_previous_metadata_changeset_revision( repository, repo, changeset_revision, downloadable=? )
if excluded_lower_bounds_changeset_revision == INITIAL_CHANGELOG_HASH:
appending_started = True
else:
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 templates/webapps/tool_shed/admin/index.mako
--- a/templates/webapps/tool_shed/admin/index.mako
+++ b/templates/webapps/tool_shed/admin/index.mako
@@ -60,58 +60,8 @@
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='admin', action='browse_repository_metadata' )}">Browse metadata</a></div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_invalid_tools', cntrller='admin' )}">Browse invalid tools</a>
- </div></div></div>
- %if can_review_repositories:
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Reviewing Repositories
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_ready_for_review' )}">Repositories ready for review</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">All repositories with no reviews</a>
- </div>
- %if trans.user.repository_reviews:
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_reviewed_by_me' )}">Repositories reviewed by me</a>
- </div>
- %endif
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_reviews' )}">All reviewed repositories</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_components' )}">Manage review components</a>
- </div>
- </div>
- </div>
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Reviewing Repositories With Tools
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionPad"></div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_missing_tool_test_components' )}">Latest revision missing tool tests</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_failing_tool_tests' )}">Latest revision failing tool tests</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_no_failing_tool_tests' )}">Latest revision all tool tests pass</a>
- </div>
- </div>
- </div>
- </div>
- %endif
<div class="toolSectionPad"></div><div class="toolSectionTitle">
Categories
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 templates/webapps/tool_shed/index.mako
--- a/templates/webapps/tool_shed/index.mako
+++ b/templates/webapps/tool_shed/index.mako
@@ -113,16 +113,16 @@
<a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories' )}">My writable repositories</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_missing_tool_test_components' )}">Latest revision missing tool tests</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_missing_tool_test_components' )}">Latest revision: missing tool tests</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_with_failing_tool_tests' )}">Latest revision failing tool tests</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_with_failing_tool_tests' )}">Latest revision: failing tool tests</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_with_no_failing_tool_tests' )}">Latest revision all tool tests pass</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_with_no_failing_tool_tests' )}">Latest revision: all tool tests pass</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_invalid_tools', cntrller='repository' )}">My invalid tools</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_my_writable_repositories_with_invalid_tools' )}">Latest revision: invalid tools</a></div><div class="toolSectionPad"></div><div class="toolSectionTitle">
@@ -164,13 +164,16 @@
<div class="toolSectionBody"><div class="toolSectionBg"><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_missing_tool_test_components' )}">Latest revision missing tool tests</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_missing_tool_test_components' )}">Latest revision: missing tool tests</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_failing_tool_tests' )}">Latest revision failing tool tests</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_failing_tool_tests' )}">Latest revision: failing tool tests</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_no_failing_tool_tests' )}">Latest revision all tool tests pass</a>
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_no_failing_tool_tests' )}">Latest revision: all tool tests pass</a>
+ </div>
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories_with_invalid_tools' )}">Latest revision: invalid tools</a></div></div></div>
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 templates/webapps/tool_shed/repository/browse_invalid_tools.mako
--- a/templates/webapps/tool_shed/repository/browse_invalid_tools.mako
+++ /dev/null
@@ -1,44 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- %if invalid_tools_dict:
- <div class="toolFormTitle">Invalid tools<i> - click the tool config file name to see why the tool is invalid</i></div>
- <div class="form-row">
- <table class="grid">
- <tr>
- <th>Tool config</th>
- <th>Repository name</th>
- <th>Repository owner</th>
- <th>Changeset revision</th>
- </tr>
- %for invalid_tool_config, repository_tup in invalid_tools_dict.items():
- <% repository_id, repository_name, repository_owner, changeset_revision = repository_tup %>
- <tr>
- <td>
- <a class="view-info" href="${h.url_for( controller='repository', action='load_invalid_tool', repository_id=trans.security.encode_id( repository_id ), tool_config=invalid_tool_config, changeset_revision=changeset_revision )}">
- ${invalid_tool_config}
- </a>
- </td>
- <td>${repository_name | h}</td>
- <td>${repository_owner | h}</td>
- <td>${changeset_revision | h}</td>
- </tr>
- %endfor
- </table>
- </div>
- </div>
- %else:
- <div class="form-row">
- %if cntrller == 'admin' and trans.user_is_admin():
- No repositories in this tool shed contain invalid tools.
- %else:
- None of your repositories contain invalid tools.
- %endif
- </div>
- %endif
-</div>
diff -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 -r c2c22e38826b65c67202b39e2f7e789c1761c892 templates/webapps/tool_shed/repository/display_tool_functional_test_results.mako
--- a/templates/webapps/tool_shed/repository/display_tool_functional_test_results.mako
+++ /dev/null
@@ -1,309 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/webapps/tool_shed/common/common.mako" import="*" />
-<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" />
-
-<%!
- def inherit(context):
- if context.get('use_panels'):
- return '/webapps/tool_shed/base_panels.mako'
- else:
- return '/base.mako'
-%>
-
-<%inherit file="${inherit(context)}"/>
-
-<%def name="render_functional_test_text( functional_test_text )">
- <%
- from tool_shed.util.shed_util_common import to_safe_string
- %>
- <style type="text/css">
- #functional_test_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style>
- <table id="functional_test_table">
- <tr><td>${ to_safe_string( functional_test_text, to_html=True ) }</td></tr>
- </table>
-</%def>
-
-<%
- from galaxy.web.framework.helpers import time_ago
-
- changeset_revision = repository_metadata.changeset_revision
- has_metadata = repository.metadata_revisions
- has_readme = metadata and 'readme' in metadata
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- is_deprecated = repository.deprecated
-
- can_browse_contents = trans.webapp.name == 'tool_shed' and not is_new
- can_contact_owner = trans.user and trans.user != repository.user
- can_download = not is_new and ( not is_malicious or can_push )
- can_manage = is_admin or repository.user == trans.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_rate = repository.user != trans.user
- can_review_repository = has_metadata and not is_deprecated and trans.app.security_agent.user_can_review_repositories( trans.user )
- can_upload = can_push
- can_view_change_log = trans.webapp.name == 'tool_shed' and not is_new
- if repository_metadata.tool_test_results:
- # The tool_test_results will contain a dictionary that includes information about the test environment even if all tests passed and the
- # repository_metadata.tools_functionally_correct column is set to True.
- tool_test_results = repository_metadata.tool_test_results
- test_environment_dict = tool_test_results.get( 'test_environment', None )
- missing_test_components = tool_test_results.get( 'missing_test_components', [] )
- failed_tests = tool_test_results.get( 'failed_tests', [] )
- passed_tests = tool_test_results.get( 'passed_tests', [] )
- else:
- tool_test_results = None
- test_environment_dict = {}
- missing_test_components = []
- failed_tests = []
- passed_tests = []
-
- if can_push:
- browse_label = 'Browse or delete repository tip files'
- else:
- browse_label = 'Browse repository tip files'
-%>
-
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_review_repository:
- %if reviewed_by_user:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='edit_review', id=review_id )}">Manage my review of this revision</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='repository_review', action='create_review', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Add a review to this revision</a>
- %endif
- %endif
- %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>
- %endif
- %if can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">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_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 ) )}">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>
- %endif
-</ul>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Repository revision</div>
- <div class="toolFormBody">
- <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>
- %else:
- ${revision_label}
- %endif
- </div>
- </div>
-</div>
-<p/>
-%if can_download:
- <div class="toolForm">
- <div class="toolFormTitle">Repository '${repository.name}'</div>
- <div class="toolFormBody">
- <div class="form-row">
- <label>Clone this repository:</label>
- ${render_clone_str( repository )}
- </div>
- </div>
- </div>
-%else:
- <b>Repository name:</b><br/>
- ${repository.name}
-%endif
-%if missing_test_components or tool_test_results or passed_tests:
- <p/>
- <div class="toolForm">
- <div class="toolFormTitle">Tool functional test results</div>
- <div class="toolFormBody">
- <div class="form-row">
- <label>Time tested:</label>
- ${time_ago( repository_metadata.time_last_tested ) | h}
- </div>
- <div class="form-row">
- <table width="100%">
- <tr bgcolor="#D8D8D8" width="100%"><td><b>Tool Shed environment</td></tr>
- </table>
- </div>
- <div class="form-row">
- <label>Tool shed version:</label>
- ${test_environment_dict.get( 'tool_shed_revision', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Tool shed database version:</label>
- ${test_environment_dict.get( 'tool_shed_database_version', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Mercurial version:</label>
- ${test_environment_dict.get( 'tool_shed_mercurial_version', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <table width="100%">
- <tr bgcolor="#D8D8D8" width="100%"><td><b>Galaxy environment</td></tr>
- </table>
- </div>
- <div class="form-row">
- <label>Galaxy version:</label>
- ${test_environment_dict.get( 'galaxy_revision', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Galaxy database version:</label>
- ${test_environment_dict.get( 'galaxy_database_version', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Architecture:</label>
- ${test_environment_dict.get( 'architecture', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Operating system:</label>
- ${test_environment_dict.get( 'system', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Python version:</label>
- ${test_environment_dict.get( 'python_version', 'unknown' ) | h}
- <div style="clear: both"></div>
- </div>
- %if failed_tests:
- <div class="form-row">
- <table width="100%">
- <tr bgcolor="#D8D8D8" width="100%"><td><b>Tests that failed</td></tr>
- </table>
- </div>
- <div class="form-row">
- <table class="grid">
- %for test_results_dict in failed_tests:
- <%
- test_id = test_results_dict.get( 'test_id', 'unknown' )
- tool_id = test_results_dict.get( 'tool_id', 'unknown' )
- tool_version = test_results_dict.get( 'tool_version', 'unknown' )
- test_status = '<font color="red">Test failed</font>'
- stderr = test_results_dict.get( 'stderr', '' )
- traceback = test_results_dict.get( 'traceback', '' )
- %>
- <tr>
- <td colspan="2" bgcolor="#FFFFCC">Tool id: <b>${tool_id}</b> version: <b>${tool_version}</b></td>
- </tr>
- <tr>
- <td><b>Test id</b></td>
- <td>${test_id}</td>
- </tr>
- <tr>
- <td><b>Status</b></td>
- <td>${test_status}</td>
- </tr>
- <tr>
- <td><b>Stderr</b></td>
- <td>${render_functional_test_text( stderr )}</td>
- </tr>
- <tr>
- <td><b>Traceback</b></td>
- <td>${render_functional_test_text( traceback )}</td>
- </tr>
- %endfor
- </table>
- <div style="clear: both"></div>
- </div>
- %endif
- %if passed_tests:
- <div class="form-row">
- <table width="100%">
- <tr bgcolor="#D8D8D8" width="100%"><td><b>Tests that passed successfully</td></tr>
- </table>
- </div>
- <div class="form-row">
- <table class="grid">
- %for test_results_dict in passed_tests:
- <%
- test_id = test_results_dict.get( 'test_id', 'unknown' )
- tool_id = test_results_dict.get( 'tool_id', 'unknown' )
- tool_version = test_results_dict.get( 'tool_version', 'unknown' )
- test_status = '<font color="green">Test passed</font>'
- %>
- <tr>
- <td colspan="2" bgcolor="#FFFFCC">Tool id: <b>${tool_id}</b> version: <b>${tool_version}</b></td>
- </tr>
- <tr>
- <td><b>Test id</b></td>
- <td>${test_id}</td>
- </tr>
- <tr>
- <td><b>Status</b></td>
- <td>${test_status}</td>
- </tr>
- %endfor
- </table>
- </div>
- %endif
- %if missing_test_components:
- <div class="form-row">
- <table width="100%">
- <tr bgcolor="#D8D8D8" width="100%"><td><b>Invalid tests</td></tr>
- </table>
- </div>
- <div class="form-row">
- <table class="grid">
- %for test_results_dict in missing_test_components:
- <%
- guid = test_results_dict.get( 'tool_guid', None )
- tool_id = test_results_dict.get( 'tool_id', None )
- tool_version = test_results_dict.get( 'tool_version', None )
- missing_components = test_results_dict.get( 'missing_components', None )
- %>
- %if tool_id or tool_version:
- <tr>
- <td colspan="2" bgcolor="#FFFFCC">Tool id: <b>${tool_id}</b> version: <b>${tool_version}</b></td>
- </tr>
- %endif
- %if missing_components:
- <tr>
- <td><b>Reason test is invalid</b></td>
- <td>${render_functional_test_text( missing_components )}</td>
- </tr>
- %endif
- %endfor
- </table>
- </div>
- %endif
- </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.
1
0
commit/galaxy-central: inithello: Update repository metadata generation to provide the file path for tool functional test output files. Update script that checks for tool functional tests and test data to use the updated metadata structure.
by commits-noreply@bitbucket.org 01 May '13
by commits-noreply@bitbucket.org 01 May '13
01 May '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4fce5cfe8be5/
Changeset: 4fce5cfe8be5
User: inithello
Date: 2013-05-01 16:23:13
Summary: Update repository metadata generation to provide the file path for tool functional test output files. Update script that checks for tool functional tests and test data to use the updated metadata structure.
Affected #: 2 files
diff -r cd6c9cc0079ce10685c04d003e735d6054a4a8c6 -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 lib/tool_shed/scripts/check_repositories_for_functional_tests.py
--- a/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
+++ b/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
@@ -387,16 +387,9 @@
missing_test_files = []
required_test_files = []
for test_dict in test_definition:
- for input_file in test_dict[ 'required_files' ]:
- if input_file not in required_test_files:
- required_test_files.append( input_file )
- for output in test_dict[ 'outputs' ]:
- fieldname, filename = output
- # In rare cases, the filename may be None. If that is the case, skip that output definition.
- if filename is None:
- continue
- if filename not in required_test_files:
- required_test_files.append( filename )
+ for required_file in test_dict[ 'required_files' ]:
+ if required_file not in required_test_files:
+ required_test_files.append( required_file )
# Make sure each specified file actually does exist in the test data path of the cloned repository.
for required_file in required_test_files:
required_file_full_path = os.path.join( test_data_path, required_file )
diff -r cd6c9cc0079ce10685c04d003e735d6054a4a8c6 -r 4fce5cfe8be5724f27a1a909dac135c3f010fe30 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -825,6 +825,8 @@
for output in ttb.outputs:
name, file_name, extra = output
outputs.append( ( name, suc.strip_path( file_name ) if file_name else None ) )
+ if file_name not in required_files and file_name is not None:
+ required_files.append( file_name )
test_dict = dict( name=ttb.name,
required_files=required_files,
inputs=inputs,
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/47ddf167c9f1/
Changeset: 47ddf167c9f1
Branch: stable
User: natefoo
Date: 2013-05-01 15:50:31
Summary: Use Galaxy's ErrorMiddleware since Paste's doesn't return start_response. Fixes downloading tarballs from the Tool Shed when use_debug = false.
Affected #: 1 file
diff -r 6ab749e3563153f714fe0699435ae9215ebe4ba2 -r 47ddf167c9f11c903a438c0979e101fe7535f061 lib/galaxy/webapps/tool_shed/buildapp.py
--- a/lib/galaxy/webapps/tool_shed/buildapp.py
+++ b/lib/galaxy/webapps/tool_shed/buildapp.py
@@ -160,8 +160,8 @@
log.debug( "Enabling 'eval exceptions' middleware" )
else:
# Not in interactive debug mode, just use the regular error middleware
- from paste.exceptions import errormiddleware
- app = errormiddleware.ErrorMiddleware( app, conf )
+ import galaxy.web.framework.middleware.error
+ app = galaxy.web.framework.middleware.error.ErrorMiddleware( app, conf )
log.debug( "Enabling 'error' middleware" )
# Transaction logging (apache access.log style)
if asbool( conf.get( 'use_translogger', True ) ):
https://bitbucket.org/galaxy/galaxy-central/commits/cd6c9cc0079c/
Changeset: cd6c9cc0079c
User: natefoo
Date: 2013-05-01 16:06:21
Summary: Merge stable.
Affected #: 2 files
diff -r 56e7a8b0823434bd1458a31da4b35cec8acf88a8 -r cd6c9cc0079ce10685c04d003e735d6054a4a8c6 lib/galaxy/webapps/tool_shed/buildapp.py
--- a/lib/galaxy/webapps/tool_shed/buildapp.py
+++ b/lib/galaxy/webapps/tool_shed/buildapp.py
@@ -161,8 +161,8 @@
log.debug( "Enabling 'eval exceptions' middleware" )
else:
# Not in interactive debug mode, just use the regular error middleware
- from paste.exceptions import errormiddleware
- app = errormiddleware.ErrorMiddleware( app, conf )
+ import galaxy.web.framework.middleware.error
+ app = galaxy.web.framework.middleware.error.ErrorMiddleware( app, conf )
log.debug( "Enabling 'error' middleware" )
# Transaction logging (apache access.log style)
if asbool( conf.get( 'use_translogger', True ) ):
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: Filter out deleted and deprecated repositories from the new tool shed lists for reviewing repositories with tool, and filter out repositories with missing tool components from the list that shows failing tool tests.
by commits-noreply@bitbucket.org 30 Apr '13
by commits-noreply@bitbucket.org 30 Apr '13
30 Apr '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56e7a8b08234/
Changeset: 56e7a8b08234
User: greg
Date: 2013-05-01 02:49:20
Summary: Filter out deleted and deprecated repositories from the new tool shed lists for reviewing repositories with tool, and filter out repositories with missing tool components from the list that shows failing tool tests.
Affected #: 1 file
diff -r 6dc37563b0b744d8b571b0075110da54fd120df4 -r 56e7a8b0823434bd1458a31da4b35cec8acf88a8 lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -537,7 +537,9 @@
def build_initial_query( self, trans, **kwd ):
# Filter by latest installable revisions that contain tools with missing tool test components.
revision_clause_list = []
- for repository in trans.sa_session.query( model.Repository ):
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ):
changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_missing_tool_test_components( trans, repository )
if changeset_revision:
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
@@ -614,7 +616,9 @@
def build_initial_query( self, trans, **kwd ):
# Filter by latest installable revisions that contain tools with at least 1 failing tool test.
revision_clause_list = []
- for repository in trans.sa_session.query( model.Repository ):
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ):
changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_failing_tool_tests( trans, repository )
if changeset_revision:
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
@@ -692,7 +696,9 @@
# We have the list of repositories that the current user is authorized to update, so filter further by latest installable revisions that contain
# tools with at least 1 failing tool test.
revision_clause_list = []
- for repository in trans.sa_session.query( model.Repository ):
+ for repository in trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deprecated == False,
+ model.Repository.table.c.deleted == False ) ):
changeset_revision = filter_by_latest_downloadable_changeset_revision_that_has_no_failing_tool_tests( trans, repository )
if changeset_revision:
revision_clause_list.append( model.RepositoryMetadata.table.c.changeset_revision == changeset_revision )
@@ -1345,7 +1351,7 @@
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
tip_ctx = str( repo.changectx( repo.changelog.tip() ) )
repository_metadata = get_latest_installable_repository_metadata_if_it_includes_tools( trans, repository )
- if repository_metadata and not repository_metadata.tools_functionally_correct:
+ if repository_metadata and not repository_metadata.missing_test_components and not repository_metadata.tools_functionally_correct:
return repository_metadata.changeset_revision
return None
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