Browse Source

Merge branch 'marc1006-fixes'

Lauri Ojansivu 5 years ago
parent
commit
9c6cd51ca7
58 changed files with 240 additions and 77 deletions
  1. 2 0
      CHANGELOG.md
  2. 17 1
      client/components/cards/cardDetails.js
  3. 2 5
      client/components/lists/listBody.js
  4. 29 2
      client/components/lists/listHeader.js
  5. 3 1
      i18n/ar.i18n.json
  6. 3 1
      i18n/bg.i18n.json
  7. 3 1
      i18n/br.i18n.json
  8. 3 1
      i18n/ca.i18n.json
  9. 3 1
      i18n/cs.i18n.json
  10. 3 1
      i18n/da.i18n.json
  11. 3 1
      i18n/de.i18n.json
  12. 3 1
      i18n/el.i18n.json
  13. 3 1
      i18n/en-GB.i18n.json
  14. 3 1
      i18n/en.i18n.json
  15. 3 1
      i18n/eo.i18n.json
  16. 3 1
      i18n/es-AR.i18n.json
  17. 3 1
      i18n/es-CL.i18n.json
  18. 3 1
      i18n/es.i18n.json
  19. 3 1
      i18n/eu.i18n.json
  20. 3 1
      i18n/fa.i18n.json
  21. 3 1
      i18n/fi.i18n.json
  22. 3 1
      i18n/fr.i18n.json
  23. 3 1
      i18n/gl.i18n.json
  24. 3 1
      i18n/he.i18n.json
  25. 3 1
      i18n/hi.i18n.json
  26. 3 1
      i18n/hu.i18n.json
  27. 3 1
      i18n/hy.i18n.json
  28. 3 1
      i18n/id.i18n.json
  29. 3 1
      i18n/ig.i18n.json
  30. 3 1
      i18n/it.i18n.json
  31. 3 1
      i18n/ja.i18n.json
  32. 3 1
      i18n/ka.i18n.json
  33. 3 1
      i18n/km.i18n.json
  34. 3 1
      i18n/ko.i18n.json
  35. 3 1
      i18n/lv.i18n.json
  36. 3 1
      i18n/mk.i18n.json
  37. 3 1
      i18n/mn.i18n.json
  38. 3 1
      i18n/nb.i18n.json
  39. 3 1
      i18n/nl.i18n.json
  40. 3 1
      i18n/oc.i18n.json
  41. 3 1
      i18n/pl.i18n.json
  42. 18 16
      i18n/pt-BR.i18n.json
  43. 3 1
      i18n/pt.i18n.json
  44. 3 1
      i18n/ro.i18n.json
  45. 4 2
      i18n/ru.i18n.json
  46. 3 1
      i18n/sl.i18n.json
  47. 3 1
      i18n/sr.i18n.json
  48. 3 1
      i18n/sv.i18n.json
  49. 3 1
      i18n/sw.i18n.json
  50. 3 1
      i18n/ta.i18n.json
  51. 3 1
      i18n/th.i18n.json
  52. 3 1
      i18n/tr.i18n.json
  53. 3 1
      i18n/uk.i18n.json
  54. 3 1
      i18n/vi.i18n.json
  55. 3 1
      i18n/zh-CN.i18n.json
  56. 3 1
      i18n/zh-HK.i18n.json
  57. 3 1
      i18n/zh-TW.i18n.json
  58. 15 0
      models/cards.js

+ 2 - 0
CHANGELOG.md

@@ -27,6 +27,8 @@ and adds the following translations:
 
 and fixes the following bugs:
 
