2015-09-08 09:44:26 -04:00
|
|
|
.row
|
2014-04-15 18:01:54 -04:00
|
|
|
for team, teamIndex in teams
|
2015-09-08 09:44:26 -04:00
|
|
|
div.column.col-md-6
|
2015-03-20 18:32:35 -04:00
|
|
|
div(id="histogram-display-#{team.name}", class="histogram-display", data-team-name=team.name)
|
2015-09-08 09:44:26 -04:00
|
|
|
table.table.table-bordered.table-condensed.table-hover.ladder-table(data-team=team.id)
|
2014-08-07 07:10:42 -04:00
|
|
|
thead
|
|
|
|
tr
|
2015-04-13 19:17:22 -04:00
|
|
|
th(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
|
2015-03-20 18:32:35 -04:00
|
|
|
th(colspan=4, style="color: #{team.primaryColor}")
|
2015-09-03 18:46:56 -04:00
|
|
|
span= team.displayName
|
2014-08-19 00:49:58 -04:00
|
|
|
span.spl(data-i18n="ladder.leaderboard") Leaderboard
|
2014-08-07 07:10:42 -04:00
|
|
|
tr
|
2015-04-13 19:17:22 -04:00
|
|
|
th(colspan=level.get('type', true) == 'hero-ladder' ? 3 : 2)
|
2014-08-07 07:10:42 -04:00
|
|
|
th(data-i18n="general.score") Score
|
|
|
|
th(data-i18n="general.name").name-col-cell Name
|
2015-09-08 09:44:26 -04:00
|
|
|
th(data-i18n="general.when") When
|
2014-08-07 07:10:42 -04:00
|
|
|
th
|
2015-03-20 18:32:35 -04:00
|
|
|
th.iconic-cell
|
|
|
|
.glyphicon.glyphicon-eye-open
|
2014-03-02 15:43:21 -05:00
|
|
|
|
2014-08-07 07:10:42 -04:00
|
|
|
tbody
|
|
|
|
- var topSessions = team.leaderboard.topPlayers.models;
|
|
|
|
- var showJustTop = team.leaderboard.inTopSessions() || me.get('anonymous');
|
|
|
|
- if(!showJustTop && topSessions.length == 20) topSessions = topSessions.slice(0, 10);
|
|
|
|
for session, rank in topSessions
|
2014-03-20 17:40:17 -04:00
|
|
|
- var myRow = session.get('creator') == me.id
|
2015-08-19 18:30:37 -04:00
|
|
|
- var sessionStats = league ? (_.find(session.get('leagues') || [], {leagueID: league.id}) || {}).stats || {} : session.attributes;
|
2014-04-15 18:01:54 -04:00
|
|
|
tr(class=myRow ? "success" : "", data-player-id=session.get('creator'), data-session-id=session.id)
|
2014-08-07 07:10:42 -04:00
|
|
|
td.code-language-cell(style="background-image: url(/images/common/code_languages/" + session.get('submittedCodeLanguage') + "_icon.png)" title=capitalize(session.get('submittedCodeLanguage')))
|
2015-04-13 19:17:22 -04:00
|
|
|
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)")
|
2014-08-07 07:10:42 -04:00
|
|
|
td.rank-cell= rank + 1
|
2015-11-24 16:18:38 -05:00
|
|
|
td.score-cell= Math.round((sessionStats.totalScore || session.get('totalScore') / 2) * 100)
|
2015-11-30 18:27:52 -05:00
|
|
|
td(class='name-col-cell' + ((new RegExp('(Simple|Shaman|Brawler|Chieftain|Thoktar) CPU')).test(session.get('creatorName')) ? ' ai' : ''))= session.get('creatorName') || "Anonymous"
|
2015-09-08 09:44:26 -04:00
|
|
|
td.age-cell= moment(session.get('submitDate')).fromNow().replace('a few ', '')
|
2014-03-20 17:40:17 -04:00
|
|
|
td.fight-cell
|
2015-09-04 19:21:35 -04:00
|
|
|
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}" + (league ? "&league=" + league.id : ""))
|
2014-03-21 22:50:54 -04:00
|
|
|
span(data-i18n="ladder.fight") Fight!
|
2015-03-20 18:32:35 -04:00
|
|
|
td.spectate-cell.iconic-cell
|
|
|
|
.glyphicon.glyphicon-eye-open
|
2014-08-07 07:10:42 -04:00
|
|
|
|
|
|
|
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
|
2015-08-19 18:30:37 -04:00
|
|
|
- var sessionStats = league ? (_.find(session.get('leagues'), {leagueID: league.id}) || {}).stats || {} : session.attributes;
|
2014-08-07 07:10:42 -04:00
|
|
|
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)")
|
2015-04-13 19:17:22 -04:00
|
|
|
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)")
|
2014-08-07 07:10:42 -04:00
|
|
|
td.rank-cell= session.rank
|
2015-11-24 16:18:38 -05:00
|
|
|
td.score-cell= Math.round((sessionStats.totalScore || session.get('totalScore') / 2) * 100)
|
2015-11-30 18:27:52 -05:00
|
|
|
td(class='name-col-cell' + ((new RegExp('(Simple|Shaman|Brawler|Chieftain|Thoktar) CPU')).test(session.get('creatorName')) ? ' ai' : ''))= session.get('creatorName') || "Anonymous"
|
2015-09-08 09:44:26 -04:00
|
|
|
td.age-cell= moment(session.get('submitDate')).fromNow().replace('a few ', '')
|
2014-08-07 07:10:42 -04:00
|
|
|
td.fight-cell
|
2015-09-04 19:21:35 -04:00
|
|
|
a(href="/play/level/#{level.get('slug') || level.id}?team=#{team.otherTeam}&opponent=#{session.id}" + (league ? "&league=" + league.id : ""))
|
2014-08-07 07:10:42 -04:00
|
|
|
span(data-i18n="ladder.fight") Fight!
|
2015-03-20 18:32:35 -04:00
|
|
|
td.spectate-cell.iconic-cell
|
|
|
|
.glyphicon.glyphicon-eye-open
|
2014-08-07 07:10:42 -04:00
|
|
|
if teamIndex == 1
|
2015-01-10 17:52:41 -05:00
|
|
|
.btn.btn-sm.load-more-ladder-entries(data-i18n="editor.more") More
|
2014-04-15 18:01:54 -04:00
|
|
|
|
2015-09-08 09:44:26 -04:00
|
|
|
div.column.col-md-4.secret
|
2014-05-02 14:00:30 -04:00
|
|
|
h4.friends-header(data-i18n="ladder.friends_playing") Friends Playing
|
2014-03-21 22:50:54 -04:00
|
|
|
if me.get('anonymous')
|
|
|
|
div.alert.alert-info
|
2016-02-25 18:24:16 -05:00
|
|
|
a(data-toggle="coco-modal", data-target="core/CreateAccountModal", data-i18n="ladder.log_in_for_friends") Log in to play with your friends!
|
2014-03-21 22:50:54 -04:00
|
|
|
|
|
|
|
else
|
2014-03-26 17:19:05 -04:00
|
|
|
if !onFacebook || !onGPlus
|
2014-03-21 22:50:54 -04:00
|
|
|
div.connect-buttons
|
2014-05-02 14:00:30 -04:00
|
|
|
span(data-i18n="ladder.social_connect_blurb") Connect and play against your friends!
|
2014-03-26 17:19:05 -04:00
|
|
|
br
|
2014-03-21 22:50:54 -04:00
|
|
|
if !onFacebook
|
2014-05-02 14:00:30 -04:00
|
|
|
button.btn.btn-sm.connect-facebook(data-i18n="community.facebook") Facebook
|
2014-03-26 17:19:05 -04:00
|
|
|
if !onGPlus
|
2014-05-02 14:00:30 -04:00
|
|
|
button.btn.btn-sm.connect-google-plus(data-i18n="community.gplus") Google+
|
2014-03-26 17:19:05 -04:00
|
|
|
|
|
|
|
if friends.length
|
|
|
|
for friend in friends
|
|
|
|
p.friend-entry
|
|
|
|
img(src=friend.imageSource).img-thumbnail
|
|
|
|
span= friend.creatorName + ' (' + friend.name + ')'
|
|
|
|
br
|
|
|
|
span= Math.round(friend.totalScore * 100)
|
|
|
|
span :
|
|
|
|
span= friend.team
|
|
|
|
br
|
2015-09-04 19:21:35 -04:00
|
|
|
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{friend.otherTeam}&opponent=#{friend._id}" + (league ? "&league=" + league.id : ""))
|
2014-03-26 17:19:05 -04:00
|
|
|
span(data-i18n="ladder.fight") Fight!
|
|
|
|
|
2014-05-02 14:00:30 -04:00
|
|
|
else if onFacebook || onGPlus
|
|
|
|
p(data-i18n="ladder.invite_friends_to_battle") Invite your friends to join you in battle!
|