|
| 1 | +<template> |
| 2 | + <tr class="row"> |
| 3 | + <th style="text-align: left" class="tabular-nums" scope="row"> |
| 4 | + <TextAlignBaseline |
| 5 | + ><span class="smaller">{{ scheduleEntry.number }}</span></TextAlignBaseline |
| 6 | + > |
| 7 | + <br /> |
| 8 | + <CategoryChip small dense :category="category" class="d-sm-none" /> |
| 9 | + </th> |
| 10 | + <td class="d-none d-sm-table-cell"> |
| 11 | + <CategoryChip small dense :category="category" /> |
| 12 | + </td> |
| 13 | + <td class="nowrap"> |
| 14 | + {{ start }}<br /> |
| 15 | + <span class="e-subtitle">{{ duration }}</span> |
| 16 | + </td> |
| 17 | + <td style="width: 100%" class="contentrow"> |
| 18 | + <router-link |
| 19 | + :to="routerLink" |
| 20 | + class="text-decoration-none text-decoration-hover-underline black--text" |
| 21 | + > |
| 22 | + {{ title }}<br /> |
| 23 | + </router-link> |
| 24 | + <span class="e-subtitle">{{ location }}</span> |
| 25 | + </td> |
| 26 | + <td class="contentrow avatarrow overflow-visible"> |
| 27 | + <AvatarRow :camp-collaborations="collaborators" size="28" class="ml-auto" /> |
| 28 | + </td> |
| 29 | + </tr> |
| 30 | +</template> |
| 31 | + |
| 32 | +<script> |
| 33 | +import AvatarRow from './AvatarRow.vue' |
| 34 | +import CategoryChip from '@/components/generic/CategoryChip.vue' |
| 35 | +import { |
| 36 | + hourShort, |
| 37 | + timeDurationShort, |
| 38 | +} from '../../common/helpers/dateHelperUTCFormatted.js' |
| 39 | +import TextAlignBaseline from '@/components/layout/TextAlignBaseline.vue' |
| 40 | +
|
| 41 | +export default { |
| 42 | + name: 'ActivityRow', |
| 43 | + components: { CategoryChip, AvatarRow, TextAlignBaseline }, |
| 44 | + props: { |
| 45 | + scheduleEntry: { type: Object, required: true }, |
| 46 | + }, |
| 47 | + computed: { |
| 48 | + collaborators() { |
| 49 | + return this.scheduleEntry |
| 50 | + .activity() |
| 51 | + .activityResponsibles() |
| 52 | + .items.map((responsible) => responsible.campCollaboration()) |
| 53 | + }, |
| 54 | + category() { |
| 55 | + return this.scheduleEntry.activity().category() |
| 56 | + }, |
| 57 | + title() { |
| 58 | + return this.scheduleEntry.activity().title |
| 59 | + }, |
| 60 | + location() { |
| 61 | + return this.scheduleEntry.activity().location |
| 62 | + }, |
| 63 | + start() { |
| 64 | + return hourShort(this.scheduleEntry.start) |
| 65 | + }, |
| 66 | + duration() { |
| 67 | + return timeDurationShort(this.scheduleEntry.start, this.scheduleEntry.end) |
| 68 | + }, |
| 69 | + routerLink() { |
| 70 | + return { |
| 71 | + name: 'activity', |
| 72 | + params: { |
| 73 | + campId: this.scheduleEntry.period().camp().id, |
| 74 | + scheduleEntryId: this.scheduleEntry.id, |
| 75 | + }, |
| 76 | + } |
| 77 | + }, |
| 78 | + }, |
| 79 | +} |
| 80 | +</script> |
| 81 | + |
| 82 | +<style scoped> |
| 83 | +.row { |
| 84 | + display: table-row; |
| 85 | + vertical-align: baseline; |
| 86 | +} |
| 87 | +
|
| 88 | +tr + tr :is(td, th) { |
| 89 | + border-top: 1px solid #ddd; |
| 90 | +} |
| 91 | +
|
| 92 | +:is(td, th) { |
| 93 | + padding-top: 0.25rem; |
| 94 | + padding-bottom: 0.25rem; |
| 95 | +} |
| 96 | +
|
| 97 | +:is(td, th) + :is(td, th) { |
| 98 | + padding-left: 0.5rem; |
| 99 | +} |
| 100 | +
|
| 101 | +.contentrow { |
| 102 | + max-width: 100px; |
| 103 | + overflow: hidden; |
| 104 | + text-overflow: ellipsis; |
| 105 | + white-space: nowrap; |
| 106 | +} |
| 107 | +
|
| 108 | +.avatarrow { |
| 109 | + vertical-align: middle; |
| 110 | +} |
| 111 | +
|
| 112 | +.e-subtitle { |
| 113 | + font-size: 0.9em; |
| 114 | + color: #666; |
| 115 | +} |
| 116 | +
|
| 117 | +.nowrap { |
| 118 | + white-space: nowrap; |
| 119 | +} |
| 120 | +
|
| 121 | +.smaller { |
| 122 | + font-size: 0.75em; |
| 123 | +} |
| 124 | +
|
| 125 | +.text-decoration-hover-underline:hover { |
| 126 | + text-decoration: underline !important; |
| 127 | +} |
| 128 | +</style> |
0 commit comments