mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
At opened card, toggle to show checklist at minicard. Part 4.
Thanks to xet7 !
This commit is contained in:
parent
1a35db62b1
commit
86814a0fd8
7 changed files with 58 additions and 42 deletions
|
|
@ -9,30 +9,10 @@ template(name="checklists")
|
||||||
else
|
else
|
||||||
a.add-checklist-top.js-open-inlined-form(title="{{_ 'add-checklist'}}")
|
a.add-checklist-top.js-open-inlined-form(title="{{_ 'add-checklist'}}")
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
if currentUser.isBoardMember
|
|
||||||
span.text-show-at-minicard
|
|
||||||
| {{_ 'show-at-minicard'}}
|
|
||||||
.material-toggle-switch(title="{{_ 'show-checklist-at-minicard'}}")
|
|
||||||
if showChecklistAtMinicard
|
|
||||||
input.toggle-switch(type="checkbox" id="toggleShowChecklistAtMinicardButton" checked="checked")
|
|
||||||
else
|
|
||||||
input.toggle-switch(type="checkbox" id="toggleShowChecklistAtMinicardButton")
|
|
||||||
label.toggle-label(for="toggleShowChecklistAtMinicardButton")
|
|
||||||
span.text-some-space
|
|
||||||
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")
|
|
||||||
|
|
||||||
.card-checklist-items
|
.card-checklist-items
|
||||||
each checklist in checklists
|
each checklist in checklists
|
||||||
+checklistDetail(checklist = checklist)
|
+checklistDetail(checklist=checklist)
|
||||||
|
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
||||||
|
|
@ -142,6 +122,27 @@ template(name='checklistItemDetail')
|
||||||
= item.title
|
= item.title
|
||||||
|
|
||||||
template(name="checklistActionsPopup")
|
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
|
ul.pop-over-list
|
||||||
li
|
li
|
||||||
a.js-delete-checklist.delete-checklist
|
a.js-delete-checklist.delete-checklist
|
||||||
|
|
|
||||||
|
|
@ -202,12 +202,6 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
const events = {
|
const events = {
|
||||||
'click #toggleShowChecklistAtMinicardButton'() {
|
|
||||||
Meteor.call('toggleShowChecklistAtMinicard');
|
|
||||||
},
|
|
||||||
'click #toggleHideCheckedItemsButton'() {
|
|
||||||
Meteor.call('toggleHideCheckedItems');
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -277,6 +271,11 @@ Template.checklists.helpers({
|
||||||
const ret = card.checklists();
|
const ret = card.checklists();
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
showAtMinicard() {
|
||||||
|
const card = ReactiveCache.getCard(this.cardId);
|
||||||
|
const ret = card.checklists({'showAtMinicard':1});
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
hideCheckedItems() {
|
hideCheckedItems() {
|
||||||
const currentUser = ReactiveCache.getCurrentUser();
|
const currentUser = ReactiveCache.getCurrentUser();
|
||||||
if (currentUser) return currentUser.hasHideCheckedItems();
|
if (currentUser) return currentUser.hasHideCheckedItems();
|
||||||
|
|
@ -304,9 +303,26 @@ BlazeComponent.extendComponent({
|
||||||
}).register('addChecklistItemForm');
|
}).register('addChecklistItemForm');
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
|
toggleItem() {
|
||||||
|
const checklist = this.currentData().checklist;
|
||||||
|
const item = this.currentData().item;
|
||||||
|
if (checklist && item && item._id) {
|
||||||
|
item.toggleItem();
|
||||||
|
}
|
||||||
|
},
|
||||||
events() {
|
events() {
|
||||||
return [
|
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 () {
|
'click .js-delete-checklist': Popup.afterConfirm('checklistDelete', function () {
|
||||||
Popup.back(2);
|
Popup.back(2);
|
||||||
const checklist = this.checklist;
|
const checklist = this.checklist;
|
||||||
|
|
|
||||||
|
|
@ -111,12 +111,11 @@ template(name="minicard")
|
||||||
+viewer
|
+viewer
|
||||||
= trueValue
|
= trueValue
|
||||||
|
|
||||||
.minicard-checklists
|
.card-checklist-attachmentGalleries
|
||||||
.card-checklist-attachmentGalleries
|
.card-checklist-attachmentGallery.card-checklists
|
||||||
.card-checklist-attachmentGallery.card-checklists
|
if currentBoard.allowsChecklists
|
||||||
if currentBoard.allowsChecklists
|
hr
|
||||||
hr
|
+checklists(cardId=_id showAtMinicard=true)
|
||||||
+checklists(cardId = _id)
|
|
||||||
|
|
||||||
if showAssignee
|
if showAssignee
|
||||||
if getAssignees
|
if getAssignees
|
||||||
|
|
|
||||||
|
|
@ -1238,7 +1238,7 @@
|
||||||
"translation": "번역",
|
"translation": "번역",
|
||||||
"text": "Text",
|
"text": "Text",
|
||||||
"translation-text": "번역 문구",
|
"translation-text": "번역 문구",
|
||||||
"show-at-minicard": "Show at minicard",
|
"show-at-minicard": "미니카드에 보이기",
|
||||||
"show-checklist-at-minicard": "Show checklist at minicard",
|
"show-checklist-at-minicard": "미니카드에 확인목록 보이기",
|
||||||
"show-subtasks-field": "Show subtasks field"
|
"show-subtasks-field": "하위할일 항목 보이기"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1238,7 +1238,7 @@
|
||||||
"translation": "번역",
|
"translation": "번역",
|
||||||
"text": "텍스트",
|
"text": "텍스트",
|
||||||
"translation-text": "번역 문구",
|
"translation-text": "번역 문구",
|
||||||
"show-at-minicard": "Show at minicard",
|
"show-at-minicard": "미니카드에 보이기",
|
||||||
"show-checklist-at-minicard": "Show checklist at minicard",
|
"show-checklist-at-minicard": "미니카드에 확인목록 보이기",
|
||||||
"show-subtasks-field": "Show subtasks field"
|
"show-subtasks-field": "하위할일 항목 보이기"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -920,7 +920,7 @@
|
||||||
"cardAssigneesPopup-title": "Administrador",
|
"cardAssigneesPopup-title": "Administrador",
|
||||||
"addmore-detail": "Adicionar descrição detalhada",
|
"addmore-detail": "Adicionar descrição detalhada",
|
||||||
"show-on-card": "Mostrar no Cartão",
|
"show-on-card": "Mostrar no Cartão",
|
||||||
"show-on-minicard": "Exibir no Mini cartão",
|
"show-on-minicard": "Mostrar no Mini cartão",
|
||||||
"new": "Novo",
|
"new": "Novo",
|
||||||
"editOrgPopup-title": "Editar Organização",
|
"editOrgPopup-title": "Editar Organização",
|
||||||
"newOrgPopup-title": "Nova Organização",
|
"newOrgPopup-title": "Nova Organização",
|
||||||
|
|
@ -1240,5 +1240,5 @@
|
||||||
"translation-text": "Texto de tradução",
|
"translation-text": "Texto de tradução",
|
||||||
"show-at-minicard": "Mostrar no mini cartão",
|
"show-at-minicard": "Mostrar no mini cartão",
|
||||||
"show-checklist-at-minicard": "Mostrar lista de verificação no mini cartão",
|
"show-checklist-at-minicard": "Mostrar lista de verificação no mini cartão",
|
||||||
"show-subtasks-field": "Show subtasks field"
|
"show-subtasks-field": "Mostrar campo subtarefas"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ Checklists.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleShowChecklistAtMinicard() {
|
toggleShowChecklistAtMinicard(checklistId) {
|
||||||
const value = this.hasShowChecklistAtMinicard();
|
const value = this.hasShowChecklistAtMinicard();
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue