From 2f9662e56284c35f026018a17aaf9084208974eb Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 1 Jun 2015 10:23:49 +0530 Subject: [PATCH] UX: show meaningful tooltip for user menu --- app/assets/javascripts/discourse/controllers/header.js.es6 | 4 ++++ app/assets/javascripts/discourse/templates/header.hbs | 2 +- config/locales/client.en.yml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/header.js.es6 b/app/assets/javascripts/discourse/controllers/header.js.es6 index c414227b6bf..618f93006c0 100644 --- a/app/assets/javascripts/discourse/controllers/header.js.es6 +++ b/app/assets/javascripts/discourse/controllers/header.js.es6 @@ -18,6 +18,10 @@ const HeaderController = DiscourseController.extend({ return Discourse.User.current() && !this.get('topic.isPrivateMessage'); }.property('topic.isPrivateMessage'), + userDisplayName: function() { + return (Discourse.SiteSettings.enable_names && this.get('currentUser.name')) ? this.get('currentUser.name') : this.get('currentUser.username'); + }.property('currentUser.name', 'currentUser.username'), + _resetCachedNotifications: function() { // a bit hacky, but if we have no focus, hide notifications first const visible = $("#notifications-dropdown").is(":visible"); diff --git a/app/assets/javascripts/discourse/templates/header.hbs b/app/assets/javascripts/discourse/templates/header.hbs index f701c967489..729d245532b 100644 --- a/app/assets/javascripts/discourse/templates/header.hbs +++ b/app/assets/javascripts/discourse/templates/header.hbs @@ -68,7 +68,7 @@ data-dropdown="user-dropdown" data-render="renderUserDropdown" href="#" - title='{{i18n 'user.avatar.title'}}' + title='{{i18n 'user.avatar.title' name=userDisplayName}}' id="current-user"> {{bound-avatar currentUser "medium"}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index d740497fce1..945594e2d3b 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -587,7 +587,7 @@ en: registration_ip_address: title: "Registration IP Address" avatar: - title: "Profile Picture" + title: "{{name}} profile" title: title: "Title"