');
tmpl_array.push('
');
@@ -511,11 +530,16 @@ var LibraryDatasetView = Backbone.View.extend({
tmpl_array.push('
Make private');
tmpl_array.push('');
+ tmpl_array.push('
You can share this dataset with another Galaxy user. ');
+ tmpl_array.push(' Share ');
+ tmpl_array.push('
');
+
tmpl_array.push('
Advanced permissions ');
- tmpl_array.push('
You can assign any number of roles to any of the following three dataset permissions:
');
+ tmpl_array.push('
You can assign any number of roles to any of the following three dataset permission types. However please read carefully the implications of such actions.
');
tmpl_array.push('
Access Roles ');
tmpl_array.push('
User has to have all these roles in order to see this dataset.
');
tmpl_array.push('
');
+ tmpl_array.push('
Save');
tmpl_array.push('
Modify Roles ');
tmpl_array.push('
Users with any of these roles can modify the information about this dataset.
');
tmpl_array.push('
');
@@ -532,7 +556,7 @@ var LibraryDatasetView = Backbone.View.extend({
return _.template(tmpl_array.join(''));
},
-templateBulkImportInModal : function(){
+ templateBulkImportInModal: function(){
var tmpl_array = [];
tmpl_array.push('
');
@@ -545,8 +569,22 @@ templateBulkImportInModal : function(){
tmpl_array.push(' ');
return _.template(tmpl_array.join(''));
- }
+ },
+ templateAccessSelect: function(){
+ var tmpl_array = [];
+
+ tmpl_array.push('
');
+
+ tmpl_array.push(' <% _.each(options, function(option) { %>');
+ tmpl_array.push(' <%- option.name %> ');
+ tmpl_array.push(' <% }); %>');
+
+ tmpl_array.push(' ');
+
+
+ return _.template(tmpl_array.join(''));
+ }
});
return {
diff --git a/static/scripts/mvc/library/library-folderrow-view.js b/static/scripts/mvc/library/library-folderrow-view.js
index b4bfc2553ed..58b185fe986 100644
--- a/static/scripts/mvc/library/library-folderrow-view.js
+++ b/static/scripts/mvc/library/library-folderrow-view.js
@@ -46,7 +46,7 @@ var FolderRowView = Backbone.View.extend({
},
showDatasetDetails : function(){
- this.dataset_view = new mod_library_dataset_view.LibraryDatasetView({id: this.id});
+ Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: this.id});
},
/**
diff --git a/static/scripts/mvc/library/library-foldertoolbar-view.js b/static/scripts/mvc/library/library-foldertoolbar-view.js
index 852f5df2c09..bde34ada457 100644
--- a/static/scripts/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/mvc/library/library-foldertoolbar-view.js
@@ -520,7 +520,7 @@ var FolderToolbarView = Backbone.View.extend({
tmpl_array.push('
');
// TOOLBAR
tmpl_array.push('
');
- tmpl_array.push('
');
+ tmpl_array.push('
include deleted');
tmpl_array.push('
');
tmpl_array.push('
');
tmpl_array.push('
');
diff --git a/static/scripts/mvc/library/library-librarytoolbar-view.js b/static/scripts/mvc/library/library-librarytoolbar-view.js
index 9eec6a7163d..b4cc07c3c89 100644
--- a/static/scripts/mvc/library/library-librarytoolbar-view.js
+++ b/static/scripts/mvc/library/library-librarytoolbar-view.js
@@ -118,7 +118,7 @@ var LibraryToolbarView = Backbone.View.extend({
tmpl_array.push('
');
tmpl_array.push(' <% if(admin_user === true) { %>');
tmpl_array.push('
');
- tmpl_array.push(' ');
+ tmpl_array.push(' include deleted ');
tmpl_array.push(' New Library');
tmpl_array.push('
');
tmpl_array.push(' <% } %>');
diff --git a/static/scripts/mvc/ui/ui-select.js b/static/scripts/mvc/ui/ui-select.js
index cdcfd3c241e..49c1280d3dd 100644
--- a/static/scripts/mvc/ui/ui-select.js
+++ b/static/scripts/mvc/ui/ui-select.js
@@ -17,6 +17,7 @@ var View = Backbone.View.extend(
value : null,
multiple : false,
minimumInputLength : 0,
+ // example format of initial data: "id:name,55:anotherrole@role.com,27:role@role.com"
initialData : ''
},
diff --git a/static/scripts/packed/galaxy.library.js b/static/scripts/packed/galaxy.library.js
index 2a4c9e51953..9b78908cefb 100644
--- a/static/scripts/packed/galaxy.library.js
+++ b/static/scripts/packed/galaxy.library.js
@@ -1 +1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/base-mvc","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view","mvc/library/library-foldertoolbar-view","mvc/library/library-dataset-view"],function(f,c,h,l,i,a,g,e,j,d){var m=Backbone.Router.extend({initialize:function(){this.routesHit=0;Backbone.history.on("route",function(){this.routesHit++},this)},routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/datasets/:dataset_id/permissions":"dataset_permissions","folders/:folder_id/download/:format":"download"},back:function(){if(this.routesHit>1){window.history.back()}else{this.navigate("#",{trigger:true,replace:true})}}});var k=l.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,folderToolbarView:null,folderListView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new k({id:"global-lib-prefs"});this.library_router=new m();this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView=new e.LibraryToolbarView();Galaxy.libraries.libraryListView=new g.LibraryListView()});this.library_router.on("route:folder_content",function(n){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new j.FolderToolbarView({id:n});Galaxy.libraries.folderListView=new a.FolderListView({id:n})});this.library_router.on("route:download",function(n,o){if($("#folder_list_body").find(":checked").length===0){h.info("You have to select some datasets to download");Galaxy.libraries.library_router.navigate("folders/"+n,{trigger:true,replace:true})}else{Galaxy.libraries.folderToolbarView.download(n,o);Galaxy.libraries.library_router.navigate("folders/"+n,{trigger:false,replace:true})}});this.library_router.on("route:dataset_detail",function(o,n){new d.LibraryDatasetView({id:n})});this.library_router.on("route:dataset_permissions",function(o,n){new d.LibraryDatasetView({id:n,show_permissions:true})});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/base-mvc","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view","mvc/library/library-foldertoolbar-view","mvc/library/library-dataset-view"],function(f,c,h,l,i,a,g,e,j,d){var m=Backbone.Router.extend({initialize:function(){this.routesHit=0;Backbone.history.on("route",function(){this.routesHit++},this)},routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/datasets/:dataset_id/permissions":"dataset_permissions","folders/:folder_id/download/:format":"download"},back:function(){if(this.routesHit>1){window.history.back()}else{this.navigate("#",{trigger:true,replace:true})}}});var k=l.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,folderToolbarView:null,folderListView:null,datasetView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new k({id:"global-lib-prefs"});this.library_router=new m();this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView=new e.LibraryToolbarView();Galaxy.libraries.libraryListView=new g.LibraryListView()});this.library_router.on("route:folder_content",function(n){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new j.FolderToolbarView({id:n});Galaxy.libraries.folderListView=new a.FolderListView({id:n})});this.library_router.on("route:download",function(n,o){if($("#folder_list_body").find(":checked").length===0){h.info("You have to select some datasets to download");Galaxy.libraries.library_router.navigate("folders/"+n,{trigger:true,replace:true})}else{Galaxy.libraries.folderToolbarView.download(n,o);Galaxy.libraries.library_router.navigate("folders/"+n,{trigger:false,replace:true})}});this.library_router.on("route:dataset_detail",function(o,n){if(Galaxy.libraries.datasetView){Galaxy.libraries.datasetView.$el.unbind("click")}Galaxy.libraries.datasetView=new d.LibraryDatasetView({id:n})});this.library_router.on("route:dataset_permissions",function(o,n){if(Galaxy.libraries.datasetView){Galaxy.libraries.datasetView.$el.unbind("click")}Galaxy.libraries.datasetView=new d.LibraryDatasetView({id:n,show_permissions:true})});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}});
\ No newline at end of file
diff --git a/static/scripts/packed/mvc/library/library-dataset-view.js b/static/scripts/packed/mvc/library/library-dataset-view.js
index 0c33b935bf9..81daf19991d 100644
--- a/static/scripts/packed/mvc/library/library-dataset-view.js
+++ b/static/scripts/packed/mvc/library/library-dataset-view.js
@@ -1 +1 @@
-define(["libs/toastr","mvc/library/library-model","mvc/ui/ui-select"],function(d,c,b){var a=Backbone.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_modify_dataset":"enableModification","click .toolbtn_cancel_modifications":"render","click .toolbtn_change_permissions":"showPermissions","click .toolbtn-download-dataset":"downloadDataset","click .toolbtn-import-dataset":"importIntoHistory","click .toolbtn-share-dataset":"shareDataset"},initialize:function(e){this.options=_.extend(this.options,e);if(this.options.id){this.fetchDataset()}},fetchDataset:function(e){this.options=_.extend(this.options,e);this.model=new c.Item({id:this.options.id});var f=this;this.model.fetch({success:function(){if(f.options.show_permissions){f.showPermissions()}else{f.render()}},error:function(h,g){if(typeof g.responseJSON!=="undefined"){d.error(g.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}else{d.error("An error ocurred :(. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}}})},render:function(e){$(".tooltip").remove();this.options=_.extend(this.options,e);var f=this.templateDataset();this.$el.html(f({item:this.model}));$(".peek").html(this.model.get("peek"));$("#center [data-toggle]").tooltip()},enableModification:function(){$(".tooltip").remove();var e=this.templateModifyDataset();this.$el.html(e({item:this.model}));$(".peek").html(this.model.get("peek"));$("#center [data-toggle]").tooltip()},downloadDataset:function(){var e="/api/libraries/datasets/download/uncompressed";var f={ldda_ids:this.id};this.processDownload(e,f)},processDownload:function(f,g,h){if(f&&g){g=typeof g=="string"?g:$.param(g);var e="";$.each(g.split("&"),function(){var i=this.split("=");e+='
'});$('
").appendTo("body").submit().remove();d.info("Your download will begin soon")}},importIntoHistory:function(){this.refreshUserHistoriesList(function(e){var f=e.templateBulkImportInModal();e.modal=Galaxy.modal;e.modal.show({closing_events:true,title:"Import into History",body:f({histories:e.histories.models}),buttons:{Import:function(){e.importCurrentIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})},refreshUserHistoriesList:function(f){var e=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){f(e)},error:function(h,g){if(typeof g.responseJSON!=="undefined"){d.error(g.responseJSON.err_msg)}else{d.error("An error ocurred :(")}}})},importCurrentIntoHistory:function(){var f=this;var g=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();var h=new c.HistoryItem();h.url=h.urlRoot+g+"/contents";var e="/api/histories/"+g+"/set_as_current";$.ajax({url:e,type:"PUT"});h.save({content:this.id,source:"library"},{success:function(){Galaxy.modal.hide();d.success("Dataset imported. Click this to start analysing it.","",{onclick:function(){window.location="/"}})},error:function(j,i){if(typeof i.responseJSON!=="undefined"){d.error("Dataset not imported. "+i.responseJSON.err_msg)}else{d.error("An error occured! Dataset not imported. Please try again.")}}})},shareDataset:function(){d.info("Feature coming soon.")},showPermissions:function(){$(".tooltip").remove();var g=this.templateDatasetPermissions();this.$el.html(g({item:this.model}));var e=this;this.access_perm=new b.View({css:"access_perm",multiple:true,placeholder:"Click to select a role",container:e.$el.find("#access_perm"),ajax:{url:"/api/libraries/datasets/5969b1f7201f12ae/permissions",dataType:"json",quietMillis:100,data:function(i,j){return{q:i,page_limit:10,page:j}},results:function(k,j){var i=(j*10)
');e.push(' ');e.push(' Download ');e.push(' to History ');e.push(' Modify ');e.push(' Permissions ');e.push(' Share ');e.push("
");e.push('');e.push(' Libraries ');e.push(' <% _.each(item.get("full_path"), function(path_item) { %>');e.push(" <% if (path_item[0] != item.id) { %>");e.push(' <%- path_item[1] %> ');e.push("<% } else { %>");e.push(' <%- path_item[1] %> ');e.push(" <% } %>");e.push(" <% }); %>");e.push(" ");e.push('');e.push('
');e.push(" ");e.push(' ">Name ');e.push(' <%= _.escape(item.get("name")) %> ');e.push(" ");e.push(' <% if (item.get("data_type")) { %>');e.push(" ");e.push(' Data type ');e.push(' <%= _.escape(item.get("data_type")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("genome_build")) { %>');e.push(" ");e.push(' Genome build ');e.push(' <%= _.escape(item.get("genome_build")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("file_size")) { %>');e.push(" ");e.push(' Size ');e.push(' <%= _.escape(item.get("file_size")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("date_uploaded")) { %>');e.push(" ");e.push(' Date uploaded (UTC) ');e.push(' <%= _.escape(item.get("date_uploaded")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("uploaded_by")) { %>');e.push(" ");e.push(' Uploaded by ');e.push(' <%= _.escape(item.get("uploaded_by")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_data_lines")) { %>');e.push(" ");e.push(' Data Lines ');e.push(' <%= _.escape(item.get("metadata_data_lines")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_comment_lines")) { %>');e.push(" ");e.push(' Comment Lines ');e.push(' <%= _.escape(item.get("metadata_comment_lines")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_columns")) { %>');e.push(" ");e.push(' Number of Columns ');e.push(' <%= _.escape(item.get("metadata_columns")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_column_types")) { %>');e.push(" ");e.push(' Column Types ');e.push(' <%= _.escape(item.get("metadata_column_types")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("message")) { %>');e.push(" ");e.push(' Message ');e.push(' <%= _.escape(item.get("message")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("misc_blurb")) { %>');e.push(" ");e.push(' Miscellaneous blurb ');e.push(' <%= _.escape(item.get("misc_blurb")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("misc_info")) { %>');e.push(" ");e.push(' Miscellaneous information ');e.push(' <%= _.escape(item.get("misc_info")) %> ');e.push(" ");e.push(" <% } %>");e.push("
");e.push("
");e.push('
');e.push(" ");e.push("
");e.push("
");e.push(" ");return _.template(e.join(""))},templateModifyDataset:function(){var e=[];e.push('
');e.push('
');e.push(' Cancel ');e.push(' Save ');e.push("
");e.push('
');e.push(' Libraries ');e.push(' <% _.each(item.get("full_path"), function(path_item) { %>');e.push(" <% if (path_item[0] != item.id) { %>");e.push(' <%- path_item[1] %> ');e.push("<% } else { %>");e.push(' <%- path_item[1] %> ');e.push(" <% } %>");e.push(" <% }); %>");e.push(" ");e.push('
');e.push('
For more editing options please import the dataset to history and use "Edit attributes" on it.
');e.push('
");e.push("
");e.push('
');e.push(" ");e.push("
");e.push("
");e.push("
");return _.template(e.join(""))},templateDatasetPermissions:function(){var e=[];e.push('
');e.push('
');e.push(' Cancel ');e.push(' Save ');e.push("
");e.push('
');e.push(' Libraries ');e.push(' <% _.each(item.get("full_path"), function(path_item) { %>');e.push(" <% if (path_item[0] != item.id) { %>");e.push(' <%- path_item[1] %> ');e.push("<% } else { %>");e.push(' <%- path_item[1] %> ');e.push(" <% } %>");e.push(" <% }); %>");e.push(" ");e.push('
<%= _.escape(item.get("name")) %> ');e.push('
You have rights to change permissions on this dataset. That means you can control who can access it, who can modify it and also appoint others that can manage permissions on it.
');e.push('
');e.push("
Basic permissions ");e.push("
You can remove all access restrictions on this dataset. ");e.push(' Remove restrictions ');e.push("
");e.push("
You can make this dataset private to you. ");e.push(' Make private ');e.push("
");e.push("
Advanced permissions ");e.push("
You can assign any number of roles to any of the following three dataset permissions:
");e.push("
Access Roles ");e.push('
User has to have all these roles in order to see this dataset.
');e.push('
');e.push("
Modify Roles ");e.push('
Users with any of these roles can modify the information about this dataset.
');e.push('
');e.push("
Manage Roles ");e.push('
Users with any of these roles can change permissions of this dataset.
');e.push('
');e.push("
");e.push("
");return _.template(e.join(""))},templateBulkImportInModal:function(){var e=[];e.push('
');e.push("Select history: ");e.push(' ');e.push(" <% _.each(histories, function(history) { %>");e.push(' "><%= _.escape(history.get("name")) %> ');e.push(" <% }); %>");e.push(" ");e.push(" ");return _.template(e.join(""))}});return{LibraryDatasetView:a}});
\ No newline at end of file
+define(["libs/toastr","mvc/library/library-model","mvc/ui/ui-select"],function(d,c,b){var a=Backbone.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_modify_dataset":"enableModification","click .toolbtn_cancel_modifications":"render","click .toolbtn-download-dataset":"downloadDataset","click .toolbtn-import-dataset":"importIntoHistory","click .toolbtn-share-dataset":"shareDataset","click .toolbtn_save_modifications":"comingSoon","click .btn-remove-restrictions":"comingSoon","click .btn-make-private":"comingSoon","click .btn-share-dataset":"comingSoon"},initialize:function(e){this.options=_.extend(this.options,e);if(this.options.id){this.fetchDataset()}},fetchDataset:function(e){this.options=_.extend(this.options,e);this.model=new c.Item({id:this.options.id});var f=this;this.model.fetch({success:function(){if(f.options.show_permissions){f.showPermissions()}else{f.render()}},error:function(h,g){if(typeof g.responseJSON!=="undefined"){d.error(g.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}else{d.error("An error ocurred :(. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}}})},render:function(e){$(".tooltip").remove();this.options=_.extend(this.options,e);var f=this.templateDataset();this.$el.html(f({item:this.model}));$(".peek").html(this.model.get("peek"));$("#center [data-toggle]").tooltip()},enableModification:function(){$(".tooltip").remove();var e=this.templateModifyDataset();this.$el.html(e({item:this.model}));$(".peek").html(this.model.get("peek"));$("#center [data-toggle]").tooltip()},downloadDataset:function(){var e="/api/libraries/datasets/download/uncompressed";var f={ldda_ids:this.id};this.processDownload(e,f)},processDownload:function(f,g,h){if(f&&g){g=typeof g=="string"?g:$.param(g);var e="";$.each(g.split("&"),function(){var i=this.split("=");e+='
'});$('
").appendTo("body").submit().remove();d.info("Your download will begin soon")}},importIntoHistory:function(){this.refreshUserHistoriesList(function(e){var f=e.templateBulkImportInModal();e.modal=Galaxy.modal;e.modal.show({closing_events:true,title:"Import into History",body:f({histories:e.histories.models}),buttons:{Import:function(){e.importCurrentIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})},refreshUserHistoriesList:function(f){var e=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){f(e)},error:function(h,g){if(typeof g.responseJSON!=="undefined"){d.error(g.responseJSON.err_msg)}else{d.error("An error ocurred :(")}}})},importCurrentIntoHistory:function(){var f=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();var g=new c.HistoryItem();g.url=g.urlRoot+f+"/contents";var e="/api/histories/"+f+"/set_as_current";$.ajax({url:e,type:"PUT"});g.save({content:this.id,source:"library"},{success:function(){Galaxy.modal.hide();d.success("Dataset imported. Click this to start analysing it.","",{onclick:function(){window.location="/"}})},error:function(i,h){if(typeof h.responseJSON!=="undefined"){d.error("Dataset not imported. "+h.responseJSON.err_msg)}else{d.error("An error occured! Dataset not imported. Please try again.")}}})},shareDataset:function(){d.info("Feature coming soon.")},goBack:function(){Galaxy.libraries.library_router.back()},showPermissions:function(){$(".tooltip").remove();var f=this.templateDatasetPermissions();this.$el.html(f({item:this.model}));var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}var e=this;$.get("/api/libraries/datasets/"+e.id+"/permissions/current").done(function(j){var k=[];for(var m=0;m
');e.push(' ");e.push('');e.push(' Libraries ');e.push(' <% _.each(item.get("full_path"), function(path_item) { %>');e.push(" <% if (path_item[0] != item.id) { %>");e.push(' <%- path_item[1] %> ');e.push("<% } else { %>");e.push(' <%- path_item[1] %> ');e.push(" <% } %>");e.push(" <% }); %>");e.push(" ");e.push('');e.push('
');e.push(" ");e.push(' ">Name ');e.push(' <%= _.escape(item.get("name")) %> ');e.push(" ");e.push(' <% if (item.get("data_type")) { %>');e.push(" ");e.push(' Data type ');e.push(' <%= _.escape(item.get("data_type")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("genome_build")) { %>');e.push(" ");e.push(' Genome build ');e.push(' <%= _.escape(item.get("genome_build")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("file_size")) { %>');e.push(" ");e.push(' Size ');e.push(' <%= _.escape(item.get("file_size")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("date_uploaded")) { %>');e.push(" ");e.push(' Date uploaded (UTC) ');e.push(' <%= _.escape(item.get("date_uploaded")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("uploaded_by")) { %>');e.push(" ");e.push(' Uploaded by ');e.push(' <%= _.escape(item.get("uploaded_by")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_data_lines")) { %>');e.push(" ");e.push(' Data Lines ');e.push(' <%= _.escape(item.get("metadata_data_lines")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_comment_lines")) { %>');e.push(" ");e.push(' Comment Lines ');e.push(' <%= _.escape(item.get("metadata_comment_lines")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_columns")) { %>');e.push(" ");e.push(' Number of Columns ');e.push(' <%= _.escape(item.get("metadata_columns")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("metadata_column_types")) { %>');e.push(" ");e.push(' Column Types ');e.push(' <%= _.escape(item.get("metadata_column_types")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("message")) { %>');e.push(" ");e.push(' Message ');e.push(' <%= _.escape(item.get("message")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("misc_blurb")) { %>');e.push(" ");e.push(' Miscellaneous blurb ');e.push(' <%= _.escape(item.get("misc_blurb")) %> ');e.push(" ");e.push(" <% } %>");e.push(' <% if (item.get("misc_info")) { %>');e.push(" ");e.push(' Miscellaneous information ');e.push(' <%= _.escape(item.get("misc_info")) %> ');e.push(" ");e.push(" <% } %>");e.push("
");e.push("
");e.push('
');e.push(" ");e.push("
");e.push("
");e.push(" ");return _.template(e.join(""))},templateModifyDataset:function(){var e=[];e.push('
');e.push('
');e.push(' Cancel ');e.push(' Save ');e.push("
");e.push('
');e.push(' Libraries ');e.push(' <% _.each(item.get("full_path"), function(path_item) { %>');e.push(" <% if (path_item[0] != item.id) { %>");e.push(' <%- path_item[1] %> ');e.push("<% } else { %>");e.push(' <%- path_item[1] %> ');e.push(" <% } %>");e.push(" <% }); %>");e.push(" ");e.push('
');e.push('
For more editing options please import the dataset to history and use "Edit attributes" on it.
');e.push('
");e.push("
");e.push('
');e.push(" ");e.push("
");e.push("
");e.push("
");return _.template(e.join(""))},templateDatasetPermissions:function(){var e=[];e.push('
');e.push('
");e.push('
');e.push(' Libraries ');e.push(' <% _.each(item.get("full_path"), function(path_item) { %>');e.push(" <% if (path_item[0] != item.id) { %>");e.push(' <%- path_item[1] %> ');e.push("<% } else { %>");e.push(' <%- path_item[1] %> ');e.push(" <% } %>");e.push(" <% }); %>");e.push(" ");e.push('
<%= _.escape(item.get("name")) %> ');e.push('
You have rights to change permissions on this dataset. That means you can control who can access it, who can modify it and also appoint others that can manage permissions on it.
');e.push('
');e.push("
Basic permissions ");e.push("
You can remove all access restrictions on this dataset. ");e.push(' Remove restrictions ');e.push("
");e.push("
You can make this dataset private to you. ");e.push(' Make private ');e.push("
");e.push("
You can share this dataset with another Galaxy user. ");e.push(' Share ');e.push("
");e.push("
Advanced permissions ");e.push("
You can assign any number of roles to any of the following three dataset permission types. However please read carefully the implications of such actions.
");e.push("
Access Roles ");e.push('
User has to have all these roles in order to see this dataset.
');e.push('
');e.push('
Save');e.push("
Modify Roles ");e.push('
Users with any of these roles can modify the information about this dataset.
');e.push('
');e.push("
Manage Roles ");e.push('
Users with any of these roles can change permissions of this dataset.
');e.push('
');e.push("
");e.push("
");return _.template(e.join(""))},templateBulkImportInModal:function(){var e=[];e.push('
');e.push("Select history: ");e.push(' ');e.push(" <% _.each(histories, function(history) { %>");e.push(' "><%= _.escape(history.get("name")) %> ');e.push(" <% }); %>");e.push(" ");e.push(" ");return _.template(e.join(""))},templateAccessSelect:function(){var e=[];e.push('
');e.push(" <% _.each(options, function(option) { %>");e.push(' <%- option.name %> ');e.push(" <% }); %>");e.push(" ");return _.template(e.join(""))}});return{LibraryDatasetView:a}});
\ No newline at end of file
diff --git a/static/scripts/packed/mvc/library/library-folderrow-view.js b/static/scripts/packed/mvc/library/library-folderrow-view.js
index dd6a65d53a1..d5926b55cec 100644
--- a/static/scripts/packed/mvc/library/library-folderrow-view.js
+++ b/static/scripts/packed/mvc/library/library-folderrow-view.js
@@ -1 +1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-dataset-view"],function(c,e,f,d,b){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .undelete_dataset_btn":"undelete_dataset"},options:{type:null},initialize:function(g){this.render(g)},render:function(g){var h=null;if(g.get("type")==="folder"){this.options.type="folder";h=this.templateRowFolder()}else{this.options.type="file";if(g.get("deleted")){h=this.templateRowDeletedFile()}else{h=this.templateRowFile()}}this.setElement(h({content_item:g}));this.$el.show();return this},showDatasetDetails:function(){this.dataset_view=new b.LibraryDatasetView({id:this.id})},undelete_dataset:function(i){$(".tooltip").hide();var h=this;var g=$(i.target).closest("tr")[0].id;var j=Galaxy.libraries.folderListView.collection.get(g);j.url=j.urlRoot+j.id+"?undelete=true";j.destroy({success:function(l,k){Galaxy.libraries.folderListView.collection.remove(g);var m=new d.Item(k);Galaxy.libraries.folderListView.collection.add(m);f.success("Dataset undeleted. Click this to see it.","",{onclick:function(){h.showDatasetDetails()}})},error:function(l,k){if(typeof k.responseJSON!=="undefined"){f.error("Dataset was not undeleted. "+k.responseJSON.err_msg)}else{f.error("An error occured! Dataset was not undeleted. Please try again.")}}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(" ");tmpl_array.push(" ");tmpl_array.push(" ");tmpl_array.push(' <%- content_item.get("name") %> ');tmpl_array.push(" ");tmpl_array.push(" folder ");tmpl_array.push(" ");tmpl_array.push(' <%= _.escape(content_item.get("update_time")) %> ');tmpl_array.push(" ");tmpl_array.push(" ");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(' /datasets/<%- content_item.id %>" class="library-dataset"><%- content_item.get("name") %> ');tmpl_array.push(' <%= _.escape(content_item.get("data_type")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("file_size")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("update_time")) %> ');tmpl_array.push(" ");tmpl_array.push(' <% if (content_item.get("is_unrestricted")) { %> <% } %>');tmpl_array.push(' <% if (content_item.get("is_private")) { %> <% } %>');tmpl_array.push(' <% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %> <% } %>');tmpl_array.push(' <% if (content_item.get("can_manage")) { %>/datasets/<%- content_item.id %>/permissions"> <% } %>');tmpl_array.push(" ");tmpl_array.push(" ");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(" ");tmpl_array.push(" ");tmpl_array.push(' <%- content_item.get("name") %> ');tmpl_array.push(' <%= _.escape(content_item.get("data_type")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("file_size")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("update_time")) %> ');tmpl_array.push(' " class="primary-button btn-xs undelete_dataset_btn show_on_hover" type="button" style="display:none; margin-left:1em;"> Undelete ');tmpl_array.push(" ");return _.template(tmpl_array.join(""))}});return{FolderRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-dataset-view"],function(c,e,f,d,b){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .undelete_dataset_btn":"undelete_dataset"},options:{type:null},initialize:function(g){this.render(g)},render:function(g){var h=null;if(g.get("type")==="folder"){this.options.type="folder";h=this.templateRowFolder()}else{this.options.type="file";if(g.get("deleted")){h=this.templateRowDeletedFile()}else{h=this.templateRowFile()}}this.setElement(h({content_item:g}));this.$el.show();return this},showDatasetDetails:function(){Galaxy.libraries.datasetView=new b.LibraryDatasetView({id:this.id})},undelete_dataset:function(i){$(".tooltip").hide();var h=this;var g=$(i.target).closest("tr")[0].id;var j=Galaxy.libraries.folderListView.collection.get(g);j.url=j.urlRoot+j.id+"?undelete=true";j.destroy({success:function(l,k){Galaxy.libraries.folderListView.collection.remove(g);var m=new d.Item(k);Galaxy.libraries.folderListView.collection.add(m);f.success("Dataset undeleted. Click this to see it.","",{onclick:function(){h.showDatasetDetails()}})},error:function(l,k){if(typeof k.responseJSON!=="undefined"){f.error("Dataset was not undeleted. "+k.responseJSON.err_msg)}else{f.error("An error occured! Dataset was not undeleted. Please try again.")}}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(" ");tmpl_array.push(" ");tmpl_array.push(" ");tmpl_array.push(' <%- content_item.get("name") %> ');tmpl_array.push(" ");tmpl_array.push(" folder ");tmpl_array.push(" ");tmpl_array.push(' <%= _.escape(content_item.get("update_time")) %> ');tmpl_array.push(" ");tmpl_array.push(" ");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(' /datasets/<%- content_item.id %>" class="library-dataset"><%- content_item.get("name") %> ');tmpl_array.push(' <%= _.escape(content_item.get("data_type")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("file_size")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("update_time")) %> ');tmpl_array.push(" ");tmpl_array.push(' <% if (content_item.get("is_unrestricted")) { %> <% } %>');tmpl_array.push(' <% if (content_item.get("is_private")) { %> <% } %>');tmpl_array.push(' <% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %> <% } %>');tmpl_array.push(' <% if (content_item.get("can_manage")) { %>/datasets/<%- content_item.id %>/permissions"> <% } %>');tmpl_array.push(" ");tmpl_array.push(" ");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push(' ');tmpl_array.push(" ");tmpl_array.push(" ");tmpl_array.push(' <%- content_item.get("name") %> ');tmpl_array.push(' <%= _.escape(content_item.get("data_type")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("file_size")) %> ');tmpl_array.push(' <%= _.escape(content_item.get("update_time")) %> ');tmpl_array.push(' " class="primary-button btn-xs undelete_dataset_btn show_on_hover" type="button" style="display:none; margin-left:1em;"> Undelete ');tmpl_array.push(" ");return _.template(tmpl_array.join(""))}});return{FolderRowView:a}});
\ No newline at end of file
diff --git a/static/scripts/packed/mvc/library/library-foldertoolbar-view.js b/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
index 208194ce0c5..bbff50f88d8 100644
--- a/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
@@ -1 +1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedDatasets"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(g){this.options=_.extend(this.options,g);var i=false;var f=true;if(Galaxy.currUser){i=Galaxy.currUser.isAdmin();f=Galaxy.currUser.isAnonymous()}var h=this.templateToolBar();this.$el.html(h({id:this.options.id,admin_user:i,anonym:f}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$(".add-library-items").show()}else{$(".add-library-items").hide()}if(this.options.contains_file===true){if(Galaxy.currUser){if(!Galaxy.currUser.isAnonymous()){$(".logged-dataset-manipulation").show();$(".dataset-manipulation").show()}else{$(".dataset-manipulation").show();$(".logged-dataset-manipulation").hide()}}else{$(".logged-dataset-manipulation").hide();$(".dataset-manipulation").hide()}}else{$(".logged-dataset-manipulation").hide();$(".dataset-manipulation").hide()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var k=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=k;var n=$("select[name=dataset_import_bulk] option:selected").text();var p=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){p.push(this.parentElement.parentElement.id)}});var o=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(o({history_name:n}));var l=100/p.length;this.initProgress(l);var f=[];for(var h=p.length-1;h>=0;h--){var j=p[h];var m=new c.HistoryItem();m.url=m.urlRoot+k+"/contents";m.content=j;m.source="library";f.push(m)}this.options.chain_call_control.total_number=f.length;var g="/api/histories/"+k+"/set_as_current";$.ajax({url:g,type:"PUT"});this.chainCall(f,n)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history. Click this to start analysing it.","",{onclick:function(){window.location="/"}})}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number
'});$('
").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number
=0;h--){var k=new c.Item({id:g[h]});l.push(k)}this.options.chain_call_control.total_number=g.length;this.chainCallDeletingHdas(l)}},chainCallDeletingHdas:function(g){var f=this;this.deleted_lddas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets deleted")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were deleted.")}else{if(this.options.chain_call_control.failed_number');tmpl_array.push('");tmpl_array.push(' ');tmpl_array.push("
");tmpl_array.push(" ");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push("");tmpl_array.push("
");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('
');f.push("Select history: ");f.push(' ');f.push(" <% _.each(histories, function(history) { %>");f.push(' "><%= _.escape(history.get("name")) %> ');f.push(" <% }); %>");f.push(" ");f.push(" ");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('
');f.push("Importing selected datasets to history <%= _.escape(history_name) %> ");f.push("
");f.push('
');f.push('
');f.push(' 0% Complete ');f.push("
");f.push("
");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('
');f.push("Adding selected datasets from history to library folder <%= _.escape(folder_name) %> ");f.push("
");f.push('
');f.push('
');f.push(' 0% Complete ');f.push("
");f.push("
");f.push("");return _.template(f.join(""))},templateDeletingDatasetsProgressBar:function(){var f=[];f.push('
');f.push("
");f.push('
');f.push('
');f.push(' 0% Complete ');f.push("
");f.push("
");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('
');f.push('
');f.push("Select history: ");f.push(' ');f.push(" <% _.each(histories, function(history) { %>");f.push(' "><%= _.escape(history.get("name")) %> ');f.push(" <% }); %>");f.push(" ");f.push("
");f.push('
');f.push("
");f.push("
");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("
");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedDatasets"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(g){this.options=_.extend(this.options,g);var i=false;var f=true;if(Galaxy.currUser){i=Galaxy.currUser.isAdmin();f=Galaxy.currUser.isAnonymous()}var h=this.templateToolBar();this.$el.html(h({id:this.options.id,admin_user:i,anonym:f}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$(".add-library-items").show()}else{$(".add-library-items").hide()}if(this.options.contains_file===true){if(Galaxy.currUser){if(!Galaxy.currUser.isAnonymous()){$(".logged-dataset-manipulation").show();$(".dataset-manipulation").show()}else{$(".dataset-manipulation").show();$(".logged-dataset-manipulation").hide()}}else{$(".logged-dataset-manipulation").hide();$(".dataset-manipulation").hide()}}else{$(".logged-dataset-manipulation").hide();$(".dataset-manipulation").hide()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var k=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=k;var n=$("select[name=dataset_import_bulk] option:selected").text();var p=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){p.push(this.parentElement.parentElement.id)}});var o=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(o({history_name:n}));var l=100/p.length;this.initProgress(l);var f=[];for(var h=p.length-1;h>=0;h--){var j=p[h];var m=new c.HistoryItem();m.url=m.urlRoot+k+"/contents";m.content=j;m.source="library";f.push(m)}this.options.chain_call_control.total_number=f.length;var g="/api/histories/"+k+"/set_as_current";$.ajax({url:g,type:"PUT"});this.chainCall(f,n)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history. Click this to start analysing it.","",{onclick:function(){window.location="/"}})}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number
'});$('
").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number
=0;h--){var k=new c.Item({id:g[h]});l.push(k)}this.options.chain_call_control.total_number=g.length;this.chainCallDeletingHdas(l)}},chainCallDeletingHdas:function(g){var f=this;this.deleted_lddas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets deleted")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were deleted.")}else{if(this.options.chain_call_control.failed_number');tmpl_array.push('");tmpl_array.push(' ');tmpl_array.push("
");tmpl_array.push(" ");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push("");tmpl_array.push("
");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('
');f.push("Select history: ");f.push(' ');f.push(" <% _.each(histories, function(history) { %>");f.push(' "><%= _.escape(history.get("name")) %> ');f.push(" <% }); %>");f.push(" ");f.push(" ");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('
');f.push("Importing selected datasets to history <%= _.escape(history_name) %> ");f.push("
");f.push('
');f.push('
');f.push(' 0% Complete ');f.push("
");f.push("
");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('
');f.push("Adding selected datasets from history to library folder <%= _.escape(folder_name) %> ");f.push("
");f.push('
');f.push('
');f.push(' 0% Complete ');f.push("
");f.push("
");f.push("");return _.template(f.join(""))},templateDeletingDatasetsProgressBar:function(){var f=[];f.push('
');f.push("
");f.push('
');f.push('
');f.push(' 0% Complete ');f.push("
");f.push("
");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('
');f.push('
');f.push("Select history: ");f.push(' ');f.push(" <% _.each(histories, function(history) { %>");f.push(' "><%= _.escape(history.get("name")) %> ');f.push(" <% }); %>");f.push(" ");f.push("
");f.push('
');f.push("
");f.push("
");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("
");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
diff --git a/static/scripts/packed/mvc/library/library-librarytoolbar-view.js b/static/scripts/packed/mvc/library/library-librarytoolbar-view.js
index f4dd51a0610..802fff592ef 100644
--- a/static/scripts/packed/mvc/library/library-librarytoolbar-view.js
+++ b/static/scripts/packed/mvc/library/library-librarytoolbar-view.js
@@ -1 +1 @@
-define(["libs/toastr","mvc/library/library-model"],function(b,a){var c=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal","click #include_deleted_chk":"check_include_deleted"},initialize:function(){this.render()},render:function(){var f=this.templateToolBar();var e=false;var d=true;if(Galaxy.currUser){e=Galaxy.currUser.isAdmin();d=Galaxy.currUser.isAnonymous()}this.$el.html(f({admin_user:e,anon_user:d}));if(e){this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted")}},show_library_modal:function(e){e.preventDefault();e.stopPropagation();var d=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){d.create_new_library_event()},Close:function(){d.modal.hide()}}})},create_new_library_event:function(){var f=this.serialize_new_library();if(this.validate_new_library(f)){var e=new a.Library();var d=this;e.save(f,{success:function(g){Galaxy.libraries.libraryListView.collection.add(g);d.modal.hide();d.clear_library_modal();Galaxy.libraries.libraryListView.render();b.success("Library created")},error:function(h,g){if(typeof g.responseJSON!=="undefined"){b.error(g.responseJSON.err_msg)}else{b.error("An error occured :(")}}})}else{b.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(d){return d.name!==""},check_include_deleted:function(d){if(d.target.checked){Galaxy.libraries.preferences.set({with_deleted:true});Galaxy.libraries.libraryListView.render()}else{Galaxy.libraries.preferences.set({with_deleted:false});Galaxy.libraries.libraryListView.render()}},templateToolBar:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push('
");tmpl_array.push('
');tmpl_array.push("
");tmpl_array.push("
");return _.template(tmpl_array.join(""))},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push("
");return tmpl_array.join("")}});return{LibraryToolbarView:c}});
\ No newline at end of file
+define(["libs/toastr","mvc/library/library-model"],function(b,a){var c=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal","click #include_deleted_chk":"check_include_deleted"},initialize:function(){this.render()},render:function(){var f=this.templateToolBar();var e=false;var d=true;if(Galaxy.currUser){e=Galaxy.currUser.isAdmin();d=Galaxy.currUser.isAnonymous()}this.$el.html(f({admin_user:e,anon_user:d}));if(e){this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted")}},show_library_modal:function(e){e.preventDefault();e.stopPropagation();var d=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){d.create_new_library_event()},Close:function(){d.modal.hide()}}})},create_new_library_event:function(){var f=this.serialize_new_library();if(this.validate_new_library(f)){var e=new a.Library();var d=this;e.save(f,{success:function(g){Galaxy.libraries.libraryListView.collection.add(g);d.modal.hide();d.clear_library_modal();Galaxy.libraries.libraryListView.render();b.success("Library created")},error:function(h,g){if(typeof g.responseJSON!=="undefined"){b.error(g.responseJSON.err_msg)}else{b.error("An error occured :(")}}})}else{b.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(d){return d.name!==""},check_include_deleted:function(d){if(d.target.checked){Galaxy.libraries.preferences.set({with_deleted:true});Galaxy.libraries.libraryListView.render()}else{Galaxy.libraries.preferences.set({with_deleted:false});Galaxy.libraries.libraryListView.render()}},templateToolBar:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push('
");tmpl_array.push('
');tmpl_array.push("
");tmpl_array.push("
");return _.template(tmpl_array.join(""))},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('
');tmpl_array.push(" ");tmpl_array.push("
");return tmpl_array.join("")}});return{LibraryToolbarView:c}});
\ No newline at end of file