mirror of
https://github.com/wekan/wekan.git
synced 2025-12-19 08:50:13 +01:00
New option to set up minimum limit to show cards count for each list in board
This commit is contained in:
parent
1ad4107201
commit
606dbbbbf2
7 changed files with 53 additions and 0 deletions
|
|
@ -6,6 +6,10 @@ template(name="listHeader")
|
||||||
h2.list-header-name(
|
h2.list-header-name(
|
||||||
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
|
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
|
||||||
= title
|
= title
|
||||||
|
if showCardsCountForList cards.count
|
||||||
|
= cards.count
|
||||||
|
span.lowercase
|
||||||
|
| {{_ 'cards'}}
|
||||||
if currentUser.isBoardMember
|
if currentUser.isBoardMember
|
||||||
if isWatching
|
if isWatching
|
||||||
i.list-header-watch-icon.fa.fa-eye
|
i.list-header-watch-icon.fa.fa-eye
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,14 @@ BlazeComponent.extendComponent({
|
||||||
return list.findWatcher(Meteor.userId());
|
return list.findWatcher(Meteor.userId());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
limitToShowCardsCount() {
|
||||||
|
return Meteor.user().getLimitToShowCardsCount();
|
||||||
|
},
|
||||||
|
|
||||||
|
showCardsCountForList(count) {
|
||||||
|
return count > this.limitToShowCardsCount();
|
||||||
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
'click .js-open-list-menu': Popup.open('listAction'),
|
'click .js-open-list-menu': Popup.open('listAction'),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
@import 'nib'
|
@import 'nib'
|
||||||
|
|
||||||
global-reset()
|
global-reset()
|
||||||
|
|
@ -374,3 +375,8 @@ a
|
||||||
.wrapper
|
.wrapper
|
||||||
height: 100%
|
height: 100%
|
||||||
margin: 0px
|
margin: 0px
|
||||||
|
|
||||||
|
.inline-input
|
||||||
|
height: 37px
|
||||||
|
margin: 8px 10px 0 0
|
||||||
|
width: 50px
|
||||||
|
|
|
||||||
|
|
@ -72,3 +72,8 @@ template(name="changeSettingsPopup")
|
||||||
| {{_ 'hide-system-messages'}}
|
| {{_ 'hide-system-messages'}}
|
||||||
if hiddenSystemMessages
|
if hiddenSystemMessages
|
||||||
i.fa.fa-check
|
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'}}")
|
||||||
|
|
|
||||||
|
|
@ -95,10 +95,21 @@ Template.changeSettingsPopup.helpers({
|
||||||
hiddenSystemMessages() {
|
hiddenSystemMessages() {
|
||||||
return Meteor.user().hasHiddenSystemMessages();
|
return Meteor.user().hasHiddenSystemMessages();
|
||||||
},
|
},
|
||||||
|
showCardsCountAt() {
|
||||||
|
return Meteor.user().getLimitToShowCardsCount();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.changeSettingsPopup.events({
|
Template.changeSettingsPopup.events({
|
||||||
'click .js-toggle-system-messages'() {
|
'click .js-toggle-system-messages'() {
|
||||||
Meteor.call('toggleSystemMessages');
|
Meteor.call('toggleSystemMessages');
|
||||||
},
|
},
|
||||||
|
'click .js-apply-show-cards-at'(evt, tpl) {
|
||||||
|
evt.preventDefault();
|
||||||
|
const minLimit = parseInt(tpl.$('#show-cards-count-at').val());
|
||||||
|
if (!isNaN(minLimit)) {
|
||||||
|
Meteor.call('changeLimitToShowCardsCount', minLimit);
|
||||||
|
Popup.back();
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@
|
||||||
"all-boards": "All boards",
|
"all-boards": "All boards",
|
||||||
"and-n-other-card": "And __count__ other card",
|
"and-n-other-card": "And __count__ other card",
|
||||||
"and-n-other-card_plural": "And __count__ other cards",
|
"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.",
|
"app-is-offline": "The application is currently offline, refreshing the page will cause data loss.",
|
||||||
"archive": "Archive",
|
"archive": "Archive",
|
||||||
"archive-all": "Archive All",
|
"archive-all": "Archive All",
|
||||||
|
|
@ -278,6 +279,7 @@
|
||||||
"shortcut-show-shortcuts": "Bring up this shortcuts list",
|
"shortcut-show-shortcuts": "Bring up this shortcuts list",
|
||||||
"shortcut-toggle-filterbar": "Toggle Filter Sidebar",
|
"shortcut-toggle-filterbar": "Toggle Filter Sidebar",
|
||||||
"shortcut-toggle-sidebar": "Toggle Board Sidebar",
|
"shortcut-toggle-sidebar": "Toggle Board Sidebar",
|
||||||
|
"show-cards-minimum-count": "Show cards count if list contains more than",
|
||||||
"signupPopup-title": "Create an Account",
|
"signupPopup-title": "Create an Account",
|
||||||
"star-board-title": "Click to star this board. It will show up at top of your boards list.",
|
"star-board-title": "Click to star this board. It will show up at top of your boards list.",
|
||||||
"starred-boards": "Starred Boards",
|
"starred-boards": "Starred Boards",
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,10 @@ Users.attachSchema(new SimpleSchema({
|
||||||
type: [String],
|
type: [String],
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
'profile.showCardsCountAt': {
|
||||||
|
type: Number,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
'profile.starredBoards': {
|
'profile.starredBoards': {
|
||||||
type: [String],
|
type: [String],
|
||||||
optional: true,
|
optional: true,
|
||||||
|
|
@ -180,6 +184,11 @@ Users.helpers({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getLimitToShowCardsCount() {
|
||||||
|
const profile = this.profile || {};
|
||||||
|
return profile.showCardsCountAt;
|
||||||
|
},
|
||||||
|
|
||||||
getName() {
|
getName() {
|
||||||
const profile = this.profile || {};
|
const profile = this.profile || {};
|
||||||
return profile.fullname || this.username;
|
return profile.fullname || this.username;
|
||||||
|
|
@ -283,6 +292,10 @@ Users.mutations({
|
||||||
setAvatarUrl(avatarUrl) {
|
setAvatarUrl(avatarUrl) {
|
||||||
return { $set: { 'profile.avatarUrl': avatarUrl }};
|
return { $set: { 'profile.avatarUrl': avatarUrl }};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setShowCardsCountAt(limit) {
|
||||||
|
return { $set: { 'profile.showCardsCountAt': limit } };
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.methods({
|
Meteor.methods({
|
||||||
|
|
@ -299,6 +312,10 @@ Meteor.methods({
|
||||||
const user = Meteor.user();
|
const user = Meteor.user();
|
||||||
user.toggleSystem(user.hasHiddenSystemMessages());
|
user.toggleSystem(user.hasHiddenSystemMessages());
|
||||||
},
|
},
|
||||||
|
changeLimitToShowCardsCount(limit) {
|
||||||
|
check(limit, Number);
|
||||||
|
Meteor.user().setShowCardsCountAt(limit);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue