diff options
author | Lauri Ojansivu <x@xet7.org> | 2016-11-29 04:05:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 04:05:29 +0200 |
commit | e41eeae09f533c63fbc04eb4e809d34b2c72fa82 (patch) | |
tree | 8a99f00b5c6c23422375a11328d1a8f899959514 /models | |
parent | 56139e33078d2fa137a809801d4631b525dbca49 (diff) | |
parent | 35778d26737c5ca1702c6c1f3ca1be0a90a9e8b8 (diff) | |
download | wekan-e41eeae09f533c63fbc04eb4e809d34b2c72fa82.tar.gz wekan-e41eeae09f533c63fbc04eb4e809d34b2c72fa82.tar.bz2 wekan-e41eeae09f533c63fbc04eb4e809d34b2c72fa82.zip |
Merge pull request #31 from mario-orlicky/show-cards-count
New option to set up minimum limit to show cards count for each list …
Diffstat (limited to 'models')
-rw-r--r-- | models/users.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js index a65a2566..58513231 100644 --- a/models/users.js +++ b/models/users.js @@ -79,6 +79,10 @@ Users.attachSchema(new SimpleSchema({ type: [String], optional: true, }, + 'profile.showCardsCountAt': { + type: Number, + optional: true, + }, 'profile.starredBoards': { type: [String], optional: true, @@ -180,6 +184,11 @@ Users.helpers({ } }, + getLimitToShowCardsCount() { + const profile = this.profile || {}; + return profile.showCardsCountAt; + }, + getName() { const profile = this.profile || {}; return profile.fullname || this.username; @@ -283,6 +292,10 @@ Users.mutations({ setAvatarUrl(avatarUrl) { return { $set: { 'profile.avatarUrl': avatarUrl }}; }, + + setShowCardsCountAt(limit) { + return { $set: { 'profile.showCardsCountAt': limit } }; + }, }); Meteor.methods({ @@ -299,6 +312,10 @@ Meteor.methods({ const user = Meteor.user(); user.toggleSystem(user.hasHiddenSystemMessages()); }, + changeLimitToShowCardsCount(limit) { + check(limit, Number); + Meteor.user().setShowCardsCountAt(limit); + }, }); if (Meteor.isServer) { |