Added email to username if no name is given

Gets rid of generic "Ghost" - we know a user will always have an email address as it is a required field.
This commit is contained in:
John O'Nolan 2013-09-22 23:07:21 +02:00 committed by Hannah Wolfe
parent bf5ab32fe9
commit 78775f1976
2 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,7 @@ function ghostLocals(req, res, next) {
_.extend(res.locals, {
currentUser: {
name: currentUser.attributes.name,
email: currentUser.attributes.email,
image: currentUser.attributes.image
}
});

View File

@ -10,7 +10,7 @@
<li id="usermenu" class="subnav">
<a href="#" data-toggle="ul" class="dropdown">
<img class="avatar" src="{{#if currentUser.image}}{{currentUser.image}}{{else}}/shared/img/user-image.png{{/if}}" alt="Avatar" />
<span class="name">{{#if currentUser.name}}{{currentUser.name}}{{else}}Ghost{{/if}}</span>
<span class="name">{{#if currentUser.name}}{{currentUser.name}}{{else}}{{currentUser.email}}{{/if}}</span>
</a>
<ul class="overlay">
<li class="usermenu-profile"><a href="/ghost/settings/user/">Your Profile</a></li>