mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Add user option to hide finished checklist items
Add a user option to hide finished items in a checklist.
This commit is contained in:
parent
2a25318ba8
commit
5755ece33e
6 changed files with 74 additions and 5 deletions
|
|
@ -1,7 +1,17 @@
|
||||||
template(name="checklists")
|
template(name="checklists")
|
||||||
h3
|
.checklists-title
|
||||||
i.fa.fa-check
|
h3
|
||||||
| {{_ 'checklists'}}
|
i.fa.fa-check
|
||||||
|
| {{_ 'checklists'}}
|
||||||
|
if currentUser.isBoardMember
|
||||||
|
.material-toggle-switch
|
||||||
|
span.toggle-switch-title {{_ 'hide-checked-items'}}
|
||||||
|
if hideCheckedItems
|
||||||
|
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton" checked="checked")
|
||||||
|
else
|
||||||
|
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton")
|
||||||
|
label.toggle-label(for="toggleHideCheckedItemsButton")
|
||||||
|
|
||||||
if toggleDeleteDialog.get
|
if toggleDeleteDialog.get
|
||||||
.board-overlay#card-details-overlay
|
.board-overlay#card-details-overlay
|
||||||
+checklistDeleteDialog(checklist = checklistToDelete)
|
+checklistDeleteDialog(checklist = checklistToDelete)
|
||||||
|
|
@ -86,7 +96,7 @@ template(name="checklistItems")
|
||||||
| {{_ 'add-checklist-item'}}...
|
| {{_ 'add-checklist-item'}}...
|
||||||
|
|
||||||
template(name='checklistItemDetail')
|
template(name='checklistItemDetail')
|
||||||
.js-checklist-item.checklist-item
|
.js-checklist-item.checklist-item(class="{{#if item.isFinished }}is-checked{{#if hideCheckedItems}} invisible{{/if}}{{/if}}")
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
.check-box-container
|
.check-box-container
|
||||||
.check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
|
.check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,9 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
this.toggleDeleteDialog.set(!this.toggleDeleteDialog.get());
|
this.toggleDeleteDialog.set(!this.toggleDeleteDialog.get());
|
||||||
},
|
},
|
||||||
|
'click #toggleHideCheckedItemsButton'() {
|
||||||
|
Meteor.call('toggleHideCheckedItems');
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -211,6 +214,14 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('checklists');
|
}).register('checklists');
|
||||||
|
|
||||||
|
Template.checklists.helpers({
|
||||||
|
hideCheckedItems() {
|
||||||
|
const currentUser = Meteor.user();
|
||||||
|
if (currentUser) return currentUser.hasHideCheckedItems();
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.checklistDeleteDialog.onCreated(() => {
|
Template.checklistDeleteDialog.onCreated(() => {
|
||||||
const $cardDetails = this.$('.card-details');
|
const $cardDetails = this.$('.card-details');
|
||||||
this.scrollState = {
|
this.scrollState = {
|
||||||
|
|
@ -246,6 +257,11 @@ Template.checklistItemDetail.helpers({
|
||||||
!Meteor.user().isWorker()
|
!Meteor.user().isWorker()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
hideCheckedItems() {
|
||||||
|
const user = Meteor.user();
|
||||||
|
if (user) return user.hasHideCheckedItems();
|
||||||
|
return false;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,10 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
|
||||||
&:hover
|
&:hover
|
||||||
color: inherit
|
color: inherit
|
||||||
|
|
||||||
|
.checklists-title
|
||||||
|
display: flex
|
||||||
|
justify-content: space-between
|
||||||
|
|
||||||
.checklist-title
|
.checklist-title
|
||||||
.checkbox
|
.checkbox
|
||||||
float: left
|
float: left
|
||||||
|
|
@ -99,6 +103,15 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
|
||||||
margin-top: 3px
|
margin-top: 3px
|
||||||
display: flex
|
display: flex
|
||||||
background: darken(white, 3%)
|
background: darken(white, 3%)
|
||||||
|
opacity: 1
|
||||||
|
transition: height 0ms 400ms, opacity 400ms 0ms
|
||||||
|
height: auto
|
||||||
|
overflow: hidden
|
||||||
|
|
||||||
|
&.is-checked.invisible
|
||||||
|
opacity: 0
|
||||||
|
height: 0
|
||||||
|
transition: height 0ms 0ms, opacity 600ms 0ms
|
||||||
|
|
||||||
&.placeholder
|
&.placeholder
|
||||||
background: darken(white, 20%)
|
background: darken(white, 20%)
|
||||||
|
|
|
||||||
|
|
@ -808,5 +808,6 @@
|
||||||
"voting": "Voting",
|
"voting": "Voting",
|
||||||
"archived": "Archived",
|
"archived": "Archived",
|
||||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||||
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
|
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list",
|
||||||
|
"hide-checked-items": "Hide checked items"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,13 @@ Users.attachSchema(
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
'profile.hideCheckedItems': {
|
||||||
|
/**
|
||||||
|
* does the user want to hide checked checklist items?
|
||||||
|
*/
|
||||||
|
type: Boolean,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
'profile.hiddenSystemMessages': {
|
'profile.hiddenSystemMessages': {
|
||||||
/**
|
/**
|
||||||
* does the user want to hide system messages?
|
* does the user want to hide system messages?
|
||||||
|
|
@ -483,6 +490,11 @@ Users.helpers({
|
||||||
return profile.showDesktopDragHandles || false;
|
return profile.showDesktopDragHandles || false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasHideCheckedItems() {
|
||||||
|
const profile = this.profile || {};
|
||||||
|
return profile.hideCheckedItems || false;
|
||||||
|
},
|
||||||
|
|
||||||
hasHiddenSystemMessages() {
|
hasHiddenSystemMessages() {
|
||||||
const profile = this.profile || {};
|
const profile = this.profile || {};
|
||||||
return profile.hiddenSystemMessages || false;
|
return profile.hiddenSystemMessages || false;
|
||||||
|
|
@ -612,6 +624,15 @@ Users.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleHideCheckedItems() {
|
||||||
|
const value = this.hasHideCheckedItems();
|
||||||
|
return {
|
||||||
|
$set: {
|
||||||
|
'profile.hideCheckedItems': !value,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
toggleSystem(value = false) {
|
toggleSystem(value = false) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
|
|
@ -690,6 +711,10 @@ Meteor.methods({
|
||||||
const user = Meteor.user();
|
const user = Meteor.user();
|
||||||
user.toggleDesktopHandles(user.hasShowDesktopDragHandles());
|
user.toggleDesktopHandles(user.hasShowDesktopDragHandles());
|
||||||
},
|
},
|
||||||
|
toggleHideCheckedItems() {
|
||||||
|
const user = Meteor.user();
|
||||||
|
user.toggleHideCheckedItems();
|
||||||
|
},
|
||||||
toggleSystemMessages() {
|
toggleSystemMessages() {
|
||||||
const user = Meteor.user();
|
const user = Meteor.user();
|
||||||
user.toggleSystem(user.hasHiddenSystemMessages());
|
user.toggleSystem(user.hasHiddenSystemMessages());
|
||||||
|
|
|
||||||
|
|
@ -3071,6 +3071,10 @@ definitions:
|
||||||
description: |
|
description: |
|
||||||
does the user want to hide system messages?
|
does the user want to hide system messages?
|
||||||
type: boolean
|
type: boolean
|
||||||
|
hideCheckedItems:
|
||||||
|
description: |
|
||||||
|
does the user want to hide checked checklist items?
|
||||||
|
type: boolean
|
||||||
hiddenSystemMessages:
|
hiddenSystemMessages:
|
||||||
description: |
|
description: |
|
||||||
does the user want to hide system messages?
|
does the user want to hide system messages?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue