Show last name if only lastname exsists in displayNameLong() and displayName().
This commit is contained in:
parent
78ddb3b62e
commit
6859b22db6
1 changed files with 20 additions and 15 deletions
|
@ -17,13 +17,15 @@ class App.Model extends Spine.Model
|
||||||
return @name if @name
|
return @name if @name
|
||||||
if @realname
|
if @realname
|
||||||
return "#{@realname} <#{@email}>"
|
return "#{@realname} <#{@email}>"
|
||||||
if @firstname
|
if !_.isEmpty(@firstname)
|
||||||
name = @firstname
|
name = @firstname
|
||||||
if @lastname
|
if !_.isEmpty(@lastname)
|
||||||
if name
|
if _.isEmpty(name)
|
||||||
|
name = ''
|
||||||
|
else
|
||||||
name = name + ' '
|
name = name + ' '
|
||||||
name = name + @lastname
|
name = name + @lastname
|
||||||
return name
|
return name if !_.isEmpty(name)
|
||||||
if @email
|
if @email
|
||||||
return @email
|
return @email
|
||||||
if @title
|
if @title
|
||||||
|
@ -34,20 +36,23 @@ class App.Model extends Spine.Model
|
||||||
|
|
||||||
displayNameLong: ->
|
displayNameLong: ->
|
||||||
return @name if @name
|
return @name if @name
|
||||||
if @firstname
|
if !_.isEmpty(@firstname)
|
||||||
name = @firstname
|
name = @firstname
|
||||||
if @lastname
|
if !_.isEmpty(@lastname)
|
||||||
if name
|
if _.isEmpty(name)
|
||||||
|
name = ''
|
||||||
|
else
|
||||||
name = name + ' '
|
name = name + ' '
|
||||||
name = name + @lastname
|
name = name + @lastname
|
||||||
if @organization
|
if !_.isEmpty(name)
|
||||||
|
if !_.isEmpty(@organization)
|
||||||
if typeof @organization is 'object'
|
if typeof @organization is 'object'
|
||||||
name = "#{name} (#{@organization.name})"
|
name = "#{name} (#{@organization.name})"
|
||||||
else
|
else
|
||||||
name = "#{name} (#{@organization})"
|
name = "#{name} (#{@organization})"
|
||||||
else if @department
|
else if !_.isEmpty(@department)
|
||||||
name = "#{name} (#{@department})"
|
name = "#{name} (#{@department})"
|
||||||
return name
|
return name if !_.isEmpty(name)
|
||||||
if @email
|
if @email
|
||||||
return @email
|
return @email
|
||||||
if @title
|
if @title
|
||||||
|
@ -224,7 +229,7 @@ class App.Model extends Spine.Model
|
||||||
|
|
||||||
# App.Model.fullLocal(id)
|
# App.Model.fullLocal(id)
|
||||||
@fullLocal: (id) ->
|
@fullLocal: (id) ->
|
||||||
@_fillUp( App[ @className ].find( id ) )
|
@_fillUp( App[@className].find(id) )
|
||||||
|
|
||||||
# App.Model.full(id, callback, force, bind)
|
# App.Model.full(id, callback, force, bind)
|
||||||
@full: (id, callback = false, force = false, bind = false) ->
|
@full: (id, callback = false, force = false, bind = false) ->
|
||||||
|
|
Loading…
Reference in a new issue