Files
gancio/pages/event/embedEvent.vue

42 lines
1.3 KiB
Vue
Raw Normal View History

2019-10-30 15:01:34 +01:00
<template lang='pug'>
2021-03-05 14:11:33 +01:00
v-card
v-card-title(v-text="$t('common.embed_title')")
v-card-text
v-alert.mb-3.mt-1(type='info' show-icon) {{$t('common.embed_help')}}
v-alert.pa-5.my-4.blue-grey.darken-4.text-body-1.lime--text.text--lighten-3 {{code.script}}<br/>{{code.el}}<br/><br/>
v-btn.float-end(text color='primary'
2021-01-11 00:17:56 +01:00
v-clipboard:copy='code'
v-clipboard:success='copyLink') {{$t("common.copy")}}
v-icon.ml-1 mdi-content-copy
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 v-clipboard:copy='code' v-clipboard:success='copyLink' color="primary") {{$t("common.copy")}}
2019-10-30 15:01:34 +01:00
</template>
<script>
import { mapState } from 'vuex'
export default {
2020-07-31 01:03:19 +02:00
name: 'EmbedEvent',
2021-03-10 15:26:09 +01:00
props: {
2021-04-14 01:30:51 +02:00
event: { type: Object, default: () => ({}) }
2021-03-10 15:26:09 +01:00
},
2019-10-30 15:01:34 +01:00
computed: {
...mapState(['settings']),
code () {
const script = `<script src='${this.settings.baseurl}/gancio-events.es.js'/>`
const el = `<gancio-event id='${this.event.id}' baseurl='${this.settings.baseurl}'></gancio-event>`
return { script, el }
2019-10-30 15:01:34 +01:00
}
2019-11-03 00:56:26 +01:00
},
methods: {
copyLink () {
2020-10-07 11:12:13 +02:00
this.$root.$message('common.copied', { color: 'success' })
2019-11-03 00:56:26 +01:00
}
2019-10-30 15:01:34 +01:00
}
}
</script>