From a6251f717be3e790bf6428367f42aa05a4fc2aee Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 24 Aug 2017 12:22:46 -0400 Subject: [PATCH] Convert user card buttons to `{{d-button}}` components --- .../components/user-card-contents.js.es6 | 5 ++++ .../components/user-card-contents.hbs | 30 ++++++++++++++++--- app/assets/stylesheets/desktop/user-card.scss | 2 +- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 index 969a6a931c5..c7215915633 100644 --- a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 +++ b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 @@ -46,6 +46,11 @@ export default Ember.Component.extend(CleansUp, { return !this.siteSettings.prioritize_username_in_ux && name && name.trim().length > 0; }, + @computed('username', 'topicPostCount') + togglePostsLabel(username, count) { + return I18n.t("topic.filter_to", { username, count }); + }, + @computed('user.user_fields.@each.value') publicUserFields() { const siteUserFields = this.site.get('user_fields'); diff --git a/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs b/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs index 1c948ba800a..3fa5aeb8874 100644 --- a/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs @@ -36,19 +36,41 @@ diff --git a/app/assets/stylesheets/desktop/user-card.scss b/app/assets/stylesheets/desktop/user-card.scss index 0920d97213b..e2fdce0db4e 100644 --- a/app/assets/stylesheets/desktop/user-card.scss +++ b/app/assets/stylesheets/desktop/user-card.scss @@ -193,7 +193,7 @@ $user_card_background: $secondary; float: right; margin: 0; - a {width: 100%; min-width: 150px;} + button { width: 100%; min-width: 150px; } } .new-user a {