define("mvc/toolshed/workflows-view",["exports","utils/localization","mvc/toolshed/toolshed-model","mvc/toolshed/util"],function(o,t,e,s){"use strict";function l(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(o,"__esModule",{value:!0});var a=l(t),r=l(e),i=l(s),d=Backbone.View.extend({el:"#center",defaults:[{}],initialize:function(o){var t=this;this.model=new r.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(o){var t=this,e=t.templateWorkflows,s=t.model.models;t.$el.html(e({title:(0,a.default)("Workflows Missing Tools"),workflows:s,queue:i.default.queueLength()})),$("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var o,t=this;$(".show_wf_repo").on("click",function(){var t=$(this).attr("data-toolids"),e=$(this).attr("data-shed"),s=Galaxy.root+"api/tool_shed/repository",l={tool_ids:t};$.get(s,l,function(t){o=t.repository.id;var s="repository/s/"+e.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+t.repository.id;Backbone.history.navigate(s,{trigger:!0,replace:!0})})}),$(".queue_wf_repo").on("click",function(){var t=$(this),e=t.attr("data-toolids"),s=t.attr("data-shed"),l=Galaxy.root+"api/tool_shed/repository",a={tool_ids:e};$.get(l,a,function(e){o=e.repository.id,a={tool_shed_url:s,repository_id:o},$.get(l,a,function(o){var e=Object.keys(o.repository.metadata)[0],l=o.repository.metadata[e];l.tool_shed_url=s,i.default.addToQueue(l),t.remove()})})}),$("#from_workflow").on("click",t.loadWorkflows)},reDraw:function(o){this.$el.empty(),this.initialize(o)},templateWorkflows:_.template(['
','
<%= title %>
','
Repository Queue (<%= queue %>)
',"
",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});o.default={Workflows:d}});
WorkflowsTool IDsShedNameOwnerActions
','
    ','<% _.each(workflow.get("workflows"), function(name) { %>','
  • <%= name %>
  • ',"<% }); %>","
","
','
    ','<% _.each(workflow.get("tools"), function(tool) { %>','
  • <%= tool %>
  • ',"<% }); %>","
","
<%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>','
    ','
  • ','" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
  • ',"
","