Skip to content

Commit d0a7c4d

Browse files
committed
Merge branch 'main' of https://github.com/JhumanJ/OpnForm
2 parents 05a5c75 + e4531ac commit d0a7c4d

File tree

4 files changed

+55
-9
lines changed

4 files changed

+55
-9
lines changed

app/Http/Resources/FormResource.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,22 @@ private function getProtectedForm()
7777
return [
7878
'id' => $this->id,
7979
'title' => $this->title,
80+
'description' => $this->description,
8081
'slug' => $this->slug,
8182
'custom_code' => $this->custom_code,
8283
'dark_mode' => $this->dark_mode,
8384
'transparent_background' => $this->transparent_background,
8485
'color' => $this->color,
86+
'theme' => $this->theme,
8587
'is_password_protected' => true,
8688
'has_password' => $this->has_password,
8789
'width' => 'centered',
8890
'no_branding' => $this->no_branding,
89-
'properties' => []
91+
'properties' => [],
92+
'logo_picture' => $this->logo_picture,
93+
'seo_meta' => $this->seo_meta,
94+
'cover_picture' => $this->cover_picture,
95+
9096
];
9197
}
9298

client/components/open/forms/OpenCompleteForm.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
<template>
22
<div v-if="form" class="open-complete-form">
33
<h1 v-if="!isHideTitle" class="mb-4 px-2" :class="{'mt-4':isEmbedPopup}" v-text="form.title" />
4+
<div v-if="form.description" v-html="form.description"
5+
class="form-description mb-4 text-gray-700 dark:text-gray-300 whitespace-pre-wrap px-2"/>
46

57
<div v-if="isPublicFormPage && form.is_password_protected">
68
<p class="form-description mb-4 text-gray-700 dark:text-gray-300 px-2">
79
This form is protected by a password.
810
</p>
911
<div class="form-group flex flex-wrap w-full">
1012
<div class="relative mb-3 w-full px-2">
11-
<text-input :form="passwordForm" name="password" native-type="password" label="Password" />
13+
<text-input :theme="theme" :form="passwordForm" name="password" native-type="password" label="Password" />
1214
</div>
1315
</div>
1416
<div class="flex flex-wrap justify-center w-full text-center">
15-
<v-button @click="passwordEntered">
17+
<open-form-button :theme="theme" :color="form.color" class="my-4" @click="passwordEntered">
1618
Submit
17-
</v-button>
19+
</open-form-button>
1820
</div>
1921
</div>
2022

@@ -62,8 +64,6 @@
6264
mode="out-in"
6365
>
6466
<div v-if="!submitted" key="form">
65-
<div v-if="form.description" v-html="form.description"
66-
class="form-description mb-4 text-gray-700 dark:text-gray-300 whitespace-pre-wrap px-2"/>
6767
<open-form v-if="form"
6868
:form="form"
6969
:loading="loading"

client/components/pages/forms/show/ExtraMenu.vue

+23-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,25 @@
2424
</svg>
2525
</v-button>
2626
</template>
27-
<a v-if="isMainPage && user" v-track.view_form_click="{form_id:form.id, form_slug:form.slug}" :href="form.share_url"
27+
<span v-if="form.visibility === 'draft'"
28+
class="block px-4 py-2 text-md text-gray-700 cursor-pointer dark:text-white hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
29+
@click="showDraftFormWarningNotification"
30+
>
31+
<svg class="w-4 h-4 mr-2" viewBox="0 0 24 24" fill="none"
32+
xmlns="http://www.w3.org/2000/svg"
33+
>
34+
<path d="M1 12C1 12 5 4 12 4C19 4 23 12 23 12C23 12 19 20 12 20C5 20 1 12 1 12Z"
35+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
36+
/>
37+
<path
38+
d="M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z"
39+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
40+
/>
41+
</svg>
42+
View form
43+
</span>
44+
45+
<a v-else-if="isMainPage && user" v-track.view_form_click="{form_id:form.id, form_slug:form.slug}" :href="form.share_url"
2846
target="_blank"
2947
class="block px-4 py-2 text-md text-gray-700 dark:text-white hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
3048
>
@@ -133,7 +151,6 @@
133151
</div>
134152
</div>
135153
</modal>
136-
137154
<form-template-modal v-if="!isMainPage && user" :form="form" :show="showFormTemplateModal" @close="showFormTemplateModal=false" />
138155
</div>
139156
</template>
@@ -185,4 +202,8 @@ const deleteForm = () => {
185202
loadingDelete.value = false
186203
})
187204
}
205+
206+
const showDraftFormWarningNotification = () => {
207+
useAlert().warning('This form is currently in Draft mode and is not publicly accessible, You can change the form status on the edit form page.')
208+
}
188209
</script>

client/pages/forms/[slug]/show.vue

+20-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@
2222
<div class="flex">
2323
<extra-menu class="mr-2" :form="form"/>
2424

25-
<v-button v-track.view_form_click="{form_id:form.id, form_slug:form.slug}" target="_blank"
25+
<v-button v-if="form.visibility === 'draft'" color="white"
26+
class="mr-2 text-blue-600 hidden sm:block" @click="showDraftFormWarningNotification"
27+
>
28+
<svg class="w-6 h-6 inline -mt-1" viewBox="0 0 24 24" fill="none"
29+
xmlns="http://www.w3.org/2000/svg"
30+
>
31+
<path d="M1 12C1 12 5 4 12 4C19 4 23 12 23 12C23 12 19 20 12 20C5 20 1 12 1 12Z"
32+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
33+
/>
34+
<path
35+
d="M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z"
36+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
37+
/>
38+
</svg>
39+
</v-button>
40+
<v-button v-else v-track.view_form_click="{form_id:form.id, form_slug:form.slug}" target="_blank"
2641
:href="form.share_url" color="white"
2742
class="mr-2 text-blue-600 hidden sm:block"
2843
>
@@ -196,4 +211,8 @@ watch(() => form?.value?.id, (id) => {
196211
const goBack = () => {
197212
useRouter().push({name: 'home'})
198213
}
214+
215+
const showDraftFormWarningNotification = () => {
216+
useAlert().warning('This form is currently in Draft mode and is not publicly accessible, You can change the form status on the edit form page.')
217+
}
199218
</script>

0 commit comments

Comments
 (0)