Fixed #2416: LadderTabView now shows hero portraits.

This commit is contained in:
Nick Winter 2015-04-13 16:17:22 -07:00
parent 588b7c9834
commit 8649383a8c
4 changed files with 15 additions and 4 deletions

View file

@ -51,10 +51,11 @@
td
padding: 1px 2px
.code-language-cell
.code-language-cell, .hero-portrait-cell
padding: 0 10px
background: transparent url(/images/common/code_languages/javascript_icon.png) no-repeat center center
height: 16px
background-size: 16px 16px
.spectate-cell
cursor: pointer

View file

@ -38,6 +38,12 @@
td
padding: 1px 2px
.name-cell
max-width: 130px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
.code-language-cell
padding: 0 10px
background: transparent url(/images/common/code_languages/javascript_icon.png) no-repeat center center

View file

@ -5,12 +5,12 @@ div#columns.row
table.table.table-bordered.table-condensed.table-hover(data-team=team.id)
thead
tr
th(colspan=2)
th(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
th(colspan=4, style="color: #{team.primaryColor}")
span= team.name
span.spl(data-i18n="ladder.leaderboard") Leaderboard
tr
th(colspan=2)
th(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
th(data-i18n="general.score") Score
th(data-i18n="general.name").name-col-cell Name
th
@ -25,6 +25,8 @@ div#columns.row
- var myRow = session.get('creator') == me.id
tr(class=myRow ? "success" : "", data-player-id=session.get('creator'), data-session-id=session.id)
td.code-language-cell(style="background-image: url(/images/common/code_languages/" + session.get('submittedCodeLanguage') + "_icon.png)" title=capitalize(session.get('submittedCodeLanguage')))
if level.get('type', true) == 'hero-ladder'
td.hero-portrait-cell(style="background-image: url(/file/db/thang.type/#{(session.get('heroConfig') || {}).thangType || '529ffbf1cf1818f2be000001'}/portrait.png)")
td.rank-cell= rank + 1
td.score-cell= Math.round(session.get('totalScore') * 100)
td.name-col-cell= session.get('creatorName') || "Anonymous"
@ -41,6 +43,8 @@ div#columns.row
- var myRow = session.get('creator') == me.id
tr(class=myRow ? "success" : "", data-player-id=session.get('creator'), data-session-id=session.id)
td.code-language-cell(style="background-image: url(/images/common/code_languages/" + session.get('submittedCodeLanguage') + "_icon.png)")
if level.get('type', true) == 'hero-ladder'
td.hero-portrait-cell(style="background-image: url(/file/db/thang.type/#{(session.get('heroConfig') || {}).thangType || '529ffbf1cf1818f2be000001'}/portrait.png)")
td.rank-cell= session.rank
td.score-cell= Math.round(session.get('totalScore') * 100)
td.name-col-cell= session.get('creatorName') || "Anonymous"

View file

@ -197,7 +197,7 @@ LevelHandler = class LevelHandler extends Handler
sortParameters =
'totalScore': req.query.order
selectProperties = ['totalScore', 'creatorName', 'creator', 'submittedCodeLanguage']
selectProperties = ['totalScore', 'creatorName', 'creator', 'submittedCodeLanguage', 'heroConfig']
query = Session
.find(sessionsQueryParameters)