Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
UI: Show account email in sidebar navigation #98
  • Loading branch information
lastzero committed Oct 9, 2021
1 parent d63e10a commit d6cc8df
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions frontend/src/component/navigation.vue
Expand Up @@ -443,7 +443,7 @@
</v-list-tile-content>
</v-list-tile>

<v-list-tile v-show="!isPublic && auth" to="/" class="p-profile">
<v-list-tile v-show="!isPublic && auth" to="/settings/account" class="p-profile">
<v-list-tile-avatar color="grey" size="36">
<span class="white--text headline">{{ displayName.length >= 1 ? displayName[0].toUpperCase() : "E" }}</span>
</v-list-tile-avatar>
Expand All @@ -452,7 +452,7 @@
<v-list-tile-title>
{{ displayName }}
</v-list-tile-title>
<v-list-tile-sub-title>Profile</v-list-tile-sub-title>
<v-list-tile-sub-title>{{ accountInfo }}</v-list-tile-sub-title>
</v-list-tile-content>

<v-list-tile-action :title="$gettext('Logout')">
Expand Down Expand Up @@ -524,9 +524,13 @@ export default {
return this.session.auth || this.isPublic;
},
displayName() {
return this.$session.getUser().FullName ? this.$session.getUser().FullName : this.$session.getUser().UserName;
const user = this.$session.getUser();
return user.FullName ? user.FullName : user.UserName;
},
accountInfo() {
const user = this.$session.getUser();
return user.PrimaryEmail ? user.PrimaryEmail : this.$gettext("Account");
}
},
created() {
this.reload.subscription = Event.subscribe("dialog.reload", () => this.reload.dialog = true);
Expand Down

0 comments on commit d6cc8df

Please sign in to comment.