diff --git a/controllers/user.js b/controllers/user.js
index aca6b10..c4dc204 100644
--- a/controllers/user.js
+++ b/controllers/user.js
@@ -116,7 +116,6 @@ exports.setting = function (req, res, next) {
url: data.url,
location: data.location,
signature: data.signature,
- profile: data.profile,
weibo: data.weibo,
githubUsername: data.github || data.githubUsername,
};
@@ -141,8 +140,6 @@ exports.setting = function (req, res, next) {
location = sanitize(location).xss();
var signature = sanitize(req.body.signature).trim();
signature = sanitize(signature).xss();
- var profile = sanitize(req.body.profile).trim();
- profile = sanitize(profile).xss();
var weibo = sanitize(req.body.weibo).trim();
weibo = sanitize(weibo).xss();
var github = sanitize(req.body.github).trim();
@@ -158,7 +155,6 @@ exports.setting = function (req, res, next) {
user.url = url;
user.location = location;
user.signature = signature;
- user.profile = profile;
user.weibo = weibo;
// create gravatar
user.avatar = User.makeGravatar(user.email);
@@ -167,6 +163,7 @@ exports.setting = function (req, res, next) {
if (err) {
return next(err);
}
+ req.session.user = user.toObject({virtual: true});
return res.redirect('/setting?save=success');
});
});
diff --git a/views/user/card.html b/views/user/card.html
index 8310ffc..317673a 100644
--- a/views/user/card.html
+++ b/views/user/card.html
@@ -6,11 +6,13 @@
<%= user.name %>
<% if (typeof(current_user) !== 'undefined' && current_user._id != user._id) { %>
+
<% if (typeof(relation) === 'undefined' || !relation) { %>
<% } else { %>
<% } %>
+
<% } %>
diff --git a/views/user/index.html b/views/user/index.html
index b8b4e97..7caced0 100644
--- a/views/user/index.html
+++ b/views/user/index.html
@@ -12,24 +12,7 @@
- <% if (typeof(current_user) !== 'undefined' && current_user._id != user._id) { %>
- <% if (typeof(relation) === 'undefined' || !relation) { %>
-
- <% } else { %>
-
- <% } %>
- <% } %>
<%= user.name %>
-
-
-
- <%= user.following_count %> 关注
- <%= user.follower_count %> 粉丝
- <%= user.score %> 积分
- <% if (user.signature) { %>
-
<%= user.signature %>
- <% } %>
-
<% if (user.url) { %>
@@ -41,7 +24,7 @@
<% if (user.location) { %>
-
- <%= user.location %>
+ <%= user.location %>
<% } %>
<% if (user.githubUsername) { %>
@@ -59,11 +42,8 @@
<% } %>
- <% if (user.profile) { %>
-
<%= user.profile %>
- <% } %>
- 于 <%= user.friendly_create_at %> 加入 <%= config.name %>
+ 注册时间 <%= user.friendly_create_at %>
<% if (typeof(current_user) !== 'undefined' && current_user.is_admin) { %>
<% if (!user.is_star) { %>
@@ -88,7 +68,7 @@
<% if (typeof(recent_topics) !== 'undefined' && recent_topics.length > 0) { %>
<%- partial('../topic/abstract', { collection: recent_topics, as: 'topic' }) %>
@@ -104,7 +84,7 @@
<% if (typeof(recent_replies) !== 'undefined' && recent_replies.length > 0) { %>
<%- partial('../topic/abstract', { collection: recent_replies, as: 'topic' }) %>
diff --git a/views/user/replies.html b/views/user/replies.html
index 83a474e..1c0765c 100644
--- a/views/user/replies.html
+++ b/views/user/replies.html
@@ -5,66 +5,12 @@
-
-
-

-
- <% if (typeof(current_user) !== 'undefined' && current_user._id != user._id) { %>
- <% if (typeof(relation) === 'undefined' || !relation) { %>
-
- <% } else { %>
-
- <% } %>
- <% } %>
-
<%= user.name %>
-
-
<%= user.follower_count %> 粉丝
- <% if(user.signature){ %>
-
<%= user.signature %>
- <% } %>
-
-
-
- <% if(user.url){ %>
- -
-
- <%= user.url %>
-
- <% } %>
- <% if(user.location){ %>
- -
-
- <%= user.location %>
-
- <% } %>
- <% if(user.weibo){ %>
- -
-
- <%= user.weibo %>
-
- <% } %>
-
- <% if (user.profile) { %>
-
<%= user.profile %>
- <% } %>
-
-
于 <%= user.friendly_create_at %> 加入 <%= config.name %>
- <% if(typeof(current_user) !== 'undefined' && current_user.is_admin){ %>
- <% if(!user.is_star){ %>
-
- <% } else { %>
-
- <% } %>
- <% } %>
-
-
+
-
+
<% if(typeof(topics) !== 'undefined' && topics.length > 0){ %>
<%- partial('../topic/list', {topics:topics,pages:pages,current_pages:current_page,base:'/user/'+user.name+'/replies'}) %>
<% }else{ %>
@@ -75,24 +21,3 @@
-<% if (typeof(current_user) !== 'undefined') { %>
-
-<% } %>
diff --git a/views/user/setting.html b/views/user/setting.html
index 206e359..dc9593c 100644
--- a/views/user/setting.html
+++ b/views/user/setting.html
@@ -64,16 +64,6 @@
<% } %>
-
-
-
- <% if(typeof(profile) !== 'undefined'){ %>
-
- <% }else{ %>
-
- <% } %>
-
-
diff --git a/views/user/topics.html b/views/user/topics.html
index 4d22cd1..08763fe 100644
--- a/views/user/topics.html
+++ b/views/user/topics.html
@@ -5,67 +5,12 @@
-
-
-

-
- <% if(typeof(current_user) !== 'undefined' && current_user._id != user._id){ %>
- <% if(typeof(relation) === 'undefined' || !relation){ %>
-
- <% }else{ %>
-
- <% } %>
- <% } %>
-
<%= user.name %>
-
-
<%= user.follower_count %> 粉丝
- <% if (user.signature) { %>
-
-
<%= user.signature %>
- <% } %>
-
-
-
- <% if(user.url){ %>
- -
-
- <%= user.url %>
-
- <% } %>
- <% if (user.location) { %>
- -
-
- <%= user.location %>
-
- <% } %>
- <% if (user.weibo) { %>
- -
-
- <%= user.weibo %>
-
- <% } %>
-
- <% if(user.profile){ %>
-
<%= user.profile %>
- <% } %>
-
-
于 <%= user.friendly_create_at %> 加入 <%= config.name %>
- <% if(typeof(current_user) !== 'undefined' && current_user.is_admin){ %>
- <% if(!user.is_star){ %>
-
- <% }else{ %>
-
- <% } %>
- <% } %>
-
-
+
-
+
<% if(typeof(topics) !== 'undefined' && topics.length > 0 ){ %>
<%- partial('../topic/list', {topics:topics,pages:pages,current_pages:current_page,base:'/user/'+user.name+'/topics'}) %>
<% }else{ %>
@@ -76,40 +21,3 @@
-<% if (typeof(current_user) !== 'undefined') { %>
-
-<% } %>