Opening up the ladder tab view by hiding the FB/G+ ladder column for now. Adding submitted dates to the leaderboards.

This commit is contained in:
Nick Winter 2015-09-08 06:44:26 -07:00
parent 6d5ddb65ea
commit b1fd171a27
5 changed files with 19 additions and 16 deletions

View file

@ -1,9 +1,7 @@
#ladder-tab-view
.ladder-table
.name-col-cell
max-width: 100px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
max-width: 170px
.histogram-display
height: 130px

View file

@ -1,8 +1,8 @@
div#columns.row
.row
for team, teamIndex in teams
div.column.col-md-4
div.column.col-md-6
div(id="histogram-display-#{team.name}", class="histogram-display", data-team-name=team.name)
table.table.table-bordered.table-condensed.table-hover(data-team=team.id)
table.table.table-bordered.table-condensed.table-hover.ladder-table(data-team=team.id)
thead
tr
th(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
@ -13,6 +13,7 @@ div#columns.row
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(data-i18n="general.when") When
th
th.iconic-cell
.glyphicon.glyphicon-eye-open
@ -31,6 +32,7 @@ div#columns.row
td.rank-cell= rank + 1
td.score-cell= Math.round(sessionStats.totalScore * 100)
td.name-col-cell= session.get('creatorName') || "Anonymous"
td.age-cell= moment(session.get('submitDate')).fromNow().replace('a few ', '')
td.fight-cell
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}" + (league ? "&league=" + league.id : ""))
span(data-i18n="ladder.fight") Fight!
@ -50,6 +52,7 @@ div#columns.row
td.rank-cell= session.rank
td.score-cell= Math.round(sessionStats.totalScore * 100)
td.name-col-cell= session.get('creatorName') || "Anonymous"
td.age-cell= moment(session.get('submitDate')).fromNow().replace('a few ', '')
td.fight-cell
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}" + (league ? "&league=" + league.id : ""))
span(data-i18n="ladder.fight") Fight!
@ -58,7 +61,7 @@ div#columns.row
if teamIndex == 1
.btn.btn-sm.load-more-ladder-entries(data-i18n="editor.more") More
div.column.col-md-4
div.column.col-md-4.secret
h4.friends-header(data-i18n="ladder.friends_playing") Friends Playing
if me.get('anonymous')
div.alert.alert-info

View file

@ -1,7 +1,7 @@
div#columns.row
.row
for team in teams
div.matches-column.col-md-6
table.table.table-bordered.table-condensed
table.table.table-bordered.table-condensed.my-matches-table
tr
th(colspan=5, style="color: #{team.primaryColor}")

View file

@ -33,8 +33,9 @@ module.exports = class LadderTabView extends CocoView
@teams = teamDataFromLevel @level
@leaderboards = {}
@refreshLadder()
@socialNetworkRes = @supermodel.addSomethingResource('social_network_apis', 0)
@checkFriends()
# Trying not loading the FP/G+ stuff for now to see if anyone complains they were using it so we can have just two columns.
#@socialNetworkRes = @supermodel.addSomethingResource('social_network_apis', 0)
#@checkFriends()
checkFriends: ->
return if @checked or (not window.FB) or (not window.gapi)
@ -185,6 +186,7 @@ module.exports = class LadderTabView extends CocoView
ctx.capitalize = _.string.capitalize
ctx.league = @options.league
ctx._ = _
ctx.moment = moment
ctx
generateHistogram: (histogramElement, histogramData, teamName) ->
@ -196,9 +198,9 @@ module.exports = class LadderTabView extends CocoView
top: 20
right: 20
bottom: 30
left: 0
left: 15
width = 300 - margin.left - margin.right
width = 470 - margin.left - margin.right
height = 125 - margin.top - margin.bottom
formatCount = d3.format(',.0')

View file

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