From 81c18fc0bdd694205d805a2d4a20bfa27992c3ba Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 26 May 2017 15:00:31 -0400 Subject: [PATCH] UX: Add link to the user's preferences page next to the avatar --- .../javascripts/admin/controllers/admin-user-index.js.es6 | 6 ++++++ app/assets/javascripts/admin/templates/user-index.hbs | 3 +++ config/locales/client.en.yml | 2 ++ 3 files changed, 11 insertions(+) diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 index 175463c0a12..834ed3912ba 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 @@ -3,6 +3,7 @@ import CanCheckEmails from 'discourse/mixins/can-check-emails'; import { propertyNotEqual, setting } from 'discourse/lib/computed'; import { userPath } from 'discourse/lib/url'; import { popupAjaxError } from 'discourse/lib/ajax-error'; +import computed from 'ember-addons/ember-computed-decorators'; export default Ember.Controller.extend(CanCheckEmails, { editingUsername: false, @@ -34,6 +35,11 @@ export default Ember.Controller.extend(CanCheckEmails, { return []; }.property('model.user_fields.[]'), + @computed('model.username_lower') + preferencesPath(username) { + return userPath(`${username}/preferences`); + }, + actions: { impersonate() { return this.get("model").impersonate(); }, diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs index 069d47ecb29..f6a7a2d75e1 100644 --- a/app/assets/javascripts/admin/templates/user-index.hbs +++ b/app/assets/javascripts/admin/templates/user-index.hbs @@ -99,6 +99,9 @@
{{i18n 'user.avatar.title'}}
{{avatar content imageSize="large"}}
+
+ {{{i18n "admin.user.visit_profile" url=preferencesPath}}} +
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index c44767ba538..0ab3ececb79 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -3254,6 +3254,8 @@ en: reset_bounce_score: label: "Reset" title: "Reset bounce score back to 0" + visit_profile: "Visit this user's preferences page to edit their profile" + deactivate_explanation: "A deactivated user must re-validate their email." suspended_explanation: "A suspended user can't log in." block_explanation: "A blocked user can't post or start topics."