From d54bd804e47a83286a87950c223c5598d3ff84c8 Mon Sep 17 00:00:00 2001 From: David Burles Date: Mon, 15 Sep 2014 12:42:17 +1000 Subject: [PATCH] added incoming posts notification button --- client/helpers/handlebars.js | 5 +++++ client/views/posts/posts_digest.html | 3 +++ client/views/posts/posts_digest.js | 4 ++++ client/views/posts/posts_list.html | 9 +++++---- client/views/posts/posts_list.js | 9 ++++++++- client/views/posts/posts_list_incoming.html | 9 +++++++++ client/views/posts/posts_list_incoming.js | 5 +++++ lib/router.js | 22 ++++++++++++++++++--- 8 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 client/views/posts/posts_list_incoming.html create mode 100644 client/views/posts/posts_list_incoming.js diff --git a/client/helpers/handlebars.js b/client/helpers/handlebars.js index 25739ab84..4593061c1 100644 --- a/client/helpers/handlebars.js +++ b/client/helpers/handlebars.js @@ -67,4 +67,9 @@ UI.registerHelper("sanitize", function(content) { console.log('cleaning up…') console.log(content) return cleanUp(content); +}); + +UI.registerHelper('pluralize', function(count, string) { + string = count === 1 ? string : string + 's'; + return i18n.t(string); }); \ No newline at end of file diff --git a/client/views/posts/posts_digest.html b/client/views/posts/posts_digest.html index 1101b29ed..f2a9dec35 100644 --- a/client/views/posts/posts_digest.html +++ b/client/views/posts/posts_digest.html @@ -11,6 +11,9 @@ {{/if}} + + {{> postsListIncoming count=postsIncoming.count}} + {{#if hasPosts}}
{{#each posts}} diff --git a/client/views/posts/posts_digest.js b/client/views/posts/posts_digest.js index 58dd76ee7..1a45c67f0 100644 --- a/client/views/posts/posts_digest.js +++ b/client/views/posts/posts_digest.js @@ -60,3 +60,7 @@ Template[getTemplate('posts_digest')].rendered = function(){ $('body').css('min-height',distanceFromTop+160); $('.more-button').css('top', distanceFromTop+"px"); } + +Template[getTemplate('posts_digest')].created = function() { + Session.set('listPopulatedAt', new Date()); +}; \ No newline at end of file diff --git a/client/views/posts/posts_list.html b/client/views/posts/posts_list.html index 48bf25cd1..f84b60466 100644 --- a/client/views/posts/posts_list.html +++ b/client/views/posts/posts_list.html @@ -1,9 +1,10 @@