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

@ -17,12 +17,13 @@ module.exports = class CocoRouter extends Backbone.Router
'': go('HomeView')
'about': go('AboutView')
'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')
'admin/candidates': go('admin/CandidatesView')
'admin/clas': go('admin/CLAsView')
@ -35,7 +36,7 @@ module.exports = class CocoRouter extends Backbone.Router
'cla': go('CLAView')
'community': go('CommunityView')
'contribute': go('contribute/MainContributeView')
'contribute/adventurer': go('contribute/AdventurerView')
'contribute/ambassador': go('contribute/AmbassadorView')
@ -47,7 +48,7 @@ module.exports = class CocoRouter extends Backbone.Router
'db/*path': 'routeToServer'
'demo(/*subpath)': go('DemoView')
'docs/components': go('docs/ComponentDocumentationView')
'editor': go('editor/MainEditorView')
'editor/achievement': go('editor/achievement/AchievementSearchView')
@ -59,13 +60,13 @@ module.exports = class CocoRouter extends Backbone.Router
'editor/level/:levelID': go('editor/level/LevelEditView')
'editor/thang': go('editor/thang/ThangTypeSearchView')
'editor/thang/:thangID': go('editor/thang/ThangTypeEditView')
'employers': go('EmployersView')
'file/*path': 'routeToServer'
'legal': go('LegalView')
'multiplayer': go('MultiplayerView')
'play': go('play/MainPlayView')
@ -77,7 +78,7 @@ module.exports = class CocoRouter extends Backbone.Router
'preview': go('HomeView')
'teachers': go('TeachersView')
'test(/*subpath)': go('TestView')
'user/:slugOrID': go('user/MainUserView')

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