-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull out schedule rows into their own component
Additionally, switched to using the global table shrink function This allows a lot of row logic to go on the row instead of every cell :) Related to Issue #43
- Loading branch information
Showing
2 changed files
with
143 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<template> | ||
<ElementTableRow> | ||
<ElementTableCell :id="internalId" class="expandable"> | ||
<FontAwesomeIcon :icon="[ 'fas', isExpanded ? 'caret-down' : 'caret-right' ]" /> | ||
</ElementTableCell> | ||
|
||
<ElementTableCell :id="'run-' + run.id" class="time"> | ||
<ElementTemporalDateTime :datetime="run.date" format="shortTime" /> | ||
</ElementTableCell> | ||
|
||
<ElementTableCell v-if="run.setupBlock" class="setup-text" column-end="span 2"> | ||
{{ (run.setupBlockText || $t('marathon.schedule.setupBlock')) }} | ||
</ElementTableCell> | ||
<template v-else> | ||
<ElementTableCell class="runners"> | ||
<User v-for="runner in run.runners" :key="`runner-${runner.id}`" :user="runner" /> | ||
</ElementTableCell> | ||
<ElementTableCell class="game"> | ||
{{ run.gameName }} | ||
</ElementTableCell> | ||
</template> | ||
|
||
<ElementTableCell class="category"> | ||
{{ run.categoryName }} | ||
</ElementTableCell> | ||
|
||
<ElementTableCell class="type"> | ||
{{ $t(`marathon.schedule.type.${run.type}`) }} | ||
</ElementTableCell> | ||
|
||
<ElementTableCell class="console"> | ||
<span> | ||
{{ run.console }} | ||
</span> | ||
<sup v-if="run.emulated"> | ||
{{ $t('global.emu') }} | ||
</sup> | ||
</ElementTableCell> | ||
|
||
<ElementTableCell class="estimate"> | ||
<ElementTemporalDuration :duration="run.estimate" /> | ||
</ElementTableCell> | ||
|
||
<ElementTableCell class="setup"> | ||
<ElementTemporalDuration :duration="run.setupTime" /> | ||
</ElementTableCell> | ||
</ElementTableRow> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import { ScheduleLine } from '~/types/api/schedule'; | ||
export default Vue.extend({ | ||
props: { | ||
run: { | ||
type: Object as () => ScheduleLine, | ||
default: undefined, | ||
}, | ||
internalId: { | ||
type: String, | ||
default: undefined, | ||
}, | ||
isExpanded: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.expandable > svg { | ||
width: 10px; | ||
} | ||
</style> |