diff --git a/public/javascripts/app/templates/likes-info.handlebars b/public/javascripts/app/templates/likes-info.handlebars index 76073e6ac..fc93be6de 100644 --- a/public/javascripts/app/templates/likes-info.handlebars +++ b/public/javascripts/app/templates/likes-info.handlebars @@ -1,4 +1,4 @@ -{{#if hasLikes}} +{{#if likes_count}}
@@ -7,7 +7,7 @@
{{#unless likes.length}} - + {{t "stream.likes" count=likes_count}} diff --git a/public/javascripts/app/templates/status-message.handlebars b/public/javascripts/app/templates/status-message.handlebars index 1e2e12350..584d3a281 100644 --- a/public/javascripts/app/templates/status-message.handlebars +++ b/public/javascripts/app/templates/status-message.handlebars @@ -14,5 +14,7 @@ {{/each}} {{/if}} -{{{text}}} -{{{o_embed_html}}} +
+ {{{text}}} + {{{o_embed_html}}} +
diff --git a/public/javascripts/app/templates/stream-element.handlebars b/public/javascripts/app/templates/stream-element.handlebars index f7925ae69..2d1afcd96 100644 --- a/public/javascripts/app/templates/stream-element.handlebars +++ b/public/javascripts/app/templates/stream-element.handlebars @@ -54,7 +54,7 @@
{{/if}} -
+
{{#if nsfw}}
diff --git a/public/javascripts/app/views/likes_info_view.js b/public/javascripts/app/views/likes_info_view.js index b6a1e1a06..5deac53ee 100644 --- a/public/javascripts/app/views/likes_info_view.js +++ b/public/javascripts/app/views/likes_info_view.js @@ -10,15 +10,10 @@ app.views.LikesInfo = app.views.StreamObject.extend({ presenter : function() { return _.extend(this.defaultPresenter(), { - likes : this.model.likes.models, - hasLikes : this.hasLikes() + likes : this.model.likes.models }) }, - hasLikes : function() { - return this.model.likes.models.length > 0 - }, - showAvatars : function(evt){ if(evt) { evt.preventDefault() } var self = this; diff --git a/spec/javascripts/app/views/likes_info_view_spec.js b/spec/javascripts/app/views/likes_info_view_spec.js index d16009fdb..92d29a400 100644 --- a/spec/javascripts/app/views/likes_info_view_spec.js +++ b/spec/javascripts/app/views/likes_info_view_spec.js @@ -17,10 +17,9 @@ describe("app.views.LikesInfo", function(){ describe(".render", function(){ it("displays a the like count if it is above zero", function() { this.view.render(); + this.view.model.set({"likes_count" : 1}) - console.log($(this.view.el)) - - expect($(this.view.el).text()).toContain(Diaspora.I18n.t('stream.pins', {count : this.view.model.get("likes_count")})) + expect($(this.view.el).find(".expand_likes").length).toBe(1) }) it("does not display the like count if it is zero", function() { diff --git a/spec/javascripts/app/views/post_view_spec.js b/spec/javascripts/app/views/post_view_spec.js index f4796ea47..1773bad79 100644 --- a/spec/javascripts/app/views/post_view_spec.js +++ b/spec/javascripts/app/views/post_view_spec.js @@ -22,14 +22,14 @@ describe("app.views.Post", function(){ this.statusMessage.set({reshares_count : 2}) var view = new app.views.Post({model : this.statusMessage}).render(); - expect(view.$(".post_initial_info").html()).toContain(Diaspora.I18n.t('stream.reshares', {count: 2})) + expect($(view.el).html()).toContain(Diaspora.I18n.t('stream.reshares', {count: 2})) }) it("does not display a reshare count for 'zero'", function(){ this.statusMessage.set({reshares_count : 0}) var view = new app.views.Post({model : this.statusMessage}).render(); - expect(view.$(".post_initial_info").html()).not.toContain("0 Reshares") + expect($(view.el).html()).not.toContain("0 Reshares") })