summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/sidebar')
-rw-r--r--client/components/sidebar/sidebar.js12
-rw-r--r--client/components/sidebar/sidebarFilters.jade53
-rw-r--r--client/components/sidebar/sidebarFilters.js9
3 files changed, 42 insertions, 32 deletions
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 5b58dbd9..ec3ebcf6 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -279,7 +279,7 @@ BlazeComponent.extendComponent({
'click .js-select-member'() {
const userId = this.currentData()._id;
const currentBoard = Boards.findOne(Session.get('currentBoard'));
- if (currentBoard.memberIndex(userId)<0) {
+ if (!currentBoard.hasMember(userId)) {
this.inviteUser(userId);
}
},
@@ -305,16 +305,12 @@ Template.changePermissionsPopup.events({
Template.changePermissionsPopup.helpers({
isAdmin() {
- const user = Users.findOne(this.userId);
- return user.isBoardAdmin();
+ const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ return currentBoard.hasAdmin(this.userId);
},
isLastAdmin() {
- const user = Users.findOne(this.userId);
- if (!user.isBoardAdmin())
- return false;
const currentBoard = Boards.findOne(Session.get('currentBoard'));
- const nbAdmins = _.where(currentBoard.members, { isAdmin: true }).length;
- return nbAdmins === 1;
+ return currentBoard.hasAdmin(this.userId) && (currentBoard.activeAdmins() === 1);
},
});
diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade
index ef26ef76..2b326493 100644
--- a/client/components/sidebar/sidebarFilters.jade
+++ b/client/components/sidebar/sidebarFilters.jade
@@ -18,17 +18,16 @@ template(name="filterSidebar")
i.fa.fa-check
hr
ul.sidebar-list
- each currentBoard.members
- if isActive
- with getUser userId
- li(class="{{#if Filter.members.isSelected _id}}active{{/if}}")
- a.name.js-toggle-member-filter
- +userAvatar(userId=this._id)
- span.sidebar-list-item-description
- = profile.fullname
- | (<span class="username">{{ username }}</span>)
- if Filter.members.isSelected _id
- i.fa.fa-check
+ each currentBoard.activeMembers
+ with getUser userId
+ li(class="{{#if Filter.members.isSelected _id}}active{{/if}}")
+ a.name.js-toggle-member-filter
+ +userAvatar(userId=this._id)
+ span.sidebar-list-item-description
+ = profile.fullname
+ | (<span class="username">{{ username }}</span>)
+ if Filter.members.isSelected _id
+ i.fa.fa-check
if Filter.isActive
hr
a.sidebar-btn.js-clear-all
@@ -55,20 +54,22 @@ template(name="multiselectionSidebar")
i.fa.fa-ellipsis-h
hr
ul.sidebar-list
- each currentBoard.members
- if isActive
- with getUser userId
- li(class="{{#if Filter.members.isSelected _id}}active{{/if}}")
- a.name.js-toggle-member-multiselection
- +userAvatar(userId=this._id)
- span.sidebar-list-item-description
- = profile.fullname
- | (<span class="username">{{ username }}</span>)
- if allSelectedElementHave 'member' _id
- i.fa.fa-check
- else if someSelectedElementHave 'member' _id
- i.fa.fa-ellipsis-h
+ each currentBoard.activeMembers
+ with getUser userId
+ li(class="{{#if Filter.members.isSelected _id}}active{{/if}}")
+ a.name.js-toggle-member-multiselection
+ +userAvatar(userId=this._id)
+ span.sidebar-list-item-description
+ = profile.fullname
+ | (<span class="username">{{ username }}</span>)
+ if allSelectedElementHave 'member' _id
+ i.fa.fa-check
+ else if someSelectedElementHave 'member' _id
+ i.fa.fa-ellipsis-h
hr
+ a.sidebar-btn.js-move-selection
+ i.fa.fa-share
+ span {{_ 'move-selection'}}
a.sidebar-btn.js-archive-selection
i.fa.fa-archive
span {{_ 'archive-selection'}}
@@ -82,3 +83,7 @@ template(name="disambiguateMultiMemberPopup")
p {{_ 'what-to-do'}}
button.wide.js-unassign-member {{_ 'unassign-member'}}
button.wide.js-assign-member {{_ 'assign-member'}}
+
+template(name="moveSelectionPopup")
+ +boardLists
+
diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js
index bdecd63e..ba4e4df9 100644
--- a/client/components/sidebar/sidebarFilters.js
+++ b/client/components/sidebar/sidebarFilters.js
@@ -93,8 +93,10 @@ BlazeComponent.extendComponent({
return popup.call(this.currentData(), evt);
}
},
+ 'click .js-move-selection': Popup.open('moveSelection'),
'click .js-archive-selection'() {
mutateSelectedCards('archive');
+ EscapeActions.executeUpTo('multiselection');
},
}];
},
@@ -121,3 +123,10 @@ Template.disambiguateMultiMemberPopup.events({
Popup.close();
},
});
+
+Template.moveSelectionPopup.events({
+ 'click .js-select-list'() {
+ mutateSelectedCards('move', this._id);
+ EscapeActions.executeUpTo('multiselection');
+ },
+});