mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Add search sidebar
This commit is contained in:
parent
2001c01b4d
commit
636e1657f6
5 changed files with 32 additions and 0 deletions
|
@ -4,6 +4,7 @@ const defaultView = 'home';
|
|||
|
||||
const viewTitles = {
|
||||
filter: 'filter-cards',
|
||||
search: 'search-cards',
|
||||
multiselection: 'multi-selection',
|
||||
archives: 'archives',
|
||||
};
|
||||
|
|
8
client/components/sidebar/sidebarSearches.jade
Normal file
8
client/components/sidebar/sidebarSearches.jade
Normal 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)
|
19
client/components/sidebar/sidebarSearches.js
Normal file
19
client/components/sidebar/sidebarSearches.js
Normal 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');
|
2
client/components/sidebar/sidebarSearches.styl
Normal file
2
client/components/sidebar/sidebarSearches.styl
Normal file
|
@ -0,0 +1,2 @@
|
|||
input
|
||||
max-width: 100%
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue