From d791bfa1fcf0943ce35de072005af9e0e729944e Mon Sep 17 00:00:00 2001 From: Arvind Date: Thu, 25 Sep 2014 16:00:17 +0530 Subject: [PATCH] Show all tags for images in galleryview in linked data page. --- swtr/static/js/main.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/swtr/static/js/main.js b/swtr/static/js/main.js index 9bcceb1..4c5e934 100644 --- a/swtr/static/js/main.js +++ b/swtr/static/js/main.js @@ -675,7 +675,8 @@ return swt.get('where'); }); - this.setGalleryView(_.uniq(swts, 'where')); + // this.setGalleryView(_.uniq(swts, 'where')); + this.setGalleryView(swts); // $(this.el).hide(); }, setGalleryView: function(swts) { @@ -731,7 +732,21 @@ render: function() { this.setUp(); _.each(this.collection, function(model) { - $(this.el).append(this.template(model.toJSON())); + var models = swtr.LDs.filter(function(swt) { + if(swt.get('how').src == model.get('how').src) { + return model; + } + }); + var tags = []; + _.each(models, function(model) { + if(model.get('how').tags) { + tags.push(model.get('how').tags); + } + }); + tags = _.flatten(tags); + $(this.el).append(this.template({'how':{'tags': tags, + 'src':model.get('how').src}, + 'who':model.get('who')})); }, this); $('html, body').animate({ scrollTop: $("#gallery").offset().top -- 1.7.10.4