added notice when digest has no posts

This commit is contained in:
Sacha Greif 2013-10-27 09:38:21 +09:00
parent 62a8c49e6c
commit 714522476c
2 changed files with 10 additions and 11 deletions

View file

@ -10,14 +10,16 @@
<a href="{{nextDateURL}}" class="next-link">Next Day</a>
{{/if}}
</div>
</div>
<div class="posts grid list">
{{#if noPostsToday}}
<p>Sorry, no posts for today.</p>
{{else}}
</div>
{{#if hasPosts}}
<div class="posts grid list">
{{#each posts}}
{{> post_item}}
{{/each}}
{{/if}}
</div>
</div>
{{else}}
<div class="grid-small grid-block dialog">
<p>Sorry, no posts for today.</p>
</div>
{{/if}}
</template>

View file

@ -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'));