mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Added Dropdown field "List" to card details
This commit is contained in:
parent
e668fdc500
commit
7c7640e63e
6 changed files with 64 additions and 1 deletions
|
@ -234,6 +234,15 @@ template(name="cardDetails")
|
|||
+viewer
|
||||
= sort
|
||||
|
||||
if currentBoard.allowsShowLists
|
||||
.card-details-item.card-details-show-lists
|
||||
h3.card-details-item-title
|
||||
i.fa.fa-th-list
|
||||
| {{_ 'list'}}
|
||||
select.js-select-lists
|
||||
each currentBoard.lists
|
||||
option(value="{{_id}}" selected="{{#if isCurrentListId _id}}selected{{/if}}") {{title}}
|
||||
|
||||
//.card-details-items
|
||||
if getSpentTime
|
||||
.card-details-item.card-details-item-spent
|
||||
|
|
|
@ -168,6 +168,15 @@ BlazeComponent.extendComponent({
|
|||
);
|
||||
},
|
||||
|
||||
/** returns if the list id is the current list id
|
||||
* @param listId list id to check
|
||||
* @return is the list id the current list id ?
|
||||
*/
|
||||
isCurrentListId(listId) {
|
||||
const ret = this.data().listId == listId;
|
||||
return ret;
|
||||
},
|
||||
|
||||
onRendered() {
|
||||
if (Meteor.settings.public.CARD_OPENED_WEBHOOK_ENABLED) {
|
||||
// Send Webhook but not create Activities records ---
|
||||
|
@ -379,6 +388,12 @@ BlazeComponent.extendComponent({
|
|||
card.move(card.boardId, card.swimlaneId, card.listId, sort);
|
||||
}
|
||||
},
|
||||
'change .js-select-lists'(event) {
|
||||
let card = this.data();
|
||||
const listSelect = this.$('.js-select-lists')[0];
|
||||
const listId = listSelect.options[listSelect.selectedIndex].value;
|
||||
card.move(card.boardId, card.swimlaneId, listId, card.sort);
|
||||
},
|
||||
'click .js-go-to-linked-card'() {
|
||||
Utils.goCardId(this.data().linkedId);
|
||||
},
|
||||
|
|
|
@ -203,6 +203,12 @@ template(name="boardCardSettingsPopup")
|
|||
span
|
||||
i.fa.fa-sort
|
||||
| {{_ 'card-sorting-by-number'}}
|
||||
div.check-div
|
||||
a.flex.js-field-has-card-show-lists(class="{{#if allowsShowLists}}is-checked{{/if}}")
|
||||
.materialCheckBox(class="{{#if allowsShowLists}}is-checked{{/if}}")
|
||||
span
|
||||
i.fa.fa-th-list
|
||||
| {{_ 'card-show-lists'}}
|
||||
div.check-div
|
||||
a.flex.js-field-has-labels(class="{{#if allowsLabels}}is-checked{{/if}}")
|
||||
.materialCheckBox(class="{{#if allowsLabels}}is-checked{{/if}}")
|
||||
|
|
|
@ -827,6 +827,10 @@ BlazeComponent.extendComponent({
|
|||
return this.currentBoard.allowsCardSortingByNumber;
|
||||
},
|
||||
|
||||
allowsShowLists() {
|
||||
return this.currentBoard.allowsShowLists;
|
||||
},
|
||||
|
||||
allowsLabels() {
|
||||
return this.currentBoard.allowsLabels;
|
||||
},
|
||||
|
@ -1061,6 +1065,22 @@ BlazeComponent.extendComponent({
|
|||
this.currentBoard.allowsCardSortingByNumber,
|
||||
);
|
||||
},
|
||||
'click .js-field-has-card-show-lists'(evt) {
|
||||
evt.preventDefault();
|
||||
this.currentBoard.allowsShowLists = !this.currentBoard
|
||||
.allowsShowLists;
|
||||
this.currentBoard.setAllowsShowLists(
|
||||
this.currentBoard.allowsShowLists,
|
||||
);
|
||||
$(`.js-field-has-card-show-lists ${MCB}`).toggleClass(
|
||||
CKCLS,
|
||||
this.currentBoard.allowsShowLists,
|
||||
);
|
||||
$('.js-field-has-card-show-lists').toggleClass(
|
||||
CKCLS,
|
||||
this.currentBoard.allowsShowLists,
|
||||
);
|
||||
},
|
||||
'click .js-field-has-labels'(evt) {
|
||||
evt.preventDefault();
|
||||
this.currentBoard.allowsLabels = !this.currentBoard.allowsLabels;
|
||||
|
|
|
@ -1144,5 +1144,6 @@
|
|||
"moveChecklistPopup-title": "Move Checklist",
|
||||
"newlineBecomesNewChecklistItem": "Newline becomes new checklist item",
|
||||
"copyChecklist": "Copy Checklist",
|
||||
"copyChecklistPopup-title": "Copy Checklist"
|
||||
"copyChecklistPopup-title": "Copy Checklist",
|
||||
"card-show-lists": "Card Show Lists"
|
||||
}
|
||||
|
|
|
@ -440,6 +440,14 @@ Boards.attachSchema(
|
|||
defaultValue: true,
|
||||
},
|
||||
|
||||
allowsShowLists: {
|
||||
/**
|
||||
* Does the board allows show lists on the card?
|
||||
*/
|
||||
type: Boolean,
|
||||
defaultValue: true,
|
||||
},
|
||||
|
||||
allowsAssignedBy: {
|
||||
/**
|
||||
* Does the board allows requested by?
|
||||
|
@ -1370,6 +1378,10 @@ Boards.mutations({
|
|||
return { $set: { allowsCardSortingByNumber } };
|
||||
},
|
||||
|
||||
setAllowsShowLists(allowsShowLists) {
|
||||
return { $set: { allowsShowLists } };
|
||||
},
|
||||
|
||||
setAllowsAttachments(allowsAttachments) {
|
||||
return { $set: { allowsAttachments } };
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue