mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Merge branch 'master' into production
This commit is contained in:
commit
5ddc468e4e
13 changed files with 42 additions and 61 deletions
|
@ -45,6 +45,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
'beta': go('HomeView')
|
||||
|
||||
'careers': => window.location.href = 'https://jobs.lever.co/codecombat'
|
||||
'Careers': => window.location.href = 'https://jobs.lever.co/codecombat'
|
||||
|
||||
'cla': go('CLAView')
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@
|
|||
users_subscribed: "Users subscribed:"
|
||||
no_users_subscribed: "No users subscribed, please double check your email addresses."
|
||||
current_recipients: "Current Recipients"
|
||||
unsubscribing: "Unsubscribing..."
|
||||
unsubscribing: "Unsubscribing" # {change}
|
||||
subscribe_prepaid: "Click Subscribe to use prepaid code"
|
||||
using_prepaid: "Using prepaid code for monthly subscription"
|
||||
|
||||
|
|
|
@ -186,21 +186,24 @@ block content
|
|||
p= recipientSubs.card
|
||||
|
||||
h4(data-i18n="subscribe.current_recipients")
|
||||
table.table.table-striped.table-condensed.recipients-table
|
||||
tr
|
||||
th(data-i18n="general.email")
|
||||
th(data-i18n="general.name")
|
||||
th
|
||||
for recipient in recipientSubs.recipients
|
||||
if recipientSubs.unsubscribingRecipients && recipientSubs.unsubscribingRecipients.length > 0
|
||||
.alert.alert-info
|
||||
span.spr(data-i18n="subscribe.unsubscribing")
|
||||
span= recipientSubs.unsubscribingRecipients[0]
|
||||
else
|
||||
table.table.table-striped.table-condensed.recipients-table
|
||||
tr
|
||||
td.recipient-email= recipient.emailLower
|
||||
td.recipient-name= recipient.name
|
||||
td.recipient-unsubscribe
|
||||
if recipient.cancel_at_period_end
|
||||
div Ends #{moment(recipient.cancel_at_period_end).format('l')}
|
||||
else if recipientSubs.unsubscribingRecipients.indexOf(recipient.emailLower) >= 0
|
||||
div(data-i18n="subscribe.unsubscribing")
|
||||
else
|
||||
button.recipient-unsubscribe-button.btn.btn-sm.btn-warning Unsubscribe
|
||||
button.confirm-recipient-unsubscribe-button.btn.btn-sm.btn-primary.hide(data-i18n="play.confirm")
|
||||
th(data-i18n="general.email")
|
||||
th(data-i18n="general.name")
|
||||
th
|
||||
for recipient in recipientSubs.recipients
|
||||
tr
|
||||
td.recipient-email= recipient.emailLower
|
||||
td.recipient-name= recipient.name
|
||||
td.recipient-unsubscribe
|
||||
if recipient.cancel_at_period_end
|
||||
div Ends #{moment(recipient.cancel_at_period_end).format('l')}
|
||||
else
|
||||
button.recipient-unsubscribe-button.btn.btn-sm.btn-warning Unsubscribe
|
||||
button.confirm-recipient-unsubscribe-button.btn.btn-sm.btn-primary.hide(data-i18n="play.confirm")
|
||||
|
||||
|
|
|
@ -6,11 +6,13 @@ block content
|
|||
|
||||
table.table.table-striped.table-bordered.table-condensed#clas
|
||||
tbody
|
||||
each cla in clas
|
||||
- var models = view.clas.models
|
||||
- var models = _.uniq(models, true, function(model) { return model.get('githubUsername'); });
|
||||
each cla in models
|
||||
tr
|
||||
td #{cla.name}
|
||||
td #{cla.get('name')}
|
||||
if me.isAdmin()
|
||||
td #{cla.email}
|
||||
td #{cla.githubUsername}
|
||||
td #{cla.created}
|
||||
td #{cla.get('email')}
|
||||
td #{cla.get('githubUsername')}
|
||||
td #{cla.get('created')}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#cla
|
||||
|
||||
.alert.alert-info.spr This agreement was generated by
|
||||
.alert.alert-info
|
||||
span.spr This agreement was generated by
|
||||
a(href="http://selector.harmonyagreements.org/") Harmony
|
||||
| . Sign at the bottom (it's easy).
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ block content
|
|||
//#contributor-list
|
||||
// TODO: collect CodeCombat userids for these guys so we can include a tiled list
|
||||
ul.diplomats
|
||||
each stats, languageCode in languageStats
|
||||
each stats, languageCode in view.calculateSpokenLanguageStats()
|
||||
if !(stats.completion < 0.02 && !stats.diplomats.length)
|
||||
li
|
||||
a(href=stats.githubURL)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
- var i = 0
|
||||
- var counter = view.constructor.deltaCounter;
|
||||
|
||||
mixin deltaPanel(delta, conflict)
|
||||
- delta.index = i++
|
||||
|
@ -41,8 +42,8 @@ mixin deltaPanel(delta, conflict)
|
|||
+deltaPanel(delta.conflict, true)
|
||||
|
||||
.panel-group(id='delta-accordion-'+(counter))
|
||||
for delta in deltas
|
||||
for delta in view.expandedDeltas
|
||||
+deltaPanel(delta)
|
||||
if !deltas.length
|
||||
if !view.expandedDeltas.length
|
||||
alert.alert-warning(data-i18n="delta.no_changes") No changes
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ extends /templates/base
|
|||
|
||||
block content
|
||||
|
||||
each campaign in campaigns
|
||||
each campaign in view.campaigns
|
||||
.campaign-container
|
||||
h1
|
||||
a(href="/play/#{campaign.levels[0].levelPath || 'level'}/#{campaign.levels[0].id}", data-i18n="play.campaign_#{campaign.id}")= campaign.name
|
||||
p.campaign-description(data-i18n="[html]play.campaign_#{campaign.id}_description")!= campaign.description
|
||||
each level in campaign.levels
|
||||
a(href=level.disabled ? "/play/ladder" : "/play/ladder/#{level.id}", disabled=level.disabled, class=levelStatusMap[level.id] || '', title=level.description)
|
||||
a(href=level.disabled ? "/play/ladder" : "/play/ladder/#{level.id}", disabled=level.disabled, class=view.levelStatusMap[level.id] || '', title=level.description)
|
||||
.level
|
||||
if level.image
|
||||
img.level-image(src="#{level.image}", alt="#{level.name}").img-rounded
|
||||
|
@ -19,7 +19,7 @@ block content
|
|||
span(data-i18n="play.level_difficulty") Difficulty:
|
||||
each i in Array(level.difficulty)
|
||||
| ★
|
||||
- var playCount = levelPlayCountMap[level.id]
|
||||
- var playCount = view.levelPlayCountMap[level.id]
|
||||
if playCount
|
||||
span.spl.spr - #{playCount.sessions}
|
||||
span(data-i18n="play.players") players
|
||||
|
|
|
@ -11,6 +11,7 @@ class CLASubmission extends CocoModel
|
|||
class CLACollection extends CocoCollection
|
||||
url: '/db/cla.submissions'
|
||||
model: CLASubmission
|
||||
comparator: (claSubmission) -> return (claSubmission.get('githubUsername') or 'zzzzz').toLowerCase()
|
||||
|
||||
module.exports = class CLAsView extends RootView
|
||||
id: 'admin-clas-view'
|
||||
|
@ -19,11 +20,3 @@ module.exports = class CLAsView extends RootView
|
|||
constructor: (options) ->
|
||||
super options
|
||||
@clas = @supermodel.loadCollection(new CLACollection(), 'clas', {cache: false}).model
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.clas = []
|
||||
if @supermodel.finished()
|
||||
c.clas = _.uniq (_.sortBy (cla.attributes for cla in @clas.models), (m) ->
|
||||
m.githubUsername?.toLowerCase()), 'githubUsername'
|
||||
c
|
||||
|
|
|
@ -61,13 +61,6 @@ module.exports = class DiplomatView extends ContributeClassView
|
|||
template: template
|
||||
contributorClassName: 'diplomat'
|
||||
|
||||
getRenderData: ->
|
||||
context = super()
|
||||
context.viewName = @viewName
|
||||
context.user = @user unless @user?.isAnonymous()
|
||||
context.languageStats = @calculateSpokenLanguageStats()
|
||||
context
|
||||
|
||||
calculateSpokenLanguageStats: ->
|
||||
@locale ?= require 'locale/locale'
|
||||
totalStrings = @countStrings @locale.en
|
||||
|
|
|
@ -71,14 +71,8 @@ module.exports = class DeltaView extends CocoView
|
|||
if skip then skippedDeltas.push delta else newDeltas.push delta
|
||||
[newDeltas, skippedDeltas]
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.deltas = @expandedDeltas
|
||||
c.counter = DeltaView.deltaCounter
|
||||
DeltaView.deltaCounter += @expandedDeltas.length
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
DeltaView.deltaCounter += @expandedDeltas.length
|
||||
deltas = @$el.find('.details')
|
||||
for delta, i in deltas
|
||||
deltaEl = $(delta)
|
||||
|
|
|
@ -22,6 +22,7 @@ module.exports = class LadderHomeView extends RootView
|
|||
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(), 'your_sessions', {cache: false}, 0).model
|
||||
@listenToOnce @sessions, 'sync', @onSessionsLoaded
|
||||
@getLevelPlayCounts()
|
||||
@campaigns = campaigns
|
||||
|
||||
onSessionsLoaded: (e) ->
|
||||
for session in @sessions.models
|
||||
|
@ -47,13 +48,6 @@ module.exports = class LadderHomeView extends RootView
|
|||
}, 0
|
||||
levelPlayCountsRequest.load()
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
context.levelStatusMap = @levelStatusMap
|
||||
context.levelPlayCountMap = @levelPlayCountMap
|
||||
context.campaigns = campaigns
|
||||
context
|
||||
|
||||
heroArenas = [
|
||||
{
|
||||
name: 'Ace of Coders'
|
||||
|
|
|
@ -83,15 +83,14 @@
|
|||
"devDependencies": {
|
||||
"auto-reload-brunch": "> 1.0 < 1.8",
|
||||
"bless-brunch": "https://github.com/ThomasConner/bless-brunch/tarball/master",
|
||||
"bower": "~1.3.8",
|
||||
"bower": "~1.6.4",
|
||||
"brunch": "^1.8.5",
|
||||
"coffee-script-brunch": "^1.8.3",
|
||||
"coffeelint-brunch": "^1.7.1",
|
||||
"compressible": "~1.0.1",
|
||||
"commonjs-require-definition": "0.2.0",
|
||||
"css-brunch": "^1.7.0",
|
||||
"jade": "0.33.x",
|
||||
"jade-brunch": "^1.8.1",
|
||||
"jade-brunch": "1.7.5",
|
||||
"jasmine-node": "1.13.x",
|
||||
"jasmine-spec-reporter": "~0.3.0",
|
||||
"javascript-brunch": "> 1.0 < 1.8",
|
||||
|
|
Loading…
Reference in a new issue