Add search sidebar

This commit is contained in:
Ghassen Rjab 2018-02-23 01:09:59 +01:00
parent 2001c01b4d
commit 636e1657f6
5 changed files with 32 additions and 0 deletions

View file

@ -4,6 +4,7 @@ const defaultView = 'home';
const viewTitles = {
filter: 'filter-cards',
search: 'search-cards',
multiselection: 'multi-selection',
archives: 'archives',
};

View file

@ -0,0 +1,8 @@
template(name="searchSidebar")
form.js-search-term-form
input(type="text" name="searchTerm" placeholder="{{_ 'search-example'}}" autofocus)
.list-body.js-perfect-scrollbar
.minicards.clearfix.js-minicards
each (results)
a.minicard-wrapper.js-minicard(href=absoluteUrl)
+minicard(this)

View file

@ -0,0 +1,19 @@
BlazeComponent.extendComponent({
onCreated() {
this.term = new ReactiveVar('');
},
results() {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
return currentBoard.searchCards(this.term.get());
},
events() {
return [{
'submit .js-search-term-form'(evt) {
evt.preventDefault();
this.term.set(evt.target.searchTerm.value);
},
}];
},
}).register('searchSidebar');

View file

@ -0,0 +1,2 @@
input
max-width: 100%

View file

@ -331,6 +331,8 @@
"restore": "Restore",
"save": "Save",
"search": "Search",
"search-cards": "Search Cards",
"search-example": "Like “Magic Card“ for example",
"select-color": "Select Color",
"set-wip-limit-value": "Set a limit for the maximum number of tasks in this list",
"setWipLimitPopup-title": "Set WIP Limit",