summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-04-21 00:14:10 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-08-11 00:15:51 +0200
commitbce22425280248eda01132ccc58c9f5beefb712a (patch)
tree32edb028b1c7f1de8ba7c87f3babc3c2860641f1
parentf0597ef0c496352cb102d85227a46831a8b04c57 (diff)
downloadwekan-bce22425280248eda01132ccc58c9f5beefb712a.tar.gz
wekan-bce22425280248eda01132ccc58c9f5beefb712a.tar.bz2
wekan-bce22425280248eda01132ccc58c9f5beefb712a.zip
Add imported card location
-rw-r--r--client/components/cards/cardDetails.jade4
-rw-r--r--client/components/cards/cardDetails.styl6
-rw-r--r--models/cards.js14
3 files changed, 24 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index d8efc7a6..7f206569 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -19,6 +19,10 @@ template(name="cardDetails")
a.js-parent-card(href=linkForCard) {{title}}
// else
{{_ 'top-level-card'}}
+ if isImportedCard
+ h3.imported-card-location
+ +viewer
+ | {{getBoardTitle}} > {{getTitle}}
if getArchived
if isImportedBoard
diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl
index 42d27d11..ab65a5d6 100644
--- a/client/components/cards/cardDetails.styl
+++ b/client/components/cards/cardDetails.styl
@@ -47,6 +47,12 @@
margin: 7px 0 0
padding: 0
+ .imported-card-location
+ font-style: italic
+ font-size: 1em
+ margin-bottom: 0
+ & p
+ margin-bottom: 0
form.inlined-form
margin-top: 5px
diff --git a/models/cards.js b/models/cards.js
index 987ce330..c6e80ea8 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -703,6 +703,20 @@ Cards.helpers({
}
},
+ getBoardTitle() {
+ if (this.isImportedCard()) {
+ const card = Cards.findOne({ _id: this.importedId });
+ const board = Boards.findOne({ _id: card.boardId });
+ return board.title;
+ } else if (this.isImportedBoard()) {
+ const board = Boards.findOne({ _id: this.importedId});
+ return board.title;
+ } else {
+ const board = Boards.findOne({ _id: this.boardId });
+ return board.title;
+ }
+ },
+
setTitle(title) {
if (this.isImportedCard()) {
return Cards.update(