mirror of
https://github.com/romancm/gamebrary
synced 2024-12-18 15:23:14 +00:00
update list view modal
This commit is contained in:
parent
03217e6131
commit
793c63049d
1 changed files with 41 additions and 46 deletions
|
@ -24,51 +24,47 @@
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<form ref="renameListForm" @submit.prevent="save">
|
<form class="list-view" ref="renameListForm" @submit.prevent="save">
|
||||||
<b-form-radio-group
|
<!-- TODO: use named components and for loop -->
|
||||||
v-model="view"
|
<h6>{{ $t('board.list.views.single') }}</h6>
|
||||||
required
|
|
||||||
:options="listViews"
|
|
||||||
class="mb-2"
|
|
||||||
buttons
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- TODO: use dynamic named component -->
|
|
||||||
<template v-if="randomGameId">
|
|
||||||
<game-card-default
|
<game-card-default
|
||||||
v-if="!view || view === 'single'"
|
|
||||||
:game-id="randomGameId"
|
:game-id="randomGameId"
|
||||||
:list="list"
|
:list="list"
|
||||||
|
:class="{ 'border-2 border-success': !view || view === 'single'}"
|
||||||
|
@click.native="view = 'single'"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<b-form-row v-if="view === 'grid'">
|
<h6>{{ $t('board.list.views.grid') }}</h6>
|
||||||
|
|
||||||
|
<b-form-row>
|
||||||
<b-col cols="6">
|
<b-col cols="6">
|
||||||
<game-card-grid
|
<game-card-grid
|
||||||
:game-id="randomGameId"
|
:game-id="randomGameId"
|
||||||
:list="list"
|
:list="list"
|
||||||
|
:class="{ 'rounded border border-success': view === 'grid'}"
|
||||||
|
@click.native="view = 'grid'"
|
||||||
/>
|
/>
|
||||||
</b-col>
|
</b-col>
|
||||||
|
|
||||||
<b-col cols="6">
|
<b-col cols="6" />
|
||||||
<game-card-grid
|
|
||||||
:game-id="randomGameId"
|
|
||||||
:list="list"
|
|
||||||
/>
|
|
||||||
</b-col>
|
|
||||||
</b-form-row>
|
</b-form-row>
|
||||||
|
|
||||||
|
<h6>{{ $t('board.list.views.compact') }}</h6>
|
||||||
<game-card-compact
|
<game-card-compact
|
||||||
v-if="view === 'compact'"
|
|
||||||
:game-id="randomGameId"
|
:game-id="randomGameId"
|
||||||
:list="list"
|
:list="list"
|
||||||
|
:class="{ 'border-success': view === 'compact'}"
|
||||||
|
@click.native="view = 'compact'"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<h6>{{ $t('board.list.views.text') }}</h6>
|
||||||
<game-card-text
|
<game-card-text
|
||||||
v-if="view === 'text'"
|
|
||||||
:game-id="randomGameId"
|
:game-id="randomGameId"
|
||||||
:list="list"
|
:list="list"
|
||||||
|
:class="{ 'border-success': view === 'text'}"
|
||||||
|
@click.native="view = 'text'"
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<template v-slot:modal-footer="{ cancel }">
|
<template v-slot:modal-footer="{ cancel }">
|
||||||
|
@ -117,13 +113,6 @@ export default {
|
||||||
view: null,
|
view: null,
|
||||||
saving: false,
|
saving: false,
|
||||||
randomGameId: null,
|
randomGameId: null,
|
||||||
// TODO: put in constants file
|
|
||||||
listViews: [
|
|
||||||
{ text: this.$t('board.list.views.single'), value: 'single' },
|
|
||||||
{ text: this.$t('board.list.views.grid'), value: 'grid' },
|
|
||||||
{ text: this.$t('board.list.views.compact'), value: 'compact' },
|
|
||||||
{ text: this.$t('board.list.views.text'), value: 'text' },
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -188,3 +177,9 @@ export default {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
||||||
|
.list-view {
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue