minor errata

This commit is contained in:
Jörn-Michael Miehe 2019-05-27 13:51:24 +02:00
parent f5425829dd
commit 9b8393c779
4 changed files with 66 additions and 57 deletions

View file

@ -205,6 +205,7 @@ export default class {
count: elements[element] count: elements[element]
}) })
retval = retval.filter(element => element.count > 0)
retval.sort((element_l, element_r) => element_r.count - element_l.count) retval.sort((element_l, element_r) => element_r.count - element_l.count)
return retval return retval

View file

@ -15,66 +15,71 @@
</v-layout> </v-layout>
</template> </template>
<v-alert v-if="!editing" :value="deck.note" type="info"> <template v-if="!editing">
{{ deck.note }} <v-alert :value="deck.note" type="info">
</v-alert> {{ deck.note }}
</v-alert>
<v-container v-if="!editing" style="position: relative" grid-list-md fluid> <v-container style="position: relative" grid-list-md fluid>
<v-layout row wrap> <v-layout row wrap>
<v-flex v-for="part in deck.parts()" :key="part.heading" xs12 sm6 md4> <v-flex v-for="part in deck.parts()" :key="part.heading" xs12 sm6 md4>
<v-card> <v-card>
<v-card-title>{{ part.count }} {{ part.heading }}</v-card-title> <v-card-title>{{ part.count }} {{ part.heading }}</v-card-title>
<v-list dense subheader> <v-list dense subheader>
<Card <Card
v-for="card in part.cards" v-for="card in part.cards"
:key="card.serial" :key="card.serial"
:count="card.count" :count="card.count"
:serial="card.serial" :serial="card.serial"
:dbentry="card.dbentry" :dbentry="card.dbentry"
></Card> ></Card>
</v-list> </v-list>
</v-card> </v-card>
</v-flex> </v-flex>
<v-btn fab absolute bottom right @click.native="editing = true"> <v-btn fab absolute bottom right @click.native="editing = true">
<v-icon>edit</v-icon> <v-icon>edit</v-icon>
</v-btn>
<v-dialog v-model="deleting" persistent>
<v-btn fab absolute bottom left slot="activator">
<v-icon>delete</v-icon>
</v-btn> </v-btn>
<v-card> <v-dialog v-model="deleting" persistent>
<v-card-title class="headline"> <template v-slot:activator="{ on }">
Really delete this deck? <v-btn fab absolute bottom left v-on="on">
</v-card-title> <v-icon>delete</v-icon>
<v-card-text>
Are you sure you want to delete this deck? This cannot be undone.
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" @click.native="deleting = false">
Cancel
</v-btn> </v-btn>
</template>
<v-btn <v-card>
color="success" <v-card-title class="headline">
@click.native=" Really delete this deck?
deleting = false </v-card-title>
delete_deck()
" <v-card-text>
> Are you sure you want to delete this deck? This cannot be
Confirm undone.
</v-btn> </v-card-text>
</v-card-actions>
</v-card> <v-card-actions>
</v-dialog> <v-spacer></v-spacer>
</v-layout>
</v-container> <v-btn color="error" @click.native="deleting = false">
Cancel
</v-btn>
<v-btn
color="success"
@click.native="
deleting = false
delete_deck()
"
>
Confirm
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</v-container>
</template>
<DeckEditor v-if="editing" :deck="deck" @save="save_deck"> <DeckEditor v-if="editing" :deck="deck" @save="save_deck">
<v-btn color="error" @click.native="editing = false"> <v-btn color="error" @click.native="editing = false">

View file

@ -67,6 +67,7 @@ export default {
result.push(deck) result.push(deck)
} }
result.sort((deck_l, deck_r) => deck_l.name.localeCompare(deck_r.name))
return result return result
} }
}, },

View file

@ -1,8 +1,10 @@
<template> <template>
<v-dialog v-model="dialog"> <v-dialog v-model="dialog">
<v-btn flat slot="activator"> <template v-slot:activator="{ on }">
{{ buttonText }} <v-btn flat v-on="on">
</v-btn> {{ buttonText }}
</v-btn>
</template>
<v-card> <v-card>
<v-snackbar <v-snackbar