broadName should insert a space when using firstName lastName, and return Anoner if nothing else is available

This commit is contained in:
Cat Sync 2016-01-22 13:58:02 -05:00
parent e4296eaf97
commit feb4c16b85
2 changed files with 3 additions and 3 deletions
app
models
templates/courses

View file

@ -19,11 +19,11 @@ module.exports = class User extends CocoModel
broadName: ->
name = @get('name')
return name if name
name = _.filter([@get('firstName'), @get('lastName')]).join('')
name = _.filter([@get('firstName'), @get('lastName')]).join(' ')
return name if name
email = @get('email')
return email if email
return ''
return 'Anoner'
getPhotoURL: (size=80, useJobProfilePhoto=false, useEmployerPageAvatar=false) ->
photoURL = if useJobProfilePhoto then @get('jobProfile')?.photoURL else null

View file

@ -55,7 +55,7 @@ block content
for user in view.users.models
.row
.col-md-6
.student-name= user.broadName() || 'Anoner'
.student-name= user.broadName()
.col-md-6
if view.teacherMode
a.remove-student-link.pull-right.text-uppercase(data-user-id=user.id)