summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/lists/listHeader.jade4
-rw-r--r--client/components/lists/listHeader.js8
-rw-r--r--client/components/main/layouts.styl5
-rw-r--r--client/components/users/userHeader.jade5
-rw-r--r--client/components/users/userHeader.js11
-rwxr-xr-xi18n/en.i18n.json2
-rw-r--r--models/users.js17
7 files changed, 52 insertions, 0 deletions
diff --git a/client/components/lists/listHeader.jade b/client/components/lists/listHeader.jade
index f9fe065f..4171f824 100644
--- a/client/components/lists/listHeader.jade
+++ b/client/components/lists/listHeader.jade
@@ -6,6 +6,10 @@ template(name="listHeader")
h2.list-header-name(
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
= title
+ if showCardsCountForList cards.count
+ = cards.count
+ span.lowercase
+ | {{_ 'cards'}}
if currentUser.isBoardMember
if isWatching
i.list-header-watch-icon.fa.fa-eye
diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js
index c7ae8e62..4d468f21 100644
--- a/client/components/lists/listHeader.js
+++ b/client/components/lists/listHeader.js
@@ -13,6 +13,14 @@ BlazeComponent.extendComponent({
return list.findWatcher(Meteor.userId());
},
+ limitToShowCardsCount() {
+ return Meteor.user().getLimitToShowCardsCount();
+ },
+
+ showCardsCountForList(count) {
+ return count > this.limitToShowCardsCount();
+ },
+
events() {
return [{
'click .js-open-list-menu': Popup.open('listAction'),
diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl
index 83d4d693..38fd83ec 100644
--- a/client/components/main/layouts.styl
+++ b/client/components/main/layouts.styl
@@ -374,3 +374,8 @@ a
.wrapper
height: 100%
margin: 0px
+
+.inline-input
+ height: 37px
+ margin: 8px 10px 0 0
+ width: 50px
diff --git a/client/components/users/userHeader.jade b/client/components/users/userHeader.jade
index f7f6222a..ad41e8aa 100644
--- a/client/components/users/userHeader.jade
+++ b/client/components/users/userHeader.jade
@@ -72,3 +72,8 @@ template(name="changeSettingsPopup")
| {{_ 'hide-system-messages'}}
if hiddenSystemMessages
i.fa.fa-check
+ li
+ label.bold
+ | {{_ 'show-cards-minimum-count'}}
+ input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="1" max="99" onkeydown="return false")
+ input.js-apply-show-cards-at.left(type="submit" value="{{_ 'apply'}}")
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js
index 1c390395..98053ed1 100644
--- a/client/components/users/userHeader.js
+++ b/client/components/users/userHeader.js
@@ -95,10 +95,21 @@ Template.changeSettingsPopup.helpers({
hiddenSystemMessages() {
return Meteor.user().hasHiddenSystemMessages();
},
+ showCardsCountAt() {
+ return Meteor.user().getLimitToShowCardsCount();
+ },
});
Template.changeSettingsPopup.events({
'click .js-toggle-system-messages'() {
Meteor.call('toggleSystemMessages');
},
+ 'click .js-apply-show-cards-at'(evt, tpl) {
+ evt.preventDefault();
+ const minLimit = parseInt(tpl.$('#show-cards-count-at').val(), 10);
+ if (!isNaN(minLimit)) {
+ Meteor.call('changeLimitToShowCardsCount', minLimit);
+ Popup.back();
+ }
+ },
});
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 83ff2975..91c8e0af 100755
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -51,6 +51,7 @@
"all-boards": "All boards",
"and-n-other-card": "And __count__ other card",
"and-n-other-card_plural": "And __count__ other cards",
+ "apply": "Apply",
"app-is-offline": "The application is currently offline, refreshing the page will cause data loss.",
"archive": "Archive",
"archive-all": "Archive All",
@@ -286,6 +287,7 @@
"shortcut-show-shortcuts": "Bring up this shortcuts list",
"shortcut-toggle-filterbar": "Toggle Filter Sidebar",
"shortcut-toggle-sidebar": "Toggle Board Sidebar",
+ "show-cards-minimum-count": "Show cards count if list contains more than",
"signupPopup-title": "Create an Account",
"star-board-title": "Click to star this board. It will show up at top of your boards list.",
"starred-boards": "Starred Boards",
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) {