Merge pull request from rubenvereecken/meh

Table headers are now unhoverable
This commit is contained in:
Nick Winter 2014-08-08 08:38:05 -07:00
commit cc0ea25262
2 changed files with 62 additions and 58 deletions
app/templates/play/ladder

View file

@ -3,47 +3,49 @@ div#columns.row
div.column.col-md-4 div.column.col-md-4
div(id="histogram-display-#{team.name}", class="histogram-display",data-team-name=team.name) div(id="histogram-display-#{team.name}", class="histogram-display",data-team-name=team.name)
table.table.table-bordered.table-condensed.table-hover table.table.table-bordered.table-condensed.table-hover
tr thead
th(colspan=2) tr
th(colspan=3, style="color: #{team.primaryColor}") th(colspan=2)
span= team.name th(colspan=3, style="color: #{team.primaryColor}")
span span= team.name
span(data-i18n="ladder.leaderboard") Leaderboard span
tr span(data-i18n="ladder.leaderboard") Leaderboard
th(colspan=2) tr
th(data-i18n="general.score") Score th(colspan=2)
th(data-i18n="general.name").name-col-cell Name th(data-i18n="general.score") Score
th th(data-i18n="general.name").name-col-cell Name
th
- var topSessions = team.leaderboard.topPlayers.models; tbody
- var showJustTop = team.leaderboard.inTopSessions() || me.get('anonymous'); - var topSessions = team.leaderboard.topPlayers.models;
- if(!showJustTop && topSessions.length == 20) topSessions = topSessions.slice(0, 10); - var showJustTop = team.leaderboard.inTopSessions() || me.get('anonymous');
for session, rank in topSessions - if(!showJustTop && topSessions.length == 20) topSessions = topSessions.slice(0, 10);
- var myRow = session.get('creator') == me.id for session, rank in topSessions
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')))
td.rank-cell= rank + 1
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!
if !showJustTop && team.leaderboard.nearbySessions().length
tr(class="active")
td(colspan=4).ellipsis-row ...
for session in team.leaderboard.nearbySessions()
- var myRow = session.get('creator') == me.id - var myRow = session.get('creator') == me.id
tr(class=myRow ? "success" : "", data-player-id=session.get('creator'), data-session-id=session.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)") td.code-language-cell(style="background-image: url(/images/common/code_languages/" + session.get('submittedCodeLanguage') + "_icon.png)" title=capitalize(session.get('submittedCodeLanguage')))
td.rank-cell= session.rank td.rank-cell= rank + 1
td.score-cell= Math.round(session.get('totalScore') * 100) td.score-cell= Math.round(session.get('totalScore') * 100)
td.name-col-cell= session.get('creatorName') || "Anonymous" td.name-col-cell= session.get('creatorName') || "Anonymous"
td.fight-cell td.fight-cell
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}") a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}")
span(data-i18n="ladder.fight") Fight! span(data-i18n="ladder.fight") Fight!
if teamIndex == 1
.btn.btn-sm.load-more-ladder-entries More if !showJustTop && team.leaderboard.nearbySessions().length
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" : "", 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)")
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!
if teamIndex == 1
.btn.btn-sm.load-more-ladder-entries More
div.column.col-md-4 div.column.col-md-4
h4.friends-header(data-i18n="ladder.friends_playing") Friends Playing h4.friends-header(data-i18n="ladder.friends_playing") Friends Playing

View file

@ -20,33 +20,35 @@ p.simulation-count
| |
span#games-in-queue= numberOfGamesInQueue || 0 span#games-in-queue= numberOfGamesInQueue || 0
table.table.table-bordered.table-condensed.table-hover table.table.table-bordered.table-condensed.table-hover
tr thead
th tr
th(data-i18n="general.player").name-col-cell Player th
th(data-i18n="ladder.games_simulated") Games simulated th(data-i18n="general.player").name-col-cell Player
th(data-i18n="ladder.games_played") Games played th(data-i18n="ladder.games_simulated") Games simulated
th(data-i18n="ladder.ratio") Ratio th(data-i18n="ladder.games_played") Games played
- var topSimulators = simulatorsLeaderboardData.topSimulators.models; th(data-i18n="ladder.ratio") Ratio
- var showJustTop = simulatorsLeaderboardData.inTopSimulators() || me.get('anonymous'); tbody
- if(!showJustTop) topSimulators = topSimulators.slice(0, 10); - var topSimulators = simulatorsLeaderboardData.topSimulators.models;
for user, rank in topSimulators - var showJustTop = simulatorsLeaderboardData.inTopSimulators() || me.get('anonymous');
- var myRow = user.id == me.id - if(!showJustTop) topSimulators = topSimulators.slice(0, 10);
tr(class=myRow ? "success" : "") for user, rank in topSimulators
td.simulator-leaderboard-cell= rank + 1
td.name-col-cell= user.get('name') || "Anonymous"
td.simulator-leaderboard-cell= user.get('simulatedBy')
td.simulator-leaderboard-cell= user.get('simulatedFor')
td.simulator-leaderboard-cell= Math.round((user.get('simulatedBy') / user.get('simulatedFor')) * 10) / 10
if !showJustTop && simulatorsLeaderboardData.nearbySimulators().length
tr(class="active")
td(colspan=5).ellipsis-row ...
for user in simulatorsLeaderboardData.nearbySimulators()
- var myRow = user.id == me.id - var myRow = user.id == me.id
- var ratio = user.get('simulatedBy') / user.get('simulatedFor');
tr(class=myRow ? "success" : "") tr(class=myRow ? "success" : "")
td.simulator-leaderboard-cell= user.rank td.simulator-leaderboard-cell= rank + 1
td.name-col-cell= user.get('name') || "Anonymous" td.name-col-cell= user.get('name') || "Anonymous"
td.simulator-leaderboard-cell= user.get('simulatedBy') td.simulator-leaderboard-cell= user.get('simulatedBy')
td.simulator-leaderboard-cell= user.get('simulatedFor') td.simulator-leaderboard-cell= user.get('simulatedFor')
td.simulator-leaderboard-cell= _.isNaN(ratio) || ratio == Infinity ? '' : ratio.toFixed(1) td.simulator-leaderboard-cell= Math.round((user.get('simulatedBy') / user.get('simulatedFor')) * 10) / 10
if !showJustTop && simulatorsLeaderboardData.nearbySimulators().length
tr(class="active")
td(colspan=5).ellipsis-row ...
for user in simulatorsLeaderboardData.nearbySimulators()
- var myRow = user.id == me.id
- var ratio = user.get('simulatedBy') / user.get('simulatedFor');
tr(class=myRow ? "success" : "")
td.simulator-leaderboard-cell= user.rank
td.name-col-cell= user.get('name') || "Anonymous"
td.simulator-leaderboard-cell= user.get('simulatedBy')
td.simulator-leaderboard-cell= user.get('simulatedFor')
td.simulator-leaderboard-cell= _.isNaN(ratio) || ratio == Infinity ? '' : ratio.toFixed(1)