libraries: changed to more grid-like styling; added packed versions of recent JS updates that showed up after packing scripts

This commit is contained in:
Martin Cech
2014-03-19 17:18:36 -04:00
parent c4308dd9bc
commit 9d3679dfbf
9 changed files with 34 additions and 36 deletions
+15 -10
View File
@@ -121,10 +121,10 @@ var FolderContentView = Backbone.View.extend({
// TOOLBAR
tmpl_array.push('<div id="library_folder_toolbar" >');
tmpl_array.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span> <span class="fa fa-folder-close"></span> folder</button>');
tmpl_array.push(' <button title="Import selected datasets into history" id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');
tmpl_array.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="primary-button" type="button"><span class="fa fa-plus"></span> <span class="fa fa-folder-close"></span> folder</button>');
tmpl_array.push(' <button title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');
tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');
tmpl_array.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');
tmpl_array.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');
tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');
tmpl_array.push(' </button>');
tmpl_array.push(' <ul class="dropdown-menu" role="menu">');
@@ -150,7 +150,7 @@ var FolderContentView = Backbone.View.extend({
// FOLDER CONTENT
tmpl_array.push('<table id="folder_table" class="library_table table table-condensed">');
tmpl_array.push('<table id="folder_table" class="grid table table-condensed">');
tmpl_array.push(' <thead>');
tmpl_array.push(' <th class="button_heading"></th>');
tmpl_array.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');
@@ -797,7 +797,6 @@ var GalaxyLibraryview = Backbone.View.extend({
initialize : function(){
var viewContext = this;
this.collection = new Libraries();
// this.collection.on('sort', this.render, this);
this.collection.fetch({
success: function(libraries){
@@ -817,8 +816,9 @@ var GalaxyLibraryview = Backbone.View.extend({
$("#center").css('overflow','auto');
},
/** Renders the libraries table either from the object's own collection, or from a given array of library models,
or renders an empty list in case no data is present. */
/** Renders the libraries table either from the object's own collection,
or from a given array of library models,
or renders an empty list in case no data is given. */
render: function (options) {
var template = this.templateLibraryList();
var libraries_to_render = null;
@@ -874,14 +874,18 @@ var GalaxyLibraryview = Backbone.View.extend({
templateLibraryList: function(){
tmpl_array = [];
tmpl_array.push('<div class="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');
tmpl_array.push('');
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-folders" target="_blank">Trello</a>.</h3>');
tmpl_array.push('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');
tmpl_array.push('<div id="library_toolbar">');
tmpl_array.push(' <button 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('<% if(libraries.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="library_table table table-condensed">');
tmpl_array.push('<table class="grid table table-condensed">');
tmpl_array.push(' <thead>');
tmpl_array.push(' <th><a title="Click to reverse order" href="#sort/name/<% if(order==="desc"||order===null){print("asc")}else{print("desc")} %>">name</a> <span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');
tmpl_array.push(' <th>description</th>');
@@ -898,6 +902,7 @@ var GalaxyLibraryview = Backbone.View.extend({
tmpl_array.push(' </tbody>');
tmpl_array.push('</table>');
tmpl_array.push('<% }%>');
tmpl_array.push('</div>');
return _.template(tmpl_array.join(''));
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
var AnnotationEditor=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(a){a=a||{};this.tooltipConfig=a.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(b){a.$annotation().text(b);a.model.save({annotation:b},{silent:true}).fail(function(){a.$annotation().text(a.model.previous("annotation"))})}});return this},_template:function(){var a=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',a,"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});
define([],function(){var a=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(b){b=b||{};this.tooltipConfig=b.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(b.$activator,b)},render:function(){var b=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(c){b.$annotation().text(c);b.model.save({annotation:c},{silent:true}).fail(function(){b.$annotation().text(b.model.previous("annotation"))})}});return this},_template:function(){var b=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',b,"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:a}});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
var TagsEditor=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(a){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return a._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var a=this.model.get("tags");if(!_.isArray(a)||_.isEmpty(a)){return""}return a.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var a=this;this.$input().on("change",function(b){a.model.save({tags:b.val},{silent:true});if(b.added){a._addNewTagToTagsUsed(b.added.text+"")}})},_addNewTagToTagsUsed:function(a){var b=Galaxy.currUser.get("tags_used");if(!_.contains(b,a)){b.push(a);b.sort();Galaxy.currUser.set("tags_used",b)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});
define([],function(){var a=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(b){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(b.$activator,b)},render:function(){var b=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return b._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var b=this.model.get("tags");if(!_.isArray(b)||_.isEmpty(b)){return""}return b.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var b=this;this.$input().on("change",function(c){b.model.save({tags:c.val},{silent:true});if(c.added){b._addNewTagToTagsUsed(c.added.text+"")}})},_addNewTagToTagsUsed:function(b){var c=Galaxy.currUser.get("tags_used");if(!_.contains(c,b)){c.push(b);c.sort();Galaxy.currUser.set("tags_used",c)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:a}});
+4 -3
View File
@@ -1292,15 +1292,16 @@ li.folderRow:hover,li.datasetRow:hover{background-color:#f9f9f9}
.library_table th{border-bottom:2px solid #5f6990 !important}
.library_table a{color:#0A143D}.library_table a:hover{color:maroon}
tr.light td{background-color:white;color:black}
tr.light:hover td{background-color:#A2A9C8}
tr.dark td{background-color:#8389a1;color:white}
tr.dark:hover td{background-color:#bbbfd0;color:white}
tr.light:hover td{background-color:#f5e8cc}
tr.dark td{background-color:#d6b161;color:white}
tr.dark:hover td{background-color:#ebd4a4;color:white}
a.dark{color:white}
.modal_table tr{border-bottom:1px solid #5f6990 !important}
.modal_table th{border:none !important}
.modal_table td{border:none !important}
th.button_heading{width:2em}
#library_folder_toolbar{margin-bottom:1em}
#library_toolbar{margin-bottom:1em}
img.expanderIcon{padding-right:4px}
input.datasetCheckbox,li,ul{padding:0;margin:0}
.rowTitle{padding:2px}
+4 -3
View File
@@ -10,15 +10,16 @@ li.folderRow:hover,li.datasetRow:hover{background-color:#f9f9f9}
.library_table th{border-bottom:2px solid #5f6990 !important}
.library_table a{color:#0A143D}.library_table a:hover{color:maroon}
tr.light td{background-color:white;color:black}
tr.light:hover td{background-color:#A2A9C8}
tr.dark td{background-color:#8389a1;color:white}
tr.dark:hover td{background-color:#bbbfd0;color:white}
tr.light:hover td{background-color:#f5e8cc}
tr.dark td{background-color:#d6b161;color:white}
tr.dark:hover td{background-color:#ebd4a4;color:white}
a.dark{color:white}
.modal_table tr{border-bottom:1px solid #5f6990 !important}
.modal_table th{border:none !important}
.modal_table td{border:none !important}
th.button_heading{width:2em}
#library_folder_toolbar{margin-bottom:1em}
#library_toolbar{margin-bottom:1em}
img.expanderIcon{padding-right:4px}
input.datasetCheckbox,li,ul{padding:0;margin:0}
.rowTitle{padding:2px}
+6 -15
View File
@@ -52,17 +52,16 @@ tr.light td
}
tr.light:hover td
{
background-color: #A2A9C8;
// color: #8389a1;
background-color: #f5e8cc;
}
tr.dark td
{
background-color: #8389a1;
background-color: #d6b161;
color: white;
}
tr.dark:hover td
{
background-color: #bbbfd0;
background-color: #ebd4a4;
color: white;
}
a.dark
@@ -70,8 +69,6 @@ a.dark
color: white;
}
.modal_table{
tr {
border-bottom: 1px solid #5f6990 !important;
@@ -84,15 +81,6 @@ a.dark
}
}
th.button_heading
{
width: 2em;
@@ -101,6 +89,9 @@ th.button_heading
#library_folder_toolbar {
margin-bottom: 1em;
}
#library_toolbar {
margin-bottom: 1em;
}
img.expanderIcon {
padding-right: 4px;