summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorMario Orlicky <orlickymario@gmail.com>2016-11-25 21:45:11 +0100
committerMario Orlicky <orlickymario@gmail.com>2016-11-25 21:45:11 +0100
commit606dbbbbf2e5ef4bccaadc4584d05c67d7148fc8 (patch)
treeb2a7b837a96cbf775cf3dfa3aa3136abb7249ec5 /models
parent1ad41072010fb59fdbace80a0aa049634074dac1 (diff)
downloadwekan-606dbbbbf2e5ef4bccaadc4584d05c67d7148fc8.tar.gz
wekan-606dbbbbf2e5ef4bccaadc4584d05c67d7148fc8.tar.bz2
wekan-606dbbbbf2e5ef4bccaadc4584d05c67d7148fc8.zip
New option to set up minimum limit to show cards count for each list in board
Diffstat (limited to 'models')
-rw-r--r--models/users.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js
index a65a2566..278d069c 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) {