mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:02:46 +08:00
Hide google search when the instance is private
This commit is contained in:
parent
a0f74daf6b
commit
42714d7d25
|
@ -3,5 +3,9 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
import DiscourseController from 'discourse/controllers/controller';
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default DiscourseController.extend(ModalFunctionality, {
|
||||||
needs: ['modal']
|
needs: ['modal'],
|
||||||
|
|
||||||
|
showGoogleSearch: function() {
|
||||||
|
return !Discourse.SiteSettings.login_required;
|
||||||
|
}.property()
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
<div id="search-help" class="modal-body">
|
<div id="search-help" class="modal-body">
|
||||||
{{{model}}}
|
{{{model}}}
|
||||||
|
{{#if showGoogleSearch}}
|
||||||
|
{{{i18n google_search}}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2288,3 +2288,13 @@ en:
|
||||||
reader:
|
reader:
|
||||||
name: Reader
|
name: Reader
|
||||||
description: Read every post in a topic with more than 100 posts
|
description: Read every post in a topic with more than 100 posts
|
||||||
|
|
||||||
|
google_search: |
|
||||||
|
<h2>Search with Google</h2>
|
||||||
|
<p>
|
||||||
|
<form action='//google.com/search' id='google-search' onsubmit="document.getElementById('google-query').value = 'site:' + window.location.host + ' ' + document.getElementById('user-query').value; return true;">
|
||||||
|
<input type="text" id='user-query' value="">
|
||||||
|
<input type='hidden' id='google-query' name="q">
|
||||||
|
<button class="btn btn-primary">Google</button>
|
||||||
|
</form>
|
||||||
|
</p>
|
||||||
|
|
|
@ -2152,11 +2152,3 @@ en:
|
||||||
<p>
|
<p>
|
||||||
<code>rainbows category:parks status:open order:latest</code> will search for topics containing the word "rainbows" in the category "parks" that are not closed or archived, ordered by date of last post.
|
<code>rainbows category:parks status:open order:latest</code> will search for topics containing the word "rainbows" in the category "parks" that are not closed or archived, ordered by date of last post.
|
||||||
</p>
|
</p>
|
||||||
<h2>Search with Google</h2>
|
|
||||||
<p>
|
|
||||||
<form action='//google.com/search' id='google-search' onsubmit="document.getElementById('google-query').value = 'site:' + window.location.host + ' ' + document.getElementById('user-query').value; return true;">
|
|
||||||
<input type="text" id='user-query' value="">
|
|
||||||
<input type='hidden' id='google-query' name="q">
|
|
||||||
<button class="btn btn-primary">Google</button>
|
|
||||||
</form>
|
|
||||||
</p>
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user