summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-02-23 20:40:48 +0200
committerLauri Ojansivu <x@xet7.org>2018-02-23 20:40:48 +0200
commita48630ffcfa5a5d96afad5960875da6e856ac079 (patch)
tree7fd0b4cbb66c3b09b4fe50e33dd6f9c38a0a8b9c /client/components
parenta9166d877ff8ffae382ce98b481e205cb465d832 (diff)
parentfe1941008cbe2ad08576e9aad78fe15f68dd50d3 (diff)
downloadwekan-a48630ffcfa5a5d96afad5960875da6e856ac079.tar.gz
wekan-a48630ffcfa5a5d96afad5960875da6e856ac079.tar.bz2
wekan-a48630ffcfa5a5d96afad5960875da6e856ac079.zip
Merge branch 'GhassenRjab-feature/search' into devel
Diffstat (limited to 'client/components')
-rw-r--r--client/components/boards/boardHeader.jade4
-rw-r--r--client/components/boards/boardHeader.js3
-rw-r--r--client/components/sidebar/sidebar.js1
-rw-r--r--client/components/sidebar/sidebarSearches.jade8
-rw-r--r--client/components/sidebar/sidebarSearches.js19
-rw-r--r--client/components/sidebar/sidebarSearches.styl2
6 files changed, 37 insertions, 0 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade
index 1a65ce27..9fa9c8a4 100644
--- a/client/components/boards/boardHeader.jade
+++ b/client/components/boards/boardHeader.jade
@@ -87,6 +87,10 @@ template(name="boardHeaderBar")
a.board-header-btn-close.js-filter-reset(title="{{_ 'filter-clear'}}")
i.fa.fa-times-thin
+ a.board-header-btn.js-open-search-view(title="{{_ 'search'}}")
+ i.fa.fa-search
+ span {{_ 'search'}}
+
a.board-header-btn.js-toggle-board-view(
title="{{_ 'board-view'}}")
i.fa.fa-th-large
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js
index 67b05446..64cb0a54 100644
--- a/client/components/boards/boardHeader.js
+++ b/client/components/boards/boardHeader.js
@@ -100,6 +100,9 @@ BlazeComponent.extendComponent({
Sidebar.setView();
Filter.reset();
},
+ 'click .js-open-search-view'() {
+ Sidebar.setView('search');
+ },
'click .js-multiselection-activate'() {
const currentCard = Session.get('currentCard');
MultiSelection.activate();
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index f4f0c118..e4a7c409 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -4,6 +4,7 @@ const defaultView = 'home';
const viewTitles = {
filter: 'filter-cards',
+ search: 'search-cards',
multiselection: 'multi-selection',
archives: 'archives',
};
diff --git a/client/components/sidebar/sidebarSearches.jade b/client/components/sidebar/sidebarSearches.jade
new file mode 100644
index 00000000..2ad5b00f
--- /dev/null
+++ b/client/components/sidebar/sidebarSearches.jade
@@ -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)
diff --git a/client/components/sidebar/sidebarSearches.js b/client/components/sidebar/sidebarSearches.js
new file mode 100644
index 00000000..111a86b8
--- /dev/null
+++ b/client/components/sidebar/sidebarSearches.js
@@ -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');
diff --git a/client/components/sidebar/sidebarSearches.styl b/client/components/sidebar/sidebarSearches.styl
new file mode 100644
index 00000000..6b8ad904
--- /dev/null
+++ b/client/components/sidebar/sidebarSearches.styl
@@ -0,0 +1,2 @@
+input
+ max-width: 100%