From 3071650eb3bc8b13d6de6b73fc85c2828d9d16a5 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 20 Apr 2015 11:10:56 -0400 Subject: [PATCH] FEATURE: when post is too short, suggest using the like button instead --- .../javascripts/discourse/templates/popup_input_tip.hbs | 2 +- app/assets/javascripts/discourse/views/composer.js.es6 | 4 ++++ config/locales/client.en.yml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/templates/popup_input_tip.hbs b/app/assets/javascripts/discourse/templates/popup_input_tip.hbs index 6a65bdeac..73e4589d0 100644 --- a/app/assets/javascripts/discourse/templates/popup_input_tip.hbs +++ b/app/assets/javascripts/discourse/templates/popup_input_tip.hbs @@ -1,2 +1,2 @@ -{{view.validation.reason}} +{{{view.validation.reason}}} diff --git a/app/assets/javascripts/discourse/views/composer.js.es6 b/app/assets/javascripts/discourse/views/composer.js.es6 index e67e5c010..95138ebc9 100644 --- a/app/assets/javascripts/discourse/views/composer.js.es6 +++ b/app/assets/javascripts/discourse/views/composer.js.es6 @@ -573,6 +573,10 @@ const ComposerView = Discourse.View.extend(Ember.Evented, { reason = I18n.t('composer.error.post_missing'); } else if( missingChars > 0 ) { reason = I18n.t('composer.error.post_length', {min: this.get('model.minimumPostLength')}); + let tl = Discourse.User.currentProp("trust_level"); + if (tl === 0 || tl === 1) { + reason += "
" + I18n.t('composer.error.try_like'); + } } if( reason ) { diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 226f0ceb9..309cc13d9 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -738,6 +738,7 @@ en: title_too_long: "Title can't be more than {{max}} characters" post_missing: "Post can't be empty" post_length: "Post must be at least {{min}} characters" + try_like: 'Have you tried the button?' category_missing: "You must choose a category" save_edit: "Save Edit"