mirror of
https://github.com/wekan/wekan.git
synced 2026-02-17 21:48:07 +01:00
Refactor imported -> linked in components
This commit is contained in:
parent
6adfcb3513
commit
f76d8e47a8
11 changed files with 52 additions and 53 deletions
|
|
@ -57,9 +57,9 @@ Template.cardAttachmentsPopup.events({
|
|||
const card = this;
|
||||
FS.Utility.eachFile(evt, (f) => {
|
||||
const file = new FS.File(f);
|
||||
if (card.isImportedCard()) {
|
||||
file.boardId = Cards.findOne(card.importedId).boardId;
|
||||
file.cardId = card.importedId;
|
||||
if (card.isLinkedCard()) {
|
||||
file.boardId = Cards.findOne(card.linkedId).boardId;
|
||||
file.cardId = card.linkedId;
|
||||
} else {
|
||||
file.boardId = card.boardId;
|
||||
file.cardId = card._id;
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ template(name="cardDetails")
|
|||
a.js-parent-card(href=linkForCard) {{title}}
|
||||
// else
|
||||
{{_ 'top-level-card'}}
|
||||
if isImportedCard
|
||||
h3.imported-card-location
|
||||
if isLinkedCard
|
||||
h3.linked-card-location
|
||||
+viewer
|
||||
| {{getBoardTitle}} > {{getTitle}}
|
||||
|
||||
if getArchived
|
||||
if isImportedBoard
|
||||
if isLinkedBoard
|
||||
p.warning {{_ 'board-archived'}}
|
||||
else
|
||||
p.warning {{_ 'card-archived'}}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
margin: 7px 0 0
|
||||
padding: 0
|
||||
|
||||
.imported-card-location
|
||||
.linked-card-location
|
||||
font-style: italic
|
||||
font-size: 1em
|
||||
margin-bottom: 0
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ BlazeComponent.extendComponent({
|
|||
const title = textarea.value.trim();
|
||||
let cardId = this.currentData().cardId;
|
||||
const card = Cards.findOne(cardId);
|
||||
if (card.isImported())
|
||||
cardId = card.importedId;
|
||||
if (card.isLinked())
|
||||
cardId = card.linkedId;
|
||||
|
||||
if (title) {
|
||||
Checklists.insert({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
template(name="minicard")
|
||||
.minicard(
|
||||
class="{{#if isImportedCard}}imported-card{{/if}}"
|
||||
class="{{#if isImportedBoard}}imported-board{{/if}}")
|
||||
class="{{#if isLinkedCard}}linked-card{{/if}}"
|
||||
class="{{#if isLinkedBoard}}linked-board{{/if}}")
|
||||
if cover
|
||||
.minicard-cover(style="background-image: url('{{cover.url}}');")
|
||||
if labels
|
||||
|
|
@ -15,15 +15,14 @@ template(name="minicard")
|
|||
if $eq 'prefix-with-parent' currentBoard.presentParentTask
|
||||
.parent-prefix
|
||||
| {{ parentCardName }}
|
||||
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 isLinkedBoard
|
||||
a.js-linked-link
|
||||
span.linked-icon.fa.fa-folder
|
||||
else if isLinkedCard
|
||||
a.js-linked-link
|
||||
span.linked-icon.fa.fa-id-card
|
||||
if getArchived
|
||||
span.imported-icon.imported-archived.fa.fa-archive
|
||||
|
||||
span.linked-icon.linked-archived.fa.fa-archive
|
||||
+viewer
|
||||
= getTitle
|
||||
if $eq 'subtext-with-full-path' currentBoard.presentParentTask
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ BlazeComponent.extendComponent({
|
|||
|
||||
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);
|
||||
'click .js-linked-link' (evt) {
|
||||
if (this.data().isLinkedCard())
|
||||
Utils.goCardId(this.data().linkedId);
|
||||
else if (this.data().isLinkedBoard())
|
||||
Utils.goBoardId(this.data().linkedId);
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@
|
|||
transition: transform 0.2s,
|
||||
border-radius 0.2s
|
||||
|
||||
&.imported-board
|
||||
&.imported-card
|
||||
.imported-icon
|
||||
&.linked-board
|
||||
&.linked-card
|
||||
.linked-icon
|
||||
display: inline-block
|
||||
margin-right: 11px
|
||||
vertical-align: baseline
|
||||
font-size: 0.9em
|
||||
.imported-archived
|
||||
.linked-archived
|
||||
color: #937760
|
||||
|
||||
.is-selected &
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue