-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Align card details better to take less space
Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
1 parent
21cc942
commit 4dfbd19
Showing
10 changed files
with
126 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,24 +64,26 @@ | |
<input type="submit" value="" class="icon-confirm"> | ||
</form> | ||
|
||
<DueDate v-if="!editing && !card.done" :card="card" /> | ||
<Done v-else-if="!editing && card.done" :card="card" /> | ||
|
||
<CardMenu v-if="!editing && compactMode" :card="card" class="right" /> | ||
<CardMenu v-if="showMenuAtTitle" :card="card" class="right card-menu" /> | ||
</div> | ||
|
||
<transition-group v-if="card.labels && card.labels.length" | ||
name="zoom" | ||
tag="ul" | ||
class="labels" | ||
@click.stop="openCard"> | ||
<li v-for="label in labelsSorted" :key="label.id" :style="labelStyle(label)"> | ||
<span @click.stop="applyLabelFilter(label)">{{ label.title }}</span> | ||
</li> | ||
</transition-group> | ||
<div class="card-labels" v-if="hasLabels"> | ||
<transition-group v-if="card.labels && card.labels.length" | ||
name="zoom" | ||
tag="ul" | ||
class="labels" | ||
@click.stop="openCard"> | ||
<li v-for="label in labelsSorted" :key="label.id" :style="labelStyle(label)"> | ||
<span @click.stop="applyLabelFilter(label)">{{ label.title }}</span> | ||
</li> | ||
</transition-group> | ||
<CardMenu v-if="showMenuAtLabels" :card="card" class="right" /> | ||
</div> | ||
|
||
<div v-show="!compactMode" class="card-controls compact-item" @click="openCard"> | ||
<CardBadges :card="card" /> | ||
<div v-if="hasBadges" v-show="!compactMode" class="card-controls compact-item" @click="openCard"> | ||
Check failure on line 83 in src/components/cards/CardItem.vue GitHub Actions / eslint
|
||
<CardBadges :card="card"> | ||
<CardMenu v-if="showMenuAtBadges" :card="card" class="right" /> | ||
</CardBadges> | ||
</div> | ||
</div> | ||
</AttachmentDragAndDrop> | ||
|
@@ -95,13 +97,11 @@ import Color from '../../mixins/color.js' | |
import labelStyle from '../../mixins/labelStyle.js' | ||
import AttachmentDragAndDrop from '../AttachmentDragAndDrop.vue' | ||
import CardMenu from './CardMenu.vue' | ||
import Done from './badges/Done.vue' | ||
import DueDate from './badges/DueDate.vue' | ||
import CardCover from './CardCover.vue' | ||
export default { | ||
name: 'CardItem', | ||
components: { CardBadges, AttachmentDragAndDrop, CardMenu, DueDate, CardCover, Done }, | ||
components: { CardBadges, AttachmentDragAndDrop, CardMenu, CardCover }, | ||
directives: { | ||
ClickOutside, | ||
}, | ||
|
@@ -165,6 +165,39 @@ export default { | |
labelsSorted() { | ||
return [...this.card.labels].sort((a, b) => (a.title < b.title) ? -1 : 1) | ||
}, | ||
hasLabels() { | ||
return this.card.labels.length > 0 | ||
}, | ||
hasBadges() { | ||
return this.card.done | ||
|| this.card.duedate | ||
|| this.idBadge | ||
|| this.card.commentsCount > 0 | ||
|| this.card.description | ||
|| this.card.attachmentCount > 0 | ||
|| this.card.assignedUsers.length > 0 | ||
}, | ||
idBadge() { | ||
return this.$store.getters.config('cardIdBadge') | ||
}, | ||
showMenuAtTitle() { | ||
if (this.editing) { | ||
return false | ||
} | ||
return this.compactMode || (!this.compactMode && !this.hasBadges && !this.hasLabels) | ||
}, | ||
showMenuAtLabels() { | ||
if (this.compactMode) { | ||
return false | ||
} | ||
return !this.hasBadges && this.hasLabels | ||
}, | ||
showMenuAtBadges() { | ||
if (this.compactMode) { | ||
return false | ||
} | ||
return this.hasBadges | ||
}, | ||
}, | ||
watch: { | ||
currentCard(newValue) { | ||
|
@@ -219,8 +252,12 @@ export default { | |
font-size: 100%; | ||
background-color: var(--color-main-background); | ||
margin-bottom: $card-spacing; | ||
padding: $card-padding; | ||
border: 2px solid var(--color-border); | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 6px; | ||
&:deep(*) { | ||
cursor: pointer; | ||
|
@@ -240,7 +277,6 @@ export default { | |
.card-upper { | ||
display: flex; | ||
min-height: 44px; | ||
form { | ||
display: flex; | ||
padding: 3px 5px; | ||
|
@@ -251,13 +287,14 @@ export default { | |
} | ||
h3 { | ||
margin: 5px $card-padding; | ||
margin: 0; | ||
padding: 6px; | ||
flex-grow: 1; | ||
font-size: 100%; | ||
overflow: hidden; | ||
word-wrap: break-word; | ||
padding-left: 4px; | ||
align-self: center; | ||
&.editable { | ||
cursor: text; | ||
|
@@ -270,19 +307,22 @@ export default { | |
input[type=text] { | ||
font-size: 100%; | ||
} | ||
.card-menu { | ||
height: 44px; | ||
align-self: end; | ||
} | ||
} | ||
/* stylelint-disable-next-line no-invalid-position-at-import-rule */ | ||
@import './../../css/labels'; | ||
.card-controls { | ||
display: flex; | ||
margin-left: $card-padding; | ||
margin-right: $card-padding; | ||
& > div { | ||
display: flex; | ||
max-height: 44px; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
} | ||
} | ||
&.card__editable .card-controls { | ||
|
@@ -291,10 +331,15 @@ export default { | |
&.card__archived { | ||
background-color: var(--color-background-dark); | ||
} | ||
} | ||
.card-labels { | ||
display: flex; | ||
align-items: end; | ||
.duedate { | ||
margin-right: 9px; | ||
.labels { | ||
flex-wrap: wrap; | ||
align-self: flex-start; | ||
} | ||
} | ||
} | ||
.right { | ||
|
@@ -346,6 +391,11 @@ export default { | |
.card { | ||
@include dark-card; | ||
} | ||
} | ||
@media print { | ||
.card-menu { | ||
display: none; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.