From 7d4dbc9962cd4dec7a22e6d19b9754090966c2b1 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 23 Sep 2015 12:10:15 -0400 Subject: [PATCH] Give example values for CSS rules in embedding --- .../admin/components/embedding-setting.js.es6 | 5 +++++ .../admin/templates/components/embedding-setting.hbs | 2 +- app/assets/javascripts/admin/templates/embedding.hbs | 9 +++++++-- config/locales/client.en.yml | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/components/embedding-setting.js.es6 b/app/assets/javascripts/admin/components/embedding-setting.js.es6 index 904afacfe..039e5d5dc 100644 --- a/app/assets/javascripts/admin/components/embedding-setting.js.es6 +++ b/app/assets/javascripts/admin/components/embedding-setting.js.es6 @@ -6,6 +6,11 @@ export default Ember.Component.extend({ @computed('field') inputId(field) { return field.dasherize(); }, + @computed('placeholder') + placeholderValue(placeholder) { + return placeholder ? I18n.t(placeholder) : null; + }, + @computed('field') translationKey(field) { return `admin.embedding.${field}`; }, diff --git a/app/assets/javascripts/admin/templates/components/embedding-setting.hbs b/app/assets/javascripts/admin/templates/components/embedding-setting.hbs index 36dbb8869..e3a99c320 100644 --- a/app/assets/javascripts/admin/templates/components/embedding-setting.hbs +++ b/app/assets/javascripts/admin/templates/components/embedding-setting.hbs @@ -5,7 +5,7 @@ {{else}} - {{input value=value id=inputId}} + {{input value=value id=inputId placeholder=placeholderValue}} {{/if}}
diff --git a/app/assets/javascripts/admin/templates/embedding.hbs b/app/assets/javascripts/admin/templates/embedding.hbs index 15d021a9c..d41970fb8 100644 --- a/app/assets/javascripts/admin/templates/embedding.hbs +++ b/app/assets/javascripts/admin/templates/embedding.hbs @@ -46,8 +46,13 @@

{{i18n "admin.embedding.crawling_settings"}}

{{i18n "admin.embedding.crawling_description"}}

- {{embedding-setting field="embed_whitelist_selector" value=embedding.embed_whitelist_selector}} - {{embedding-setting field="embed_blacklist_selector" value=embedding.embed_blacklist_selector}} + {{embedding-setting field="embed_whitelist_selector" + value=embedding.embed_whitelist_selector + placeholder="admin.embedding.whitelist_example"}} + + {{embedding-setting field="embed_blacklist_selector" + value=embedding.embed_blacklist_selector + placeholder="admin.embedding.blacklist_example"}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index f5fa11808..a0af30ff9 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2592,7 +2592,9 @@ en: embed_username_key_from_feed: "Key to pull discourse username from feed" embed_truncate: "Truncate the embedded posts" embed_whitelist_selector: "CSS selector for elements that are allowed in embeds" + whitelist_example: "article, #story, .post" embed_blacklist_selector: "CSS selector for elements that are removed from embeds" + blacklist_example: ".ad-unit, header" feed_polling_enabled: "Import posts via RSS/ATOM" feed_polling_url: "URL of RSS/ATOM feed to crawl" save: "Save Embedding Settings"