Commit f589043d authored by Thomas Löffler's avatar Thomas Löffler

Show exact match of extension key search more prominent

parent 55569c3e
Pipeline #4549 passed with stages
in 9 minutes and 9 seconds
......@@ -3,8 +3,7 @@
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers">
<f:section name="Document">
<li class="card card-size-medium mb-3{f:if(condition:document.isElevated, then: ' results-elevated')}"
<{f:if(condition:exactMatch, then: 'div', else: 'li')} class="card card-size-medium mb-3{f:if(condition:exactMatch, then: ' border-primary bg-light')}"
data-document-score="{document.score}"
data-document-id="{document.id}"
data-document-url="{document.url}"
......@@ -55,10 +54,10 @@
</div>
<f:if condition="{document.insecure_boolS}">
<f:else>
<a class="btn btn-outline-primary btn-block mb-0" href="{document.extensionDownloadZipUrl_stringS}">
<a class="btn {f:if(condition:exactMatch, then: 'btn-primary', else: 'btn-outline-primary')} btn-block mb-0" href="{document.extensionDownloadZipUrl_stringS}">
<i class="fa fa-download"></i> Download version {document.extensionVersion_stringS} as ZIP
</a>
</f:else>
</f:if>
</li>
</{f:if(condition:exactMatch, then: 'div', else: 'li')}>
</f:section>
......@@ -9,7 +9,6 @@
<div class="container-fluid">
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" />
<f:if condition="{resultSet.usedSearch.numberOfResults}">
<f:else>
<div class="alert alert-danger mt-3">
......@@ -44,9 +43,18 @@
<f:if condition="{hasSearched}">
<s:widget.resultPaginate resultSet="{resultSet}" configuration="{templatePath:'EXT:ter_layout/Resources/Private/Templates/Solr/ViewHelpers/Widget/ResultPaginate/Index.html'}">
<f:variable name="exactMatchFound" value="0" />
<f:if condition="{resultSet.usedQuery.queryString -> f:format.case(mode:'lower')} == {documents.0.extensionKey_stringS}">
<f:render partial="Result/Document" section="Document" arguments="{resultSet:resultSet, document:documents.0, exactMatch: 1}" />
<f:variable name="exactMatchFound" value="1" />
</f:if>
<ol start="{pagination.displayRangeStart}" class="results-list list-unstyled card-container">
<f:for each="{documents}" as="document" iteration="iterator">
<f:render partial="Result/Document" section="Document" arguments="{resultSet:resultSet, document:document}" />
<f:if condition="{exactMatchFound} && {iterator.isFirst}">
<f:else>
<f:render partial="Result/Document" section="Document" arguments="{resultSet:resultSet, document:document}" />
</f:else>
</f:if>
</f:for>
</ol>
</s:widget.resultPaginate>
......
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