mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-25 20:30:01 -04:00
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:
parent
6d5ddb65ea
commit
b1fd171a27
5 changed files with 19 additions and 16 deletions
|
@ -1,9 +1,7 @@
|
||||||
#ladder-tab-view
|
#ladder-tab-view
|
||||||
|
.ladder-table
|
||||||
.name-col-cell
|
.name-col-cell
|
||||||
max-width: 100px
|
max-width: 170px
|
||||||
white-space: nowrap
|
|
||||||
overflow: hidden
|
|
||||||
text-overflow: ellipsis
|
|
||||||
|
|
||||||
.histogram-display
|
.histogram-display
|
||||||
height: 130px
|
height: 130px
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
div#columns.row
|
.row
|
||||||
for team, teamIndex in teams
|
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)
|
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
|
thead
|
||||||
tr
|
tr
|
||||||
th(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
|
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(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
|
||||||
th(data-i18n="general.score") Score
|
th(data-i18n="general.score") Score
|
||||||
th(data-i18n="general.name").name-col-cell Name
|
th(data-i18n="general.name").name-col-cell Name
|
||||||
|
th(data-i18n="general.when") When
|
||||||
th
|
th
|
||||||
th.iconic-cell
|
th.iconic-cell
|
||||||
.glyphicon.glyphicon-eye-open
|
.glyphicon.glyphicon-eye-open
|
||||||
|
@ -31,6 +32,7 @@ div#columns.row
|
||||||
td.rank-cell= rank + 1
|
td.rank-cell= rank + 1
|
||||||
td.score-cell= Math.round(sessionStats.totalScore * 100)
|
td.score-cell= Math.round(sessionStats.totalScore * 100)
|
||||||
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
||||||
|
td.age-cell= moment(session.get('submitDate')).fromNow().replace('a few ', '')
|
||||||
td.fight-cell
|
td.fight-cell
|
||||||
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}" + (league ? "&league=" + league.id : ""))
|
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!
|
span(data-i18n="ladder.fight") Fight!
|
||||||
|
@ -50,6 +52,7 @@ div#columns.row
|
||||||
td.rank-cell= session.rank
|
td.rank-cell= session.rank
|
||||||
td.score-cell= Math.round(sessionStats.totalScore * 100)
|
td.score-cell= Math.round(sessionStats.totalScore * 100)
|
||||||
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
||||||
|
td.age-cell= moment(session.get('submitDate')).fromNow().replace('a few ', '')
|
||||||
td.fight-cell
|
td.fight-cell
|
||||||
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}" + (league ? "&league=" + league.id : ""))
|
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!
|
span(data-i18n="ladder.fight") Fight!
|
||||||
|
@ -58,7 +61,7 @@ div#columns.row
|
||||||
if teamIndex == 1
|
if teamIndex == 1
|
||||||
.btn.btn-sm.load-more-ladder-entries(data-i18n="editor.more") More
|
.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
|
h4.friends-header(data-i18n="ladder.friends_playing") Friends Playing
|
||||||
if me.get('anonymous')
|
if me.get('anonymous')
|
||||||
div.alert.alert-info
|
div.alert.alert-info
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
div#columns.row
|
.row
|
||||||
for team in teams
|
for team in teams
|
||||||
div.matches-column.col-md-6
|
div.matches-column.col-md-6
|
||||||
table.table.table-bordered.table-condensed
|
table.table.table-bordered.table-condensed.my-matches-table
|
||||||
|
|
||||||
tr
|
tr
|
||||||
th(colspan=5, style="color: #{team.primaryColor}")
|
th(colspan=5, style="color: #{team.primaryColor}")
|
||||||
|
|
|
@ -33,8 +33,9 @@ module.exports = class LadderTabView extends CocoView
|
||||||
@teams = teamDataFromLevel @level
|
@teams = teamDataFromLevel @level
|
||||||
@leaderboards = {}
|
@leaderboards = {}
|
||||||
@refreshLadder()
|
@refreshLadder()
|
||||||
@socialNetworkRes = @supermodel.addSomethingResource('social_network_apis', 0)
|
# 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.
|
||||||
@checkFriends()
|
#@socialNetworkRes = @supermodel.addSomethingResource('social_network_apis', 0)
|
||||||
|
#@checkFriends()
|
||||||
|
|
||||||
checkFriends: ->
|
checkFriends: ->
|
||||||
return if @checked or (not window.FB) or (not window.gapi)
|
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.capitalize = _.string.capitalize
|
||||||
ctx.league = @options.league
|
ctx.league = @options.league
|
||||||
ctx._ = _
|
ctx._ = _
|
||||||
|
ctx.moment = moment
|
||||||
ctx
|
ctx
|
||||||
|
|
||||||
generateHistogram: (histogramElement, histogramData, teamName) ->
|
generateHistogram: (histogramElement, histogramData, teamName) ->
|
||||||
|
@ -196,9 +198,9 @@ module.exports = class LadderTabView extends CocoView
|
||||||
top: 20
|
top: 20
|
||||||
right: 20
|
right: 20
|
||||||
bottom: 30
|
bottom: 30
|
||||||
left: 0
|
left: 15
|
||||||
|
|
||||||
width = 300 - margin.left - margin.right
|
width = 470 - margin.left - margin.right
|
||||||
height = 125 - margin.top - margin.bottom
|
height = 125 - margin.top - margin.bottom
|
||||||
|
|
||||||
formatCount = d3.format(',.0')
|
formatCount = d3.format(',.0')
|
||||||
|
|
|
@ -205,7 +205,7 @@ LevelHandler = class LevelHandler extends Handler
|
||||||
|
|
||||||
sortParameters =
|
sortParameters =
|
||||||
'totalScore': req.query.order
|
'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
|
query = Session
|
||||||
.find(sessionsQueryParameters)
|
.find(sessionsQueryParameters)
|
||||||
|
|
Loading…
Add table
Reference in a new issue