aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-02-23 19:21:14 +0100
committerArthurHoaro <arthur@hoa.ro>2016-02-28 14:17:40 +0100
commitc51fae92dc7d3080def81a2797e0d683b3e6d82a (patch)
tree394f9419589c1983d9be9834b89c8be2e8ef237c /tpl
parent6c3d6a31f413862941fe514e7167c04fe71ba1a7 (diff)
downloadShaarli-c51fae92dc7d3080def81a2797e0d683b3e6d82a.tar.gz
Shaarli-c51fae92dc7d3080def81a2797e0d683b3e6d82a.tar.zst
Shaarli-c51fae92dc7d3080def81a2797e0d683b3e6d82a.zip
Allow crossed search between terms and tags
* Partial fix of #449 * Current use case: search term + click on tag. * LinkFilter now returns all links if no filter is given. * Unit tests.
Diffstat (limited to 'tpl')
-rw-r--r--tpl/linklist.html38
1 files changed, 21 insertions, 17 deletions
diff --git a/tpl/linklist.html b/tpl/linklist.html
index ca91699e..c0d42006 100644
--- a/tpl/linklist.html
+++ b/tpl/linklist.html
@@ -11,16 +11,16 @@
11 <div id="headerform" class="search"> 11 <div id="headerform" class="search">
12 <form method="GET" class="searchform" name="searchform"> 12 <form method="GET" class="searchform" name="searchform">
13 <input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="Search text" 13 <input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="Search text"
14 {if="!empty($search_crits) && $search_type=='fulltext'"} 14 {if="!empty($search_term)"}
15 value="{$search_crits}" 15 value="{$search_term}"
16 {/if} 16 {/if}
17 > 17 >
18 <input type="submit" value="Search" class="bigbutton"> 18 <input type="submit" value="Search" class="bigbutton">
19 </form> 19 </form>
20 <form method="GET" class="tagfilter" name="tagfilter"> 20 <form method="GET" class="tagfilter" name="tagfilter">
21 <input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="Filter by tag" 21 <input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="Filter by tag"
22 {if="!empty($search_crits) && $search_type=='tags'"} 22 {if="!empty($search_tags)"}
23 value="{function="implode(' ', $search_crits)"}" 23 value="{$search_tags}"
24 {/if} 24 {/if}
25 autocomplete="off" class="awesomplete" data-multiple data-minChars="1" 25 autocomplete="off" class="awesomplete" data-multiple data-minChars="1"
26 data-list="{loop="$tags"}{$key}, {/loop}" 26 data-list="{loop="$tags"}{$key}, {/loop}"
@@ -44,19 +44,23 @@
44 </div> 44 </div>
45 45
46 {if="count($links)==0"} 46 {if="count($links)==0"}
47 <div id="searchcriteria">Nothing found.</i></div> 47 <div id="searchcriteria">Nothing found.</div>
48 {else} 48 {elseif="!empty($search_term) or !empty($search_tags)"}
49 {if="$search_type=='fulltext'"} 49 <div id="searchcriteria">
50 <div id="searchcriteria">{$result_count} results for <i>{$search_crits}</i></div> 50 {$result_count} results
51 {/if} 51 {if="!empty($search_term)"}
52 {if="$search_type=='tags'"} 52 for <em>{$search_term}</em>
53 <div id="searchcriteria">{$result_count} results for tags <i> 53 {/if}
54 {loop="search_crits"} 54 {if="!empty($search_tags)"}
55 <span class="linktag" title="Remove tag"> 55 {$exploded_tags=explode(' ', $search_tags)}
56 <a href="?removetag={function="urlencode($value)"}">{$value} <span class="remove">x</span></a> 56 tagged
57 </span> 57 {loop="$exploded_tags"}
58 {/loop}</i></div> 58 <span class="linktag" title="Remove tag">
59 {/if} 59 <a href="?removetag={function="urlencode($value)"}">{$value} <span class="remove">x</span></a>
60 </span>
61 {/loop}
62 {/if}
63 </div>
60 {/if} 64 {/if}
61 <ul> 65 <ul>
62 {loop="links"} 66 {loop="links"}