Skip to content

Commit

Permalink
排行榜显示用户参与杯赛的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Dec 7, 2014
1 parent 71103fc commit 88df91a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion client/css/rank.css
Expand Up @@ -11,5 +11,9 @@

.rank-section table {
margin: 10px auto;
width: 600px;
width: 700px;
}

.rank-section td {
vertical-align: top;
}
2 changes: 1 addition & 1 deletion routes/rank.js
Expand Up @@ -5,7 +5,7 @@ app.get('/', function(req, res) {
where: 'rank IS NOT NULL',
limit: 100,
order: 'rank ASC',
include: [{ model: User }]
include: [{ model: User, include: [{ model: Tournament }]}]
}).done(function(err, rank) {
res.render('rank', { rank: rank });
});
Expand Down
5 changes: 4 additions & 1 deletion views/rank.jade
Expand Up @@ -21,7 +21,10 @@ block content
tr
td #{index + 1}
td
a(href="/#{item.User.login}") #{item.User.name}
a(href="/#{item.User.login}")
img(src="#{item.User.avatar}", width="32")
if item.User.Tournaments.length > 0
span [<a href="/tournaments/#{item.User.Tournaments[0].id}">杯赛</a>]
td #{item.win}
td #{item.lost}
td #{Math.round(item.win / (item.win + item.lost) * 100)}%
Expand Down

0 comments on commit 88df91a

Please sign in to comment.