PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.4.3
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.4.3
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / assets / js-templates / form-components.php

form-components.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.4.3, at assets/js-templates/form-components.php

786 lines 38.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <script type="text/x-template" id="tmpl-wpuf-dynamic-field">
2 <div>
3
4 <div class="panel-field-opt panel-field-opt-text">
5 <label>
6 <?php _e( 'Dynamic value population', 'weforms' ); ?>
7 <help-text text="<?php _e( 'Field value or options can be populated dynamically through filter hook or query string', 'weforms' ); ?>"></help-text>
8 </label>
9
10 <ul>
11 <li>
12 <label>
13 <input type="checkbox" value="yes" v-model="dynamic.status"> <?php _e( 'Allow field to be populated dynamically', 'weforms' ); ?>
14 </label>
15 </li>
16 </ul>
17 </div>
18
19
20 <template v-if="dynamic.status">
21
22 <div class="panel-field-opt panel-field-opt-text"><label>
23 <?php _e( 'Parameter Name', 'weforms' ); ?>
24 <help-text text="<?php _e( 'Enter a Parameter Name, using that the field value can be populated through filter hook or query string', 'weforms' ); ?>"></help-text>
25 <input type="text" v-model="dynamic.param_name">
26 </label>
27 </div>
28 </template>
29
30 </div>
31 </script>
32
33 <script type="text/x-template" id="tmpl-wpuf-field-name">
34 <div>
35 <div class="panel-field-opt panel-field-name clearfix">
36
37 <label>
38 <?php _e( 'First Name', 'weforms' ); ?>
39 </label>
40
41 <div class="name-field-placeholder">
42
43 <div class="name-merge-tag-holder">
44 <input type="text" v-model="editing_form_field.first_name.placeholder">
45 <wpuf-merge-tags
46 filter="no_fields"
47 v-on:insert="insertValue"
48 :field="{name: 'first_name', type: 'placeholder'}">
49 </wpuf-merge-tags>
50 </div>
51
52 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
53 </div>
54
55 <div class="name-field-value">
56 <div class="name-merge-tag-holder">
57 <input type="text" v-model="editing_form_field.first_name.default">
58 <wpuf-merge-tags
59 filter="no_fields"
60 v-on:insert="insertValue"
61 :field="{name: 'first_name', type: 'default'}">
62 </wpuf-merge-tags>
63 </div>
64
65 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
66 </div>
67 </div>
68
69 <div class="panel-field-opt panel-field-name clearfix" v-if="editing_form_field.format !== 'first-last'">
70
71 <label>
72 <?php _e( 'Middle Name', 'weforms' ); ?>
73 </label>
74
75 <div class="name-field-placeholder">
76 <div class="name-merge-tag-holder">
77 <input type="text" v-model="editing_form_field.middle_name.placeholder">
78 <wpuf-merge-tags
79 filter="no_fields"
80 v-on:insert="insertValue"
81 :field="{name: 'middle_name', type: 'placeholder'}">
82 </wpuf-merge-tags>
83 </div>
84
85 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
86 </div>
87
88 <div class="name-field-value">
89
90 <div class="name-merge-tag-holder">
91 <input type="text" v-model="editing_form_field.middle_name.default">
92 <wpuf-merge-tags
93 filter="no_fields"
94 v-on:insert="insertValue"
95 :field="{name: 'middle_name', type: 'default'}">
96 </wpuf-merge-tags>
97 </div>
98
99 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
100 </div>
101 </div>
102
103 <div class="panel-field-opt panel-field-name clearfix">
104
105 <label>
106 <?php _e( 'Last Name', 'weforms' ); ?>
107 </label>
108
109 <div class="name-field-placeholder">
110
111 <div class="name-merge-tag-holder">
112 <input type="text" v-model="editing_form_field.last_name.placeholder">
113 <wpuf-merge-tags
114 filter="no_fields"
115 v-on:insert="insertValue"
116 :field="{name: 'last_name', type: 'placeholder'}">
117 </wpuf-merge-tags>
118 </div>
119
120 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
121 </div>
122
123 <div class="name-field-value">
124 <div class="name-merge-tag-holder">
125 <input type="text" v-model="editing_form_field.last_name.default">
126 <wpuf-merge-tags
127 filter="no_fields"
128 v-on:insert="insertValue"
129 :field="{name: 'last_name', type: 'default'}">
130 </wpuf-merge-tags>
131 </div>
132 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
133 </div>
134 </div>
135 </div>
136 </script>
137
138 <script type="text/x-template" id="tmpl-wpuf-field-text-with-tag">
139 <div v-if="met_dependencies" class="panel-field-opt panel-field-opt-text field-text-with-tag">
140 <label>
141 {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
142
143 <input
144 v-if="option_field.variation && 'number' === option_field.variation"
145 type="number"
146 v-model="value"
147 @focusout="on_focusout"
148 @keyup="on_keyup"
149 >
150
151 <input
152 v-if="!option_field.variation"
153 type="text"
154 v-model="value"
155 @focusout="on_focusout"
156 @keyup="on_keyup"
157 >
158
159 <wpuf-merge-tags :filter="option_field.tag_filter" v-on:insert="insertValue"></wpuf-merge-tags>
160 </label>
161 </div>
162 </script>
163
164 <script type="text/x-template" id="tmpl-wpuf-form-date_field">
165 <div class="wpuf-fields">
166 <input
167 type="text"
168 :class="class_names('datepicker')"
169 :placeholder="field.format"
170 :value="field.default"
171 :size="field.size"
172 >
173 <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
174 </div></script>
175
176 <script type="text/x-template" id="tmpl-wpuf-form-name_field">
177 <div class="wpuf-fields">
178
179 <div :class="['wpuf-name-field-wrap', 'format-' + field.format]">
180 <div class="wpuf-name-field-first-name">
181 <input
182 type="text"
183 :class="class_names('textfield')"
184 :placeholder="field.first_name.placeholder"
185 :value="field.first_name.default"
186 :size="field.size"
187 >
188 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.first_name.sub }}</label>
189 </div>
190
191 <div class="wpuf-name-field-middle-name">
192 <input
193 type="text"
194 :class="class_names('textfield')"
195 :placeholder="field.middle_name.placeholder"
196 :value="field.middle_name.default"
197 :size="field.size"
198 >
199 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.middle_name.sub }}</label>
200 </div>
201
202 <div class="wpuf-name-field-last-name">
203 <input
204 type="text"
205 :class="class_names('textfield')"
206 :placeholder="field.last_name.placeholder"
207 :value="field.last_name.default"
208 :size="field.size"
209 >
210 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.last_name.sub }}</label>
211 </div>
212 </div>
213
214 <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
215 </div>
216 </script>
217
218 <script type="text/x-template" id="tmpl-wpuf-form-notification">
219 <div>
220 <!-- <pre>{{ notifications.length }}</pre> -->
221 <a href="#" class="button button-secondary add-notification" v-on:click.prevent="addNew"><span class="dashicons dashicons-plus-alt"></span> <?php _e( 'Add Notification', 'weforms' ); ?></a>
222
223 <div :class="[editing ? 'editing' : '', 'notification-wrap']">
224 <!-- notification-wrap -->
225
226 <div class="notification-table-wrap">
227 <table class="wp-list-table widefat fixed striped posts wpuf-cf-notification-table">
228 <thead>
229 <tr>
230 <th class="col-toggle">&nbsp;</th>
231 <th class="col-name"><?php _e( 'Name', 'weforms' ); ?></th>
232 <th class="col-subject"><?php _e( 'Subject', 'weforms' ); ?></th>
233 <th class="col-action">&nbsp;</th>
234 </tr>
235 </thead>
236 <tbody>
237 <tr v-for="(notification, index) in notifications">
238 <td class="col-toggle">
239 <a href="#" v-on:click.prevent="toggelNotification(index)">
240 <img v-if="notification.active" src="<?php echo WPUF_ASSET_URI; ?>/images/active.png" width="24" alt="status">
241 <img v-else src="<?php echo WPUF_ASSET_URI; ?>/images/inactive.png" width="24" alt="status">
242 </a>
243 </td>
244 <td class="col-name"><a href="#" v-on:click.prevent="editItem(index)">{{ notification.name }}</a></td>
245 <td class="col-subject">{{ notification.type === 'email' ? notification.subject : notification.smsText }}</td>
246 <td class="col-action">
247 <a href="#" v-on:click.prevent="duplicate(index)" title="<?php esc_attr_e( 'Duplicate', 'weforms' ); ?>"><span class="dashicons dashicons-admin-page"></span></a>
248 <a href="#" v-on:click.prevent="editItem(index)" title="<?php esc_attr_e( 'Settings', 'weforms' ); ?>"><span class="dashicons dashicons-admin-generic"></span></a>
249 </td>
250 </tr>
251 <tr v-if="!notifications.length">
252 <td colspan="4"><?php _e( 'No notifications found', 'weforms' ); ?></td>
253 </tr>
254 </tbody>
255 </table>
256 </div><!-- .notification-table-wrap -->
257
258 <div class="notification-edit-area" v-if="notifications[editingIndex]">
259
260 <div class="notification-head">
261 <input type="text" name="" v-model="notifications[editingIndex].name" v-on:keyup.enter="editDone()" value="Admin Notification">
262 </div>
263
264 <div class="form-fields">
265
266 <div class="notification-row notification-field">
267 <label for="notification-title"><?php _e( 'Type', 'weforms' ); ?></label>
268 <select type="text" v-model="notifications[editingIndex].type">
269 <option value="email"><?php _e( 'Email Notification', 'weforms' ); ?></option>
270 <option value="sms"><?php _e( 'SMS Notification', 'weforms' ); ?></option>
271 </select>
272 </div>
273
274 <template v-if="notifications[editingIndex].type == 'email' ">
275 <div class="notification-row">
276 <div class="row-one-half notification-field first">
277 <label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label>
278 <input type="text" v-model="notifications[editingIndex].to">
279 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="to"></wpuf-merge-tags>
280 </div>
281
282 <div class="row-one-half notification-field">
283 <label for="notification-title"><?php _e( 'Reply To', 'weforms' ); ?></label>
284 <input type="email" v-model="notifications[editingIndex].replyTo">
285 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="replyTo"></wpuf-merge-tags>
286 </div>
287 </div>
288
289 <div class="notification-row notification-field">
290 <label for="notification-title"><?php _e( 'Subject', 'weforms' ); ?></label>
291 <input type="text" v-model="notifications[editingIndex].subject">
292 <wpuf-merge-tags v-on:insert="insertValue" field="subject"></wpuf-merge-tags>
293 </div>
294
295 <div class="notification-row notification-field">
296 <label for="notification-title"><?php _e( 'Email Message', 'weforms' ); ?></label>
297
298 <weforms-text-editor
299 v-model="notifications[editingIndex].message"
300 :i18n="i18n"
301 :editingIndex="editingIndex"
302 >
303 </weforms-text-editor>
304
305 <wpuf-merge-tags v-on:insert="insertValueEditor" field="message"></wpuf-merge-tags>
306 </div>
307 </template>
308 <template v-else>
309 <template v-if="has_sms">
310 <div class="notification-row notification-field">
311 <label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label>
312 <input type="text" v-model="notifications[editingIndex].smsTo">
313 <wpuf-merge-tags v-on:insert="insertValue" field="smsTo"></wpuf-merge-tags>
314 </div>
315 <div class="notification-row notification-field">
316 <label for="notification-title"><?php _e( 'SMS Text', 'weforms' ); ?></label>
317 <textarea name="" rows="6" v-model="notifications[editingIndex].smsText"></textarea>
318 <wpuf-merge-tags v-on:insert="insertValue" field="smsText"></wpuf-merge-tags>
319 </div>
320 </template>
321 <template v-else>
322 <p>
323 <label class="wpuf-pro-text-alert">
324 <a :href="pro_link" target="_blank"><?php _e( 'SMS notification moule not found', 'wpuf' ); ?></a>
325 </label>
326 </p>
327 </template>
328 </template>
329
330 <section class="advanced-fields">
331 <a href="#" class="field-toggle" v-on:click.prevent="toggleAdvanced()"><span class="dashicons dashicons-arrow-right"></span><?php _e( ' Advanced', 'weforms' ); ?></a>
332
333 <div class="advanced-field-wrap">
334 <p class="wpuf-pro-text-alert"><?php _e( 'Make sure that your mail server is configured properly for the following "From" fields', 'weforms' ); ?></p>
335 <template v-if="notifications[editingIndex].type == 'email' ">
336 <div class="notification-row">
337 <div class="row-one-half notification-field first">
338 <label for="notification-title"><?php _e( 'From Name', 'weforms' ); ?></label>
339 <input type="text" v-model="notifications[editingIndex].fromName">
340 <wpuf-merge-tags v-on:insert="insertValue" field="fromName"></wpuf-merge-tags>
341 </div>
342
343 <div class="row-one-half notification-field">
344 <label for="notification-title"><?php _e( 'From Address', 'weforms' ); ?></label>
345 <input type="email" name="" v-model="notifications[editingIndex].fromAddress">
346 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="fromAddress"></wpuf-merge-tags>
347 </div>
348 </div>
349
350 <div class="notification-row">
351 <div class="row-one-half notification-field first">
352 <label for="notification-title"><?php _e( 'CC', 'weforms' ); ?></label>
353 <input type="email" name="" v-model="notifications[editingIndex].cc">
354 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="cc"></wpuf-merge-tags>
355 </div>
356
357 <div class="row-one-half notification-field">
358 <label for="notification-title"><?php _e( 'BCC', 'weforms' ); ?></label>
359 <input type="email" name="" v-model="notifications[editingIndex].bcc">
360 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="bcc"></wpuf-merge-tags>
361 </div>
362 </div>
363 </template>
364
365 <div class="notification-row notification-field">
366 <template v-if="is_pro">
367
368 <notification-conditional-logics
369 :notification="notifications[editingIndex]"
370 >
371 </notification-conditional-logics>
372
373 </template>
374 <template v-else>
375 <label class="wpuf-pro-text-alert">
376 <a :href="pro_link" target="_blank"><?php _e( 'Conditional Logics available in Pro Version', 'wpuf' ); ?></a>
377 </label>
378 </template>
379 </div>
380 </div>
381 </section><!-- .advanced-fields -->
382 </div>
383
384 <div class="submit-area">
385 <a href="#" v-on:click.prevent="deleteItem(editingIndex)" title="<?php esc_attr_e( 'Delete', 'weforms' ); ?>"><span class="dashicons dashicons-trash"></span></a>
386 <button class="button button-secondary" v-on:click.prevent="editDone()"><?php _e( 'Done', 'weforms' ); ?></button>
387 </div>
388 </div><!-- .notification-edit-area -->
389
390 </div><!-- .notification-wrap -->
391 </div>
392 </script>
393
394 <script type="text/x-template" id="tmpl-wpuf-integration">
395 <div class="wpuf-integrations-wrap">
396
397 <template v-if="hasIntegrations">
398 <div :class="['wpuf-integration', isAvailable(integration.id) ? '' : 'collapsed']" v-for="integration in integrations">
399 <div :class="['wpuf-panel', isActive(integration.id) ? 'panel-checked' : '']">
400 <div class="wpuf-panel-body">
401 <span class="premium-badge" v-if="!isAvailable(integration.id)"><?php _e( 'Premium', 'weforms' ); ?></span>
402 <img class="icon" :src="integration.icon" :alt="integration.title">
403 </div>
404 <div class="wpuf-panel-footer">
405 <div class="wpuf-setting">
406 <a href="#" @click.prevent="openModal($event.target)" title="<?php _e( 'Settings', 'weforms' ); ?>">
407 <svg width="21px" height="21px" viewBox="0 0 21 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
408 <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
409 <g id="Individual-Form-Integration-Page-Design---weForms" transform="translate(-203.000000, -290.000000)" fill="#CCCCCC" fill-rule="nonzero">
410 <g id="Group-4" transform="translate(183.000000, 116.000000)">
411 <path d="M40.9342889,183.334097 C40.9010806,183.038903 40.5568864,182.817077 40.259262,182.817077 C39.2970029,182.817077 38.4431201,182.252081 38.0850175,181.378295 C37.7191793,180.483334 37.9550754,179.439603 38.6722182,178.781783 C38.8979565,178.575428 38.9253826,178.229992 38.7360563,177.990038 C38.2435578,177.364644 37.6837832,176.799726 37.0725944,176.310131 C36.8332603,176.118075 36.4821119,176.144797 36.2745796,176.374592 C35.648701,177.06773 34.5244636,177.325342 33.6557347,176.962873 C32.7516878,176.582588 32.1815991,175.666531 32.237389,174.683199 C32.2557512,174.374331 32.030013,174.10578 31.7220744,174.069916 C30.9377337,173.979201 30.1465168,173.976388 29.3598319,174.063665 C29.0554096,174.097263 28.8296713,174.359485 28.8399073,174.664447 C28.8741314,175.63809 28.2971666,176.53813 27.4021055,176.90474 C26.5437688,177.255333 25.4274233,176.999909 24.8027948,176.312944 C24.5963565,176.086664 24.2509121,176.058848 24.0104059,176.246294 C23.3810893,176.740031 22.8087346,177.305417 22.3117041,177.925655 C22.1178459,178.16678 22.1463659,178.516279 22.3743701,178.723728 C23.105187,179.385534 23.3411612,180.438328 22.9614927,181.343602 C22.5990145,182.206684 21.7027813,182.762929 20.6767623,182.762929 C20.3438199,182.752224 20.1066736,182.975691 20.0702617,183.278387 C19.9779036,184.06724 19.9768096,184.871017 20.0657297,185.666278 C20.0987036,185.962723 20.4533682,186.182595 20.7542743,186.182595 C21.6686353,186.159233 22.5465063,186.725323 22.9147667,187.621456 C23.2818551,188.516417 23.0458809,189.559522 22.3276441,190.217889 C22.1029998,190.424245 22.0744797,190.769134 22.2638061,191.009087 C22.7516945,191.630496 23.3115472,192.195961 23.9249239,192.689619 C24.1655082,192.883473 24.5155626,192.856126 24.7241107,192.62633 C25.3523334,191.931473 26.4764927,191.67433 27.3417836,192.037503 C28.2480965,192.416615 28.8181852,193.332594 28.7623952,194.316473 C28.7441893,194.625498 28.9710214,194.894517 29.2777098,194.929835 C29.6789441,194.976638 30.0826006,195 30.4873511,195 C30.8715515,195 31.25583,194.978903 31.6400304,194.936164 C31.9445309,194.902565 32.1701129,194.640344 32.1598769,194.334835 C32.1246371,193.361739 32.7026176,192.461699 33.5965067,192.095713 C34.4606255,191.742777 35.5722828,192.001092 36.1969894,192.687353 C36.4045998,192.913164 36.7476219,192.940433 36.9894564,192.753612 C37.617601,192.261048 38.1887836,191.69613 38.6881582,191.074173 C38.8819384,190.833595 38.8545904,190.483549 38.6254141,190.276178 C37.8945972,189.614373 37.657451,188.561423 38.0371194,187.656773 C38.39405,186.805177 39.2569967,186.233383 40.185188,186.233383 L40.3150519,186.236743 C40.6161144,186.2612 40.8931106,186.029294 40.9296007,185.721988 C41.0221151,184.932432 41.023209,184.129358 40.9342889,183.334097 Z M30.5166525,188.024555 C28.5852583,188.024555 27.0142326,186.453568 27.0142326,184.522222 C27.0142326,182.590953 28.5852583,181.019888 30.5166525,181.019888 C32.4479686,181.019888 34.0189943,182.590953 34.0189943,184.522222 C34.0189943,186.453568 32.4479686,188.024555 30.5166525,188.024555 Z" id="Shape" transform="translate(30.500000, 184.500000) scale(-1, 1) translate(-30.500000, -184.500000) "></path>
412 </g>
413 </g>
414 </g>
415 </svg>
416 </a>
417 </div>
418 <div :class="['wpuf-toggle-switch', 'big', isActive(integration.id) ? 'checked' : '']" v-on:click="toggleState(integration.id, $event.target)">
419 <span class="toggle-indicator"></span>
420 </div>
421 </div>
422 </div>
423
424 <div :id="integration.id" class="wf-modal" role="dialog">
425 <div class="wf-modal-dialog">
426 <div class="wf-modal-content">
427 <div class="wf-modal-header">
428 <div class="modal-header-left">
429 <div :class="['wpuf-toggle-switch', 'big', isActive(integration.id) ? 'checked' : '']" v-on:click="toggleState(integration.id, $event.target)">
430 <span class="toggle-indicator"></span>
431 </div>
432 <img class="icon" height="30px" :src="integration.icon" :alt="integration.title">
433 </div>
434 <span class="modal-close" @click.prevent="hideModal($event.target)">x</span>
435 </div>
436 <div class="wf-modal-body">
437 <div v-if="isAvailable(integration.id)">
438 <component :is="'wpuf-integration-' + integration.id" :id="integration.id"></component>
439 </div>
440 <div v-else>
441 <?php _e( 'This feature is available on the premium version only.', 'best-contact-form' ); ?>
442 <a class="button" :href="pro_link" target="_blank"><?php _e( 'Upgrade to Pro', 'best-contact-form' ); ?></a>
443 </div>
444 </div>
445 <div class="wf-modal-footer">
446 <button type="button" class="button button-primary" @click="save_form_builder($event.target)">
447 <?php _e( 'Save Form', 'weforms' ); ?>
448 </button>
449 </div>
450 </div>
451 </div>
452 </div>
453
454 </div>
455 </template>
456
457 <div v-else>
458 <?php _e( 'No integration found.', 'best-contact-form' ); ?>
459 </div>
460 </div>
461 </script>
462
463 <script type="text/x-template" id="tmpl-wpuf-integration-erp">
464 <div>
465
466 <?php if ( !function_exists( 'erp_crm_get_contact_groups' ) ) { ?>
467
468 <p>
469 <?php printf( __( '<a href="%s" target="_blank">WP ERP</a> plugin is not installed. Please install the plugin first.', 'weforms' ), 'https://wordpress.org/plugins/erp/' ); ?>
470 </p>
471
472 <?php } else { ?>
473 <?php
474 $erp_contact_groups = erp_crm_get_contact_groups( [
475 'number' => -1,
476 'orderby' => 'name',
477 'order' => 'ASC',
478 ] );
479 ?>
480
481 <div class="wpuf-int-form-row">
482 <div class="wpuf-int-field-label">
483 <label for="erp-group-id"><?php _e( 'Contact Group', 'weforms' ); ?></label>
484 </div>
485 <div class="wpuf-int-field">
486 <ul style="margin: 0;">
487 <?php foreach ( $erp_contact_groups as $group ) { ?>
488 <li>
489 <label>
490 <input type="checkbox" v-model="settings.group" class="checkbox" value="<?php echo $group->id; ?>">
491 <?php echo $group->name; ?>
492 </label>
493 </li>
494 <?php } ?>
495 </ul>
496 </div>
497 </div>
498
499 <div class="wpuf-int-form-row">
500 <div class="wpuf-int-field-label">
501 <label for="erp-group-id"><?php _e( 'Life Stage', 'weforms' ); ?></label>
502 </div>
503 <div class="wpuf-int-field">
504 <select v-model="settings.stage">
505 <?php echo erp_crm_get_life_stages_dropdown(); ?>
506 </select>
507 </div>
508 </div>
509
510 <fieldset>
511 <legend><?php _e( 'Mapping Fields', 'weforms' ); ?></legend>
512
513 <p class="description" style="padding: 0 0 10px 0;">
514 <?php _e( 'Please map the form input fields with ERP required fields', 'weforms' ); ?>
515 </p>
516
517 <div class="wpuf-int-form-row mapping-fields">
518 <div class="wpuf-int-field-label">
519 <label><?php _e( 'Email Address', 'default' ); ?> <span class="required">*</span></label>
520 </div>
521 <div class="wpuf-int-field">
522 <div class="wpuf-int-field-small">
523 <input type="email" class="regular-text" v-model="settings.fields.email">
524 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="email"></wpuf-merge-tags>
525 </div>
526 </div>
527 </div>
528
529 <div class="wpuf-int-form-row">
530 <div class="wpuf-int-field-label">
531 <label><?php _e( 'First Name', 'default' ); ?></label>
532 </div>
533 <div class="wpuf-int-field">
534 <div class="wpuf-int-field-small">
535 <input type="text" class="regular-text" v-model="settings.fields.first_name">
536 <wpuf-merge-tags v-on:insert="insertValue" field="first_name"></wpuf-merge-tags>
537 </div>
538 </div>
539 </div>
540
541 <div class="wpuf-int-form-row">
542 <div class="wpuf-int-field-label">
543 <label><?php _e( 'Last Name', 'default' ); ?></label>
544 </div>
545 <div class="wpuf-int-field">
546 <div class="wpuf-int-field-small">
547 <input type="text" class="regular-text" v-model="settings.fields.last_name">
548 <wpuf-merge-tags v-on:insert="insertValue" field="last_name"></wpuf-merge-tags>
549 </div>
550 </div>
551 </div>
552 </fieldset>
553
554 <?php } ?>
555 </div></script>
556
557 <script type="text/x-template" id="tmpl-wpuf-integration-slack">
558 <div>
559 <div class="wpuf-int-form-row">
560 <div class="wpuf-int-field-label">
561 <label for="mailchimp-list-id"><?php _e( 'Slack Webhook URL', 'weforms' ); ?></label>
562 </div>
563 <div class="wpuf-int-field">
564 <input type="url" class="regular-text" v-model="settings.url" placeholder="https://hooks.slack.com/services/...">
565 <p class="help"><?php printf( __( '%sSlack webhook URL%s to send our JSON payloads (%sView documentation%s)', 'weforms' ), '<a href="https://api.slack.com/incoming-webhooks" target="_blank" >', '</a>', '<a href="https://wedevs.com/docs/weforms/integrations/slack/" target="_blank" >', '</a>' ); ?></p>
566 </div>
567 </div>
568 </div></script>
569
570 <script type="text/x-template" id="tmpl-wpuf-merge-tags">
571 <div class="wpuf-merge-tag-wrap">
572 <a href="#" v-on:click.prevent="toggleFields($event)" class="merge-tag-link" title="<?php echo esc_attr( 'Click to toggle merge tags', 'wpuf' ); ?>"><span class="dashicons dashicons-editor-code"></span></a>
573
574 <!-- <pre>{{ form_fields.length }}</pre> -->
575
576 <div class="wpuf-merge-tags">
577 <div class="merge-tag-section" v-if="!filter || filter !== 'no_fields' ">
578 <div class="merge-tag-head"><?php _e( 'Form Fields', 'wpuf' ); ?></div>
579
580 <ul>
581 <template v-if="form_fields.length">
582 <li v-for="field in form_fields">
583
584 <template v-if="field.template === 'name_field'">
585 <a href="#" v-on:click.prevent="insertField('name-full', field.name);">{{ field.label }}</a>
586 (
587 <a href="#" v-on:click.prevent="insertField('name-first', field.name);"><?php _e( 'first', 'wpuf' ); ?></a> |
588 <a href="#" v-on:click.prevent="insertField('name-middle', field.name);"><?php _e( 'middle', 'wpuf' ); ?></a> |
589 <a href="#" v-on:click.prevent="insertField('name-last', field.name);"><?php _e( 'last', 'wpuf' ); ?></a>
590 )
591 </template>
592
593 <template v-else-if="field.template === 'image_upload'">
594 <a href="#" v-on:click.prevent="insertField('image', field.name);">{{ field.label }}</a>
595 </template>
596
597 <template v-else-if="field.template === 'file_upload'">
598 <a href="#" v-on:click.prevent="insertField('file', field.name);">{{ field.label }}</a>
599 </template>
600
601 <a v-else href="#" v-on:click.prevent="insertField('field', field.name);">{{ field.label }} </a>
602
603 </li>
604 </template>
605 <li v-else>
606 <?php _e( 'No fields available', 'wpuf' ); ?>
607 </li>
608 </ul>
609 </div><!-- .merge-tag-section -->
610
611 <template v-if="!fieldsonly">
612
613 <?php
614 if ( function_exists( 'weforms_get_merge_tags' ) ) {
615 $merge_tags = weforms_get_merge_tags();
616
617 foreach ( $merge_tags as $section_key => $section ) {
618 ?>
619
620 <div class="merge-tag-section">
621 <div class="merge-tag-head"><?php echo $section['title']; ?></div>
622
623 <ul>
624 <?php foreach ( $section['tags'] as $key => $value ) { ?>
625 <li>
626 <a href="#" v-on:click.prevent="insertField('<?php echo $key; ?>');"><?php echo $value; ?></a>
627 </li>
628 <?php } ?>
629 </ul>
630 </div><!-- .merge-tag-section -->
631
632 <?php
633 }
634 }
635 ?>
636 </template>
637 </div><!-- .merge-tags -->
638 </div>
639 </script>
640
641 <script type="text/x-template" id="tmpl-wpuf-modal">
642 <div>
643 <div :class="['wpuf-form-template-modal', show ? 'show' : 'hide' ]">
644
645 <span class="screen-reader-text"><?php _e( 'Modal window. Press escape to close.', 'wpuf' ); ?></span>
646 <a href="#" class="close" v-on:click.prevent="closeModal()">× <span class="screen-reader-text"><?php _e( 'Close modal window', 'wpuf' ); ?></span></a>
647
648 <header class="modal-header">
649 <slot name="header"></slot>
650 </header>
651
652 <div :class="['content-container', this.$slots.footer ? 'modal-footer' : 'no-footer']">
653 <div class="content">
654 <slot name="body"></slot>
655 </div>
656 </div>
657
658 <footer v-if="this.$slots.footer">
659 <slot name="footer"></slot>
660 </footer>
661 </div>
662 <div :class="['wpuf-form-template-modal-backdrop', show ? 'show' : 'hide' ]"></div>
663 </div>
664 </script>
665
666 <script type="text/x-template" id="tmpl-wpuf-template-modal">
667 <div class="wefroms-form-templates">
668 <wpuf-modal :show.sync="show" :onClose="onClose">
669 <h2 slot="header">
670 <?php _e( 'Select a Template', 'weforms' ); ?>
671 <small><?php printf( __( 'Select from a pre-defined template or from a <a href="#" %s>blank form</a>', 'weforms' ), '@click.prevent="blankForm()"' ); ?></small>
672
673 <span class="choose-form-categroy">
674 <?php _e( 'Select Category', 'weforms' ); ?> &nbsp;
675 <select v-model="category">
676 <option value="all">All</option>
677 <?php
678 $registry = weforms()->templates->get_templates();
679 $categories = weforms_get_form_template_categories();
680 $colors = weforms_get_flat_ui_colors();
681
682 foreach ( $categories as $key => $category ) {
683 printf( '<option value="%s">%s</option>', $key, $category['name'] );
684 }
685 ?>
686 </select>
687 </span>
688 </h2>
689
690 <div slot="body">
691
692 <?php
693
694 // remove the blank form from index as it's handled separately
695 if ( array_key_exists( 'blank', $registry ) ) {
696 unset( $registry['blank'] );
697 }
698
699 foreach ( $categories as $category_id => $category ) {
700 ?>
701 <div class="clearfix" v-if="category=='<?php echo $category_id; ?>' || category=='all'">
702
703 <?php
704
705 printf( '<h2><i class="%s" style="color: %s"></i> &nbsp; %s</h2> <ul class="clearfix">', $category['icon'], $colors[array_rand( $colors )], $category['name'] );
706
707 if ( $category_id == 'default' ) {
708 ?>
709
710 <li class="blank-form">
711 <h3><?php _e( 'Blank Form', 'weforms' ); ?></h3>
712
713 <div class="blank-form-text">
714 <span class="dashicons dashicons-plus"></span>
715 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
716 </div>
717
718 <div class="form-create-overlay">
719
720 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
721 <br>
722 <button class="button button-primary" @click.prevent="blankForm($event.target)" title="<?php echo esc_attr( 'Blank Form' ); ?>">
723 <?php _e( 'Create Form', 'weforms' ); ?>
724 </button>
725 </div>
726 </li>
727
728 <?php
729 }
730
731 foreach ( $registry as $key => $template ) {
732 if ( $category_id !== $template->category ) {
733 continue;
734 }
735
736 $is_available = true;
737 $class = 'template-active';
738 $title = $template->title;
739 $image = $template->image ? $template->image : '';
740
741 if ( !$template->is_enabled() ) {
742 $title = __( 'This integration is not installed.', 'weforms' );
743 $class = 'template-inactive';
744 $is_available = false;
745 } ?>
746
747 <li class="<?php echo $class; ?>">
748 <h3><?php _e( $title, 'weforms' ); ?></h3>
749
750 <?php if ( $image ) {
751 printf( '<img src="%s" alt="%s">', $image, $title );
752 } ?>
753
754 <div class="form-create-overlay">
755
756 <div class="title"><?php echo $template->get_title(); ?></div>
757 <div class="description"><?php echo $template->get_description(); ?></div>
758 <br>
759
760 <button class="button button-primary" @click.prevent="createForm('<?php echo $key; ?>', $event.target)" title="<?php echo esc_attr( $title ); ?>" <?php echo $is_available ? '' : 'disabled="disabled"'; ?>>
761 <?php if ( $is_available ) { ?>
762 <?php _e( 'Create Form', 'weforms' ); ?>
763 <?php } else { ?>
764 <?php _e( 'Require Pro Upgrade', 'weforms' ); ?>
765 <?php } ?>
766 </button>
767 </div>
768 </li>
769 <?php
770 } ?>
771
772 </ul></div>
773
774 <?php
775 }
776 ?>
777 </div>
778 </wpuf-modal>
779 </div></script>
780
781 <script type="text/x-template" id="tmpl-wpuf-weforms-text-editor">
782 <div>
783 <textarea :value="value" :id="'wefroms-tinymce-' + editorId" rows="5"></textarea>
784 </div>
785 </script>
786