gancio-upstream/pages/event/embedEvent.vue

44 lines
1.2 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
2021-01-11 00:17:56 +01:00
v-row
v-col.col-12
v-alert.mb-1.mt-1(type='info' show-icon) {{$t('common.embed_help')}}
v-text-field(v-model='code')
2021-01-11 00:17:56 +01:00
v-btn(slot='prepend' plain text color='primary'
v-clipboard:copy='code'
v-clipboard:success='copyLink') {{$t("common.copy")}}
v-icon.ml-1 mdi-content-copy
v-col.mt-2(v-html='code')
v-card-actions
v-spacer
2020-10-09 00:42:03 +02:00
v-btn(color='warning' @click="$emit('close')") {{$t("common.cancel")}}
v-btn(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: {
event: { type: Object, default: () => ({})}
},
2019-10-30 15:01:34 +01:00
computed: {
...mapState(['settings']),
code () {
const style = "style='border: 0; width: 100%; height: 215px;'"
const src = `${this.settings.baseurl}/embed/${this.event.id}`
const code = `<iframe ${style} src="${src}"></iframe>`
return code
}
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>