Skip to content

Commit

Permalink
Merge pull request #25 from slub/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dikastes authored Nov 12, 2024
2 parents 99a018d + 9371f8d commit e893b9d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Classes/Common/QueryParamsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ public static function createElasticParams(array $searchParams): array

// Todo: automate the creation of parameters
if (isset($searchParams['f_itemType']) && $searchParams['f_itemType'] !== "") {
$params['body']['query']['bool']['filter']['term']['itemType.keyword'] = $searchParams['f_itemType'];
$params['body']['query']['bool']['filter'][] = ['term' => ['itemType.keyword' => $searchParams['f_itemType']]];
}
if (isset($searchParams['f_place']) && $searchParams['f_place'] !== "") {
$params['body']['query']['bool']['filter']['term']['place.keyword'] = $searchParams['f_place'];
$params['body']['query']['bool']['filter'][] = ['term' => ['place.keyword' => $searchParams['f_place']]];
}
if (isset($searchParams['f_date']) && $searchParams['f_date'] !== "") {
$params['body']['query']['bool']['filter']['term']['date.keyword'] = $searchParams['f_date'];
$params['body']['query']['bool']['filter'][] = ['term' => ['date.keyword' => $searchParams['f_date']]];
}

return $params;
}

Expand Down
9 changes: 9 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
<trans-unit id="filter_container_close">
<source>Filtermenü schließen</source>
</trans-unit>
<trans-unit id="searchResults_hits_label">
<source>Treffer</source>
</trans-unit>
<trans-unit id="searchResults_params_label">
<source>Ihre Suchparameter</source>
</trans-unit>
<trans-unit id="searchResults_params_remove_label">
<source>Suchparameter "%s" entfernen</source>
</trans-unit>
</body>
</file>
</xliff>
10 changes: 9 additions & 1 deletion Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@
<trans-unit id="filter_container_close">
<source>Filtermenü schließen</source>
</trans-unit>

<trans-unit id="searchResults_hits_label">
<source>Treffer</source>
</trans-unit>
<trans-unit id="searchResults_params_label">
<source>Ihre Suchparameter</source>
</trans-unit>
<trans-unit id="searchResults_params_remove_label">
<source>Suchparameter "%s" entfernen</source>
</trans-unit>
</body>
</file>
</xliff>
23 changes: 21 additions & 2 deletions Resources/Private/Templates/Search/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,31 @@


<div class="searchresults-info frame">
<output class="searchresults-total-items">{totalItems} Treffer</output>
<div class="searchresults-info-total">
<output class="searchresults-total-items">{totalItems} {f:translate(key: 'searchResults_hits_label', extensionName: 'liszt_common')}</output>
<button class="filter-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#filter-container" aria-controls="filter-container">
Filter
{f:translate(key: 'filter_container_label', extensionName: 'liszt_common')}
</button>
</div>
<f:debug>{_all}</f:debug>

<f:if condition="{searchParams}">
<div class="searchresults-filtertags" aria-label="{f:translate(key: 'searchResults_params_label', extensionName: 'liszt_common')}" role="navigation" >
<f:for each="{searchParams}" key="key" as="searchParam">
<span class="searchresults-filtertags-tag">
<span>{searchParam}</span>
<f:link.action action="index" controller="Search" pluginName="SearchListing" arguments="{lc:searchParams(action: 'remove', searchParamsArray: searchParams, key: key)}" additionalAttributes="{type:'button'}" class="tag-cross">
<span class="visually-hidden">{f:translate(key: 'searchResults_params_remove_label', arguments: {0: searchParam}, extensionName: 'liszt_common')}</span>
<svg aria-hidden="true" stroke="currentColor" fill="none" viewBox="0 0 8 8"><path stroke-linecap="round" stroke-width="1" d="M1 1l6 6m0-6L1 7"></path></svg>
</f:link.action>
</span>
</f:for>
</div>
</f:if>

</div>


<aside class="sidebar">
<nav class="filter-container offcanvas offcanvas-end" id="filter-container" aria-label="{f:translate(key: 'filter_container_label', extensionName: 'liszt_common')}" >
<div class="offcanvas-header">
Expand Down

0 comments on commit e893b9d

Please sign in to comment.