Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-08-13 19:17:40 -07:00
commit 3735e434c6
5 changed files with 14 additions and 12 deletions

View file

@ -21,6 +21,7 @@ module.exports = class CocoRouter extends Backbone.Router
'account': go('account/MainAccountView')
'account/settings': go('account/AccountSettingsView')
'account/unsubscribe': go('account/UnsubscribeView')
'account/profile': go('user/JobProfileView') # legacy URL, sent in emails
#'account/payment'
'admin': go('admin/MainAdminView')

View file

@ -75,7 +75,7 @@ block append content
td
a(href="/play/level/#{session.get('levelID')}")= session.get('levelName')
td= moment(session.get('changed')).fromNow()
if session.get('state').complete === true
if session.get('state') && session.get('state').complete === true
td(data-i18n="user.status_completed") Completed
else
td(data-i18n="user.status_unfinished") Unfinished

View file

@ -436,7 +436,7 @@ module.exports = class ThangsTabView extends CocoView
else # Mediator event
window.thangsTreema = @thangsTreema
thangData = @thangsTreema.get "id=#{e.thangID}"
@editThangView = new LevelThangEditView thangData: thangData, supermodel: @supermodel, level: @level, world: @world
@editThangView = new LevelThangEditView thangData: thangData, level: @level, world: @world
@insertSubView @editThangView
@$el.find('.thangs-column').hide()
Backbone.Mediator.publish 'level:view-switched', e

View file

@ -9,6 +9,7 @@ module.exports = class UserView extends RootView
constructor: (@userID, options) ->
super options
@userID ?= me.id
@listenTo @, 'userNotFound', @ifUserNotFound
@fetchUser @userID

View file

@ -65,7 +65,7 @@ module.exports = class JobProfileView extends UserView
@render()
super options, userID
onUserLoaded: ->
onLoaded: ->
@finishInit() unless @destroyed
super()
@ -275,7 +275,7 @@ module.exports = class JobProfileView extends UserView
_.delay ->
justSavedSection.removeClass 'just-saved', duration: 1500, easing: 'easeOutQuad'
, 500
if me.isAdmin() and @user
if me.isAdmin() and @user and @remark
visibleSettings = ['history', 'tasks']
data = _.pick (@remark.attributes), (value, key) -> key in visibleSettings
data.history ?= []
@ -530,7 +530,7 @@ module.exports = class JobProfileView extends UserView
console.log 'Saved UserRemark', @remark, 'with response', response
updateProgress: (highlightNext) ->
return unless @user
return unless @user?.loaded
completed = 0
totalWeight = 0
next = null