mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
UI 修改. thx to https://github.com/cnodejs/nodeclub/pull/373
This commit is contained in:
parent
b9f2c85c10
commit
eb8f732afb
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
@ -6,11 +6,13 @@
|
||||
<span class='user_name'><a class='dark' href="/user/<%= user.name %>"><%= user.name %></a></span>
|
||||
|
||||
<% if (typeof(current_user) !== 'undefined' && current_user._id != user._id) { %>
|
||||
<div class="board clearfix">
|
||||
<% if (typeof(relation) === 'undefined' || !relation) { %>
|
||||
<button class='btn btn-success follow_btn' action='follow'>加入关注</button>
|
||||
<% } else { %>
|
||||
<button class='btn follow_btn' action='un_follow'>取消关注</button>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<div class='board clearfix'>
|
||||
@ -23,6 +25,8 @@
|
||||
<a href='/user/<%= user.name %>/follower'><span class='big'><%= user.follower_count %></span> 粉丝</a>
|
||||
<div class='space'></div>
|
||||
<span class='big'><%= user.score %></span> 积分
|
||||
<div class="space"></div>
|
||||
<span class="signature"><%= user.signature || '' %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,24 +12,7 @@
|
||||
<div class='user_big_avatar'>
|
||||
<img src="<%= user.avatar_url %>" class="user_avatar" title="<%= user.name %>" />
|
||||
</div>
|
||||
<% if (typeof(current_user) !== 'undefined' && current_user._id != user._id) { %>
|
||||
<% if (typeof(relation) === 'undefined' || !relation) { %>
|
||||
<button class='btn btn-success follow_btn' action='follow'>加入关注</button>
|
||||
<% } else { %>
|
||||
<button class='btn follow_btn' action='un_follow'>取消关注</button>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<a class='dark'><%= user.name %></a>
|
||||
<div class='col_fade'>
|
||||
<span>
|
||||
<img src="<%- config.site_static_host %>/public/images/cert_icon&16.png" />
|
||||
<%= user.following_count %> 关注
|
||||
<%= user.follower_count %> 粉丝
|
||||
<%= user.score %> 积分</span>
|
||||
<% if (user.signature) { %>
|
||||
<span><%= user.signature %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class='user_profile'>
|
||||
<ul class='unstyled'>
|
||||
<% if (user.url) { %>
|
||||
@ -41,7 +24,7 @@
|
||||
<% if (user.location) { %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>/public/images/compass_icon&16.png" />
|
||||
<span class='col_fade'><%= user.location %></span>
|
||||
<span class='dark'><%= user.location %></span>
|
||||
</li>
|
||||
<% } %>
|
||||
<% if (user.githubUsername) { %>
|
||||
@ -59,11 +42,8 @@
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
<% if (user.profile) { %>
|
||||
<p><%= user.profile %></p>
|
||||
<% } %>
|
||||
</div>
|
||||
<p class='col_fade'>于 <%= user.friendly_create_at %> 加入 <%= config.name %></p>
|
||||
<p class='col_fade'>注册时间 <%= user.friendly_create_at %></p>
|
||||
<% if (typeof(current_user) !== 'undefined' && current_user.is_admin) { %>
|
||||
<% if (!user.is_star) { %>
|
||||
<button class='btn' id='set_star_btn' action='set_star'>设为达人</button>
|
||||
@ -88,7 +68,7 @@
|
||||
|
||||
<div class='panel'>
|
||||
<div class='header'>
|
||||
<span class='col_fade'>最近发布话题</span>
|
||||
<span class='col_fade'>最近创建的话题</span>
|
||||
</div>
|
||||
<% if (typeof(recent_topics) !== 'undefined' && recent_topics.length > 0) { %>
|
||||
<%- partial('../topic/abstract', { collection: recent_topics, as: 'topic' }) %>
|
||||
@ -104,7 +84,7 @@
|
||||
|
||||
<div class='panel'>
|
||||
<div class='header'>
|
||||
<span class='col_fade'>最近参与话题</span>
|
||||
<span class='col_fade'>最近参与的话题</span>
|
||||
</div>
|
||||
<% if (typeof(recent_replies) !== 'undefined' && recent_replies.length > 0) { %>
|
||||
<%- partial('../topic/abstract', { collection: recent_replies, as: 'topic' }) %>
|
||||
|
||||
@ -5,66 +5,12 @@
|
||||
<div class='header'>
|
||||
<ul class='breadcrumb'>
|
||||
<li><a href='/'>主页</a><span class='divider'>/</span></li>
|
||||
<li class='active'><%= user.name %></li>
|
||||
<li class='active'><a href="/user/<%=user.name%>"><%=user.name%>的主页</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='inner'>
|
||||
<div class='user_big_avatar'>
|
||||
<img src="<%= user.avatar_url %>" title="<%= user.name %>" />
|
||||
</div>
|
||||
<% if (typeof(current_user) !== 'undefined' && current_user._id != user._id) { %>
|
||||
<% if (typeof(relation) === 'undefined' || !relation) { %>
|
||||
<button class='btn btn-success follow_btn' action='follow'>加入关注</button>
|
||||
<% } else { %>
|
||||
<button class='btn follow_btn' action='un_follow'>取消关注</button>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<h2><%= user.name %></h2>
|
||||
<div class='col_fade'>
|
||||
<span><img src="<%- config.site_static_host %>/public/images/cert_icon&16.png" /> <%= user.follower_count %> 粉丝</span>
|
||||
<% if(user.signature){ %>
|
||||
<span><%= user.signature %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class='user_profile'>
|
||||
<ul class='unstyled'>
|
||||
<% if(user.url){ %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>/public/images/paper_airplane_icon&16.png" />
|
||||
<a class='dark' href="<%= user.url %>" target='_blank'><%= user.url %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
<% if(user.location){ %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>/public/images/compass_icon&16.png" />
|
||||
<span class='col_fade'><%= user.location %></span>
|
||||
</li>
|
||||
<% } %>
|
||||
<% if(user.weibo){ %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>/public/images/twitter_2_icon&16.png" />
|
||||
<a class='dark' href="<%= user.weibo %>" target='_blank'><%= user.weibo %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
<% if (user.profile) { %>
|
||||
<p><%= user.profile %></p>
|
||||
<% } %>
|
||||
</div>
|
||||
<p class='col_fade'>于 <%= user.friendly_create_at %> 加入 <%= config.name %></p>
|
||||
<% if(typeof(current_user) !== 'undefined' && current_user.is_admin){ %>
|
||||
<% if(!user.is_star){ %>
|
||||
<button class='btn' id='set_star_btn' action='set_star'>设为达人</button>
|
||||
<% } else { %>
|
||||
<button class='btn' id='set_star_btn' action='cancel_star'>取消达人</button>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel'>
|
||||
<div class='header'>
|
||||
<span class='col_fade'><%= user.name %> 参与的话题</span>
|
||||
</div>
|
||||
<div class="header"><%= user.name %> 参与的话题</div>
|
||||
<% 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 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if (typeof(current_user) !== 'undefined') { %>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#set_star_btn').click(function () {
|
||||
var $me = $(this);
|
||||
var action = $me.attr('action');
|
||||
$.post('/user/'+action,{user_id: '<%= user._id %>'},function (data) {
|
||||
if(data.status == 'success'){
|
||||
if(action == 'set_star'){
|
||||
$me.html('取消达人');
|
||||
$me.attr('action','cancel_star');
|
||||
}else{
|
||||
$me.html('设为达人');
|
||||
$me.attr('action','set_star');
|
||||
}
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
@ -64,16 +64,6 @@
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class='control-group'>
|
||||
<label class='control-label' for='profile'>个人简介</label>
|
||||
<div class='controls'>
|
||||
<% if(typeof(profile) !== 'undefined'){ %>
|
||||
<textarea class='input-xlarge' id='profile' name='profile' rows='4'><%= profile %></textarea>
|
||||
<% }else{ %>
|
||||
<textarea class='input-xlarge' id='profile' name='profile' rows='4'></textarea>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class='control-group'>
|
||||
<label class='control-label' for='weibo'>微博</label>
|
||||
<div class='controls'>
|
||||
|
||||
@ -5,67 +5,12 @@
|
||||
<div class='header'>
|
||||
<ul class='breadcrumb'>
|
||||
<li><a href='/'>主页</a><span class='divider'>/</span></li>
|
||||
<li class='active'><%= user.name %></li>
|
||||
<li class='active'><a href="/user/<%=user.name%>"><%=user.name%>的主页</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='inner'>
|
||||
<div class='user_big_avatar'>
|
||||
<img src="<%= user.avatar_url %>" title="<%= user.name %>" />
|
||||
</div>
|
||||
<% if(typeof(current_user) !== 'undefined' && current_user._id != user._id){ %>
|
||||
<% if(typeof(relation) === 'undefined' || !relation){ %>
|
||||
<button class='btn btn-success' id='follow_btn' action='follow'>加入关注</button>
|
||||
<% }else{ %>
|
||||
<button class='btn' id='follow_btn' action='un_follow'>取消关注</button>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<h2><%= user.name %></h2>
|
||||
<div class='col_fade'>
|
||||
<span><img src="<%- config.site_static_host %>/public/images/cert_icon&16.png" /> <%= user.follower_count %> 粉丝</span>
|
||||
<% if (user.signature) { %>
|
||||
<span class='sp10'></span>
|
||||
<span><%= user.signature %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class='user_profile'>
|
||||
<ul class='unstyled'>
|
||||
<% if(user.url){ %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>%>/public/images/paper_airplane_icon&16.png" />
|
||||
<a class='dark' href="<%= user.url %>" target='_blank'><%= user.url %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
<% if (user.location) { %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>/public/images/compass_icon&16.png" />
|
||||
<span class='col_fade'><%= user.location %></span>
|
||||
</li>
|
||||
<% } %>
|
||||
<% if (user.weibo) { %>
|
||||
<li>
|
||||
<img class='user_icon' src="<%- config.site_static_host %>/public/images/twitter_2_icon&16.png" />
|
||||
<a class='dark' href="<%= user.weibo %>" target='_blank'><%= user.weibo %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
<% if(user.profile){ %>
|
||||
<p><%= user.profile %></p>
|
||||
<% } %>
|
||||
</div>
|
||||
<p class='col_fade'>于 <%= user.friendly_create_at %> 加入 <%= config.name %></p>
|
||||
<% if(typeof(current_user) !== 'undefined' && current_user.is_admin){ %>
|
||||
<% if(!user.is_star){ %>
|
||||
<button class='btn' id='set_star_btn' action='set_star'>设为达人</button>
|
||||
<% }else{ %>
|
||||
<button class='btn' id='set_star_btn' action='cancel_star'>取消达人</button>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel'>
|
||||
<div class='header'>
|
||||
<span class='col_fade'><%= user.name %> 发布的话题</span>
|
||||
</div>
|
||||
<div class="header"><%=user.name%> 创建的话题</div>
|
||||
<% 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 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if (typeof(current_user) !== 'undefined') { %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#follow_btn').click(function(){
|
||||
var $me = $(this);
|
||||
var action = $me.attr('action');
|
||||
$.post('/user/'+action,{follow_id: '<%= user._id %>'},function(data){
|
||||
if(data.status == 'success'){
|
||||
if(action == 'follow'){
|
||||
$me.html('取消关注');
|
||||
$me.attr('action','un_follow');
|
||||
}else{
|
||||
$me.html('加入关注');
|
||||
$me.attr('action','follow');
|
||||
}
|
||||
$me.toggleClass('btn-success');
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
$('#set_star_btn').click(function(){
|
||||
var $me = $(this);
|
||||
var action = $me.attr('action');
|
||||
$.post('/user/'+action,{user_id: '<%= user._id %>'},function(data){
|
||||
if(data.status == 'success'){
|
||||
if(action == 'set_star'){
|
||||
$me.html('取消达人');
|
||||
$me.attr('action','cancel_star');
|
||||
}else{
|
||||
$me.html('设为达人');
|
||||
$me.attr('action','set_star');
|
||||
}
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user