mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02: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
|
||||
a.add-checklist-top.js-open-inlined-form(title="{{_ 'add-checklist'}}")
|
||||
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
|
||||
each checklist in checklists
|
||||
+checklistDetail(checklist = checklist)
|
||||
+checklistDetail(checklist=checklist)
|
||||
|
||||
if canModifyCard
|
||||
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
||||
|
@ -142,6 +122,27 @@ 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
|
||||
|
|
|
@ -202,12 +202,6 @@ BlazeComponent.extendComponent({
|
|||
|
||||
events() {
|
||||
const events = {
|
||||
'click #toggleShowChecklistAtMinicardButton'() {
|
||||
Meteor.call('toggleShowChecklistAtMinicard');
|
||||
},
|
||||
'click #toggleHideCheckedItemsButton'() {
|
||||
Meteor.call('toggleHideCheckedItems');
|
||||
},
|
||||
};
|
||||
|
||||
return [
|
||||
|
@ -277,6 +271,11 @@ 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();
|
||||
|
@ -304,9 +303,26 @@ 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;
|
||||
|
|
|
@ -111,12 +111,11 @@ template(name="minicard")
|
|||
+viewer
|
||||
= trueValue
|
||||
|
||||
.minicard-checklists
|
||||
.card-checklist-attachmentGalleries
|
||||
.card-checklist-attachmentGallery.card-checklists
|
||||
if currentBoard.allowsChecklists
|
||||
hr
|
||||
+checklists(cardId = _id)
|
||||
+checklists(cardId=_id showAtMinicard=true)
|
||||
|
||||
if showAssignee
|
||||
if getAssignees
|
||||
|
|
|
@ -1238,7 +1238,7 @@
|
|||
"translation": "번역",
|
||||
"text": "Text",
|
||||
"translation-text": "번역 문구",
|
||||
"show-at-minicard": "Show at minicard",
|
||||
"show-checklist-at-minicard": "Show checklist at minicard",
|
||||
"show-subtasks-field": "Show subtasks field"
|
||||
"show-at-minicard": "미니카드에 보이기",
|
||||
"show-checklist-at-minicard": "미니카드에 확인목록 보이기",
|
||||
"show-subtasks-field": "하위할일 항목 보이기"
|
||||
}
|
||||
|
|
|
@ -1238,7 +1238,7 @@
|
|||
"translation": "번역",
|
||||
"text": "텍스트",
|
||||
"translation-text": "번역 문구",
|
||||
"show-at-minicard": "Show at minicard",
|
||||
"show-checklist-at-minicard": "Show checklist at minicard",
|
||||
"show-subtasks-field": "Show subtasks field"
|
||||
"show-at-minicard": "미니카드에 보이기",
|
||||
"show-checklist-at-minicard": "미니카드에 확인목록 보이기",
|
||||
"show-subtasks-field": "하위할일 항목 보이기"
|
||||
}
|
||||
|
|
|
@ -920,7 +920,7 @@
|
|||
"cardAssigneesPopup-title": "Administrador",
|
||||
"addmore-detail": "Adicionar descrição detalhada",
|
||||
"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",
|
||||
"editOrgPopup-title": "Editar Organização",
|
||||
"newOrgPopup-title": "Nova Organização",
|
||||
|
@ -1240,5 +1240,5 @@
|
|||
"translation-text": "Texto de tradução",
|
||||
"show-at-minicard": "Mostrar 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();
|
||||
return {
|
||||
$set: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue