define(["libs/toastr","mvc/tag","mvc/workflow/workflow-model"],function(a,b,c){var d=Backbone.View.extend({tagName:"tr",initialize:function(){_.bindAll(this,"render","_rowTemplate","renderTagEditor","_templateActions","removeWorkflow","copyWorkflow"),a.options.timeOut=1500},events:{"click #show-in-tool-panel":"showInToolPanel","click #delete-workflow":"removeWorkflow","click #rename-workflow":"renameWorkflow","click #copy-workflow":"copyWorkflow"},render:function(){return $(this.el).html(this._rowTemplate()),this},showInToolPanel:function(){this.model.set("show_in_tool_panel",!this.model.get("show_in_tool_panel")),this.model.save(),window.location=Galaxy.root+"workflow"},removeWorkflow:function(){var b=this.model.get("name");confirm("Are you sure you want to delete workflow '"+b+"'?")&&(this.model.destroy({success:function(){a.success("Successfully deleted workflow '"+b+"'")}}),this.remove())},renameWorkflow:function(){var b=this.model.get("name"),c=prompt("Enter a new Name for workflow '"+b+"'",b);c&&(this.model.save({name:c},{success:function(){a.success("Successfully renamed workflow '"+b+"' to '"+c+"'")}}),this.render())},copyWorkflow:function(){self=this;var b=this.model.get("name");$.getJSON(this.model.urlRoot+"/"+this.model.id+"/download",function(c){var d="Copy of "+b,e=self.model.get("owner");e!=Galaxy.user.attributes.username&&(d+=" shared by user "+e),c.name=d,self.collection.create(c,{at:0,wait:!0,success:function(){a.success("Successfully copied workflow '"+b+"' to '"+d+"'")},error:function(b,c,d){a.error(d.errorThrown)}})}).error(function(b){a.error(b.responseJSON.err_msg)})},_rowTemplate:function(){var a=this.model.get("show_in_tool_panel"),b=this.model.id,c='',d='