mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
fix to username, apply to main user
This commit is contained in:
parent
d2c5506234
commit
7a478ab6cd
3 changed files with 6 additions and 9 deletions
|
|
@ -66,9 +66,12 @@ module.exports.viewHelpers = (view) ->
|
|||
else
|
||||
return "armor#{armor}_m.png"
|
||||
|
||||
view.fn "userName", (auth) ->
|
||||
view.fn "username", (auth) ->
|
||||
if auth?.facebook?.displayName?
|
||||
auth.facebook.displayName
|
||||
else if auth?.facebook?
|
||||
fb = auth.facebook
|
||||
if fb._raw then "#{fb.name.givenName} #{fb.name.familyName}" else fb.name
|
||||
else if auth?.local?
|
||||
auth.local.username
|
||||
else
|
||||
|
|
|
|||
|
|
@ -49,12 +49,6 @@ get '/', (page, model, next) ->
|
|||
|
||||
return page.redirect '/500.html' unless userObj? #this should never happen, but it is. Looking into it
|
||||
|
||||
# support legacy Everyauth schema (now using derby-auth, Passport)
|
||||
if username = userObj.auth?.local?.username
|
||||
_view.loginName = username
|
||||
else if fb = userObj.auth?.facebook
|
||||
_view.loginName = if fb._raw then "#{fb.name.givenName} #{fb.name.familyName}" else fb.name
|
||||
|
||||
# Setup Item Store
|
||||
items = userObj.items
|
||||
_view.items =
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@
|
|||
<a href="#" class="btn btn-small btn-info" data-target="#login-modal" data-toggle="modal">Login / Register</a>
|
||||
{else}
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-small">{_view.loginName}</button>
|
||||
<button class="btn btn-small">{username(_user.auth)}</button>
|
||||
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
<!-- Party -->
|
||||
{#if _user.flags.partyEnabled}
|
||||
{#each _friends as :friend}
|
||||
<td class="avatar friend-avatar" rel="tooltip" title="{userName(:friend.auth)}" data-placement="bottom" >
|
||||
<td class="avatar friend-avatar" rel="tooltip" title="{username(:friend.auth)}" data-placement="bottom" >
|
||||
<div class='avatar-sprites'>
|
||||
<img class='weapon weapon-{:friend.items.weapon}' src="/img/BrowserQuest/habitrpg_mods/weapon{:friend.items.weapon}.png" />
|
||||
<img class='armor armor-{:friend.items.armor}' src="/img/BrowserQuest/habitrpg_mods/{currentArmor(:friend.preferences.gender, :friend.items.armor, :friend.preferences.armorSet)}" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue