2020-09-07 02:23:03 +02:00
|
|
|
<template lang='pug'>
|
|
|
|
v-container
|
|
|
|
v-card-title {{$t('common.events')}}
|
|
|
|
v-card-subtitle {{$t('admin.event_confirm_description')}}
|
|
|
|
v-card-text
|
|
|
|
v-data-table(
|
2021-01-25 01:17:25 +01:00
|
|
|
:hide-default-footer='unconfirmedEvents.length<10'
|
2022-03-07 16:39:02 +01:00
|
|
|
:footer-props='{ prevIcon: mdiChevronLeft, nextIcon: mdiChevronRight }'
|
2020-09-07 02:23:03 +02:00
|
|
|
:items='unconfirmedEvents'
|
|
|
|
:headers='headers')
|
|
|
|
template(v-slot:item.actions='{ item }')
|
2020-10-28 01:27:58 +01:00
|
|
|
v-btn(text small @click='confirm(item)' color='success') {{$t('common.confirm')}}
|
2021-11-20 21:02:48 +01:00
|
|
|
v-btn(text small :to='`/event/${item.slug || item.id}`' color='success') {{$t('common.preview')}}
|
2020-10-28 01:27:58 +01:00
|
|
|
v-btn(text small :to='`/add/${item.id}`' color='warning') {{$t('common.edit')}}
|
2020-09-07 02:23:03 +02:00
|
|
|
v-btn(text small @click='remove(item)'
|
|
|
|
color='error') {{$t('common.delete')}}
|
|
|
|
|
|
|
|
</template>
|
|
|
|
<script>
|
2022-03-07 16:39:02 +01:00
|
|
|
import { mdiChevronLeft, mdiChevronRight } from '@mdi/js'
|
2020-09-07 02:23:03 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
unconfirmedEvents: { type: Array, default: () => [] }
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
2022-03-07 16:39:02 +01:00
|
|
|
mdiChevronLeft, mdiChevronRight,
|
2020-09-07 02:23:03 +02:00
|
|
|
valid: false,
|
|
|
|
dialog: false,
|
|
|
|
editing: false,
|
|
|
|
headers: [
|
|
|
|
{ value: 'title', text: 'Title' },
|
|
|
|
{ value: 'actions', text: 'Actions', align: 'right' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
edit (event) {
|
|
|
|
this.$router.push(`/add/${event.id}`)
|
|
|
|
},
|
2020-10-28 01:27:58 +01:00
|
|
|
async confirm (event) {
|
2020-09-07 02:23:03 +02:00
|
|
|
try {
|
2020-10-28 01:27:58 +01:00
|
|
|
await this.$axios.$put(`/event/confirm/${event.id}`)
|
|
|
|
this.$emit('confirmed', event.id)
|
2022-02-26 21:19:59 +01:00
|
|
|
this.$root.$message('event.confirmed', { color: 'success' })
|
2020-09-07 02:23:03 +02:00
|
|
|
} catch (e) {}
|
|
|
|
},
|
|
|
|
async remove (event) {
|
2020-10-07 11:12:13 +02:00
|
|
|
const ret = await this.$root.$confirm('event.remove_confirmation')
|
2020-09-07 02:23:03 +02:00
|
|
|
if (!ret) { return }
|
|
|
|
await this.$axios.delete(`/event/${event.id}`)
|
2020-10-07 11:12:13 +02:00
|
|
|
this.$root.$message('admin.event_remove_ok')
|
2020-09-07 02:23:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|