From 42714d7d25ab210026d0c0c9093c9e16ca0ef938 Mon Sep 17 00:00:00 2001
From: Arpit Jalan
Date: Mon, 20 Oct 2014 16:46:12 +0530
Subject: [PATCH] Hide google search when the instance is private
---
.../discourse/controllers/search-help.js.es6 | 6 +++++-
.../discourse/templates/modal/search_help.hbs | 3 +++
config/locales/client.en.yml | 10 ++++++++++
config/locales/server.en.yml | 8 --------
4 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/app/assets/javascripts/discourse/controllers/search-help.js.es6 b/app/assets/javascripts/discourse/controllers/search-help.js.es6
index 821c431af65..c62a9db6c00 100644
--- a/app/assets/javascripts/discourse/controllers/search-help.js.es6
+++ b/app/assets/javascripts/discourse/controllers/search-help.js.es6
@@ -3,5 +3,9 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality';
import DiscourseController from 'discourse/controllers/controller';
export default DiscourseController.extend(ModalFunctionality, {
- needs: ['modal']
+ needs: ['modal'],
+
+ showGoogleSearch: function() {
+ return !Discourse.SiteSettings.login_required;
+ }.property()
});
diff --git a/app/assets/javascripts/discourse/templates/modal/search_help.hbs b/app/assets/javascripts/discourse/templates/modal/search_help.hbs
index ace1db3e6db..5a9bf72d986 100644
--- a/app/assets/javascripts/discourse/templates/modal/search_help.hbs
+++ b/app/assets/javascripts/discourse/templates/modal/search_help.hbs
@@ -1,3 +1,6 @@
{{{model}}}
+ {{#if showGoogleSearch}}
+ {{{i18n google_search}}}
+ {{/if}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index f107118c9f6..04676d2ca51 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2288,3 +2288,13 @@ en:
reader:
name: Reader
description: Read every post in a topic with more than 100 posts
+
+ google_search: |
+ Search with Google
+
+
+
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 8b0a2ac1a4d..4706a307191 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -2152,11 +2152,3 @@ en:
rainbows category:parks status:open order:latest
will search for topics containing the word "rainbows" in the category "parks" that are not closed or archived, ordered by date of last post.
- Search with Google
-
-
-