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> <a href="{{nextDateURL}}" class="next-link">Next Day</a>
{{/if}} {{/if}}
</div> </div>
</div> </div>
<div class="posts grid list"> {{#if hasPosts}}
{{#if noPostsToday}} <div class="posts grid list">
<p>Sorry, no posts for today.</p>
{{else}}
{{#each posts}} {{#each posts}}
{{> post_item}} {{> post_item}}
{{/each}} {{/each}}
{{/if}} </div>
</div> {{else}}
<div class="grid-small grid-block dialog">
<p>Sorry, no posts for today.</p>
</div>
{{/if}}
</template> </template>

View file

@ -1,9 +1,6 @@
Template.posts_digest.helpers({ Template.posts_digest.helpers({
hasPosts: function(){ hasPosts: function(){
// return digestHandle && digestHandle.ready(); return !!this.posts.count();
},
noPostsToday: function(){
// return digestHandle && digestHandle.ready() && !findDigestPosts(moment(Session.get('currentDate'))).count();
}, },
currentDate: function(){ currentDate: function(){
var currentDate=moment(Session.get('currentDate')); var currentDate=moment(Session.get('currentDate'));