<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<aui:input helpMessage="collated-spell-check-result-enabled-help" id="collatedSpellCheckResultEnabled" label="display-did-you-mean-if-the-number-of-search-results-does-not-meet-the-threshold" name="preferences--collatedSpellCheckResultEnabled--" type="checkbox" value="<%= searchDisplayContext.isCollatedSpellCheckResultEnabled() %>" />

<div class="options-container <%= !searchDisplayContext.isCollatedSpellCheckResultEnabled() ? "hide" : StringPool.BLANK %>" id="<portlet:namespace />collatedSpellCheckResultOptionsContainer">
	<aui:input disabled="<%= !searchDisplayContext.isCollatedSpellCheckResultEnabled() %>" helpMessage="collated-spell-check-result-display-threshold-help" label="threshold-for-displaying-did-you-mean" name="preferences--collatedSpellCheckResultDisplayThreshold--" size="10" type="text" value="<%= searchDisplayContext.getCollatedSpellCheckResultDisplayThreshold() %>" />
</div>

<aui:input helpMessage="query-suggestion-enabled-help" id="querySuggestionEnabled" label="display-related-queries" name="preferences--querySuggestionEnabled--" type="checkbox" value="<%= searchDisplayContext.isQuerySuggestionEnabled() %>" />

<div class="options-container <%= !searchDisplayContext.isQuerySuggestionEnabled() ? "hide" : StringPool.BLANK %>" id="<portlet:namespace />querySuggestionOptionsContainer">
	<aui:input disabled="<%= !searchDisplayContext.isQuerySuggestionEnabled() %>" label="maximum-number-of-related-queries" name="preferences--querySuggestionMax--" size="10" type="text" value="<%= searchDisplayContext.getQuerySuggestionMax() %>" />

	<aui:input disabled="<%= !searchDisplayContext.isQuerySuggestionEnabled() %>" helpMessage="query-suggestion-display-threshold-help" label="threshold-for-displaying-related-queries" name="preferences--querySuggestionDisplayThreshold--" size="10" type="text" value="<%= searchDisplayContext.getQuerySuggestionDisplayThreshold() %>" />
</div>

<aui:input helpMessage="query-indexing-enabled-help" id="queryIndexingEnabled" label="add-new-related-queries-based-on-successful-queries" name="preferences--queryIndexingEnabled--" type="checkbox" value="<%= searchDisplayContext.isQueryIndexingEnabled() %>" />

<div class="options-container <%= !searchDisplayContext.isQueryIndexingEnabled() ? "hide" : StringPool.BLANK %>" id="<portlet:namespace />queryIndexingOptionsContainer">
	<aui:input disabled="<%= !searchDisplayContext.isQueryIndexingEnabled() %>" helpMessage="query-indexing-threshold-help" name="preferences--queryIndexingThreshold--" size="10" type="text" value="<%= searchDisplayContext.getQueryIndexingThreshold() %>" />
</div>

<aui:script>
	Liferay.Util.toggleBoxes(
		'<portlet:namespace />collatedSpellCheckResultEnabled',
		'<portlet:namespace />collatedSpellCheckResultOptionsContainer'
	);
	Liferay.Util.toggleBoxes(
		'<portlet:namespace />queryIndexingEnabled',
		'<portlet:namespace />queryIndexingOptionsContainer'
	);
	Liferay.Util.toggleBoxes(
		'<portlet:namespace />querySuggestionEnabled',
		'<portlet:namespace />querySuggestionOptionsContainer'
	);
</aui:script>