Skip to content

Commit e4531ac

Browse files
madassdevJhumanJ
andauthored
Form password customization (#286)
* feat: add seo, cover, logo and description to password protected forms * add seo meta to password protected form * fix: unused method and fixed form button color error --------- Co-authored-by: Julien Nahum <julien@nahum.net>
1 parent 000b65d commit e4531ac

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
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"

0 commit comments

Comments
 (0)