From f9290a443448967baeb09c220245e8c72de42b85 Mon Sep 17 00:00:00 2001 From: Vidit Date: Fri, 16 Feb 2018 06:01:57 +0530 Subject: [PATCH] added count of research notes and comments on profile page (#2263) * added count of research notes and comments on profile page fixes #2262 * minor changes --- app/controllers/users_controller.rb | 2 ++ app/views/users/profile.html.erb | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 85f106d287..921f0dd0f2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -128,6 +128,8 @@ def profile .limit(20) @wikis = wikis.collect(&:parent).uniq + @comment_count = Comment.where(status: 0, uid: @user.uid).count + # User's social links @github = @profile_user.social_link("github") @twitter = @profile_user.social_link("twitter") diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 2fd4141362..bb58b24815 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -168,12 +168,14 @@
+ <%= raw t('users.profile.joined_time_ago', :time_ago => distance_of_time_in_words(@user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' })) %> +
+