Merge pull request #2895 from techAPJ/patch-1
Hide google search when the instance is private
This commit is contained in:
commit
b394b7d626
|
@ -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()
|
||||
});
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<div id="search-help" class="modal-body">
|
||||
{{{model}}}
|
||||
{{#if showGoogleSearch}}
|
||||
{{{i18n google_search}}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -2288,3 +2288,13 @@ en:
|
|||
reader:
|
||||
name: Reader
|
||||
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>
|
||||
<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>
|
||||
<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