commit/galaxy-central: martenson: libraries: more refactoring; basic UI based on role handling; attaching to global Galaxy object; persistent lib preferences
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/36410a555b2a/ Changeset: 36410a555b2a User: martenson Date: 2014-04-02 17:07:04 Summary: libraries: more refactoring; basic UI based on role handling; attaching to global Galaxy object; persistent lib preferences Affected #: 11 files diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/galaxy.library.js --- a/static/scripts/galaxy.library.js +++ b/static/scripts/galaxy.library.js @@ -10,6 +10,7 @@ "galaxy.masthead", "utils/utils", "libs/toastr", + "mvc/base-mvc", "mvc/library/library-model", "mvc/library/library-folderlist-view", "mvc/library/library-librarylist-view", @@ -17,6 +18,7 @@ function(mod_masthead, mod_utils, mod_toastr, + mod_baseMVC, mod_library_model, mod_folderlist_view, mod_librarylist_view, @@ -32,40 +34,51 @@ } }); +// ============================================================================ +/** session storage for library preferences */ +var LibraryPrefs = mod_baseMVC.SessionStorageModel.extend({ + defaults : { + with_deleted : false, + sort_order : 'asc', + sort_by : 'name' + } +}); + // galaxy library wrapper View var GalaxyLibrary = Backbone.View.extend({ + toolbarView: null, + libraryListView: null, + library_router: null, + folderContentView: null, + initialize : function(){ + Galaxy.libraries = this; - initialize : function(){ - // toolbarView = new mod_librarytoolbar_view.ToolbarView(); - toolbarView = null; - // libraryListView = new mod_librarylist_view.LibraryListView(); - libraryListView = null; - library_router = new LibraryRouter(); + this.preferences = new LibraryPrefs( {id: 'global-lib-prefs'} ); - folderContentView = null; + this.library_router = new LibraryRouter(); - library_router.on('route:libraries', function() { + this.library_router.on('route:libraries', function() { // initialize and render the toolbar first - toolbarView = new mod_librarytoolbar_view.ToolbarView(); + Galaxy.libraries.toolbarView = new mod_librarytoolbar_view.ToolbarView(); // initialize and render libraries second - libraryListView = new mod_librarylist_view.LibraryListView(); + Galaxy.libraries.libraryListView = new mod_librarylist_view.LibraryListView(); }); - library_router.on('route:folder_content', function(id) { + this.library_router.on('route:folder_content', function(id) { // render folder contents - if (!folderContentView) {folderContentView = new mod_folderlist_view.FolderContentView();} - folderContentView.render({id: id}); + if (!Galaxy.libraries.folderContentView) {Galaxy.libraries.folderContentView = new mod_folderlist_view.FolderContentView();} + Galaxy.libraries.folderContentView.render({id: id}); }); - library_router.on('route:download', function(folder_id, format) { + this.library_router.on('route:download', function(folder_id, format) { if ($('#center').find(':checked').length === 0) { // this happens rarely when there is a server/data error and client gets an actual response instead of an attachment // we don't know what was selected so we can't download again, we redirect to the folder provided - library_router.navigate('folders/' + folder_id, {trigger: true, replace: true}); + Galaxy.libraries.library_router.navigate('folders/' + folder_id, {trigger: true, replace: true}); } else { // send download stream - folderContentView.download(folder_id, format); - library_router.navigate('folders/' + folder_id, {trigger: false, replace: true}); + Galaxy.libraries.folderContentView.download(folder_id, format); + Galaxy.libraries.library_router.navigate('folders/' + folder_id, {trigger: false, replace: true}); } }); diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/mvc/library/library-librarylist-view.js --- a/static/scripts/mvc/library/library-librarylist-view.js +++ b/static/scripts/mvc/library/library-librarylist-view.js @@ -13,14 +13,6 @@ mod_library_model, mod_library_libraryrow_view) { -// ============================================================================ -/** session storage for library preferences */ -var LibraryPrefs = mod_baseMVC.SessionStorageModel.extend({ - defaults : { - with_deleted : false - } -}); - // galaxy library view var LibraryListView = Backbone.View.extend({ el: '#libraries_element', @@ -38,8 +30,6 @@ collection: null, - preferences: null, - // map of library model ids to library views = cache rowViews: {}, @@ -49,8 +39,6 @@ this.rowViews = {}; - this.preferences = new LibraryPrefs({id: 'global-lib-prefs'}); - this.collection = new mod_library_model.Libraries(); this.collection.fetch({ @@ -69,7 +57,8 @@ render: function (options) { var template = this.templateLibraryList(); var libraries_to_render = null; - var include_deleted = this.preferences.get('with_deleted'); + var include_deleted = true; + var include_deleted = Galaxy.libraries.preferences.get('with_deleted'); var models = null if (typeof options !== 'undefined'){ include_deleted = typeof options.with_deleted !== 'undefined' ? options.with_deleted : false; @@ -88,7 +77,7 @@ libraries_to_render = []; } - this.$el.html(template({length: libraries_to_render.length, order: this.collection.sort_order})); + this.$el.html(template({length: libraries_to_render.length, order: Galaxy.libraries.preferences.get('sort_order') })); this.renderRows(libraries_to_render); // initialize the library tooltips @@ -125,10 +114,12 @@ // }, sort_clicked : function(){ - if (this.collection.sort_order == 'asc'){ + if (Galaxy.libraries.preferences.get('sort_order') === 'asc'){ this.sortLibraries('name','desc'); + Galaxy.libraries.preferences.set({'sort_order': 'desc'}); } else { this.sortLibraries('name','asc'); + Galaxy.libraries.preferences.set({'sort_order': 'asc'}); } this.render(); }, @@ -138,14 +129,14 @@ sortLibraries: function(sort_by, order){ if (sort_by === 'name'){ if (order === 'asc'){ - this.collection.sort_order = 'asc'; + // this.collection.sort_order = 'asc'; this.collection.comparator = function(libraryA, libraryB){ if (libraryA.get('name').toLowerCase() > libraryB.get('name').toLowerCase()) return 1; // after if (libraryB.get('name').toLowerCase() > libraryA.get('name').toLowerCase()) return -1; // before return 0; // equal } } else if (order === 'desc'){ - this.collection.sort_order = 'desc'; + // this.collection.sort_order = 'desc'; this.collection.comparator = function(libraryA, libraryB){ if (libraryA.get('name').toLowerCase() > libraryB.get('name').toLowerCase()) return -1; // before if (libraryB.get('name').toLowerCase() > libraryA.get('name').toLowerCase()) return 1; // after @@ -234,7 +225,7 @@ patch: true, success: function(library) { mod_toastr.success('Changes to library saved'); - galaxyLibraryview.toggle_library_modification($library_row); + Galaxy.libraries.libraryListView.toggle_library_modification($library_row); }, error: function(model, response){ mod_toastr.error('An error occured during updating the library :('); @@ -316,7 +307,7 @@ // add the newly undeleted library back to the collection // backbone does not accept changes through destroy, so update it too library.set('deleted', false); - galaxyLibraryview.collection.add(library); + Galaxy.libraries.libraryListView.collection.add(library); $library_row.removeClass('active'); mod_toastr.success('Library has been undeleted'); }, @@ -337,7 +328,7 @@ // add the new deleted library back to the collection $library_row.remove(); library.set('deleted', true); - galaxyLibraryview.collection.add(library); + Galaxy.libraries.libraryListView.collection.add(library); mod_toastr.success('Library has been marked deleted'); }, error: function(){ diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/mvc/library/library-libraryrow-view.js --- a/static/scripts/mvc/library/library-libraryrow-view.js +++ b/static/scripts/mvc/library/library-libraryrow-view.js @@ -12,34 +12,54 @@ // galaxy library row view var LibraryRowView = Backbone.View.extend({ + element_visibility_config: { + upload_library_btn: false, + edit_library_btn: false, + permission_library_btn: false, + save_library_btn: false, + cancel_library_btn: false, + delete_library_btn: false, + undelete_library_btn: false + }, + initialize : function(library){ this.render(library); }, render: function(library){ var tmpl = this.templateRow(); - this.setElement(tmpl({library:library})); - this.set_up_visual_features(library); + this.prepareButtons(library); + this.setElement(tmpl({library:library, button_config: this.element_visibility_config})); + this.$el.show(); + // this.set_up_visual_features(library); }, - set_up_visual_features: function(library, options){ - if (library.get('deleted') === true){ - this.$el.addClass('active'); - this.$el.find('.public_lib_ico').hide(); - this.$el.find('.undelete_library_btn').show(); - this.$el.find('.upload_library_btn').hide(); - this.$el.find('.edit_library_btn').hide(); - this.$el.find('.permission_library_btn').hide(); - this.$el.find('.cancel_library_btn').hide(); - this.$el.find('.delete_library_btn').hide(); + prepareButtons: function(library){ + if (library.get('deleted') === true ){ + if (Galaxy.currUser.isAdmin()){ + this.element_visibility_config.undelete_library_btn = true; + this.element_visibility_config.upload_library_btn = false; + this.element_visibility_config.edit_library_btn = false; + this.element_visibility_config.permission_library_btn = false; + } + } else if (library.get('deleted') === false ) { + this.element_visibility_config.undelete_library_btn = false; + if (library.get('can_user_add') === true){ + this.element_visibility_config.upload_library_btn = true; + } + if (library.get('can_user_modify') === true){ + this.element_visibility_config.edit_library_btn = true; + } + if (library.get('can_user_manage') === true){ + this.element_visibility_config.permission_library_btn = true; + } } - this.$el.show(); }, templateRow: function() { tmpl_array = []; - tmpl_array.push(' <tr style="display:none;" data-id="<%- library.get("id") %>">'); + tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">'); tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>'); tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>'); tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>'); @@ -49,13 +69,13 @@ tmpl_array.push(' <% } else if(library.get("public") === true) { %>'); tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>'); tmpl_array.push(' <% }%>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Upload to library" class="primary-button btn-xs upload_library_btn" type="button"><span class="fa fa-upload"></span></button>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button"><span class="fa fa-pencil"></span></button>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button"><span class="fa fa-group"></span></button>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="display:none;"><span class="fa fa-floppy-o"> Save</span></button>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="display:none;"><span class="fa fa-times"> Cancel</span></button>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="display:none;"><span class="fa fa-trash-o"> Delete</span></button>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="display:none;"><span class="fa fa-unlock"> Undelete</span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Upload to library" class="primary-button btn-xs upload_library_btn" type="button" style="<% if(button_config.upload_library_btn === false) { print("display:none;") } %>"><span class="fa fa-upload"></span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>'); + tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>'); tmpl_array.push(' </td>'); tmpl_array.push(' </tr>'); diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/mvc/library/library-librarytoolbar-view.js --- a/static/scripts/mvc/library/library-librarytoolbar-view.js +++ b/static/scripts/mvc/library/library-librarytoolbar-view.js @@ -22,23 +22,26 @@ }, render: function(){ - var toolbar_template = this.templateToolBar() + var toolbar_template = this.templateToolBar(); this.$el.html(toolbar_template({admin_user: Galaxy.currUser.isAdmin(), anon_user: Galaxy.currUser.isAnonymous()})) + if (Galaxy.currUser.isAdmin() === true){ + this.$el.find('#include_deleted_chk')[0].checked = Galaxy.libraries.preferences.get('with_deleted'); + } }, delegate_modal: function(event){ // probably should refactor to have this functionality in this view, not in the library view - libraryListView.show_library_modal(event); + Galaxy.libraries.libraryListView.show_library_modal(event); }, // include or exclude deleted libraries from the view check_include_deleted: function(event){ if (event.target.checked){ - libraryListView.preferences.set({'with_deleted': true}); - libraryListView.render(); + Galaxy.libraries.preferences.set({'with_deleted': true}); + Galaxy.libraries.libraryListView.render(); } else{ - libraryListView.preferences.set({'with_deleted': false}); - libraryListView.render(); + Galaxy.libraries.preferences.set({'with_deleted': false}); + Galaxy.libraries.libraryListView.render(); } }, @@ -51,8 +54,8 @@ tmpl_array.push(' <h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fold..." target="_blank">Trello</a>.</h3>'); tmpl_array.push(' <% if(admin_user === true) { %>'); tmpl_array.push(' <div id="library_toolbar">'); - tmpl_array.push(' <input id="include_deleted_chk" style="margin: 0;" type="checkbox">include deleted</input>'); - tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Library" id="create_new_library_btn" class="primary-button" type="button"><span class="fa fa-plus"></span> New Library</button>'); + tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Include deleted libraries"><input id="include_deleted_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>'); + tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Create New Library"><button id="create_new_library_btn" class="primary-button btn-xs" type="button"><span class="fa fa-plus"></span> New Library</button><span>'); tmpl_array.push(' </div>'); tmpl_array.push(' <% } %>'); tmpl_array.push(' </div>'); diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/packed/galaxy.library.js --- a/static/scripts/packed/galaxy.library.js +++ b/static/scripts/packed/galaxy.library.js @@ -1,1 +1,1 @@ -var library_router=null;define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view"],function(e,c,g,h,a,f,d){var i=Backbone.Router.extend({routes:{"":"libraries","sort/:sort_by/:order":"sort_libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var b=Backbone.View.extend({initialize:function(){toolbarView=null;libraryListView=null;library_router=new i();folderContentView=null;library_router.on("route:libraries",function(){toolbarView=new d.ToolbarView();libraryListView=new f.LibraryListView()});library_router.on("route:folder_content",function(j){if(!folderContentView){folderContentView=new a.FolderContentView()}folderContentView.render({id:j})});library_router.on("route:download",function(j,k){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+j,{trigger:true,replace:true})}else{folderContentView.download(j,k);library_router.navigate("folders/"+j,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}}); \ No newline at end of file +var library_router=null;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"],function(e,c,g,j,h,a,f,d){var k=Backbone.Router.extend({routes:{"":"libraries","sort/:sort_by/:order":"sort_libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var i=j.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({toolbarView:null,libraryListView:null,library_router:null,folderContentView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new i({id:"global-lib-prefs"});this.library_router=new k();this.library_router.on("route:libraries",function(){Galaxy.libraries.toolbarView=new d.ToolbarView();Galaxy.libraries.libraryListView=new f.LibraryListView()});this.library_router.on("route:folder_content",function(l){if(!Galaxy.libraries.folderContentView){Galaxy.libraries.folderContentView=new a.FolderContentView()}Galaxy.libraries.folderContentView.render({id:l})});this.library_router.on("route:download",function(l,m){if($("#center").find(":checked").length===0){Galaxy.libraries.library_router.navigate("folders/"+l,{trigger:true,replace:true})}else{Galaxy.libraries.folderContentView.download(l,m);Galaxy.libraries.library_router.navigate("folders/"+l,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}}); \ No newline at end of file diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/packed/mvc/library/library-librarylist-view.js --- a/static/scripts/packed/mvc/library/library-librarylist-view.js +++ b/static/scripts/packed/mvc/library/library-librarylist-view.js @@ -1,1 +1,1 @@ -define(["galaxy.masthead","mvc/base-mvc","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-libraryrow-view"],function(c,h,e,f,d,a){var b=h.SessionStorageModel.extend({defaults:{with_deleted:false}});var g=Backbone.View.extend({el:"#libraries_element",events:{"click .edit_library_btn":"edit_button_event","click .save_library_btn":"save_library_modification","click .cancel_library_btn":"cancel_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library","click .sort-libraries-link":"sort_clicked"},modal:null,collection:null,preferences:null,rowViews:{},initialize:function(){var i=this;this.rowViews={};this.preferences=new b({id:"global-lib-prefs"});this.collection=new d.Libraries();this.collection.fetch({success:function(j){i.render()},error:function(k,j){f.error("An error occured. Please try again.")}})},render:function(j){var k=this.templateLibraryList();var l=null;var i=this.preferences.get("with_deleted");var m=null;if(typeof j!=="undefined"){i=typeof j.with_deleted!=="undefined"?j.with_deleted:false;m=typeof j.models!=="undefined"?j.models:null}if(this.collection!==null&&m===null){if(i){l=this.collection.models}else{l=this.collection.where({deleted:false})}}else{if(m!==null){l=m}else{l=[]}}this.$el.html(k({length:l.length,order:this.collection.sort_order}));this.renderRows(l);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},renderRows:function(n){for(var m=0;m<n.length;m++){var l=n[m];var k=_.findWhere(this.rowViews,{id:l.get("id")});if(k!==undefined){this.$el.find("#library_list_body").append(k.el)}else{var j=new a.LibraryRowView(l);this.$el.find("#library_list_body").append(j.el);this.rowViews[l.get("id")]=j}}},sort_clicked:function(){if(this.collection.sort_order=="asc"){this.sortLibraries("name","desc")}else{this.sortLibraries("name","asc")}this.render()},sortLibraries:function(j,i){if(j==="name"){if(i==="asc"){this.collection.sort_order="asc";this.collection.comparator=function(l,k){if(l.get("name").toLowerCase()>k.get("name").toLowerCase()){return 1}if(k.get("name").toLowerCase()>l.get("name").toLowerCase()){return -1}return 0}}else{if(i==="desc"){this.collection.sort_order="desc";this.collection.comparator=function(l,k){if(l.get("name").toLowerCase()>k.get("name").toLowerCase()){return -1}if(k.get("name").toLowerCase()>l.get("name").toLowerCase()){return 1}return 0}}}this.collection.sort()}},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div class="library_container table-responsive">');tmpl_array.push("<% if(length === 0) { %>");tmpl_array.push("<div>I see no libraries. Why don't you create one?</div>");tmpl_array.push("<% } else{ %>");tmpl_array.push('<table class="grid table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th style="width:30%;"><a class="sort-libraries-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');tmpl_array.push(' <th style="width:22%;">description</th>');tmpl_array.push(' <th style="width:22%;">synopsis</th> ');tmpl_array.push(' <th style="width:26%;"></th> ');tmpl_array.push(" </thead>");tmpl_array.push(' <tbody id="library_list_body">');tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("<% }%>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_modal">');tmpl_array.push(" <form>");tmpl_array.push(' <input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push(' <input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},save_library_modification:function(l){var k=$(l.target).closest("tr");var i=this.collection.get(k.data("id"));var j=false;var n=k.find(".input_library_name").val();if(typeof n!=="undefined"&&n!==i.get("name")){if(n.length>2){i.set("name",n);j=true}else{f.warning("Library name has to be at least 3 characters long");return}}var m=k.find(".input_library_description").val();if(typeof m!=="undefined"&&m!==i.get("description")){i.set("description",m);j=true}var o=k.find(".input_library_synopsis").val();if(typeof o!=="undefined"&&o!==i.get("synopsis")){i.set("synopsis",o);j=true}if(j){i.save(null,{patch:true,success:function(p){f.success("Changes to library saved");galaxyLibraryview.toggle_library_modification(k)},error:function(q,p){f.error("An error occured during updating the library :(")}})}},edit_button_event:function(i){this.toggle_library_modification($(i.target).closest("tr"))},toggle_library_modification:function(l){var i=this.collection.get(l.data("id"));l.find(".public_lib_ico").toggle();l.find(".deleted_lib_ico").toggle();l.find(".edit_library_btn").toggle();l.find(".upload_library_btn").toggle();l.find(".permission_library_btn").toggle();l.find(".save_library_btn").toggle();l.find(".cancel_library_btn").toggle();if(i.get("deleted")){}else{l.find(".delete_library_btn").toggle()}if(l.find(".edit_library_btn").is(":hidden")){var j=i.get("name");var n='<input type="text" class="form-control input_library_name" placeholder="name">';l.children("td").eq(0).html(n);if(typeof j!==undefined){l.find(".input_library_name").val(j)}var k=i.get("description");var n='<input type="text" class="form-control input_library_description" placeholder="description">';l.children("td").eq(1).html(n);if(typeof k!==undefined){l.find(".input_library_description").val(k)}var m=i.get("synopsis");var n='<input type="text" class="form-control input_library_synopsis" placeholder="synopsis">';l.children("td").eq(2).html(n);if(typeof m!==undefined){l.find(".input_library_synopsis").val(m)}}else{l.children("td").eq(0).html(i.get("name"));l.children("td").eq(1).html(i.get("description"));l.children("td").eq(2).html(i.get("synopsis"))}},cancel_library_modification:function(k){var j=$(k.target).closest("tr");var i=this.collection.get(j.data("id"));this.toggle_library_modification(j);j.children("td").eq(0).html(i.get("name"));j.children("td").eq(1).html(i.get("description"));j.children("td").eq(2).html(i.get("synopsis"))},undelete_library:function(k){var j=$(k.target).closest("tr");var i=this.collection.get(j.data("id"));this.toggle_library_modification(j);i.url=i.urlRoot+i.id+"?undelete=true";i.destroy({success:function(l){l.set("deleted",false);galaxyLibraryview.collection.add(l);j.removeClass("active");f.success("Library has been undeleted")},error:function(){f.error("An error occured while undeleting the library :(")}})},delete_library:function(k){var j=$(k.target).closest("tr");var i=this.collection.get(j.data("id"));this.toggle_library_modification(j);i.destroy({success:function(l){j.remove();l.set("deleted",true);galaxyLibraryview.collection.add(l);f.success("Library has been marked deleted")},error:function(){f.error("An error occured during deleting the library :(")}})},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},show_library_modal:function(j){j.preventDefault();j.stopPropagation();var i=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){i.create_new_library_event()},Close:function(){i.modal.hide()}}})},create_new_library_event:function(){var k=this.serialize_new_library();if(this.validate_new_library(k)){var j=new d.Library();var i=this;j.save(k,{success:function(l){i.collection.add(l);i.modal.hide();i.clear_library_modal();i.render();f.success("Library created")},error:function(){f.error("An error occured :(")}})}else{f.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(i){return i.name!==""}});return{LibraryListView:g}}); \ No newline at end of file +define(["galaxy.masthead","mvc/base-mvc","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-libraryrow-view"],function(b,g,d,e,c,a){var f=Backbone.View.extend({el:"#libraries_element",events:{"click .edit_library_btn":"edit_button_event","click .save_library_btn":"save_library_modification","click .cancel_library_btn":"cancel_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library","click .sort-libraries-link":"sort_clicked"},modal:null,collection:null,rowViews:{},initialize:function(){var h=this;this.rowViews={};this.collection=new c.Libraries();this.collection.fetch({success:function(i){h.render()},error:function(j,i){e.error("An error occured. Please try again.")}})},render:function(i){var j=this.templateLibraryList();var k=null;var h=true;var h=Galaxy.libraries.preferences.get("with_deleted");var l=null;if(typeof i!=="undefined"){h=typeof i.with_deleted!=="undefined"?i.with_deleted:false;l=typeof i.models!=="undefined"?i.models:null}if(this.collection!==null&&l===null){if(h){k=this.collection.models}else{k=this.collection.where({deleted:false})}}else{if(l!==null){k=l}else{k=[]}}this.$el.html(j({length:k.length,order:Galaxy.libraries.preferences.get("sort_order")}));this.renderRows(k);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},renderRows:function(m){for(var l=0;l<m.length;l++){var k=m[l];var j=_.findWhere(this.rowViews,{id:k.get("id")});if(j!==undefined){this.$el.find("#library_list_body").append(j.el)}else{var h=new a.LibraryRowView(k);this.$el.find("#library_list_body").append(h.el);this.rowViews[k.get("id")]=h}}},sort_clicked:function(){if(Galaxy.libraries.preferences.get("sort_order")==="asc"){this.sortLibraries("name","desc");Galaxy.libraries.preferences.set({sort_order:"desc"})}else{this.sortLibraries("name","asc");Galaxy.libraries.preferences.set({sort_order:"asc"})}this.render()},sortLibraries:function(i,h){if(i==="name"){if(h==="asc"){this.collection.comparator=function(k,j){if(k.get("name").toLowerCase()>j.get("name").toLowerCase()){return 1}if(j.get("name").toLowerCase()>k.get("name").toLowerCase()){return -1}return 0}}else{if(h==="desc"){this.collection.comparator=function(k,j){if(k.get("name").toLowerCase()>j.get("name").toLowerCase()){return -1}if(j.get("name").toLowerCase()>k.get("name").toLowerCase()){return 1}return 0}}}this.collection.sort()}},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div class="library_container table-responsive">');tmpl_array.push("<% if(length === 0) { %>");tmpl_array.push("<div>I see no libraries. Why don't you create one?</div>");tmpl_array.push("<% } else{ %>");tmpl_array.push('<table class="grid table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th style="width:30%;"><a class="sort-libraries-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');tmpl_array.push(' <th style="width:22%;">description</th>');tmpl_array.push(' <th style="width:22%;">synopsis</th> ');tmpl_array.push(' <th style="width:26%;"></th> ');tmpl_array.push(" </thead>");tmpl_array.push(' <tbody id="library_list_body">');tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("<% }%>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_modal">');tmpl_array.push(" <form>");tmpl_array.push(' <input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push(' <input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},save_library_modification:function(k){var j=$(k.target).closest("tr");var h=this.collection.get(j.data("id"));var i=false;var m=j.find(".input_library_name").val();if(typeof m!=="undefined"&&m!==h.get("name")){if(m.length>2){h.set("name",m);i=true}else{e.warning("Library name has to be at least 3 characters long");return}}var l=j.find(".input_library_description").val();if(typeof l!=="undefined"&&l!==h.get("description")){h.set("description",l);i=true}var n=j.find(".input_library_synopsis").val();if(typeof n!=="undefined"&&n!==h.get("synopsis")){h.set("synopsis",n);i=true}if(i){h.save(null,{patch:true,success:function(o){e.success("Changes to library saved");Galaxy.libraries.libraryListView.toggle_library_modification(j)},error:function(p,o){e.error("An error occured during updating the library :(")}})}},edit_button_event:function(h){this.toggle_library_modification($(h.target).closest("tr"))},toggle_library_modification:function(k){var h=this.collection.get(k.data("id"));k.find(".public_lib_ico").toggle();k.find(".deleted_lib_ico").toggle();k.find(".edit_library_btn").toggle();k.find(".upload_library_btn").toggle();k.find(".permission_library_btn").toggle();k.find(".save_library_btn").toggle();k.find(".cancel_library_btn").toggle();if(h.get("deleted")){}else{k.find(".delete_library_btn").toggle()}if(k.find(".edit_library_btn").is(":hidden")){var i=h.get("name");var m='<input type="text" class="form-control input_library_name" placeholder="name">';k.children("td").eq(0).html(m);if(typeof i!==undefined){k.find(".input_library_name").val(i)}var j=h.get("description");var m='<input type="text" class="form-control input_library_description" placeholder="description">';k.children("td").eq(1).html(m);if(typeof j!==undefined){k.find(".input_library_description").val(j)}var l=h.get("synopsis");var m='<input type="text" class="form-control input_library_synopsis" placeholder="synopsis">';k.children("td").eq(2).html(m);if(typeof l!==undefined){k.find(".input_library_synopsis").val(l)}}else{k.children("td").eq(0).html(h.get("name"));k.children("td").eq(1).html(h.get("description"));k.children("td").eq(2).html(h.get("synopsis"))}},cancel_library_modification:function(j){var i=$(j.target).closest("tr");var h=this.collection.get(i.data("id"));this.toggle_library_modification(i);i.children("td").eq(0).html(h.get("name"));i.children("td").eq(1).html(h.get("description"));i.children("td").eq(2).html(h.get("synopsis"))},undelete_library:function(j){var i=$(j.target).closest("tr");var h=this.collection.get(i.data("id"));this.toggle_library_modification(i);h.url=h.urlRoot+h.id+"?undelete=true";h.destroy({success:function(k){k.set("deleted",false);Galaxy.libraries.libraryListView.collection.add(k);i.removeClass("active");e.success("Library has been undeleted")},error:function(){e.error("An error occured while undeleting the library :(")}})},delete_library:function(j){var i=$(j.target).closest("tr");var h=this.collection.get(i.data("id"));this.toggle_library_modification(i);h.destroy({success:function(k){i.remove();k.set("deleted",true);Galaxy.libraries.libraryListView.collection.add(k);e.success("Library has been marked deleted")},error:function(){e.error("An error occured during deleting the library :(")}})},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},show_library_modal:function(i){i.preventDefault();i.stopPropagation();var h=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){h.create_new_library_event()},Close:function(){h.modal.hide()}}})},create_new_library_event:function(){var j=this.serialize_new_library();if(this.validate_new_library(j)){var i=new c.Library();var h=this;i.save(j,{success:function(k){h.collection.add(k);h.modal.hide();h.clear_library_modal();h.render();e.success("Library created")},error:function(){e.error("An error occured :(")}})}else{e.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(h){return h.name!==""}});return{LibraryListView:f}}); \ No newline at end of file diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/packed/mvc/library/library-libraryrow-view.js --- a/static/scripts/packed/mvc/library/library-libraryrow-view.js +++ b/static/scripts/packed/mvc/library/library-libraryrow-view.js @@ -1,1 +1,1 @@ -define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({initialize:function(f){this.render(f)},render:function(g){var f=this.templateRow();this.setElement(f({library:g}));this.set_up_visual_features(g)},set_up_visual_features:function(f,g){if(f.get("deleted")===true){this.$el.addClass("active");this.$el.find(".public_lib_ico").hide();this.$el.find(".undelete_library_btn").show();this.$el.find(".upload_library_btn").hide();this.$el.find(".edit_library_btn").hide();this.$el.find(".permission_library_btn").hide();this.$el.find(".cancel_library_btn").hide();this.$el.find(".delete_library_btn").hide()}this.$el.show()},templateRow:function(){tmpl_array=[];tmpl_array.push(' <tr style="display:none;" data-id="<%- library.get("id") %>">');tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(' <td class="right-center">');tmpl_array.push(' <% if(library.get("deleted") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');tmpl_array.push(' <% } else if(library.get("public") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');tmpl_array.push(" <% }%>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Upload to library" class="primary-button btn-xs upload_library_btn" type="button"><span class="fa fa-upload"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button"><span class="fa fa-pencil"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button"><span class="fa fa-group"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="display:none;"><span class="fa fa-floppy-o"> Save</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="display:none;"><span class="fa fa-times"> Cancel</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="display:none;"><span class="fa fa-trash-o"> Delete</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="display:none;"><span class="fa fa-unlock"> Undelete</span></button>');tmpl_array.push(" </td>");tmpl_array.push(" </tr>");return _.template(tmpl_array.join(""))}});return{LibraryRowView: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({element_visibility_config:{upload_library_btn:false,edit_library_btn:false,permission_library_btn:false,save_library_btn:false,cancel_library_btn:false,delete_library_btn:false,undelete_library_btn:false},initialize:function(f){this.render(f)},render:function(g){var f=this.templateRow();this.prepareButtons(g);this.setElement(f({library:g,button_config:this.element_visibility_config}));this.$el.show()},prepareButtons:function(f){if(f.get("deleted")===true){if(Galaxy.currUser.isAdmin()){this.element_visibility_config.undelete_library_btn=true;this.element_visibility_config.upload_library_btn=false;this.element_visibility_config.edit_library_btn=false;this.element_visibility_config.permission_library_btn=false}}else{if(f.get("deleted")===false){this.element_visibility_config.undelete_library_btn=false;if(f.get("can_user_add")===true){this.element_visibility_config.upload_library_btn=true}if(f.get("can_user_modify")===true){this.element_visibility_config.edit_library_btn=true}if(f.get("can_user_manage")===true){this.element_visibility_config.permission_library_btn=true}}}},templateRow:function(){tmpl_array=[];tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(' <td class="right-center">');tmpl_array.push(' <% if(library.get("deleted") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');tmpl_array.push(' <% } else if(library.get("public") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');tmpl_array.push(" <% }%>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Upload to library" class="primary-button btn-xs upload_library_btn" type="button" style="<% if(button_config.upload_library_btn === false) { print("display:none;") } %>"><span class="fa fa-upload"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>');tmpl_array.push(" </td>");tmpl_array.push(" </tr>");return _.template(tmpl_array.join(""))}});return{LibraryRowView:a}}); \ No newline at end of file diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/scripts/packed/mvc/library/library-librarytoolbar-view.js --- a/static/scripts/packed/mvc/library/library-librarytoolbar-view.js +++ b/static/scripts/packed/mvc/library/library-librarytoolbar-view.js @@ -1,1 +1,1 @@ -define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(a,d,e,c){var b=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"delegate_modal","click #include_deleted_chk":"check_include_deleted"},initialize:function(){this.render()},render:function(){var f=this.templateToolBar();this.$el.html(f({admin_user:Galaxy.currUser.isAdmin(),anon_user:Galaxy.currUser.isAnonymous()}))},delegate_modal:function(f){libraryListView.show_library_modal(f)},check_include_deleted:function(f){if(f.target.checked){libraryListView.preferences.set({with_deleted:true});libraryListView.render()}else{libraryListView.preferences.set({with_deleted:false});libraryListView.render()}},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div id="libraries_container" style="width: 90%; margin: auto; margin-top:2em; overflow: auto !important; ">');tmpl_array.push(' <div id="toolbar_form" margin-top:0.5em; ">');tmpl_array.push(' <h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fold..." target="_blank">Trello</a>.</h3>');tmpl_array.push(" <% if(admin_user === true) { %>");tmpl_array.push(' <div id="library_toolbar">');tmpl_array.push(' <input id="include_deleted_chk" style="margin: 0;" type="checkbox">include deleted</input>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Library" id="create_new_library_btn" class="primary-button" type="button"><span class="fa fa-plus"></span> New Library</button>');tmpl_array.push(" </div>");tmpl_array.push(" <% } %>");tmpl_array.push(" </div>");tmpl_array.push(' <div id="libraries_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))}});return{ToolbarView:b}}); \ No newline at end of file +define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(a,d,e,c){var b=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"delegate_modal","click #include_deleted_chk":"check_include_deleted"},initialize:function(){this.render()},render:function(){var f=this.templateToolBar();this.$el.html(f({admin_user:Galaxy.currUser.isAdmin(),anon_user:Galaxy.currUser.isAnonymous()}));if(Galaxy.currUser.isAdmin()===true){this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted")}},delegate_modal:function(f){Galaxy.libraries.libraryListView.show_library_modal(f)},check_include_deleted:function(f){if(f.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('<div id="libraries_container" style="width: 90%; margin: auto; margin-top:2em; overflow: auto !important; ">');tmpl_array.push(' <div id="toolbar_form" margin-top:0.5em; ">');tmpl_array.push(' <h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fold..." target="_blank">Trello</a>.</h3>');tmpl_array.push(" <% if(admin_user === true) { %>");tmpl_array.push(' <div id="library_toolbar">');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Include deleted libraries"><input id="include_deleted_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Create New Library"><button id="create_new_library_btn" class="primary-button btn-xs" type="button"><span class="fa fa-plus"></span> New Library</button><span>');tmpl_array.push(" </div>");tmpl_array.push(" <% } %>");tmpl_array.push(" </div>");tmpl_array.push(' <div id="libraries_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))}});return{ToolbarView:b}}); \ No newline at end of file diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1309,7 +1309,7 @@ .modal_table td{border:none !important} th.button_heading{width:2em} #library_folder_toolbar{margin-bottom:1em} -#library_toolbar{margin-bottom:1em} +#library_toolbar{margin-bottom:1em}#library_toolbar span{margin-right:0.2em} img.expanderIcon{padding-right:4px} input.datasetCheckbox,li,ul{padding:0;margin:0} .rowTitle{padding:2px} diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/style/blue/library.css --- a/static/style/blue/library.css +++ b/static/style/blue/library.css @@ -20,7 +20,7 @@ .modal_table td{border:none !important} th.button_heading{width:2em} #library_folder_toolbar{margin-bottom:1em} -#library_toolbar{margin-bottom:1em} +#library_toolbar{margin-bottom:1em}#library_toolbar span{margin-right:0.2em} img.expanderIcon{padding-right:4px} input.datasetCheckbox,li,ul{padding:0;margin:0} .rowTitle{padding:2px} diff -r 9d91895363591d3c1eb8f18fac8fa6511aa19e52 -r 36410a555b2a9e587f4f24ea4ddfc120fde76fd5 static/style/src/less/library.less --- a/static/style/src/less/library.less +++ b/static/style/src/less/library.less @@ -96,6 +96,9 @@ } #library_toolbar { margin-bottom: 1em; + span { + margin-right: 0.2em; + } } img.expanderIcon { 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.
participants (1)
-
commits-noreply@bitbucket.org