From 2ba5234282e4dbf0bf04e5f165558b5eef5db75d Mon Sep 17 00:00:00 2001 From: ViditChitkara Date: Wed, 7 Feb 2018 00:13:14 +0530 Subject: [PATCH 1/2] added count of research notes and comments on profile page fixes #2262 --- app/controllers/users_controller.rb | 2 ++ app/views/users/profile.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d98af39aea..e2e5bd487c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -127,6 +127,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 4a24f861d6..f2ea5af9cc 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -170,10 +170,10 @@ From d4363dc78b201a408525273d424195a4a838a941 Mon Sep 17 00:00:00 2001 From: ViditChitkara Date: Wed, 7 Feb 2018 01:44:32 +0530 Subject: [PATCH 2/2] minor changes --- app/views/users/profile.html.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index f2ea5af9cc..74eefdd83e 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' })) %> +
+