Sort tags for display (note, this is stupid to have in 3 places -- refactor)

This commit is contained in:
Dannon Baker
2017-06-01 10:38:13 -04:00
parent 75028ac1ee
commit c260e0b0c8
14 changed files with 22 additions and 22 deletions
@@ -307,7 +307,7 @@ var DatasetListItemView = _super.extend(
_renderNametags : function(){
var tpl = _.template([
'<% _.each(_.uniq(tags), function(tag){ %>',
'<% _.each(_.sortBy(_.uniq(tags), function(x) { return x }), function(tag){ %>',
'<% if (tag.indexOf("name:") == 0){ %>',
'<span class="label label-info"><%- tag.slice(5) %></span>',
'<% } %>',
+2 -2
View File
@@ -16,7 +16,7 @@ var _super = DATASET_LI.DatasetListItemView;
var HDAListItemView = _super.extend(
/** @lends HDAListItemView.prototype */{
className : _super.prototype.className + " history-content",
className : _super.prototype.className + " history-content",
initialize : function( attributes, options ){
_super.prototype.initialize.call( this, attributes, options );
@@ -45,7 +45,7 @@ HDAListItemView.prototype.templates = (function(){
'</div>',
'</br>',
'<span class="nametags">',
'<% _.each(dataset.tags, function(tag){ %>',
'<% _.each(_.sortBy(_.uniq(dataset.tags), function(x) { return x }), function(tag){ %>',
'<% if (tag.indexOf("name:") == 0){ %>',
'<span class="label label-info"><%- tag.slice(5) %></span>',
'<% } %>',
+1 -1
View File
@@ -85,7 +85,7 @@ HDCAListItemView.prototype.templates = (function(){
'</div>',
'<div class="subtitle"></div>',
'<span class="nametags">',
'<% _.each(_.uniq(collection.tags), function(tag){ %>',
'<% _.each(_.sortBy(_.uniq(collection.tags), function(x) { return x }), function(tag){ %>',
'<% if (tag.indexOf("name:") == 0){ %>',
'<span class="label label-info"><%- tag.slice(5) %></span>',
'<% } %>',