diff --git a/client/components/boards/boardsList.jade b/client/components/boards/boardsList.jade index 66e5fae12..c85667b99 100644 --- a/client/components/boards/boardsList.jade +++ b/client/components/boards/boardsList.jade @@ -94,16 +94,18 @@ template(name="boardList") span.board-list-item-name(title="{{_ 'board-drag-drop-reorder-or-click-open'}}") +viewer = title - if allowsBoardMemberList - .minicard-members - each member in boardMembers _id - a.name - +userAvatar(userId=member noRemove=true) - if allowsCardCounterList - .minicard-lists.flex.flex-wrap - each list in boardLists _id - .item - | {{ list }} + unless currentSetting.hideBoardMemberList + if allowsBoardMemberList + .minicard-members + each member in boardMembers _id + a.name + +userAvatar(userId=member noRemove=true) + unless currentSetting.hideCardCounterList + if allowsCardCounterList + .minicard-lists.flex.flex-wrap + each list in boardLists _id + .item + | {{ list }} i.fa.js-star-board( class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}" title="{{_ 'star-board-title'}}") diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 032d81a37..0576e02c3 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -2,6 +2,18 @@ import { TAPi18n } from '/imports/i18n'; const subManager = new SubsManager(); +Template.boardList.helpers({ + currentSetting() { + return Settings.findOne(); + }, + hideCardCounterList() { + return Utils.isMiniScreen() && Session.get('currentBoard'); + }, + hideBoardMemberList() { + return Utils.isMiniScreen() && Session.get('currentBoard'); + }, +}) + Template.boardListHeaderBar.events({ 'click .js-open-archived-board'() { Modal.open('archivedBoards'); diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade index dc864fed7..cd7ab3843 100644 --- a/client/components/settings/settingBody.jade +++ b/client/components/settings/settingBody.jade @@ -253,6 +253,20 @@ template(name='layoutSettings') .title {{_ 'automatic-linked-url-schemes'}} .form-group textarea#automatic-linked-url-schemes.wekan-form-control= currentSetting.automaticLinkedUrlSchemes + li.layout-form + .title {{_ 'hide-card-counter-list'}} + .form-group.flex + input.wekan-form-control#hide-card-counter-list(type="radio" name="hideCardCounterList" value="true" checked="{{#if currentSetting.hideCardCounterList}}checked{{/if}}") + span {{_ 'yes'}} + input.wekan-form-control#hide-card-counter-list(type="radio" name="hideCardCounterList" value="false" checked="{{#unless currentSetting.hideCardCounterList}}checked{{/unless}}") + span {{_ 'no'}} + li.layout-form + .title {{_ 'hide-board-member-list'}} + .form-group.flex + input.wekan-form-control#hide-board-member-list(type="radio" name="hideBoardMemberList" value="true" checked="{{#if currentSetting.hideBoardMemberList}}checked{{/if}}") + span {{_ 'yes'}} + input.wekan-form-control#hide-board-member-list(type="radio" name="hideBoardMemberList" value="false" checked="{{#unless currentSetting.hideBoardMemberList}}checked{{/unless}}") + span {{_ 'no'}} li button.js-save-layout.primary {{_ 'save'}} diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 04afdce0c..51baebd9d 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -85,6 +85,12 @@ BlazeComponent.extendComponent({ toggleHideLogo() { $('#hide-logo').toggleClass('is-checked'); }, + toggleHideCardCounterList() { + $('#hide-card-counter-list').toggleClass('is-checked'); + }, + toggleHideBoardMemberList() { + $('#hide-board-member-list').toggleClass('is-checked'); + }, toggleDisplayAuthenticationMethod() { $('#display-authentication-method').toggleClass('is-checked'); }, @@ -230,6 +236,8 @@ BlazeComponent.extendComponent({ .val() .trim(); const hideLogoChange = $('input[name=hideLogo]:checked').val() === 'true'; + const hideCardCounterListChange = $('input[name=hideCardCounterList]:checked').val() === 'true'; + const hideBoardMemberListChange = $('input[name=hideBoardMemberList]:checked').val() === 'true'; const displayAuthenticationMethod = $('input[name=displayAuthenticationMethod]:checked').val() === 'true'; const defaultAuthenticationMethod = $('#defaultAuthenticationMethod').val(); @@ -241,6 +249,8 @@ BlazeComponent.extendComponent({ $set: { productName, hideLogo: hideLogoChange, + hideCardCounterList: hideCardCounterListChange, + hideBoardMemberList: hideBoardMemberListChange, customLoginLogoImageUrl, customLoginLogoLinkUrl, customHelpLinkUrl, @@ -291,6 +301,8 @@ BlazeComponent.extendComponent({ 'click button.js-save': this.saveMailServerInfo, 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, 'click a.js-toggle-hide-logo': this.toggleHideLogo, + 'click a.js-toggle-hide-card-counter-list': this.toggleHideCardCounterList, + 'click a.js-toggle-hide-board-member-list': this.toggleHideBoardMemberList, 'click button.js-save-layout': this.saveLayout, 'click a.js-toggle-display-authentication-method': this .toggleDisplayAuthenticationMethod, diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade index a2f2985cd..fcc9a5f66 100644 --- a/client/components/sidebar/sidebar.jade +++ b/client/components/sidebar/sidebar.jade @@ -140,18 +140,20 @@ template(name="boardChangeColorPopup") template(name="boardInfoOnMyBoardsPopup") form.board-info-on-my-boards h3 {{_ 'show-at-all-boards-page'}} - div.check-div - a.flex.js-field-has-cardcounterlist(class="{{#if allowsCardCounterList}}is-checked{{/if}}") - .materialCheckBox(class="{{#if allowsCardCounterList}}is-checked{{/if}}") - span - i.fa.fa-sign-out - | {{_ 'show-card-counter-per-list'}} - div.check-div - a.flex.js-field-has-boardmemberlist(class="{{#if allowsBoardMemberList}}is-checked{{/if}}") - .materialCheckBox(class="{{#if allowsBoardMemberList}}is-checked{{/if}}") - span - i.fa.fa-hourglass-start - | {{_ 'show-board_members-avatar'}} + unless currentSetting.hideCardCounterList + div.check-div + a.flex.js-field-has-cardcounterlist(class="{{#if allowsCardCounterList}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsCardCounterList}}is-checked{{/if}}") + span + i.fa.fa-sign-out + | {{_ 'show-card-counter-per-list'}} + unless currentSetting.hideBoardMemberList + div.check-div + a.flex.js-field-has-boardmemberlist(class="{{#if allowsBoardMemberList}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsBoardMemberList}}is-checked{{/if}}") + span + i.fa.fa-hourglass-start + | {{_ 'show-board_members-avatar'}} template(name="boardCardSettingsPopup") form.board-card-settings @@ -407,10 +409,12 @@ template(name="boardMenuPopup") i.fa.fa-paint-brush | {{_ 'board-change-color'}} if currentUser.isBoardAdmin - li - a.js-board-info-on-my-boards(title="{{_ 'board-info-on-my-boards'}}") - i.fa.fa-id-card-o - | {{_ 'board-info-on-my-boards'}} + unless currentSetting.hideBoardMemberList + unless currentSetting.hideCardCounterList + li + a.js-board-info-on-my-boards(title="{{_ 'board-info-on-my-boards'}}") + i.fa.fa-id-card-o + | {{_ 'board-info-on-my-boards'}} hr ul.pop-over-list if withApi diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index 79295f97b..ad18303e1 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -22,6 +22,8 @@ BlazeComponent.extendComponent({ onCreated() { this._isOpen = new ReactiveVar(false); this._view = new ReactiveVar(defaultView); + this._hideCardCounterList = new ReactiveVar(false); + this._hideBoardMemberList = new ReactiveVar(false); Sidebar = this; }, @@ -143,6 +145,18 @@ Template.homeSidebar.helpers({ }, }); +Template.boardInfoOnMyBoardsPopup.helpers({ + currentSetting() { + return Settings.findOne(); + }, + hideCardCounterList() { + return Utils.isMiniScreen() && Session.get('currentBoard'); + }, + hideBoardMemberList() { + return Utils.isMiniScreen() && Session.get('currentBoard'); + }, +}) + EscapeActions.register( 'sidebarView', () => { diff --git a/imports/i18n/data/en.i18n.json b/imports/i18n/data/en.i18n.json index 0acdd871e..f33770468 100644 --- a/imports/i18n/data/en.i18n.json +++ b/imports/i18n/data/en.i18n.json @@ -854,7 +854,8 @@ "custom-product-name": "Custom Product Name", "layout": "Layout", "hide-logo": "Hide Logo", - "hide-logo2": "Hide Logo2", + "hide-card-counter-list": "Hide card counter list on All Boards", + "hide-board-member-list": "Hide board member list on All Boards", "add-custom-html-after-body-start": "Add Custom HTML after start", "add-custom-html-before-body-end": "Add Custom HTML before end", "error-undefined": "Something went wrong", diff --git a/models/settings.js b/models/settings.js index eba6d57d5..6a569990c 100644 --- a/models/settings.js +++ b/models/settings.js @@ -64,6 +64,14 @@ Settings.attachSchema( type: Boolean, optional: true, }, + hideCardCounterList: { + type: Boolean, + optional: true, + }, + hideBoardMemberList: { + type: Boolean, + optional: true, + }, customLoginLogoImageUrl: { type: String, optional: true, diff --git a/server/migrations.js b/server/migrations.js index 7641f516d..bbb639a7b 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -509,6 +509,38 @@ Migrations.add('add-hide-logo', () => { ); }); +Migrations.add('add-hide-card-counter-list', () => { + Settings.update( + { + hideCardCounterList: { + $exists: false, + }, + }, + { + $set: { + hideCardCounterList: false, + }, + }, + noValidateMulti, + ); +}); + +Migrations.add('add-hide-board-member-list', () => { + Settings.update( + { + hideBoardMemberList: { + $exists: false, + }, + }, + { + $set: { + hideBoardMemberList: false, + }, + }, + noValidateMulti, + ); +}); + Migrations.add('add-displayAuthenticationMethod', () => { Settings.update( { @@ -1126,6 +1158,38 @@ Migrations.add('add-hide-logo-by-default', () => { ); }); +Migrations.add('add-hide-card-counter-list-by-default', () => { + Settings.update( + { + hideCardCounterList: { + hideCardCounterList: false, + }, + }, + { + $set: { + hideCardCounterList: true, + }, + }, + noValidateMulti, + ); +}); + +Migrations.add('add-hide-board-member-list-by-default', () => { + Settings.update( + { + hideBoardMemberList: { + hideBoardMember: false, + }, + }, + { + $set: { + hideBoardMemberList: true, + }, + }, + noValidateMulti, + ); +}); + Migrations.add('add-card-number-allowed', () => { Boards.update( { diff --git a/server/publications/settings.js b/server/publications/settings.js index 6f903b735..050702a9a 100644 --- a/server/publications/settings.js +++ b/server/publications/settings.js @@ -13,6 +13,8 @@ Meteor.publish('setting', () => { disableForgotPassword: 1, productName: 1, hideLogo: 1, + hideCardCounterList: 1, + hideBoardMemberList: 1, customLoginLogoImageUrl: 1, customLoginLogoLinkUrl: 1, customHelpLinkUrl: 1,