From 714522476c4a5831e3935a430cf7639763ea4e0a Mon Sep 17 00:00:00 2001 From: Sacha Greif Date: Sun, 27 Oct 2013 09:38:21 +0900 Subject: [PATCH] added notice when digest has no posts --- client/views/posts/posts_digest.html | 16 +++++++++------- client/views/posts/posts_digest.js | 5 +---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/client/views/posts/posts_digest.html b/client/views/posts/posts_digest.html index 8a5d345c0..eb9502b90 100644 --- a/client/views/posts/posts_digest.html +++ b/client/views/posts/posts_digest.html @@ -10,14 +10,16 @@ Next Day {{/if}} - -
- {{#if noPostsToday}} -

Sorry, no posts for today.

- {{else}} +
+ {{#if hasPosts}} +
{{#each posts}} {{> post_item}} {{/each}} - {{/if}} -
+ + {{else}} +
+

Sorry, no posts for today.

+
+ {{/if}} diff --git a/client/views/posts/posts_digest.js b/client/views/posts/posts_digest.js index 9096a1bc8..37db7aac4 100644 --- a/client/views/posts/posts_digest.js +++ b/client/views/posts/posts_digest.js @@ -1,9 +1,6 @@ Template.posts_digest.helpers({ hasPosts: function(){ - // return digestHandle && digestHandle.ready(); - }, - noPostsToday: function(){ - // return digestHandle && digestHandle.ready() && !findDigestPosts(moment(Session.get('currentDate'))).count(); + return !!this.posts.count(); }, currentDate: function(){ var currentDate=moment(Session.get('currentDate'));