1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f93113b8e477/ changeset: f93113b8e477 user: jgoecks date: 2013-01-15 16:48:35 summary: Change 'clone history' to 'copy history' in user interface and associated code. affected #: 5 files diff -r ec543816a2a2b6fea98e3353e65f9e9c30d62cbe -r f93113b8e4771c31aed6dd39aba38d09e11ffb31 lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -150,7 +150,7 @@ ] operations = [ grids.GridOperation( "View", allow_multiple=False, target="_top" ), - grids.GridOperation( "Clone" ), + grids.GridOperation( "Copy" ), grids.GridOperation( "Unshare" ) ] standard_filters = [] @@ -400,13 +400,13 @@ # Display history. history = self.get_history( trans, ids[0], False) return self.display_by_username_and_slug( trans, history.user.username, history.slug ) - elif operation == "clone": + elif operation == "copy": if not ids: - message = "Select a history to clone" + message = "Select a history to copy" return self.shared_list_grid( trans, status='error', message=message, **kwargs ) - # When cloning shared histories, only copy active datasets - new_kwargs = { 'clone_choice' : 'active' } - return self.clone( trans, ids, **new_kwargs ) + # When copying shared histories, only copy active datasets + new_kwargs = { 'copy_choice' : 'active' } + return self.copy( trans, ids, **new_kwargs ) elif operation == 'unshare': if not ids: message = "Select a history to unshare" @@ -957,7 +957,7 @@ def share( self, trans, id=None, email="", **kwd ): # If a history contains both datasets that can be shared and others that cannot be shared with the desired user, # then the entire history is shared, and the protected datasets will be visible, but inaccessible ( greyed out ) - # in the cloned history + # in the copyd history params = util.Params( kwd ) user = trans.get_user() # TODO: we have too many error messages floating around in here - we need @@ -1270,15 +1270,16 @@ return trans.show_message( "<p>%s" % change_msg, refresh_frames=['history'] ) @web.expose - @web.require_login( "clone shared Galaxy history" ) - def clone( self, trans, id=None, **kwd ): - """Clone a list of histories""" + @web.require_login( "copy shared Galaxy history" ) + def copy( self, trans, id=None, **kwd ): + """Copy one or more histories""" params = util.Params( kwd ) - # If clone_choice was not specified, display form passing along id + # If copy_choice was not specified, display form passing along id # argument - clone_choice = params.get( 'clone_choice', None ) - if not clone_choice: - return trans.fill_template( "/history/clone.mako", id_argument=id ) + copy_choice = params.get( 'copy_choice', None ) + if not copy_choice: + return trans.fill_template( "/history/copy.mako", id_argument=id ) + # Extract histories for id argument, defaulting to current if id is None: histories = [ trans.history ] @@ -1296,20 +1297,20 @@ if trans.sa_session.query( trans.app.model.HistoryUserShareAssociation ) \ .filter_by( user=user, history=history ) \ .count() == 0: - return trans.show_error_message( "The history you are attempting to clone is not owned by you or shared with you. " ) + return trans.show_error_message( "The history you are attempting to copy is not owned by you or shared with you. " ) owner = False - name = "Clone of '%s'" % history.name + name = "Copy of '%s'" % history.name if not owner: name += " shared by '%s'" % history.user.email - if clone_choice == 'activatable': + if copy_choice == 'activatable': new_history = history.copy( name=name, target_user=user, activatable=True ) - elif clone_choice == 'active': + elif copy_choice == 'active': name += " (active items only)" new_history = history.copy( name=name, target_user=user ) if len( histories ) == 1: - msg = 'Clone with name "<a href="%s" target="_top">%s</a>" is now included in your previously stored histories.' % ( url_for( controller="history", action="switch_to_history", hist_id=trans.security.encode_id( new_history.id ) ) , new_history.name ) + msg = 'New history "<a href="%s" target="_top">%s</a>" has been created.' % ( url_for( controller="history", action="switch_to_history", hist_id=trans.security.encode_id( new_history.id ) ) , new_history.name ) else: - msg = '%d cloned histories are now included in your previously stored histories.' % len( histories ) + msg = 'Copied and created %d new histories.' % len( histories ) return trans.show_ok_message( msg ) @web.expose diff -r ec543816a2a2b6fea98e3353e65f9e9c30d62cbe -r f93113b8e4771c31aed6dd39aba38d09e11ffb31 templates/history/clone.mako --- a/templates/history/clone.mako +++ /dev/null @@ -1,27 +0,0 @@ -<% _=n_ %> -<%inherit file="/base.mako"/> -<%def name="title()">Clone History</%def> - -<div class="toolForm"> - <div class="toolFormTitle">Clone History</div> - <div class="toolFormBody"> - <form action="${h.url_for( controller='history', action='clone' )}" method="post" > - <div class="form-row"> - %if id_argument is not None: - <input type="hidden" name="id" value="${id_argument}"> - %endif - You can clone the history such that the clone will include all items in the original - history, or you can eliminate the original history's deleted items from the clone. - </div> - <div class="form-row"> - <input type="radio" name="clone_choice" value="activatable"> Clone all history items, including deleted items - </div> - <div class="form-row"> - <input type="radio" name="clone_choice" value="active"> Clone only items that are not deleted - </div> - <div class="form-row"> - <input type="submit" name="clone_choice_button" value="Clone"> - </div> - </form> - </div> -</div> diff -r ec543816a2a2b6fea98e3353e65f9e9c30d62cbe -r f93113b8e4771c31aed6dd39aba38d09e11ffb31 templates/history/copy.mako --- /dev/null +++ b/templates/history/copy.mako @@ -0,0 +1,27 @@ +<% _=n_ %> +<%inherit file="/base.mako"/> +<%def name="title()">Copy History</%def> + +<div class="toolForm"> + <div class="toolFormTitle">Copy History</div> + <div class="toolFormBody"> + <form action="${h.url_for( controller='history', action='copy' )}" method="post" > + <div class="form-row"> + %if id_argument is not None: + <input type="hidden" name="id" value="${id_argument}"> + %endif + You can make a copy of the history that includes all datasets in the original history or just the active + (not deleted) datasets. + </div> + <div class="form-row"> + <input type="radio" name="copy_choice" value="activatable"> Copy all datasets, including deleted ones + </div> + <div class="form-row"> + <input type="radio" name="copy_choice" value="active"> Copy only active (not deleted) datasets + </div> + <div class="form-row"> + <input type="submit" name="copy_choice_button" value="Copy"> + </div> + </form> + </div> +</div> diff -r ec543816a2a2b6fea98e3353e65f9e9c30d62cbe -r f93113b8e4771c31aed6dd39aba38d09e11ffb31 templates/history/options.mako --- a/templates/history/options.mako +++ b/templates/history/options.mako @@ -16,7 +16,7 @@ %if len( history.active_datasets ) > 0: <li><a href="${h.url_for( controller='root', action='history_new' )}">Create</a> a new empty history</li><li><a href="${h.url_for( controller='workflow', action='build_from_current_history' )}">Construct workflow</a> from current history</li> - <li><a href="${h.url_for( controller='history', action='clone', id=trans.security.encode_id( history.id ) )}">Clone</a> current history</li> + <li><a href="${h.url_for( controller='history', action='copy', id=trans.security.encode_id( history.id ) )}">Copy</a> current history</li> %endif <li><a href="${h.url_for( controller='history', action='share' )}" target="galaxy_main">Share</a> current history</div><li><a href="${h.url_for( controller='root', action='history_set_default_permissions' )}">Change default permissions</a> for current history</li> diff -r ec543816a2a2b6fea98e3353e65f9e9c30d62cbe -r f93113b8e4771c31aed6dd39aba38d09e11ffb31 templates/root/index.mako --- a/templates/root/index.mako +++ b/templates/root/index.mako @@ -22,8 +22,8 @@ "${_("Create New")}": function() { galaxy_history.location = "${h.url_for( controller='root', action='history_new' )}"; }, - "${_("Clone")}": function() { - galaxy_main.location = "${h.url_for( controller='history', action='clone')}"; + "${_("Copy History")}": function() { + galaxy_main.location = "${h.url_for( controller='history', action='copy')}"; }, "${_("Copy Datasets")}": function() { galaxy_main.location = "${h.url_for( controller='dataset', action='copy_datasets' )}"; 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.