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

Add css for nicer likes view and add sorting for likes

parent bf8ca85e
Pipeline #9611 passed with stages
in 5 minutes and 32 seconds
......@@ -68,11 +68,17 @@ plugin.tx_solr {
lastUpload {
label = Last Upload
field = extensionLastUpload_intS
defaultOrder = desc
}
author {
label = Author
field = author
}
likes {
label = Likes
field = likes_intS
defaultOrder = desc
}
}
}
}
......
<div class="tx_solr">
<div class="row">
<div class="col-md-12">
<f:render section="content" />
</div>
</div>
<f:render section="content" />
</div>
......@@ -34,7 +34,7 @@
<f:link.action pageUid="3" action="show" controller="Extension" pluginName="Pi1" extensionName="TerFe2" arguments="{extension: document.uid}">{document.title}</f:link.action>
</h3>
<span class="text-primary">
<i class="fa fa-heart"></i> {document.likes_intS}
<i class="fa fa-heart"></i> {document.likes_intS -> f:format.number(decimals: 0, thousandsSeparator: ',')}
</span>
</div>
<h4 class="card-subtitle text-muted mb-2">
......
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/">
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/">
<f:layout name="Fullwidth" />
<f:section name="content">
<div class="container-fluid">
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" />
<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>
</div>
</f:else>
<f:then>
<div class="row">
<div class="col-lg-3">
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchSorting}">
<f:render partial="Result/Sorting" section="Sorting" arguments="{resultSet:resultSet}" />
</f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}">
<f:render partial="Result/Facets" section="Facets" arguments="{resultSet:resultSet}" />
</f:if>
</div>
<div class="col-lg-9">
<div id="tx-solr-search">
<f:if condition="{resultSet.isAutoCorrected}">
<div class="container-fluid">
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" />
<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>
</div>
</f:else>
<f:then>
<div class="row">
<div class="col-lg-3">
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchSorting}">
<f:render partial="Result/Sorting" section="Sorting" arguments="{resultSet:resultSet}" />
</f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}">
<f:render partial="Result/Facets" section="Facets" arguments="{resultSet:resultSet}" />
</f:if>
</div>
<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>
</f:if>
</f:if>
<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="{q:suggestion.suggestion}" noCacheHash="1">{suggestion.suggestion}</f:link.page>
</f:for>
?
</f:then>
</f:if>
<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="{q:suggestion.suggestion}" noCacheHash="1">{suggestion.suggestion}</f:link.page>
</f:for>
?
</f:then>
</f:if>
<f:if condition="{resultSet.hasSearched}">
<s:widget.resultPaginate resultSet="{resultSet}" configuration="{maximumNumberOfLinks: settings.maximumNumberOfLinks, templatePath:'EXT:ter_layout/Resources/Private/Templates/Solr/ViewHelpers/Widget/ResultPaginate/Index.html'}">
<f:variable name="exactMatchFound" value="0" />
<f:if condition="{resultSet.usedQuery.options.query -> f:format.case(mode:'lower')} == {documents.0.extensionKey_stringS}">
<f:render partial="Result/Document" section="DocumentWrap" arguments="{resultSet:resultSet, document:documents.0, exactMatchFound: 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:if condition="{exactMatchFound} && {iterator.isFirst}">
<f:else>
<f:render partial="Result/Document" section="DocumentWrap" arguments="{resultSet:resultSet, document:document}" />
</f:else>
</f:if>
</f:for>
</ol>
</s:widget.resultPaginate>
</f:if>
</div>
</div>
</div>
</f:then>
</f:if>
</div>
<f:if condition="{resultSet.hasSearched}">
<s:widget.resultPaginate resultSet="{resultSet}" configuration="{maximumNumberOfLinks: settings.maximumNumberOfLinks, templatePath:'EXT:ter_layout/Resources/Private/Templates/Solr/ViewHelpers/Widget/ResultPaginate/Index.html'}">
<f:variable name="exactMatchFound" value="0" />
<f:if condition="{resultSet.usedQuery.options.query -> f:format.case(mode:'lower')} == {documents.0.extensionKey_stringS}">
<f:render partial="Result/Document" section="DocumentWrap" arguments="{resultSet:resultSet, document:documents.0, exactMatchFound: 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:if condition="{exactMatchFound} && {iterator.isFirst}">
<f:else>
<f:render partial="Result/Document" section="DocumentWrap" arguments="{resultSet:resultSet, document:document}" />
</f:else>
</f:if>
</f:for>
</ol>
</s:widget.resultPaginate>
</f:if>
</div>
</div>
</div>
</f:then>
</f:if>
</div>
</f:section>
......@@ -38,6 +38,14 @@ span.ter-ext-state-expiremental {
hyphens: auto;
}
.tx_solr .card span.text-primary {
white-space: nowrap;
}
.tx_solr .card span.text-primary .fa-heart {
margin-right: 4px;
}
/*
* Solr search form
*/
......
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