From 43e7890dcfe2f7ffd66e06e58f8714b5fb9c19c3 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 2 Jun 2016 13:07:47 -0400 Subject: [PATCH] FIX: Add more descriptive text for expanding links --- app/assets/javascripts/discourse/widgets/link.js.es6 | 3 ++- .../javascripts/discourse/widgets/post-links.js.es6 | 9 +-------- config/locales/client.en.yml | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/link.js.es6 b/app/assets/javascripts/discourse/widgets/link.js.es6 index 1ccc5353687..51ed2a7691b 100644 --- a/app/assets/javascripts/discourse/widgets/link.js.es6 +++ b/app/assets/javascripts/discourse/widgets/link.js.es6 @@ -31,7 +31,8 @@ export default createWidget('link', { }, buildAttributes(attrs) { - return { href: this.href(attrs), title: this.label(attrs) }; + return { href: this.href(attrs), + title: attrs.title ? I18n.t(attrs.title) : this.label(attrs) }; }, label(attrs) { diff --git a/app/assets/javascripts/discourse/widgets/post-links.js.es6 b/app/assets/javascripts/discourse/widgets/post-links.js.es6 index 2a6833ce8d6..6c8acb6653c 100644 --- a/app/assets/javascripts/discourse/widgets/post-links.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-links.js.es6 @@ -19,6 +19,7 @@ export default createWidget('post-links', { if (state.collapsed) { return this.attach('link', { labelCount: `post_links.title`, + title: "post_links.about", count: links.length, action: 'expandLinks', className: 'expand-links' @@ -48,14 +49,6 @@ export default createWidget('post-links', { }); } - // if (attrs.canReplyAsNewTopic) { - // result.push(h('li', this.attach('link', { - // className: 'reply-new', - // contents: () => [I18n.t('post.reply_as_new_topic'), iconNode('plus')], - // action: 'newTopicAction' - // }))); - // } - return h('ul.post-links', result); }, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 6ea345a0682..58aa2c0f3b3 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1828,6 +1828,7 @@ en: one: "1 click" other: "%{count} clicks" post_links: + about: "expand the links for this post" title: one: "1 post link" other: "%{count} post links"