|
31 | 31 | <span @click.stop="toggleLabels" @mouseover="hover=true" @mouseleave="hover=false" v-for="l in task.labelIds" :key="l" class="task-preview-label" :class="getClass" :style="getStyle(l)"><span>{{ getLabelText(l) }}</span></span>
|
32 | 32 | </section>
|
33 | 33 | <p>{{ task.title }}</p>
|
34 |
| -<section v-if="checkBadges" class="task-preview-badges flex wrap"> |
| 34 | +<section v-if="checkBadges" class="task-preview-badges flex sapce-between"> |
| 35 | + <section :style="getHeight" class="flex"> |
| 36 | + |
35 | 37 | <section v-if="task.startDate || task.dueDate" class="task-preview-date">
|
36 | 38 | <div class="start-only" v-if="task.startDate && !task.dueDate">
|
37 | 39 | <span></span>
|
|
48 | 50 | <span>{{ dueDate }}</span>
|
49 | 51 | </div>
|
50 | 52 | </section>
|
| 53 | +<section v-if="task.comments" class="task-preview-comments"> |
| 54 | + <span></span> |
| 55 | + <span>{{ task.comments.length }}</span> |
| 56 | +</section> |
| 57 | +<section v-if="task.attachments" class="task-preview-attachments"> |
| 58 | + <span></span> |
| 59 | + <span>{{ task.attachments.length }}</span> |
| 60 | +</section> |
| 61 | +<section v-if="task.checklists" :class="checkComplete" class="task-preview-checklists"> |
| 62 | + <section class="" v-if="task.checklists.length"> |
| 63 | + |
| 64 | + <span></span> |
| 65 | + <span>{{ checklistComplete }}</span> |
| 66 | + <span>/</span> |
| 67 | + <span>{{ checklistTotal }}</span> |
| 68 | + </section> |
| 69 | +</section> |
| 70 | + </section> |
| 71 | + |
51 | 72 | <!-- <div class=""> -->
|
52 |
| -<section :style="getWidth" v-if="task.members" class="task-members flex"> |
| 73 | + <section> |
| 74 | + |
| 75 | +<section :style="getWidth" v-if="task.members" class="task-members "> |
53 | 76 | <user-avatar v-for="m in task.members" :key="m._id" :user="m"></user-avatar>
|
54 | 77 | </section>
|
| 78 | + </section> |
55 | 79 | <!-- </div> -->
|
56 | 80 | </section>
|
57 | 81 | </section>
|
|
65 | 89 |
|
66 | 90 | import userAvatar from "./user-avatar.vue"
|
67 | 91 | import { Container, Draggable } from "vue3-smooth-dnd";
|
| 92 | +// import Container from 'C:/dev/vue3-smooth-dnd/packages/lib/src/components/Container.js' |
| 93 | +// import Draggable from 'C:/dev/vue3-smooth-dnd/packages/lib/src/components/Draggable.js' |
68 | 94 | import { utilService } from "../services/util.service";
|
69 | 95 | import format from 'date-fns/format'
|
70 | 96 | import { tr } from 'date-fns/locale';
|
@@ -176,6 +202,31 @@ export default {
|
176 | 202 | },
|
177 | 203 | },
|
178 | 204 | computed: {
|
| 205 | + checkComplete(){ |
| 206 | + var complete = true |
| 207 | + this.task.checklists.forEach(c => { |
| 208 | + c.todos.forEach(t => { |
| 209 | + if(!t.isDone) complete = false |
| 210 | + }); |
| 211 | + }); |
| 212 | + if(complete) return 'complete' |
| 213 | + }, |
| 214 | + checklistComplete(){ |
| 215 | + var count = 0 |
| 216 | + this.task.checklists.forEach(c => { |
| 217 | + c.todos.forEach(cc => { |
| 218 | + if(cc.isDone) count++ |
| 219 | + }) |
| 220 | + }) |
| 221 | + return count |
| 222 | + }, |
| 223 | + checklistTotal(){ |
| 224 | + var count = 0 |
| 225 | + this.task.checklists.forEach(c => { |
| 226 | + count += c.todos.length |
| 227 | + }) |
| 228 | + return count |
| 229 | + }, |
179 | 230 | checkStyle(){
|
180 | 231 | if(this.task.style){
|
181 | 232 | if(this.task.style.size === 'big')
|
@@ -205,9 +256,32 @@ export default {
|
205 | 256 | var badgeCount = 0
|
206 | 257 | if(this.task.startDate || this.task.dueDate) badgeCount++
|
207 | 258 | if(this.task.comments) badgeCount++
|
208 |
| - if (badgeCount > 2 || badgeCount === 0){ |
209 |
| - return 'width: 100%' |
| 259 | + if(this.task.checklists) badgeCount++ |
| 260 | + if(this.task.attachments) badgeCount++ |
| 261 | + if (badgeCount > 2){ |
| 262 | + // return 'width: 100%' |
| 263 | + return 'margin-block-start: 30px; position: absolute; right: 0;' |
| 264 | + // return |
| 265 | + } |
| 266 | + }, |
| 267 | + getHeight(){ |
| 268 | + var badgeCount = 0 |
| 269 | + if(this.task.startDate || this.task.dueDate) badgeCount++ |
| 270 | + if(this.task.comments) badgeCount++ |
| 271 | + if(this.task.checklists) badgeCount++ |
| 272 | + if(this.task.attachments) badgeCount++ |
| 273 | + if (badgeCount > 2 && this.task.members){ |
| 274 | + if(this.task.members.length) |
| 275 | + return 'margin-block-end: 37px' |
210 | 276 | }
|
| 277 | + // if (badgeCount && !this.task.members){ |
| 278 | + // // if(this.task.members.length) |
| 279 | + // return 'margin-block-end: 37px' |
| 280 | + // } |
| 281 | + // if (badgeCount && this.task.members){ |
| 282 | + // if(!this.task.members.length) |
| 283 | + // return 'margin-block-end: 37px' |
| 284 | + // } |
211 | 285 | },
|
212 | 286 | getDateBg(){
|
213 | 287 | if (this.task.startDate && !this.task.dueDate)
|
|
0 commit comments