From be78ab73fa4ca64c0f9d4be34a3a08f9b4f32785 Mon Sep 17 00:00:00 2001 From: Jonathan M Tran Date: Tue, 16 Apr 2013 22:23:47 -0700 Subject: [PATCH 1/2] Created a helper to address the '1 comments -> 1 comment' problem --- client/views/posts/post_item.html | 2 +- client/views/posts/post_item.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 client/views/posts/post_item.html mode change 100644 => 100755 client/views/posts/post_item.js diff --git a/client/views/posts/post_item.html b/client/views/posts/post_item.html old mode 100644 new mode 100755 index e1dbbdc7f..ed171f961 --- a/client/views/posts/post_item.html +++ b/client/views/posts/post_item.html @@ -38,7 +38,7 @@ {{name}} {{/each}} -

{{votes}} points by {{ago}}, {{comments}} comments +

{{votes}} points by {{ago}}, {{comments}} {{commentsDisplayText}} {{#if can_edit}} | Edit {{/if}} diff --git a/client/views/posts/post_item.js b/client/views/posts/post_item.js old mode 100644 new mode 100755 index 94da6cfb1..3bf9387ba --- a/client/views/posts/post_item.js +++ b/client/views/posts/post_item.js @@ -58,7 +58,10 @@ Template.post_item.helpers({ }, categoryLink: function(){ return getCategoryUrl(this.slug); - } + }, + commentsDisplayText: function(){ + return this.comments == 1 ? 'comment' : 'comments'; + }, }); Template.post_item.rendered = function(){ From 87f5664e1c870ee9622ffb968257e6d528482784 Mon Sep 17 00:00:00 2001 From: Jonathan M Tran Date: Thu, 18 Apr 2013 23:20:07 -0700 Subject: [PATCH 2/2] Fix for nothing happening when editing another user --- client/views/posts/post_item.html | 0 client/views/posts/post_item.js | 0 client/views/users/user_edit.js | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 client/views/posts/post_item.html mode change 100755 => 100644 client/views/posts/post_item.js diff --git a/client/views/posts/post_item.html b/client/views/posts/post_item.html old mode 100755 new mode 100644 diff --git a/client/views/posts/post_item.js b/client/views/posts/post_item.js old mode 100755 new mode 100644 diff --git a/client/views/users/user_edit.js b/client/views/users/user_edit.js index e15aae911..99451356f 100644 --- a/client/views/users/user_edit.js +++ b/client/views/users/user_edit.js @@ -12,7 +12,7 @@ Template.user_edit.helpers({ userEmail : function(){ var currentUser = Meteor.user(); if(Session.get('selectedUserId') && !currentUser.loading && currentUser.isAdmin){ - currentUserMeteor.users.findOne(Session.get('selectedUserId')); + currentUser = Meteor.users.findOne(Session.get('selectedUserId')); } return getEmail(currentUser); }, @@ -64,4 +64,4 @@ Template.user_edit.events = { }); } -}; \ No newline at end of file +};