preparation hide checklist-items per card

This commit is contained in:
Martin Filser 2023-09-15 21:47:05 +02:00
parent f6d2b08025
commit d949753d54
8 changed files with 12 additions and 110 deletions

View file

@ -8,20 +8,6 @@ textarea.js-edit-checklist-item {
resize: none;
height: 34px;
}
.card-details .text-show-at-minicard {
width: 350px;
text-align: left;
}
.minicard .text-show-at-minicard {
display: none;
}
.text-some-space {
width: 20px;
}
.text-hide-checked-items {
width: 400px;
text-align: left;
}
.delete-text,
.js-delete-checklist-item,
.js-convert-checklist-item-to-card {
@ -40,8 +26,6 @@ textarea.js-edit-checklist-item {
display: flex;
justify-content: space-between;
}
.checklist-progress-bar-container {
display: flex;
flex-direction: row;

View file

@ -9,6 +9,14 @@ template(name="checklists")
else
a.add-checklist-top.js-open-inlined-form(title="{{_ 'add-checklist'}}")
i.fa.fa-plus
if currentUser.isBoardMember
.material-toggle-switch(title="{{_ 'hide-checked-items'}}")
//span.toggle-switch-title
if hideCheckedItems
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton" checked="checked")
else
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton")
label.toggle-label(for="toggleHideCheckedItemsButton")
.card-checklist-items
each checklist in checklists
@ -122,27 +130,6 @@ template(name='checklistItemDetail')
= item.title
template(name="checklistActionsPopup")
if currentUser.isBoardMember
span.text-show-at-minicard
| {{_ 'show-at-minicard'}}
.material-toggle-switch(title="{{_ 'show-checklist-at-minicard'}}")
if showAtMinicard
input.toggle-switch(type="checkbox" id="toggleShowChecklistAtMinicardButton" checked="checked")
else
input.toggle-switch(type="checkbox" id="toggleShowChecklistAtMinicardButton")
label.toggle-label(for="toggleShowChecklistAtMinicardButton")
hr
span.text-hide-checked-items
| {{_ 'hide-checked-items'}}
.material-toggle-switch(title="{{_ 'hide-checked-items'}}")
//span.toggle-switch-title
//.check-square-icon.i.fa.fa-check-square-o
if hideCheckedItems
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton" checked="checked")
else
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton")
label.toggle-label(for="toggleHideCheckedItemsButton")
hr
ul.pop-over-list
li
a.js-delete-checklist.delete-checklist

View file

@ -202,6 +202,9 @@ BlazeComponent.extendComponent({
events() {
const events = {
'click #toggleHideCheckedItemsButton'() {
Meteor.call('toggleHideCheckedItems');
},
};
return [
@ -271,11 +274,6 @@ Template.checklists.helpers({
const ret = card.checklists();
return ret;
},
showAtMinicard() {
const card = ReactiveCache.getCard(this.cardId);
const ret = card.checklists({'showAtMinicard':1});
return ret;
},
hideCheckedItems() {
const currentUser = ReactiveCache.getCurrentUser();
if (currentUser) return currentUser.hasHideCheckedItems();
@ -303,26 +301,9 @@ BlazeComponent.extendComponent({
}).register('addChecklistItemForm');
BlazeComponent.extendComponent({
toggleItem() {
const checklist = this.currentData().checklist;
const item = this.currentData().item;
if (checklist && item && item._id) {
item.toggleItem();
}
},
events() {
return [
{
'click .js-checklist-item .check-box-container': this.toggleItem,
'click #toggleShowChecklistAtMinicardButton'() {
const checklist = this.checklist;
if (checklist && checklist._id) {
Meteor.call('toggleShowChecklistAtMinicard', checklist._id);
}
},
'click #toggleHideCheckedItemsButton'() {
Meteor.call('toggleHideCheckedItems');
},
'click .js-delete-checklist': Popup.afterConfirm('checklistDelete', function () {
Popup.back(2);
const checklist = this.checklist;

View file

@ -1,12 +1,3 @@
.minicard .checklists-title,
.minicard .add-checklist,
.minicard .add-checklist-item,
.minicard .checklist-details-menu {
display: none;
}
.minicard .checklist-progress-bar-container {
width: 190px; /* TODO: Add adjustable width https://github.com/wekan/wekan/pull/4964 */
}
.minicard-wrapper {
cursor: pointer;
position: relative;
@ -138,14 +129,6 @@
max-width: 100%;
margin-right: 4px;
}
/*
.minicard .checklists-title,
.minicard .add-checklist,
.minicard .add-checklist-item,
.minicard .checklist-details-menu {
display: none;
}
*/
.minicard .handle {
width: 20px;
height: 20px;

View file

@ -112,12 +112,6 @@ template(name="minicard")
+viewer
= trueValue
.card-checklist-attachmentGalleries
.card-checklist-attachmentGallery.card-checklists
if currentBoard.allowsChecklists
//hr
//+checklists(cardId=_id showAtMinicard=true)
if showAssignee
if getAssignees
.minicard-assignees.js-minicard-assignees

View file

@ -88,11 +88,6 @@ BlazeComponent.extendComponent({
events() {
return [
{
'click .minicard-checklists'() {
// Prevents clicking checklist at minicard from opening card details,
// while still allowing checking checlist items.
event.preventDefault();
},
'click .js-linked-link'() {
if (this.data().isLinkedCard()) Utils.goCardId(this.data().linkedId);
else if (this.data().isLinkedBoard())

View file

@ -1244,8 +1244,6 @@
"translation": "Translation",
"text": "Text",
"translation-text": "Translation text",
"show-at-minicard": "Show at minicard",
"show-checklist-at-minicard": "Show checklist at minicard",
"show-subtasks-field": "Show subtasks field",
"convert-to-markdown": "Convert to markdown",
"import-board-zip": "Add .zip file that has board JSON files, and board name subdirectories with attachments",

View file

@ -27,14 +27,6 @@ Checklists.attachSchema(
type: Date,
optional: true,
},
showAtMinicard: {
/**
* Show at minicard. Default: false.
*/
type: Boolean,
optional: true,
defaultValue: false,
},
createdAt: {
/**
* Creation date of the checklist
@ -142,9 +134,6 @@ Checklists.helpers({
const items = ReactiveCache.getChecklist({ _id: this._id }).items;
return _.pluck(items, '_id').indexOf(itemId);
},
hasShowChecklistAtMinicard() {
return showAtMinicard || false;
},
});
Checklists.allow({
@ -202,15 +191,6 @@ Checklists.mutations({
},
};
},
toggleShowChecklistAtMinicard(checklistId) {
const value = this.hasShowChecklistAtMinicard();
return {
$set: {
'showAtMinicard': !value,
},
};
},
});
if (Meteor.isServer) {