diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-01-25 19:05:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-25 19:05:09 +0200 |
commit | ba15526516e1754385d2d6404d64ae9cead3ce95 (patch) | |
tree | 29834be1c70610ea3373e03c64891a6b35569fd1 /models/cards.js | |
parent | 542cc75dc4a4bf392cac72345ab013cf59c67ad3 (diff) | |
parent | 6c3dbc3c6f52a42ddbeeaec9bbfcc82c1c839f7d (diff) | |
download | wekan-ba15526516e1754385d2d6404d64ae9cead3ce95.tar.gz wekan-ba15526516e1754385d2d6404d64ae9cead3ce95.tar.bz2 wekan-ba15526516e1754385d2d6404d64ae9cead3ce95.zip |
Merge pull request #2126 from bentiss/color-swimlanes
Color for swimlanes
Diffstat (limited to 'models/cards.js')
-rw-r--r-- | models/cards.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/models/cards.js b/models/cards.js index c5d9bf05..ff19a9a0 100644 --- a/models/cards.js +++ b/models/cards.js @@ -69,7 +69,7 @@ Cards.attachSchema(new SimpleSchema({ type: String, optional: true, allowedValues: [ - 'green', 'yellow', 'orange', 'red', 'purple', + 'white', 'green', 'yellow', 'orange', 'red', 'purple', 'blue', 'sky', 'lime', 'pink', 'black', 'silver', 'peachpuff', 'crimson', 'plum', 'darkgreen', 'slateblue', 'magenta', 'gold', 'navy', 'gray', @@ -1526,6 +1526,10 @@ if (Meteor.isServer) { Authentication.checkUserId(req.userId); const paramBoardId = req.params.boardId; const paramListId = req.params.listId; + const currentCards = Cards.find({ + listId: paramListId, + archived: false, + }, { sort: ['sort'] }); const check = Users.findOne({ _id: req.body.authorId, }); @@ -1538,7 +1542,7 @@ if (Meteor.isServer) { description: req.body.description, userId: req.body.authorId, swimlaneId: req.body.swimlaneId, - sort: 0, + sort: currentCards.count(), members, }); JsonRoutes.sendResult(res, { @@ -1571,13 +1575,16 @@ if (Meteor.isServer) { * * @description Edit a card * - * The color has to be chosen between `green`, `yellow`, `orange`, `red`, - * `purple`, `blue`, `sky`, `lime`, `pink`, `black`, `silver`, `peachpuff`, - * `crimson`, `plum`, `darkgreen`, `slateblue`, `magenta`, `gold`, `navy`, - * `gray`, `saddlebrown`, `paleturquoise`, `mistyrose`, `indigo`: + * The color has to be chosen between `white`, `green`, `yellow`, `orange`, + * `red`, `purple`, `blue`, `sky`, `lime`, `pink`, `black`, `silver`, + * `peachpuff`, `crimson`, `plum`, `darkgreen`, `slateblue`, `magenta`, + * `gold`, `navy`, `gray`, `saddlebrown`, `paleturquoise`, `mistyrose`, + * `indigo`: * * <img src="/card-colors.png" width="40%" alt="Wekan card colors" /> * + * Note: setting the color to white has the same effect than removing it. + * * @param {string} boardId the board ID of the card * @param {string} list the list ID of the card * @param {string} cardId the ID of the card |