Skip to content

Commit

Permalink
Defaults to user.email for the userlist plugin if user.first_name is …
Browse files Browse the repository at this point in the history
…not present
  • Loading branch information
sgrove committed Apr 11, 2012
1 parent 5233691 commit 99e84b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/assets/javascripts/backbone/plugins/user_list.js.coffee
Expand Up @@ -17,8 +17,12 @@ class Kandan.Plugins.UserList
$el.next().hide();

for user in Kandan.Data.ActiveUsers.all()
displayName = null
displayName = "#{user.first_name} #{user.last_name}" if user.first_name?
displayName ||= user.email # Default to user email address if that's all we have

$users.append @template({
name: "#{user.first_name} #{user.last_name}",
name: displayName,
gravatar_hash: user.gravatar_hash
})
$el.html($users)
Expand Down

0 comments on commit 99e84b9

Please sign in to comment.