diff options
author | Mario Orlicky <orlickymario@gmail.com> | 2016-11-25 21:45:11 +0100 |
---|---|---|
committer | Mario Orlicky <orlickymario@gmail.com> | 2016-11-25 21:45:11 +0100 |
commit | 606dbbbbf2e5ef4bccaadc4584d05c67d7148fc8 (patch) | |
tree | b2a7b837a96cbf775cf3dfa3aa3136abb7249ec5 /client/components | |
parent | 1ad41072010fb59fdbace80a0aa049634074dac1 (diff) | |
download | wekan-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 'client/components')
-rw-r--r-- | client/components/lists/listHeader.jade | 4 | ||||
-rw-r--r-- | client/components/lists/listHeader.js | 8 | ||||
-rw-r--r-- | client/components/main/layouts.styl | 6 | ||||
-rw-r--r-- | client/components/users/userHeader.jade | 5 | ||||
-rw-r--r-- | client/components/users/userHeader.js | 11 |
5 files changed, 34 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..13834644 100644 --- a/client/components/main/layouts.styl +++ b/client/components/main/layouts.styl @@ -1,3 +1,4 @@ + @import 'nib' global-reset() @@ -374,3 +375,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..65b7e8c3 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()); + if (!isNaN(minLimit)) { + Meteor.call('changeLimitToShowCardsCount', minLimit); + Popup.back(); + } + }, }); |