Skip to content

Beautiful Open-Source Form Builder

Merge branch 'main' into vue-3

Forms Dev54918354eaa6
diff --cc resources/js/components/forms/FileInput.vue
index b678725b3,0b041e6f8..22ae29a96
--- a/resources/js/components/forms/FileInput.vue
+++ b/resources/js/components/forms/FileInput.vue
@@@ -1,180 -1,108 +1,116 @@@
<template>
- <input-wrapper v-bind="$props">
- <div :class="wrapperClass">
- <label
- v-if="label"
- :class="[
- theme.default.label,
- {
- 'text-xs uppercase': uppercaseLabels,
- 'text-sm': !uppercaseLabels,
- },
- ]"
- >
- {{ label }}
- <span v-if="required" class="required-dot text-red-500">*</span>
- </label>
- <small v-if="help && helpPosition=='above_input'" :class="theme.default.help" class="flex mb-1">
- <slot name="help"><span class="field-help" v-html="help" /></slot>
- </small>
++ <input-wrapper
++ v-bind="$props"
++ >
+ <template #label>
+ <slot name="label" />
+ </template>
- <span class="inline-block w-full rounded-md shadow-sm">
- <button type="button" aria-haspopup="listbox" aria-expanded="true" aria-labelledby="listbox-label" role="button"
- class="cursor-pointer relative flex"
- :class="[theme.default.input,{'!ring-red-500 !ring-2': hasValidation && form.errors.has(name), '!cursor-not-allowed !bg-gray-200':disabled}]"
- :style="inputStyle" @click.self="showUploadModal=true"
+ <div class="flex w-full items-center justify-center transition-colors duration-40"
+ :class="[{'!cursor-not-allowed':disabled, 'cursor-pointer':!disabled,
+ [theme.fileInput.inputHover.light + ' dark:'+theme.fileInput.inputHover.dark]: uploadDragoverEvent,
+ ['hover:'+theme.fileInput.inputHover.light +' dark:hover:'+theme.fileInput.inputHover.dark]: !loading}, theme.fileInput.input]"
+ @dragover.prevent="uploadDragoverEvent=true"
+ @dragleave.prevent="uploadDragoverEvent=false"
+ @drop.prevent="onUploadDropEvent"
+ @click="openFileUpload"
+ >
+ <div
+ v-if="loading"
+ class="text-gray-600 dark:text-gray-400"
>
- <div v-if="currentUrl==null" class="h-6 text-gray-600 dark:text-gray-400 flex-grow truncate"
- @click.prevent="showUploadModal=true"
- >
- Upload {{ multiple ? 'file(s)' : 'a file' }} <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 inline"
- fill="none" viewBox="0 0 24 24"
- stroke="currentColor"
+ <loader class="mx-auto h-6 w-6" />
+ <p class="mt-2 text-center text-sm text-gray-500">
+ Uploading your file...
+ </p>
+ </div>
+ <template v-else>
+ <div class="text-center">
+ <input
+ ref="actual-input"
+ class="hidden"
+ :multiple="multiple"
+ type="file"
+ :name="name"
+ :accept="acceptExtensions"
+ @change="manualFileUpload"
>
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
+ <div v-if="files.length" class="flex flex-wrap items-center justify-center gap-4">
+ <uploaded-file
+ v-for="file in files"
+ :key="file.url"
+ :file="file"
+ :theme="theme"
+ @remove="clearFile(file)"
/>
- </svg>
- </div>
- <template v-else>
- <div class="flex-grow h-6 text-gray-600 dark:text-gray-400 truncate" @click.prevent="showUploadModal=true">
- <div>
- <p v-if="files.length==1"><svg xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6 inline mr-2 -mt-1" fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- >
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
- />
- </svg>{{ files[0].file.name }}</p>
- <p v-else><svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 inline mr-2 -mt-1" fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- >
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
- />
- </svg>{{ files.length }} file(s)</p>
- </div>
</div>
- <div v-if="files.length>0">
- <a href="#" class="hover:text-nt-blue" role="button" @click.prevent="clearAll">
- <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
- stroke="currentColor"
+ <template v-else>
+ <div class="text-gray-500 w-full flex justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
+ stroke="currentColor" class="w-6 h-6"
>
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
+ <path stroke-linecap="round" stroke-linejoin="round"
+ d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"
/>
</svg>
- </a>
- </div>
- </template>
- </button>
- </span>
+ </div>
+
+ <p class="mt-2 text-sm text-gray-500 font-semibold select-none">
+ Click to choose {{ multiple ? 'file(s)' : 'a file' }} or drag here
+ </p>
+ <p class="mt-1 text-xs text-gray-400 dark:text-gray-600 select-none">
+ Size limit: {{ mbLimit }}MB per file
+ </p>
+ </template>
+ </div>
+ </template>
+ </div>
- <small v-if="help && helpPosition=='below_input'" :class="theme.default.help">
- <slot name="help"><span class="field-help" v-html="help" /></slot>
- </small>
- <has-error v-if="hasValidation" :form="form" :field="name" />
- </div>
+ <template #help>
+ <slot name="help" />
+ </template>
-
+ <template #error>
+ <slot name="error" />
+ </template>
-
- <!-- Modal -->
- <modal :portal-order="2" :show="showUploadModal" @close="showUploadModal=false">
- <h2 class="text-lg font-semibold">
- Upload {{ multiple ? 'file(s)' : 'a file' }}
- </h2>
-
- <div class="max-w-3xl mx-auto lg:max-w-none">
- <div class="sm:mt-5 sm:grid sm:grid-cols-1 sm:gap-4 sm:items-start sm:pt-5">
- <div class="mt-2 sm:mt-0 sm:col-span-2 mb-5">
- <div
- v-cloak
- class="w-full flex justify-center items-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md h-128"
- @dragover.prevent="onUploadDragoverEvent($event)"
- @drop.prevent="onUploadDropEvent($event)"
- >
- <div v-if="loading" class="text-gray-600 dark:text-gray-400">
- <loader class="h-6 w-6 mx-auto m-10" />
- <p class="text-center mt-6">
- Uploading your file...
- </p>
- </div>
- <template v-else>
- <div
- class="absolute rounded-full bg-gray-100 h-20 w-20 z-10 transition-opacity duration-500 ease-in-out"
- :class="{
- 'opacity-100': uploadDragoverTracking,
- 'opacity-0': !uploadDragoverTracking
- }"
- />
- <div class="relative z-20 text-center">
- <input ref="actual-input" class="hidden" :multiple="multiple" type="file" :name="name"
- :accept="acceptExtensions"
- @change="manualFileUpload"
- >
- <svg xmlns="http://www.w3.org/2000/svg" class="mx-auto h-24 w-24 text-gray-200" fill="none"
- viewBox="0 0 24 24" stroke="currentColor"
- >
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
- />
- </svg>
- <p class="mt-5 text-sm text-gray-600">
- <button
- type="button"
- class="font-semibold text-nt-blue hover:text-nt-blue-dark focus:outline-none focus:underline transition duration-150 ease-in-out"
- @click="openFileUpload"
- >
- Upload {{ multiple ? 'file(s)' : 'a file' }}
- </button>
- or drag and drop
- </p>
- <p class="mt-1 text-xs text-gray-500">
- Up to {{ mbLimit }}mb
- </p>
- </div>
- </template>
- </div>
- <div v-if="files.length" class="mt-4">
- <div class="border rounded-md">
- <div v-for="file,index in files" class="flex p-2" :class="{'border-t':index!==0}">
- <p class="flex-grow truncate text-gray-500">
- {{ file.file.name }}
- </p>
- <div>
- <a href="#" class="text-gray-400 dark:text-gray-600 hover:text-nt-blue flex" role="button"
- @click.prevent="clearFile(index)"
- >
- <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
- stroke="currentColor"
- >
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
- />
- </svg>
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </modal>
+ </input-wrapper>
</template>
<script>
+ import axios from 'axios'
-import inputMixin from '~/mixins/forms/input.js'
+import { inputProps, useFormInput } from './useFormInput.js'
+import InputWrapper from './components/InputWrapper.vue'
- import Modal from '../Modal.vue'
- import inputMixin from '~/mixins/forms/input.js'
+ import UploadedFile from './components/UploadedFile.vue'
export default {
name: 'FileInput',
- components: { InputWrapper, Modal },
-
- components: { UploadedFile },
- mixins: [inputMixin],
++ components: { InputWrapper, UploadedFile },
++ mixins: [],
props: {
+ ...inputProps,
multiple: { type: Boolean, default: true },
mbLimit: { type: Number, default: 5 },
- accept: { type: String, default: '' }
+ accept: { type: String, default: '' },
+ moveToFormAssets: { type: Boolean, default: false }
},
- mixins: [inputMixin],
- data: () => ({
- showUploadModal: false,
++ setup (props, context) {
++ const {
++ compVal,
++ inputStyle,
++ hasValidation,
++ hasError
++ } = useFormInput(props, context)
++
++ return {
++ compVal,
++ inputStyle,
++ hasValidation,
++ hasError
++ }
++ },
+
+ data: () => ({
files: [],
- uploadDragoverTracking: false,
uploadDragoverEvent: false,
loading: false
}),
diff --cc resources/js/components/forms/ImageInput.vue
index 2ad1d7f01,3020f1b4a..08bb3c4af
--- a/resources/js/components/forms/ImageInput.vue
+++ b/resources/js/components/forms/ImageInput.vue
@@@ -151,9 -130,20 +151,20 @@@ export default
}
},
+ watch: {
+ showUploadModal: {
+ handler (val) {
+ document.removeEventListener('paste', this.onUploadPasteEvent)
+ if(this.showUploadModal){
+ document.addEventListener("paste", this.onUploadPasteEvent)
+ }
+ }
+ }
+ },
+
methods: {
clearUrl () {
- this.$set(this.form, this.name, null)
+ this.form[this.name] = null
},
onUploadDragoverEvent (e) {
this.uploadDragoverEvent = true
diff --cc resources/js/components/forms/index.js
index 6dc03df1c,04e542d49..fd6f7a7c8
--- a/resources/js/components/forms/index.js
+++ b/resources/js/components/forms/index.js
@@@ -15,39 -15,32 +15,41 @@@ import ImageInput from './ImageInput.vu
import RatingInput from './RatingInput.vue'
import FlatSelectInput from './FlatSelectInput.vue'
import ToggleSwitchInput from './ToggleSwitchInput.vue'
+ import ScaleInput from './ScaleInput.vue'
-// Components that are registered globaly.
-[
- HasError,
- AlertError,
- AlertSuccess,
- VCheckbox,
- VSelect,
- CheckboxInput,
- ColorInput,
- TextInput,
- SelectInput,
- TextAreaInput,
- FileInput,
- ImageInput,
- RatingInput,
- FlatSelectInput,
- ToggleSwitchInput,
- ScaleInput
-].forEach(Component => {
- Vue.component(Component.name, Component)
-})
+export function registerComponents (app) {
+ [
+ HasError,
+ AlertError,
+ AlertSuccess,
+ VCheckbox,
+ VSelect,
+ CheckboxInput,
+ ColorInput,
+ TextInput,
+ SelectInput,
+ TextAreaInput,
+ FileInput,
+ ImageInput,
+ RatingInput,
+ FlatSelectInput,
- ToggleSwitchInput
++ ToggleSwitchInput,
++ ScaleInput
+ ].forEach(Component => {
+ Component.name ? app.component(Component.name, Component) : app.component(Component.name, Component)
+ })
-// Lazy load some heavy component
-Vue.component('SignatureInput', () => import('./SignatureInput.vue'))
-Vue.component('RichTextAreaInput', () => import('./RichTextAreaInput.vue'))
-Vue.component('DateInput', () => import('./DateInput.vue'))
-Vue.component('PhoneInput', () => import('./PhoneInput.vue'))
+ // Register async components
+ app.component('SignatureInput', defineAsyncComponent(() =>
+ import('./SignatureInput.vue')
+ ))
+ app.component('RichTextAreaInput', defineAsyncComponent(() =>
+ import('./RichTextAreaInput.vue')
+ ))
+ app.component('PhoneInput', defineAsyncComponent(() =>
+ import('./PhoneInput.vue')
+ ))
+ app.component('DateInput', defineAsyncComponent(() =>
+ import('./DateInput.vue')
+ ))
+}
diff --cc resources/js/components/open/forms/components/FormEditor.vue
index 05f078eeb,9c8f8c824..01c6eed33
--- a/resources/js/components/open/forms/components/FormEditor.vue
+++ b/resources/js/components/open/forms/components/FormEditor.vue
@@@ -55,21 -55,21 +55,21 @@@
Please create this form on a device with a larger screen. That will allow you to preview your form changes.
</div>
- <form-information />
- <form-structure />
- <form-customization />
- <form-about-submission />
- <form-notifications />
- <form-security-privacy />
+ <form-information/>
+ <form-structure/>
+ <form-customization/>
+ <form-notifications/>
+ <form-about-submission/>
+ <form-access />
+ <form-security-privacy/>
<form-custom-seo />
- <form-custom-code />
- <form-integrations />
+ <form-custom-code/>
</div>
- <form-editor-preview/>
+ <form-editor-preview />
- <form-field-edit-sidebar/>
- <add-form-block-sidebar/>
+ <form-field-edit-sidebar />
+ <add-form-block-sidebar />
<!-- Form Error Modal -->
<form-error-modal
diff --cc resources/js/components/open/forms/components/form-components/FormAboutSubmission.vue
index 2dc00deae,9cc5f83dd..4d90b492e
--- a/resources/js/components/open/forms/components/form-components/FormAboutSubmission.vue
+++ b/resources/js/components/open/forms/components/form-components/FormAboutSubmission.vue
@@@ -166,12 -133,11 +134,11 @@@ import ProTag from '../../../../common/
import VTransition from '../../../../common/transitions/VTransition.vue'
export default {
- components: { Collapse, ProTag, VTransition },
+ components: {EditorOptionsPanel, ProTag, VTransition},
props: {},
- data() {
+ data () {
return {
- submissionOptions: {},
- isCollapseOpen: true
+ submissionOptions: {}
}
},
diff --cc resources/js/components/open/forms/fields/components/FieldOptions.vue
index 12509d0bf,a2eb16315..f1f16cbab
--- a/resources/js/components/open/forms/fields/components/FieldOptions.vue
+++ b/resources/js/components/open/forms/fields/components/FieldOptions.vue
@@@ -267,9 -288,15 +290,14 @@@
:form="field"
label="Pre-filled value"
/>
- <text-input v-else-if="field.type!=='files'" name="prefill" class="mt-3"
+ <file-input v-else-if="field.type==='files'" name="prefill" class="mt-4"
+ :form="field"
+ label="Pre-filled file"
+ :multiple="field.multiple===true" :moveToFormAssets="true"
+ />
+ <text-input v-else-if="!['files', 'signature'].includes(field.type)" name="prefill" class="mt-3"
:form="field"
label="Pre-filled value"
- :disabled="field.type==='date' && field.prefill_today===true"
/>
<div v-if="['select','multi_select'].includes(field.type)" class="-mt-3 mb-3 text-gray-400 dark:text-gray-500">
<small>
@@@ -456,62 -483,79 +484,79 @@@ export default
},
methods: {
- onFieldDisabledChange(val) {
- this.$set(this.field, 'disabled', val)
+ onFieldDisabledChange (val) {
+ this.field.disabled = val
if (this.field.disabled) {
- this.$set(this.field, 'hidden', false)
+ this.field.hidden = false
}
},
- onFieldRequiredChange(val) {
- this.$set(this.field, 'required', val)
+ onFieldRequiredChange (val) {
+ this.field.required = val
if (this.field.required) {
- this.$set(this.field, 'hidden', false)
+ this.field.hidden = false
}
},
- onFieldHiddenChange(val) {
- this.$set(this.field, 'hidden', val)
+ onFieldHiddenChange (val) {
+ this.field.hidden = val
if (this.field.hidden) {
- this.$set(this.field, 'required', false)
- this.$set(this.field, 'disabled', false)
+ this.field.required = false
+ this.field.disabled = false
} else {
- this.$set(this.field, 'generates_uuid', false)
- this.$set(this.field, 'generates_auto_increment_id', false)
+ this.field.generates_uuid = false
+ this.field.generates_auto_increment_id = false
}
},
- onFieldDateRangeChange(val) {
- this.$set(this.field, 'date_range', val)
+ onFieldDateRangeChange (val) {
+ this.field.date_range = val
if (this.field.date_range) {
- this.$set(this.field, 'with_time', false)
- this.$set(this.field, 'prefill_today', false)
+ this.field.with_time = false
+ this.field.prefill_today = false
}
},
- onFieldWithTimeChange(val) {
- this.$set(this.field, 'with_time', val)
+ onFieldWithTimeChange (val) {
+ this.field.with_time = val
if (this.field.with_time) {
- this.$set(this.field, 'date_range', false)
+ this.field.date_range = false
}
},
- onFieldGenUIdChange(val) {
- this.$set(this.field, 'generates_uuid', val)
+ onFieldGenUIdChange (val) {
+ this.field.generates_uuid = val
if (this.field.generates_uuid) {
- this.$set(this.field, 'generates_auto_increment_id', false)
- this.$set(this.field, 'hidden', true)
+ this.field.generates_auto_increment_id = false
+ this.field.hidden = true
}
},
- onFieldGenAutoIdChange(val) {
- this.$set(this.field, 'generates_auto_increment_id', val)
+ onFieldGenAutoIdChange (val) {
+ this.field.generates_auto_increment_id = val
if (this.field.generates_auto_increment_id) {
- this.$set(this.field, 'generates_uuid', false)
- this.$set(this.field, 'hidden', true)
+ this.field.generates_uuid = false
+ this.field.hidden = true
}
},
- initRating () {
- if (this.field.is_rating && !this.field.rating_max_value) {
- this.field.rating_max_value = 5
+ initRating() {
+ if (this.field.is_rating) {
+ this.$set(this.field, 'is_scale', false)
+ if (!this.field.rating_max_value) {
+ this.$set(this.field, 'rating_max_value', 5)
+ }
+ }
+ },
+ initScale () {
+ if (this.field.is_scale) {
+ this.$set(this.field, 'is_rating', false)
+ if (!this.field.scale_min_value) {
+ this.$set(this.field, 'scale_min_value', 1)
+ }
+ if (!this.field.scale_max_value) {
+ this.$set(this.field, 'scale_max_value', 5)
+ }
+ if (!this.field.scale_step_value) {
+ this.$set(this.field, 'scale_step_value', 1)
+ }
}
},
- onFieldOptionsChange(val) {
- const vals = (val) ? val.trim().split("\n") : []
+ onFieldOptionsChange (val) {
+ const vals = (val) ? val.trim().split('\n') : []
const tmpOpts = vals.map(name => {
return {
name: name,
diff --cc resources/js/components/pages/pricing/PricingTable.vue
index f5d581769,4c4e3055a..599eb12ca
--- a/resources/js/components/pages/pricing/PricingTable.vue
+++ b/resources/js/components/pages/pricing/PricingTable.vue
@@@ -109,9 -106,8 +111,10 @@@ import { mapGetters } from 'vuex
import axios from 'axios'
import MonthlyYearlySelector from './MonthlyYearlySelector.vue'
import CheckoutDetailsModal from './CheckoutDetailsModal.vue'
+ import CustomPlan from './CustomPlan.vue'
+MonthlyYearlySelector.compatConfig = { MODE: 3 }
+
export default {
components: {
MonthlyYearlySelector,
diff --cc resources/js/components/pages/welcome/TemplatesSlider.vue
index dcd879e97,eb8286808..d3f0b2e0f
--- a/resources/js/components/pages/welcome/TemplatesSlider.vue
+++ b/resources/js/components/pages/welcome/TemplatesSlider.vue
@@@ -24,10 -18,10 +24,10 @@@
</div>
<div v-if="templates.length > 0"
- class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_128px,_black_calc(100%-128px),transparent_100%)]"
+ class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_128px,_black_calc(100%-128px),transparent_100%)]"
>
<ul ref="templates-slider" class="flex justify-center md:justify-start animate-infinite-scroll">
- <li v-for="(template, i) in templates" :key="template.id" class="mx-4 w-72 h-auto">
+ <li v-for="(template, i) in sliderTemplates" :key="template.id" class="mx-4 w-72 h-auto">
<single-template :slug="template.slug" />
</li>
</ul>
diff --cc resources/js/pages/home.vue
index 3f147a10d,883813ec6..d87826250
--- a/resources/js/pages/home.vue
+++ b/resources/js/pages/home.vue
@@@ -62,25 -59,23 +62,28 @@@
<div class="flex-grow items-center truncate cursor-pointer" role="button" @click.prevent="viewForm(form)">
<span class="font-semibold text-gray-900 dark:text-white">{{ form.title }}</span>
<ul class="flex text-gray-500">
- <li class="pr-1">{{ form.views_count }} view{{ form.views_count > 0 ? 's' : '' }}</li>
- <li class="list-disc ml-6 pr-1">{{ form.submissions_count }}
+ <li class="pr-1">
+ {{ form.views_count }} view{{ form.views_count > 0 ? 's' : '' }}
+ </li>
+ <li class="list-disc ml-6 pr-1">
+ {{ form.submissions_count }}
submission{{ form.submissions_count > 0 ? 's' : '' }}
</li>
- <li class="list-disc ml-6">Edited {{ form.last_edited_human }}</li>
+ <li class="list-disc ml-6">
+ Edited {{ form.last_edited_human }}
+ </li>
</ul>
- <div v-if="form.visibility=='draft' || (form.tags && form.tags.length > 0)" class="mt-1 flex items-center flex-wrap gap-3">
- <span v-if="form.visibility=='draft'"
- class="inline-flex items-center rounded-full bg-yellow-100 px-2 py-1 text-xs font-medium text-yellow-600 ring-1 ring-inset ring-gray-500/10 dark:text-white dark:bg-gray-700"
- >
+ <div v-if="['draft','closed'].includes(form.visibility) || (form.tags && form.tags.length > 0)" class="mt-1 flex items-center flex-wrap gap-3">
+ <span v-if="form.visibility=='draft'"
+ class="inline-flex items-center rounded-full bg-yellow-100 px-2 py-1 text-xs font-medium text-yellow-600 ring-1 ring-inset ring-gray-500/10 dark:text-white dark:bg-gray-700">
Draft
</span>
+ <span v-else-if="form.visibility=='closed'"
+ class="inline-flex items-center rounded-full bg-yellow-100 px-2 py-1 text-xs font-medium text-yellow-600 ring-1 ring-inset ring-gray-500/10 dark:text-white dark:bg-gray-700">
+ Closed
+ </span>
<span v-for="(tag,i) in form.tags" :key="tag"
- class="inline-flex items-center rounded-full bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 dark:text-white dark:bg-gray-700"
+ class="inline-flex items-center rounded-full bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 dark:text-white dark:bg-gray-700"
>
{{ tag }}
</span>
diff --cc resources/js/router/routes.js
index 55a93b609,8d67a5654..709616ffb
--- a/resources/js/router/routes.js
+++ b/resources/js/router/routes.js
@@@ -70,6 -70,8 +70,8 @@@ export default
{ path: '/my-templates', name: 'my_templates', component: page('templates/my_templates.vue') },
{ path: '/form-templates', name: 'templates', component: page('templates/templates.vue') },
{ path: '/form-templates/:slug', name: 'templates.show', component: page('templates/show.vue') },
+ { path: '/form-templates/types/:slug', name: 'templates.types.show', component: page('templates/types-show.vue') },
+ { path: '/form-templates/industries/:slug', name: 'templates.industries.show', component: page('templates/industries-show.vue') },
- { path: '*', component: page('errors/404.vue') }
+ { path: '/:pathMatch(.*)*', component: page('errors/404.vue') }
]