Commit 7b14b92e authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[BUGFIX] Beautify exact match, show query if nothing found and add spellcheck

parent 4dab350a
Pipeline #18369 passed with stages
in 5 minutes and 50 seconds
......@@ -4,6 +4,7 @@ plugin.tx_solr {
query {
allowEmptyQuery = 1
}
spellchecking = 1
results {
resultsHighlighting = 1
......
......@@ -6,7 +6,7 @@
<f:section name="DocumentWrap">
<f:if condition="{exactMatchFound}">
<f:then>
<div class="card card-size-medium mb-3 border-primary bg-light">
<div class="card card-size-medium mb-3 bg-light">
<f:render section="Document" arguments="{_all}" />
</div>
</f:then>
......@@ -79,13 +79,13 @@
<div class="btn-group d-flex" role="group">
<f:if condition="{document.insecure_boolS}">
<f:else>
<f:link.action pageUid="3" rel="nofollow" class="btn {f:if(condition:exactMatchFound, then: 'btn-primary-lg', else: 'btn-primary')} btn-block mb-0 w-100" action="download" extensionName="TerFe2" controller="Extension" pluginName="Pi1" arguments="{extension: document.uid}" title="Downlad version {document.extensionVersion_stringS} of TYPO3 extension {document.extensionKey_stringS}">
<f:link.action pageUid="3" rel="nofollow" class="btn {f:if(condition:exactMatchFound, then: 'btn-lg')} btn-primary btn-block mb-0 w-100" action="download" extensionName="TerFe2" controller="Extension" pluginName="Pi1" arguments="{extension: document.uid}" title="Downlad version {document.extensionVersion_stringS} of TYPO3 extension {document.extensionKey_stringS}">
<i class="fa fa-download"></i> v{document.extensionVersion_stringS}
</f:link.action>
</f:else>
</f:if>
<f:if condition="{document.hasManual_boolS}">
<f:link.external class="btn {f:if(condition:exactMatchFound, then: 'btn-info-lg', else: 'btn-info')} btn-block mb-0 w-100" uri="{document.extensionDocumentationLink_stringS}" rel="nofollow" title="Go to documentation of extension {document.extensionKey_stringS}">
<f:link.external class="btn {f:if(condition:exactMatchFound, then: 'btn-lg ')} btn-info btn-block mb-0 w-100" uri="{document.extensionDocumentationLink_stringS}" rel="nofollow" title="Go to documentation of extension {document.extensionKey_stringS}">
<i class="fa fa-book"></i> Documentation
</f:link.external>
</f:if>
......
......@@ -10,7 +10,15 @@
<f:if condition="{resultSet.allResultCount}">
<f:else>
<div class="alert alert-danger mt-3">
<s:translate key="no_results_nothing_found" arguments="{0: resultSet.usedQuery.queryString}">Nothing found for "%s".</s:translate>
<s:translate key="no_results_nothing_found" arguments="{0: resultSet.usedQuery.options.query}">Nothing found for "%s".</s:translate>
<f:if condition="{resultSet.hasSpellCheckingSuggestions}">
<f:then>
<s:translate key="didYouMean">Did you mean</s:translate>
<f:for each="{resultSet.spellCheckingSuggestions}" as="suggestion">
<f:link.page additionalParams="{tx_solr:{q:suggestion.suggestion}}" noCacheHash="1">{suggestion.suggestion}</f:link.page>
</f:for>?
</f:then>
</f:if>
</div>
</f:else>
<f:then>
......@@ -26,10 +34,10 @@
<div class="col-lg-9">
<div id="tx-solr-search">
<f:if condition="{resultSet.isAutoCorrected}">
<span class="searched-for">
<s:translate key="no_results_nothing_found" arguments="{0: resultSet.usedQuery.queryString}">Nothing found for "%s".</s:translate>
<s:translate key="no_results_search_for_original" arguments="{0: resultSet.correctedQueryString}">Search instead for "%s".</s:translate>
</span>
<span class="searched-for">
<s:translate key="no_results_nothing_found" arguments="{0: resultSet.usedQuery.queryString}">Nothing found for "%s".</s:translate>
<s:translate key="no_results_search_for_original" arguments="{0: resultSet.correctedQueryString}">Search instead for "%s".</s:translate>
</span>
</f:if>
<f:if condition="{resultSet.hasSpellCheckingSuggestions}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment