codecombat/app/templates/play/ladder/ladder_tab.jade

41 lines
1.8 KiB
Text
Raw Normal View History

2014-03-02 15:43:21 -05:00
div#columns.row
for team in teams
div.column.col-md-6
table.table.table-bordered.table-condensed.table-hover
tr
th
th(colspan=3, style="color: #{team.primaryColor}")
2014-03-02 15:43:21 -05:00
span= team.name
span
2014-03-12 15:51:38 -04:00
span(data-i18n="ladder.leaderboard") Leaderboard
2014-03-02 15:43:21 -05:00
tr
th
2014-03-12 16:25:14 -04:00
th(data-i18n="general.score") Score
2014-03-12 15:51:38 -04:00
th(data-i18n="general.name").name-col-cell Name
2014-03-02 15:43:21 -05:00
th
- var topSessions = team.leaderboard.topPlayers.models;
- var inTheTop = team.leaderboard.inTopSessions();
- if(!inTheTop) topSessions = topSessions.slice(0, 10);
for session, rank in topSessions
2014-03-02 15:43:21 -05:00
- var myRow = session.get('creator') == me.id
tr(class=myRow ? "success" : "")
td.rank-cell= rank + 1
td.score-cell= Math.round(session.get('totalScore') * 100)
2014-03-02 15:43:21 -05:00
td.name-col-cell= session.get('creatorName') || "Anonymous"
td.fight-cell
2014-03-03 14:11:27 -05:00
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{team.otherTeam}&opponent=#{session.id}")
span(data-i18n="ladder.fight") Fight!
2014-03-20 22:18:46 -04:00
if !inTheTop && ! me.get('anonymous')
tr(class="active")
td(colspan=4).ellipsis-row ...
for session in team.leaderboard.nearbySessions()
- var myRow = session.get('creator') == me.id
tr(class=myRow ? "success" : "")
td.rank-cell= session.rank
td.score-cell= Math.round(session.get('totalScore') * 100)
td.name-col-cell= session.get('creatorName') || "Anonymous"
td.fight-cell
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{team.otherTeam}&opponent=#{session.id}")
span(data-i18n="ladder.fight") Fight!