mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-02-02 02:26:42 +00:00
Add duplicates checkbox to advanced filter search
This commit is contained in:
@@ -3,6 +3,7 @@ title: $:/language/Search/
|
||||
DefaultResults/Caption: List
|
||||
Filter/Caption: Filter
|
||||
Filter/Hint: Search via a [[filter expression|https://tiddlywiki.com/static/Filters.html]]
|
||||
Filter/AllowDuplicates: Allow duplicate results
|
||||
Filter/Matches: //<small><<resultCount>> matches</small>//
|
||||
Matches: //<small><<resultCount>> matches</small>//
|
||||
Matches/All: All matches:
|
||||
|
||||
@@ -96,13 +96,24 @@ caption: {{$:/language/Search/Filter/Caption}}
|
||||
</$list>
|
||||
</div>
|
||||
|
||||
<div class="tc-advanced-search-options">
|
||||
<$checkbox tiddler="$:/config/Search/AllowDuplicates" field="text" checked="yes" unchecked="no" default="yes">
|
||||
<$text text=" "/><<lingo Filter/AllowDuplicates>>
|
||||
</$checkbox>
|
||||
</div>
|
||||
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="" tag="div" class="tc-search-results">
|
||||
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
|
||||
<$let
|
||||
filter-allow-duplicates="::defaultprefix:all [subfilter{$:/temp/advancedsearch}]"
|
||||
filter-deduplicate="::defaultprefix:or [subfilter{$:/temp/advancedsearch}]"
|
||||
currentFilter={{{ [{$:/config/Search/AllowDuplicates}match[yes]then<filter-allow-duplicates>else<filter-deduplicate>] }}}
|
||||
resultCount={{{ [subfilter<currentFilter>count[]] }}}
|
||||
>
|
||||
<p><<lingo Filter/Matches>></p>
|
||||
<$list filter={{$:/temp/advancedsearch}}>
|
||||
<$list filter="[subfilter<currentFilter>]">
|
||||
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
|
||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||
</span>
|
||||
</$list>
|
||||
</$set>
|
||||
</$let>
|
||||
</$reveal>
|
||||
|
||||
2
core/wiki/config/SearchAllowDuplicates.tid
Normal file
2
core/wiki/config/SearchAllowDuplicates.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/config/Search/AllowDuplicates
|
||||
text: yes
|
||||
@@ -940,6 +940,10 @@ button.tc-btn-invisible.tc-remove-tag-button {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.tc-advanced-search .tc-advanced-search-options input {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.tc-search a svg {
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
|
||||
Reference in New Issue
Block a user