@@ -84,7 +84,8 @@ <h1 class="center" >Bibliograph 2</h1>
84
84
< option value ="title " > Search in title</ option >
85
85
< option value ="titleabs " > Search in title and abstract</ option >
86
86
< option value ="titleabsfull " > Search in title, abstract and full text</ option >
87
- < option value ="concept " > Filter by concept</ option >
87
+ < option value ="concept " > Filter by concepts</ option >
88
+ < option value ="topic " > Filter by topics</ option >
88
89
</ select >
89
90
< button type ="button " @click.prevent ="params.splice(index, 1) "> X</ button >
90
91
@@ -161,6 +162,44 @@ <h1 class="center" >Bibliograph 2</h1>
161
162
x-model ="param.op " />
162
163
< label :for ="`radio-and-${index}` " > AND</ label >
163
164
165
+ < ul :class ="param.op === 'or' ? 'concept-list-or' : 'concept-list-and' " class ="concept-list ">
166
+ < template x-for ="(concept, i) in param.concepts ">
167
+ < li >
168
+ < span class ="card ">
169
+ < span x-text ="concept.display_name "> </ span >
170
+ |
171
+ < a href ="# " @click.prevent ='param.concepts.splice(i, 1) '> x</ a >
172
+ </ span >
173
+ </ li >
174
+ </ template >
175
+ </ ul >
176
+ </ div >
177
+ </ template >
178
+ < template x-if ="param.type === 'topic' ">
179
+ < div x-data ="{ ac: null, str: '' } "
180
+ x-init ="param.concepts = param.concepts || [];
181
+ param.op = param.op || 'or';
182
+ $nextTick(() => ac = new autoComplete({selector: `#search-${index}`, ...autoCompleteTopicConfig})) ">
183
+ < input :id ="`search-${index}` "
184
+ class ="card w-100 "
185
+ type ="search "
186
+ x-model ="str "
187
+ @selection ="param.concepts.push($event.detail.selection.value); str=''; " />
188
+ < input :id ="`radio-or-${index}` "
189
+ :name ="`radio-${index}` "
190
+ class ="concept-radio-or "
191
+ type ="radio "
192
+ value ="or "
193
+ x-model ="param.op " />
194
+ < label :for ="`radio-or-${index}` " > OR</ label >
195
+ < input :id ="`radio-and-${index}` "
196
+ :name ="`radio-${index}` "
197
+ class ="concept-radio-and "
198
+ type ="radio "
199
+ value ="and "
200
+ x-model ="param.op " />
201
+ < label :for ="`radio-and-${index}` " > AND</ label >
202
+
164
203
< ul :class ="param.op === 'or' ? 'concept-list-or' : 'concept-list-and' " class ="concept-list ">
165
204
< template x-for ="(concept, i) in param.concepts ">
166
205
< li >
0 commit comments