在 Ticket 页面加上用户信息

This commit is contained in:
jysperm
2014-04-27 01:26:36 +08:00
parent a4af987da7
commit b44c1e4579
4 changed files with 29 additions and 5 deletions

View File

@@ -30,8 +30,16 @@ module.exports =
unless mTicket.getMember ticket, account
return res.send 403
renderer 'ticket/view',
ticket: ticket
async.map ticket.replys, (reply, callback) ->
mAccount.findId reply.account_id, (reply_account) ->
reply.account = reply_account
callback null, reply
, (err, result) ->
ticket.replys = result
renderer 'ticket/view',
ticket: ticket
post:
create: (req, res) ->

View File

@@ -23,7 +23,7 @@ exports.register = (username, email, passwd, callback = null) ->
signup: new Date()
group: []
setting:
avatar_url: crypto.createHash('md5').update(email).digest('hex')
avatar_url: "//ruby-china.org/avatar/#{crypto.createHash('md5').update(email).digest('hex')}?s=58"
attribure:
plans: []
tokens: []

View File

@@ -5,3 +5,16 @@
.list-group-item a {
margin-right: 10px;
}
.list-group-item img {
width: 58px;
height: 58px;
}
.list-content {
margin-left: 68px;
}
.label {
margin-right: 5px;
}

View File

@@ -14,10 +14,13 @@ block main
ul.list-group
for reply in ticket.replys
li.list-group-item.clearfix
a.pull-left(href='/member/')
img(src='http://ruby-china.org/avatar/efcc15b92617a95a09f514a9bff9e6c3?s=58')
a.pull-left
img(src= reply.account.setting.avatar_url)
.list-content
p!= reply.content_html
p
span.label.label-info= reply.account.username
span.label.label-default= reply.created_at
.row
header= t('ticket.create_reply')