Skip to content

Commit cd005bf

Browse files
committed
Search Filter with Keywords -2
1 parent a77f45c commit cd005bf

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

client/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,12 @@ Template.resultsData.helpers({
121121
}
122122
})
123123

124+
/**
125+
*
126+
*/
127+
128+
Template.registerHelper('mkList', (str) => {
129+
var arr = str.split(',');
130+
return arr;
131+
})
132+

client/search.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,22 @@
8888
{{getCount @index}}
8989
<strong><span class="{{#if isAPI}} has-text-danger {{/if}}">{{fullname}}</span></strong>
9090

91-
{{#if keywords}}<a href='#' class="setSettings button is-rounded is-small"
92-
data-settings="keywordFilter:{{keywords}}"><span
93-
class=" is-primary">{{keywords}}</span></a>{{/if}}
91+
{{#if keywords}}
92+
93+
{{#each mkList keywords}}
94+
95+
<a href='#' class="setSettings button is-rounded is-small"
96+
data-settings="keywordFilter:{{this}}"><span
97+
class=" is-primary">{{this}}</span></a>
98+
99+
100+
101+
{{/each}}
102+
103+
104+
105+
106+
{{/if}}
94107
<br />
95108
<small>{{ moFormat this.createAt 'dddd, MMMM Do YYYY, h:mm:ss a'}}</small>
96109
<br>

0 commit comments

Comments
 (0)