+- [Fix Deleting linked card makes board not load](https://github.com/wekan/wekan/issues/2785).
+  Thanks to marc1006 and xet7.
 - [Fix getStartDayOfWeek once again](https://github.com/wekan/wekan/pull/3061).
   Thanks to marc1006.
 - [Fix shortcuts list and support card shortcuts when hovering

+ 17 - 1
client/components/cards/cardDetails.js

@@ -956,7 +956,23 @@ BlazeComponent.extendComponent({
         },
         'click .js-delete': Popup.afterConfirm('cardDelete', function() {
           Popup.close();
-          Cards.remove(this._id);
+          // verify that there are no linked cards
+          if (Cards.find({ linkedId: this._id }).count() === 0) {
+            Cards.remove(this._id);
+          } else {
+            // TODO: Maybe later we can list where the linked cards are.
+            // Now here is popup with a hint that the card cannot be deleted
+            // as there are linked cards.
+            // Related:
+            //   client/components/lists/listHeader.js about line 248
+            //   https://github.com/wekan/wekan/issues/2785
+            const message = `${TAPi18n.__(
+              'delete-linked-card-before-this-card',
+            )} linkedId: ${
+              this._id
+            } at client/components/cards/cardDetails.js and https://github.com/wekan/wekan/issues/2785`;
+            alert(message);
+          }
           Utils.goBoardId(this.boardId);
         }),
         'change .js-field-parent-board'(event) {

+ 2 - 5
client/components/lists/listBody.js

@@ -658,10 +658,7 @@ BlazeComponent.extendComponent({
               _id = element.copy(this.boardId, this.swimlaneId, this.listId);
               // 1.B Linked card
             } else {
-              delete element._id;
-              element.type = 'cardType-linkedCard';
-              element.linkedId = element.linkedId || element._id;
-              _id = Cards.insert(element);
+              _id = element.link(this.boardId, this.swimlaneId, this.listId);
             }
             Filter.addException(_id);
             // List insertion
@@ -675,7 +672,7 @@ BlazeComponent.extendComponent({
             element.sort = Boards.findOne(this.boardId)
               .swimlanes()
               .count();
-            element.type = 'swimlalne';
+            element.type = 'swimlane';
             _id = element.copy(this.boardId);
           } else if (this.isBoardTemplateSearch) {
             board = Boards.findOne(element.linkedId);

+ 29 - 2
client/components/lists/listHeader.js

@@ -223,8 +223,35 @@ BlazeComponent.extendComponent({
 Template.listMorePopup.events({
   'click .js-delete': Popup.afterConfirm('listDelete', function() {
     Popup.close();
-    this.allCards().map(card => Cards.remove(card._id));
-    Lists.remove(this._id);
+    // TODO how can we avoid the fetch call?
+    const allCards = this.allCards().fetch();
+    const allCardIds = _.pluck(allCards, '_id');
+    // it's okay if the linked cards are on the same list
+    if (
+      Cards.find({
+        $and: [
+          { listId: { $ne: this._id } },
+          { linkedId: { $in: allCardIds } },
+        ],
+      }).count() === 0
+    ) {
+      allCardIds.map(_id => Cards.remove(_id));
+      Lists.remove(this._id);
+    } else {
+      // TODO: Figure out more informative message.
+      // Popup with a hint that the list cannot be deleted as there are
+      // linked cards. We can adapt the query above so we can list the linked
+      // cards.
+      // Related:
+      //   client/components/cards/cardDetails.js about line 969
+      //   https://github.com/wekan/wekan/issues/2785
+      const message = `${TAPi18n.__(
+        'delete-linked-cards-before-this-list',
+      )} linkedId: ${
+        this._id
+      } at client/components/lists/listHeader.js and https://github.com/wekan/wekan/issues/2785`;
+      alert(message);
+    }
     Utils.goBoardId(this.boardId);
   }),
 });

+ 3 - 1
i18n/ar.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/bg.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/br.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ca.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/cs.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/da.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/de.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/el.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/en-GB.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/en.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/eo.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/es-AR.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/es-CL.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/es.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/eu.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/fa.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/fi.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Viimeksi muokattu",
   "last-activity": "Viimeisin toiminta",
   "voting": "Äänestys",
-  "archived": "Arkistoitu"
+  "archived": "Arkistoitu",
+  "delete-linked-card-before-this-card": "Et voi poistaa tätä korttia ennenkuin ensin poistat linkitetyn kortin jolla on",
+  "delete-linked-cards-before-this-list": "Et voi poistaa tätä listaa ennenkuin poistat linkitetyt kortit jotka osoittavat kortteihin tässä listassa"
 }

+ 3 - 1
i18n/fr.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Dernière modification le",
   "last-activity": "Dernière activité",
   "voting": "Vote",
-  "archived": "Archivé"
+  "archived": "Archivé",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/gl.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/he.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "שינוי אחרון ב־",
   "last-activity": "פעילות אחרונה",
   "voting": "הצבעה",
-  "archived": "בארכיון"
+  "archived": "בארכיון",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/hi.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/hu.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/hy.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/id.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ig.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/it.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ja.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ka.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/km.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ko.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/lv.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/mk.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/mn.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/nb.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/nl.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Laatste aanpassing op",
   "last-activity": "Laatste activiteit",
   "voting": "Stemmen",
-  "archived": "Gearchiveerd"
+  "archived": "Gearchiveerd",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/oc.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/pl.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 18 - 16
i18n/pt-BR.i18n.json

@@ -309,7 +309,7 @@
   "error-board-notAMember": "Você precisa ser um membro desse quadro para fazer isto",
   "error-json-malformed": "Seu texto não é um JSON válido",
   "error-json-schema": "Seu JSON não inclui as informações no formato correto",
-  "error-csv-schema": "Your CSV(Comma Separated Values)/TSV (Tab Separated Values) does not include the proper information in the correct format",
+  "error-csv-schema": "Seu CSV(Comma Separated Values)/TSV (Tab Separated Values) não inclui a informação adequada no formato correto",
   "error-list-doesNotExist": "Esta lista não existe",
   "error-user-doesNotExist": "Este usuário não existe",
   "error-user-notAllowSelf": "Você não pode convidar a si mesmo",
@@ -317,10 +317,10 @@
   "error-username-taken": "Esse username já existe",
   "error-email-taken": "E-mail já está em uso",
   "export-board": "Exportar quadro",
-  "export-board-json": "Export board to JSON",
-  "export-board-csv": "Export board to CSV",
-  "export-board-tsv": "Export board to TSV",
-  "export-board-html": "Export board to HTML",
+  "export-board-json": "Exportar quadro para JSON",
+  "export-board-csv": "Exportar quadro para CSV",
+  "export-board-tsv": "Exportar quadro para TSV",
+  "export-board-html": "Exportar quadro para HTML",
   "exportBoardPopup-title": "Exportar quadro",
   "sort": "Ordenar",
   "sort-desc": "Clique para Ordenar Lista",
@@ -357,16 +357,16 @@
   "import-board-c": "Importar quadro",
   "import-board-title-trello": "Importar quadro do Trello",
   "import-board-title-wekan": "Importar quadro a partir de exportação prévia",
-  "import-board-title-csv": "Import board from CSV/TSV",
+  "import-board-title-csv": "Importar quadro de CSV/TSV",
   "from-trello": "Do Trello",
   "from-wekan": "A partir de exportação prévia",
-  "from-csv": "From CSV/TSV",
+  "from-csv": "De CSV/TSV",
   "import-board-instruction-trello": "No seu quadro do Trello, vá em 'Menu', depois em 'Mais', 'Imprimir e Exportar', 'Exportar JSON', então copie o texto emitido",
-  "import-board-instruction-csv": "Paste in your Comma Separated Values(CSV)/ Tab Separated Values (TSV) .",
+  "import-board-instruction-csv": "Cole seu Comma Separated Values(CSV)/ Tab Separated Values (TSV) .",
   "import-board-instruction-wekan": "Em seu quadro vá para 'Menu', depois 'Exportar quadro' e copie o texto no arquivo baixado.",
   "import-board-instruction-about-errors": "Se você receber erros ao importar o quadro, às vezes a importação ainda funciona e o quadro está na página Todos os Quadros.",
   "import-json-placeholder": "Cole seus dados JSON válidos aqui",
-  "import-csv-placeholder": "Paste your valid CSV/TSV data here",
+  "import-csv-placeholder": "Cole aqui os dados válidos de seu CSV/TSV",
   "import-map-members": "Mapear membros",
   "import-members-map": "Seu quadro importado possui alguns membros. Por favor, mapeie os membros que você deseja importar para seus usuários",
   "import-show-user-mapping": "Revisar mapeamento dos membros",
@@ -399,7 +399,7 @@
   "swimlaneActionPopup-title": "Ações de Raia",
   "swimlaneAddPopup-title": "Adicionar uma Raia abaixo",
   "listImportCardPopup-title": "Importe um cartão do Trello",
-  "listImportCardsTsvPopup-title": "Import Excel CSV/TSV",
+  "listImportCardsTsvPopup-title": "Importar Excel CSV/TSV",
   "listMorePopup-title": "Mais",
   "link-list": "Vincular a esta lista",
   "list-delete-pop": "Todas as ações serão excluidas da lista de atividades e você não poderá recuperar a lista. Não há como desfazer.",
@@ -799,10 +799,12 @@
   "saturday": "Sábado",
   "sunday": "Domingo",
   "status": "Status",
-  "swimlane": "Swimlane",
-  "owner": "Owner",
-  "last-modified-at": "Last modified at",
-  "last-activity": "Last activity",
-  "voting": "Voting",
-  "archived": "Archived"
+  "swimlane": "Raia",
+  "owner": "Proprietário",
+  "last-modified-at": "Última modificação em",
+  "last-activity": "Última atividade",
+  "voting": "Votação",
+  "archived": "Arquivado",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/pt.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ro.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 4 - 2
i18n/ru.i18n.json

@@ -320,7 +320,7 @@
   "export-board-json": "Экспортировать доску в JSON",
   "export-board-csv": "Экспортировать доску в CSV",
   "export-board-tsv": "Экспортировать доску в TSV",
-  "export-board-html": "Export board to HTML",
+  "export-board-html": "Экспортировать доску в HTML",
   "exportBoardPopup-title": "Экспортировать доску",
   "sort": "Сортировать",
   "sort-desc": "Нажмите, чтобы отсортировать список",
@@ -804,5 +804,7 @@
   "last-modified-at": "Последний раз изменено",
   "last-activity": "Последние действия",
   "voting": "Голосование",
-  "archived": "Архивировано"
+  "archived": "Архивировано",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/sl.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/sr.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/sv.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Senast ändrad",
   "last-activity": "Senaste aktivitet",
   "voting": "Röstning",
-  "archived": "Arkiverad"
+  "archived": "Arkiverad",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/sw.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/ta.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/th.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/tr.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/uk.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/vi.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/zh-CN.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/zh-HK.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 3 - 1
i18n/zh-TW.i18n.json

@@ -804,5 +804,7 @@
   "last-modified-at": "Last modified at",
   "last-activity": "Last activity",
   "voting": "Voting",
-  "archived": "Archived"
+  "archived": "Archived",
+  "delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
+  "delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
 }

+ 15 - 0
models/cards.js

@@ -438,6 +438,21 @@ Cards.helpers({
     return _id;
   },
 
+  link(boardId, swimlaneId, listId) {
+    // TODO is there a better method to create a deepcopy?
+    linkCard = JSON.parse(JSON.stringify(this));
+    // TODO is this how it is meant to be?
+    linkCard.linkedId = linkCard.linkedId || linkCard._id;
+    linkCard.boardId = boardId;
+    linkCard.swimlaneId = swimlaneId;
+    linkCard.listId = listId;
+    linkCard.type = 'cardType-linkedCard';
+    delete linkCard._id;
+    // TODO shall we copy the labels for a linked card?!
+    delete linkCard.labelIds;
+    return Cards.insert(linkCard);
+  },
+
   list() {
     return Lists.findOne(this.listId);
   },