forked from Fliplet/fliplet-widget-form-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.html
75 lines (75 loc) · 3.25 KB
/
build.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<div class="hidden" data-form-builder-id="{{ id }}">
<form v-if="isConfigured" v-on:submit.prevent="onSubmit" class="fl-form" v-bind:class="{ 'form-offline': isOffline, 'loading-form': isSending || isLoading && !blockScreen }">
<template v-if="isSending">
<div class="sending-form">
<div class="spinner-holder animated">
<div class="spinner-overlay" data-translate="widgets.form.loading">Loading...</div>
<p v-html="isSendingMessage"></p>
</div>
</div>
</template>
<template v-if="isLoading && !blockScreen">
<div class="sending-form">
<div class="spinner-holder animated">
<div class="spinner-overlay" data-translate="widgets.form.loading">Loading...</div>
<p v-html="isLoadingMessage"></p>
</div>
</div>
</template>
<div v-if="!isSent" class="form-html">
<div v-if="isOffline" class="text-danger" v-bind:class="{ 'cover-form' : blockScreen }" v-html="isOfflineMessage"></div>
<div v-if="hasRequiredFields" class="required-info-label">\{{$t("widgets.form.sending.requiredFields")}}</div>
<template v-for="field in fields">
<component :is="field._type" v-bind="field" v-on:_input="onInput" v-on:_error="onError" v-on:_reset="reset" v-if="field.enabled"></component>
</template>
<div class="callout callout-danger" v-if="error">
<p>\{{ error }}</p>
</div>
</div>
<transition name="fade">
<div v-if="isSent">{{{ resultHtml }}}</div>
</transition>
</form>
<div v-else-if="!isConfigured && isPlaceholder">
<form class="fl-form placeholder">
<div class="form-html">
<div class="form-group clearfix" _type="flTitle">
<h2>Example form</h2>
</div>
<div class="form-group clearfix" _type="flParagraph">
<p>Click on this example to configure your own form</p>
</div>
<div class="form-group clearfix" _type="flInput">
<label>Name</label>
<input type="text" name="field-1" placeholder="Enter your name" class="form-control">
</div>
<div class="form-group clearfix" _type="flSelect">
<label>Type of enquiry</label>
<label class="select-proxy-display">
<span class="icon fa fa-chevron-down"></span>
<span class="select-value-proxy">-- Select one</span>
<select name="field-3" class="form-control hidden-select">
<option value="">-- Select one</option>
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
</select>
</label>
</div>
<div class="form-group clearfix" _type="flTextarea">
<label>Message</label>
<textarea name="field-2" rows="4" class="form-control"></textarea>
</div>
<div class="form-btns clearfix">
<button type="submit" class="btn btn-primary pull-right">Submit</button>
<button type="reset" class="btn btn-secondary pull-right">Clear</button>
</div>
</div>
</form>
</div>
<div v-else class="col-sm-12 loading-message">
<!-- Show loading animation -->
<div class="spinner-holder animated">
<div class="spinner-overlay">Loading...</div>
</div>
</div>
</div>