Skip to content

Commit

Permalink
Fallback to email for current user in upper-right-hand corner if firs…
Browse files Browse the repository at this point in the history
…t name is null
  • Loading branch information
sgrove committed Apr 11, 2012
1 parent 52efcc5 commit f6661b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/assets/javascripts/backbone/kandan.js.coffee
Expand Up @@ -101,9 +101,11 @@ window.Kandan =
<img src="http://gravatar.com/avatar/<%= gravatar_hash %>?s=25&d=http://bushi.do/images/profile.png"/><span><%= name %></span>
'''
currentUser = Kandan.Helpers.Users.currentUser()
displayName = "#{currentUser.first_name} #{currentUser.last_name}" if currentUser.first_name?
displayName ||= currentUser.email
$(".header .user").html template({
gravatar_hash: currentUser.gravatar_hash,
name: "#{currentUser.first_name} #{currentUser.last_name}"
name: displayName
})

init: ->
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/index.html.erb
Expand Up @@ -17,7 +17,7 @@

<div class="search">
<form method="get" action="/search" target="_blank">
<input type="text" class="query" name="query"/>
<input type="text" class="query" name="query"/>
</form>
</div>
</div>
Expand Down

0 comments on commit f6661b1

Please sign in to comment.