Templates pages migration (#275)
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
<v-button color="gray" size="small" @click.prevent="showFormTemplateModal=true">
|
||||
Edit Template
|
||||
</v-button>
|
||||
<!-- <form-template-modal v-if="form" :form="form" :template="template" :show="showFormTemplateModal"-->
|
||||
<!-- @close="showFormTemplateModal=false"-->
|
||||
<!-- />-->
|
||||
<form-template-modal v-if="form" :form="form" :template="template" :show="showFormTemplateModal"
|
||||
@close="showFormTemplateModal=false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #right>
|
||||
@@ -199,7 +199,8 @@ import {computed} from 'vue'
|
||||
import OpenCompleteForm from '../../components/open/forms/OpenCompleteForm.vue'
|
||||
import Breadcrumb from '~/components/global/Breadcrumb.vue'
|
||||
import SingleTemplate from '../../components/pages/templates/SingleTemplate.vue'
|
||||
import {fetchTemplate} from "~/stores/templates.js";
|
||||
import {fetchTemplate} from "~/stores/templates.js"
|
||||
import FormTemplateModal from '~/components/open/forms/components/templates/FormTemplateModal.vue'
|
||||
|
||||
defineRouteRules({
|
||||
prerender: true
|
||||
@@ -262,7 +263,8 @@ const copyTemplateUrl = () => {
|
||||
|
||||
useOpnSeoMeta({
|
||||
title: () => {
|
||||
return template ? template.value.name : 'Form Template'
|
||||
if (!template || !template.value) return 'Form Template'
|
||||
return template.value.name
|
||||
},
|
||||
description () {
|
||||
if (!template || !template.value) return null
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</section>
|
||||
|
||||
|
||||
<templates-list :templates="templates" :filter-industries="false" :show-industrys="false">
|
||||
<templates-list :templates="templates" :filter-industries="false" :show-industries="false">
|
||||
<template #before-lists>
|
||||
<section class="py-12 bg-white border-t border-gray-200 sm:py-16">
|
||||
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl">
|
||||
|
||||
@@ -13,34 +13,28 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- <templates-list :only-my="true" />-->
|
||||
<templates-list :templates="templates" :loading="loading" :show-types="false" :show-industries="false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TemplatesList from '../../components/pages/templates/TemplatesList.vue'
|
||||
<script setup>
|
||||
definePageMeta({
|
||||
middleware: "auth"
|
||||
})
|
||||
|
||||
export default {
|
||||
components: { TemplatesList },
|
||||
useOpnSeoMeta({
|
||||
title: 'My Templates',
|
||||
description: 'Our collection of beautiful templates to create your own forms!'
|
||||
})
|
||||
|
||||
setup () {
|
||||
definePageMeta({
|
||||
middleware: "auth"
|
||||
})
|
||||
useOpnSeoMeta({
|
||||
title: 'My Templates',
|
||||
description: 'Our collection of beautiful templates to create your own forms!'
|
||||
})
|
||||
},
|
||||
let loading = ref(false)
|
||||
let templates = ref([])
|
||||
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
|
||||
mounted () {},
|
||||
|
||||
computed: {},
|
||||
|
||||
methods: {}
|
||||
}
|
||||
onMounted(() => {
|
||||
loading.value = true
|
||||
opnFetch('templates',{query: {onlymy: true}}).then((data) => {
|
||||
loading.value = false
|
||||
templates.value = data
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user