move components where they belong
This commit is contained in:
@@ -141,8 +141,8 @@ export default {
|
||||
name: 'Event',
|
||||
mixins: [clipboard],
|
||||
components: {
|
||||
EventAdmin: () => import(/* webpackChunkName: "event" */'./eventAdmin'),
|
||||
EmbedEvent: () => import(/* webpackChunkName: "event" */'./embedEvent'),
|
||||
EventAdmin: () => import(/* webpackChunkName: "event" */'@/components/eventAdmin'),
|
||||
EmbedEvent: () => import(/* webpackChunkName: "event" */'@/components/embedEvent'),
|
||||
MyPicture
|
||||
},
|
||||
async asyncData ({ $axios, params, error }) {
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<template lang='pug'>
|
||||
v-card
|
||||
v-card-title(v-text="$t('common.embed_title')")
|
||||
v-card-text
|
||||
v-alert.mb-3.mt-1(type='info' show-icon :icon='mdiInformation') {{$t('common.embed_help')}}
|
||||
v-alert.pa-5.my-4.blue-grey.darken-4.text-body-1.lime--text.text--lighten-3 <pre>{{code}}</pre>
|
||||
v-btn.float-end(text color='primary' @click='clipboard(code)') {{$t("common.copy")}}
|
||||
v-icon.ml-1(v-text='mdiContentCopy')
|
||||
p.mx-auto
|
||||
.mx-auto
|
||||
gancio-event(:id='event.id' :baseurl='settings.baseurl')
|
||||
v-card-actions
|
||||
v-spacer
|
||||
v-btn(text color='warning' @click="$emit('close')") {{$t("common.cancel")}}
|
||||
v-btn(text @click='clipboard(code)' color="primary") {{$t("common.copy")}}
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import clipboard from '../../assets/clipboard'
|
||||
import { mdiContentCopy, mdiInformation } from '@mdi/js'
|
||||
|
||||
export default {
|
||||
name: 'EmbedEvent',
|
||||
data() {
|
||||
return { mdiContentCopy, mdiInformation }
|
||||
},
|
||||
mixins: [clipboard],
|
||||
props: {
|
||||
event: { type: Object, default: () => ({}) }
|
||||
},
|
||||
computed: {
|
||||
...mapState(['settings']),
|
||||
code () {
|
||||
return `<script src='${this.settings.baseurl}\/gancio-events.es.js'><\/script>\n<gancio-event baseurl='${this.settings.baseurl}' id=${this.event.id}></gancio-event>\n\n`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,54 +0,0 @@
|
||||
<template lang='pug'>
|
||||
div
|
||||
v-btn(text color='primary' v-if='event.is_visible' @click='toggle(false)') {{$t(`common.${event.parentId?'skip':'hide'}`)}}
|
||||
v-btn(text color='success' v-else @click='toggle(false)') <v-icon color='yellow' v-text='mdiAlert'></v-icon> {{$t('common.confirm')}}
|
||||
v-btn(text color='primary' @click='$router.push(`/add/${event.id}`)') {{$t('common.edit')}}
|
||||
v-btn(text color='primary' v-if='!event.parentId' @click='remove(false)') {{$t('common.remove')}}
|
||||
|
||||
template(v-if='event.parentId')
|
||||
v-divider
|
||||
span.mr-1 <v-icon v-text='mdiRepeat'></v-icon> {{$t('event.edit_recurrent')}}
|
||||
v-btn(text color='primary' v-if='event.parent.is_visible' @click='toggle(true)') {{$t('common.pause')}}
|
||||
v-btn(text color='primary' v-else @click='toggle(true)') {{$t('common.start')}}
|
||||
v-btn(text color='primary' @click='$router.push(`/add/${event.parentId}`)') {{$t('common.edit')}}
|
||||
v-btn(text color='primary' @click='remove(true)') {{$t('common.remove')}}
|
||||
</template>
|
||||
<script>
|
||||
import { mdiAlert, mdiRepeat } from '@mdi/js'
|
||||
export default {
|
||||
name: 'EventAdmin',
|
||||
data () {
|
||||
return { mdiAlert, mdiRepeat }
|
||||
},
|
||||
props: {
|
||||
event: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async remove (parent = false) {
|
||||
const ret = await this.$root.$confirm(`event.remove_${parent ? 'recurrent_' : ''}confirmation`)
|
||||
if (!ret) { return }
|
||||
const id = parent ? this.event.parentId : this.event.id
|
||||
await this.$axios.delete(`/event/${id}`)
|
||||
this.$router.replace('/')
|
||||
},
|
||||
async toggle (parent = false) {
|
||||
const id = parent ? this.event.parentId : this.event.id
|
||||
const is_visible = parent ? this.event.parent.is_visible : this.event.is_visible
|
||||
const method = is_visible ? 'unconfirm' : 'confirm'
|
||||
try {
|
||||
await this.$axios.$put(`/event/${method}/${id}`)
|
||||
if (parent) {
|
||||
this.event.parent.is_visible = !is_visible
|
||||
} else {
|
||||
this.event.is_visible = !is_visible
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user