From 48d5100dfe0bed270b0c212584fef4bcc8edeb6e Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Mon, 6 May 2013 13:25:07 -0400 Subject: [PATCH] some profile changes, added post count to users and account and some css to account --- public/css/style.less | 14 ++++++++++++++ public/templates/account.tpl | 37 +++++++++++++++++++++++++----------- src/posts.js | 5 ++++- src/user.js | 3 ++- 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/public/css/style.less b/public/css/style.less index 13c2f43c56..1e6a81775d 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -272,4 +272,18 @@ footer.footer { color: rgb(100,100,100); font-weight: 600; cursor: pointer; +} + +.account-username{ + font-size:20px; + font-weight:bold; +} + +.account-bio-block{ + display:inline-block; +} + +.account-bio-label{ + display:inline-block; + width:100px; } \ No newline at end of file diff --git a/public/templates/account.tpl b/public/templates/account.tpl index 2b1ce5b327..af8a5715d8 100644 --- a/public/templates/account.tpl +++ b/public/templates/account.tpl @@ -7,21 +7,36 @@ + + {user.username} +
+ +
+ +
+ +
+ + {user.joindate} +
+ + + {user.reputation} +
- + + {user.postcount} +
+
- {user.username} -
+ + + +
+ +
-
- Member for - {user.joindate} -
- - Reputation - {user.reputation} -
diff --git a/src/posts.js b/src/posts.js index 8a4bf8a4f5..e03badb1fd 100644 --- a/src/posts.js +++ b/src/posts.js @@ -202,7 +202,10 @@ var RDB = require('./redis.js'), // User Details - move this out later RDB.lpush('uid:' + uid + ':posts', pid); - if (callback) callback(pid); + RDB.db.hincrby(uid, 'postcount', 1); + + if (callback) + callback(pid); }); } diff --git a/src/user.js b/src/user.js index 068327ebd2..718827e130 100644 --- a/src/user.js +++ b/src/user.js @@ -197,7 +197,8 @@ var config = require('../config.js'), 'joindate' : new Date().getTime(), 'password' : hash, 'picture' : User.createGravatarURLFromEmail(email), - 'reputation': 0 + 'reputation': 0, + 'postcount': 0 }); RDB.set('username:' + username + ':uid', uid);