# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User jeremy goecks <jeremy.goecks@emory.edu> # Date 1287691826 14400 # Node ID 53d1fa98fa0573f84bbbd8c8264d15bfff0cb90f # Parent 9d9f0de20f4f9da28d53be38411b1ee1075201a1 Add button that enables uploading or importing a workflow to Galaxy instance. --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -1077,13 +1077,16 @@ class WorkflowController( BaseController # Create workflow. workflow = self._workflow_from_dict( trans, data, source="uploaded file" ).latest_workflow - # Provide user feedback. + # Provide user feedback and show workflow list. if workflow.has_errors: - return trans.show_warn_message( "Imported, but some steps in this workflow have validation errors" ) + trans.set_message( "Imported, but some steps in this workflow have validation errors", + type="warning" ) if workflow.has_cycles: - return trans.show_warn_message( "Imported, but this workflow contains cycles" ) + trans.set_message( "Imported, but this workflow contains cycles", + type="warning" ) else: - return trans.show_message( "Workflow '%s' imported" % workflow.name ) + trans.set_message( "Workflow '%s' imported" % workflow.name ) + return self.list( trans ) @web.json def get_datatypes( self, trans ): --- a/templates/workflow/list.mako +++ b/templates/workflow/list.mako @@ -17,12 +17,12 @@ %if message: <% try: - messagetype + status except: - messagetype = "done" + status = "done" %><p /> - <div class="${messagetype}message"> + <div class="${status}message"> ${h.to_unicode( message )} </div> %endif @@ -36,6 +36,12 @@ <span>Create new workflow</span></a></li> + <li> + <a class="action-button" href="${h.url_for( action='import_workflow' )}"> + <img src="${h.url_for('/static/images/fugue/arrow-090.png')}" /> + <span>Upload or import workflow</span> + </a> + </li></ul> %if workflows: Binary file static/images/fugue/arrow-090.png has changed --- a/lib/galaxy/web/framework/__init__.py +++ b/lib/galaxy/web/framework/__init__.py @@ -587,12 +587,14 @@ class GalaxyWebTransaction( base.Default rval = self.template_context[name] = FormData() rval.values.update( kwargs ) return rval - def set_message( self, message ): + def set_message( self, message, type=None ): """ - Convenience method for setting the 'message' element of the template - context. + Convenience method for setting the 'message' and 'message_type' + element of the template context. """ self.template_context['message'] = message + if type: + self.template_context['status'] = type def get_message( self ): """ Convenience method for getting the 'message' element of the template