Browse Source

Indicate board or card through icons. Indicate if archived

Andrés Manelli 7 years ago
parent
commit
f0597ef0c4

+ 5 - 2
client/components/cards/cardDetails.jade

@@ -20,8 +20,11 @@ template(name="cardDetails")
           // else
             {{_ 'top-level-card'}}
 
-    if archived
-      p.warning {{_ 'card-archived'}}
+    if getArchived
+      if isImportedBoard
+        p.warning {{_ 'board-archived'}}
+      else
+        p.warning {{_ 'card-archived'}}
 
     .card-details-items
       .card-details-item.card-details-item-received

+ 9 - 2
client/components/cards/minicard.jade

@@ -15,8 +15,15 @@ template(name="minicard")
       if $eq 'prefix-with-parent' currentBoard.presentParentTask
         .parent-prefix
           | {{ parentCardName }}
-      if isImported
-        span.imported-icon.fa.fa-share-alt
+      if isImportedBoard
+        a.js-imported-link
+          span.imported-icon.fa.fa-folder
+      else if isImportedCard
+        a.js-imported-link
+          span.imported-icon.fa.fa-id-card
+      if getArchived
+        span.imported-icon.imported-archived.fa.fa-archive
+
       +viewer
         = getTitle
       if $eq 'subtext-with-full-path' currentBoard.presentParentTask

+ 11 - 0
client/components/cards/minicard.js

@@ -6,4 +6,15 @@ BlazeComponent.extendComponent({
   template() {
     return 'minicard';
   },
+
+  events() {
+    return [{
+      'click .js-imported-link' (evt) {
+        if (this.data().isImportedCard())
+          Utils.goCardId(this.data().importedId);
+        else if (this.data().isImportedBoard())
+          Utils.goBoardId(this.data().importedId);
+      },
+    }];
+  },
 }).register('minicard');

+ 2 - 0
client/components/cards/minicard.styl

@@ -51,6 +51,8 @@
       margin-right: 11px
       vertical-align: baseline
       font-size: 0.9em
+    .imported-archived
+      color: #937760
 
   .is-selected &
     transform: translateX(11px)

+ 1 - 0
i18n/en.i18n.json

@@ -109,6 +109,7 @@
     "bucket-example": "Like “Bucket List” for example",
     "cancel": "Cancel",
     "card-archived": "This card is moved to Recycle Bin.",
+    "board-archived": "This board is moved to Recycle Bin.",
     "card-comments-title": "This card has %s comment.",
     "card-delete-notice": "Deleting is permanent. You will lose all actions associated with this card.",
     "card-delete-pop": "All actions will be removed from the activity feed and you won't be able to re-open the card. There is no undo.",

+ 12 - 0
models/cards.js

@@ -721,6 +721,18 @@ Cards.helpers({
       );
     }
   },
+
+  getArchived() {
+    if (this.isImportedCard()) {
+      const card = Cards.findOne({ _id: this.importedId });
+      return card.archived;
+    } else if (this.isImportedBoard()) {
+      const board = Boards.findOne({ _id: this.importedId});
+      return board.archived;
+    } else {
+      return this.archived;
+    }
+  },
 });
 
 Cards.mutations({