| 1 |
<script type="text/x-template" id="tmpl-wpuf-builder-stage"> |
| 2 |
<div id="form-preview-stage" class="wpuf-style"> |
| 3 |
<h4 v-if="!form_fields.length" class="text-center"> |
| 4 |
<?php _e( 'Add fields by dragging the fields from the right sidebar to this area.', 'wp-user-frontend' ); ?> |
| 5 |
</h4> |
| 6 |
|
| 7 |
<ul :class="['wpuf-form', 'sortable-list', 'form-label-' + label_type]"> |
| 8 |
<li |
| 9 |
v-for="(field, index) in form_fields" |
| 10 |
:key="field.id" |
| 11 |
:class="[ |
| 12 |
'field-items', 'wpuf-el', field.name, field.css, 'form-field-' + field.template, |
| 13 |
field.width ? 'field-size-' + field.width : '', |
| 14 |
('custom_hidden_field' === field.template) ? 'hidden-field' : '', |
| 15 |
parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : '' |
| 16 |
]" |
| 17 |
:data-index="index" |
| 18 |
data-source="stage" |
| 19 |
v-if="'humanpresence' !== field.template" |
| 20 |
> |
| 21 |
<div v-if="!is_full_width(field.template)" class="wpuf-label"> |
| 22 |
<label v-if="!is_invisible(field)" :for="'wpuf-' + field.name ? field.name : 'cls'"> |
| 23 |
{{ field.label }} <span v-if="field.required && 'yes' === field.required" class="required">*</span> |
| 24 |
</label> |
| 25 |
</div> |
| 26 |
|
| 27 |
<component v-if="is_template_available(field)" :is="'form-' + field.template" :field="field"></component> |
| 28 |
|
| 29 |
<div v-if="is_pro_feature(field.template)" class="stage-pro-alert"> |
| 30 |
<label class="wpuf-pro-text-alert"> |
| 31 |
<a :href="pro_link" target="_blank"><strong>{{ get_field_name(field.template) }}</strong> <?php _e( 'is available in Pro Version', 'wp-user-frontend' ); ?></a> |
| 32 |
</label> |
| 33 |
</div> |
| 34 |
|
| 35 |
<div v-if="!is_failed_to_validate(field.template)" class="control-buttons"> |
| 36 |
<p> |
| 37 |
<i class="fa fa-arrows move"></i> |
| 38 |
<i class="fa fa-pencil" @click="open_field_settings(field.id)"></i> |
| 39 |
<i class="fa fa-clone" @click="clone_field(field.id, index)"></i> |
| 40 |
<i class="fa fa-trash-o" @click="delete_field(index)"></i> |
| 41 |
</p> |
| 42 |
</div> |
| 43 |
</li> |
| 44 |
|
| 45 |
<li v-if="!form_fields.length" class="field-items empty-list-item"></li> |
| 46 |
|
| 47 |
<li class="wpuf-submit"> |
| 48 |
<div class="wpuf-label"> </div> |
| 49 |
|
| 50 |
<?php do_action( 'wpuf-form-builder-template-builder-stage-submit-area' ); ?> |
| 51 |
</li> |
| 52 |
</ul><!-- .wpuf-form --> |
| 53 |
|
| 54 |
<div v-if="hidden_fields.length" class="hidden-field-list"> |
| 55 |
<h4><?php esc_html_e( 'Hidden Fields', 'wp-user-frontend' ); ?></h4> |
| 56 |
|
| 57 |
<ul class="wpuf-form"> |
| 58 |
<li |
| 59 |
v-for="(field, index) in hidden_fields" |
| 60 |
:class="['field-items', parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : '']" |
| 61 |
> |
| 62 |
<span v-if="'humanpresence' !== field.template"><strong><?php esc_html_e( 'key', 'wp-user-frontend' ); ?></strong>: {{ field.name }} | <strong><?php esc_html_e( 'value', 'wp-user-frontend' ); ?></strong>: {{ field.meta_value }}</span> |
| 63 |
|
| 64 |
<span v-if="'humanpresence' === field.template"><component v-if="is_template_available(field)" :is="'form-' + field.template" :field="field"></component></span> |
| 65 |
|
| 66 |
<div class="control-buttons"> |
| 67 |
<p> |
| 68 |
<i class="fa fa-pencil" @click="open_field_settings(field.id)"></i> |
| 69 |
<i class="fa fa-clone" @click="clone_field(field.id, index)"></i> |
| 70 |
<i class="fa fa-trash-o" @click="delete_hidden_field(field.id)"></i> |
| 71 |
</p> |
| 72 |
</div> |
| 73 |
</li> |
| 74 |
</ul> |
| 75 |
</div> |
| 76 |
|
| 77 |
<?php do_action( 'wpuf-form-builder-template-builder-stage-bottom-area' ); ?> |
| 78 |
</div><!-- #form-preview-stage --> |
| 79 |
</script> |
| 80 |
|
| 81 |
<script type="text/x-template" id="tmpl-wpuf-field-checkbox"> |
| 82 |
<div v-if="met_dependencies" class="panel-field-opt panel-field-opt-checkbox"> |
| 83 |
<label v-if="option_field.title" :class="option_field.title_class"> |
| 84 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 85 |
</label> |
| 86 |
<ul :class="[option_field.inline ? 'list-inline' : '']"> |
| 87 |
<li v-for="(option, key) in option_field.options"> |
| 88 |
<label> |
| 89 |
<input type="checkbox" :value="key" v-model="value"> {{ option }} |
| 90 |
</label> |
| 91 |
</li> |
| 92 |
</ul> |
| 93 |
</div> |
| 94 |
</script> |
| 95 |
|
| 96 |
<script type="text/x-template" id="tmpl-wpuf-field-html_help_text"> |
| 97 |
<div class="panel-field-opt panel-field-html-help-text" v-html="option_field.text"></div> |
| 98 |
</script> |
| 99 |
|
| 100 |
<script type="text/x-template" id="tmpl-wpuf-field-multiselect"> |
| 101 |
<div class="panel-field-opt panel-field-opt-select"> |
| 102 |
<label v-if="option_field.title"> |
| 103 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 104 |
</label> |
| 105 |
|
| 106 |
<select |
| 107 |
:class="['term-list-selector']" |
| 108 |
v-model="value" |
| 109 |
multiple |
| 110 |
> |
| 111 |
<option v-for="(option, key) in option_field.options" :value="key">{{ option }}</option> |
| 112 |
</select> |
| 113 |
</div> |
| 114 |
</script> |
| 115 |
|
| 116 |
<script type="text/x-template" id="tmpl-wpuf-field-option-data"> |
| 117 |
<div class="panel-field-opt panel-field-opt-text"> |
| 118 |
<label class="clearfix"> |
| 119 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 120 |
<span class="pull-right"> |
| 121 |
<input type="checkbox" v-model="show_value"> <?php _e( 'Show values', 'wp-user-frontend' ); ?> |
| 122 |
</span> |
| 123 |
</label> |
| 124 |
|
| 125 |
<ul :class="['option-field-option-chooser', show_value ? 'show-value' : '']"> |
| 126 |
<li class="clearfix margin-0 header"> |
| 127 |
<div class="selector"> </div> |
| 128 |
|
| 129 |
<div class="sort-handler"> </div> |
| 130 |
|
| 131 |
<div class="label"> |
| 132 |
<?php _e( 'Label', 'wp-user-frontend' ); ?> |
| 133 |
</div> |
| 134 |
|
| 135 |
<div v-if="show_value" class="value"> |
| 136 |
<?php _e( 'Value', 'wp-user-frontend' ); ?> |
| 137 |
</div> |
| 138 |
|
| 139 |
<div class="action-buttons"> </div> |
| 140 |
</li> |
| 141 |
</ul> |
| 142 |
|
| 143 |
<ul :class="['option-field-option-chooser margin-0', show_value ? 'show-value' : '']"> |
| 144 |
<li v-for="(option, index) in options" :key="option.id" :data-index="index" class="clearfix option-field-option"> |
| 145 |
<div class="selector"> |
| 146 |
<input |
| 147 |
v-if="option_field.is_multiple" |
| 148 |
type="checkbox" |
| 149 |
:value="option.value" |
| 150 |
v-model="selected" |
| 151 |
> |
| 152 |
<input |
| 153 |
v-else |
| 154 |
type="radio" |
| 155 |
:value="option.value" |
| 156 |
v-model="selected" |
| 157 |
class="option-chooser-radio" |
| 158 |
> |
| 159 |
</div> |
| 160 |
|
| 161 |
<div class="sort-handler"> |
| 162 |
<i class="fa fa-bars"></i> |
| 163 |
</div> |
| 164 |
|
| 165 |
<div class="label"> |
| 166 |
<input type="text" v-model="option.label" @input="set_option_label(index, option.label)"> |
| 167 |
</div> |
| 168 |
|
| 169 |
<div v-if="show_value" class="value"> |
| 170 |
<input type="text" v-model="option.value"> |
| 171 |
</div> |
| 172 |
|
| 173 |
<div class="action-buttons clearfix"> |
| 174 |
<i class="fa fa-minus-circle" @click="delete_option(index)"></i> |
| 175 |
</div> |
| 176 |
</li> |
| 177 |
<li> |
| 178 |
<div class="plus-buttons clearfix" @click="add_option"> |
| 179 |
<i class="fa fa-plus-circle"></i> |
| 180 |
</div> |
| 181 |
</li> |
| 182 |
</ul> |
| 183 |
|
| 184 |
<a v-if="!option_field.is_multiple && selected" href="#clear" @click.prevent="clear_selection"><?php _e( 'Clear Selection', 'wp-user-frontend' ); ?></a> |
| 185 |
</div> |
| 186 |
</script> |
| 187 |
|
| 188 |
<script type="text/x-template" id="tmpl-wpuf-field-option-pro-feature-alert"> |
| 189 |
<div class="panel-field-opt panel-field-opt-pro-feature"> |
| 190 |
<label>{{ option_field.title }}</label><br> |
| 191 |
<label class="wpuf-pro-text-alert"> |
| 192 |
<a :href="pro_link" target="_blank"><?php _e( 'Available in Pro Version', 'wp-user-frontend' ); ?></a> |
| 193 |
</label> |
| 194 |
</div> |
| 195 |
</script> |
| 196 |
|
| 197 |
<script type="text/x-template" id="tmpl-wpuf-field-options"> |
| 198 |
<div class="wpuf-form-builder-field-options"> |
| 199 |
<div v-if="!parseInt(editing_field_id)" class="options-fileds-section text-center"> |
| 200 |
<p> |
| 201 |
<span class="loader"></span> |
| 202 |
</p> |
| 203 |
</div> |
| 204 |
|
| 205 |
<div v-else> |
| 206 |
<div class="option-fields-section"> |
| 207 |
<h3 class="section-title clearfix" @click="show_basic_settings = !show_basic_settings"> |
| 208 |
{{ form_field_type_title }} <i :class="[show_basic_settings ? 'fa fa-angle-down' : 'fa fa-angle-right']"></i> |
| 209 |
</h3> |
| 210 |
|
| 211 |
<transition name="slide-fade"> |
| 212 |
<div v-show="show_basic_settings" class="option-field-section-fields"> |
| 213 |
<component |
| 214 |
v-for="option_field in basic_settings" |
| 215 |
:key="option_field.name" |
| 216 |
:is="'field-' + option_field.type" |
| 217 |
:option_field="option_field" |
| 218 |
:editing_form_field="editing_form_field" |
| 219 |
></component> |
| 220 |
</div> |
| 221 |
</transition> |
| 222 |
</div> |
| 223 |
|
| 224 |
|
| 225 |
<div v-if="advanced_settings.length" class="option-fields-section"> |
| 226 |
<h3 class="section-title" @click="show_advanced_settings = !show_advanced_settings"> |
| 227 |
{{ i18n.advanced_options }} <i :class="[show_advanced_settings ? 'fa fa-angle-down' : 'fa fa-angle-right']"></i> |
| 228 |
</h3> |
| 229 |
|
| 230 |
<transition name="slide-fade"> |
| 231 |
<div v-show="show_advanced_settings" class="option-field-section-fields"> |
| 232 |
<component |
| 233 |
v-for="option_field in advanced_settings" |
| 234 |
:key="option_field.name" |
| 235 |
:is="'field-' + option_field.type" |
| 236 |
:option_field="option_field" |
| 237 |
:editing_form_field="editing_form_field" |
| 238 |
></component> |
| 239 |
</div> |
| 240 |
</transition> |
| 241 |
</div> |
| 242 |
|
| 243 |
<?php do_action( 'wpuf_builder_field_options' ); ?> |
| 244 |
</div> |
| 245 |
|
| 246 |
</div> |
| 247 |
</script> |
| 248 |
|
| 249 |
<script type="text/x-template" id="tmpl-wpuf-field-radio"> |
| 250 |
<div class="panel-field-opt panel-field-opt-radio"> |
| 251 |
<label v-if="option_field.title"> |
| 252 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 253 |
</label> |
| 254 |
|
| 255 |
<ul :class="[option_field.inline ? 'list-inline' : '']"> |
| 256 |
<li v-for="(option, key) in option_field.options"> |
| 257 |
<label> |
| 258 |
<input type="radio" :value="key" v-model="value"> {{ option }} |
| 259 |
</label> |
| 260 |
</li> |
| 261 |
</ul> |
| 262 |
</div> |
| 263 |
</script> |
| 264 |
|
| 265 |
<script type="text/x-template" id="tmpl-wpuf-field-range"> |
| 266 |
<div v-if="met_dependencies" class="panel-field-opt panel-field-opt-text"> |
| 267 |
<label> |
| 268 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 269 |
{{ option_field.min_column }} |
| 270 |
<input |
| 271 |
type="range" |
| 272 |
v-model="value" |
| 273 |
v-bind:min="minColumn" |
| 274 |
v-bind:max="maxColumn" |
| 275 |
> |
| 276 |
</label> |
| 277 |
</div> |
| 278 |
</script> |
| 279 |
|
| 280 |
<script type="text/x-template" id="tmpl-wpuf-field-select"> |
| 281 |
<div class="panel-field-opt panel-field-opt-select"> |
| 282 |
<label v-if="option_field.title"> |
| 283 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 284 |
</label> |
| 285 |
|
| 286 |
<select class="opt-select-element" v-model="value"> |
| 287 |
<option value=""><?php _e( 'Select an option', 'wp-user-frontend' ); ?></option> |
| 288 |
<option v-for="(option, key) in option_field.options" :value="key">{{ option }}</option> |
| 289 |
</select> |
| 290 |
</div> |
| 291 |
</script> |
| 292 |
|
| 293 |
<script type="text/x-template" id="tmpl-wpuf-field-text"> |
| 294 |
<div v-if="met_dependencies" class="panel-field-opt panel-field-opt-text"> |
| 295 |
<label> |
| 296 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 297 |
|
| 298 |
<input |
| 299 |
v-if="option_field.variation && 'number' === option_field.variation" |
| 300 |
type="number" |
| 301 |
v-model="value" |
| 302 |
@focusout="on_focusout" |
| 303 |
@keyup="on_keyup" |
| 304 |
> |
| 305 |
|
| 306 |
<input |
| 307 |
v-if="!option_field.variation" |
| 308 |
type="text" |
| 309 |
v-model="value" |
| 310 |
@focusout="on_focusout" |
| 311 |
@keyup="on_keyup" |
| 312 |
> |
| 313 |
</label> |
| 314 |
</div> |
| 315 |
</script> |
| 316 |
|
| 317 |
<script type="text/x-template" id="tmpl-wpuf-field-text-meta"> |
| 318 |
<div class="panel-field-opt panel-field-opt-text panel-field-opt-text-meta"> |
| 319 |
<label> |
| 320 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 321 |
<input |
| 322 |
type="text" |
| 323 |
v-model="value" |
| 324 |
> |
| 325 |
</label> |
| 326 |
</div> |
| 327 |
</script> |
| 328 |
|
| 329 |
<script type="text/x-template" id="tmpl-wpuf-field-textarea"> |
| 330 |
<div class="panel-field-opt panel-field-opt-textarea"> |
| 331 |
<label> |
| 332 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 333 |
|
| 334 |
<textarea :rows="option_field.rows || 5" v-model="value"></textarea> |
| 335 |
</label> |
| 336 |
</div> |
| 337 |
</script> |
| 338 |
|
| 339 |
<script type="text/x-template" id="tmpl-wpuf-field-visibility"> |
| 340 |
<div class="panel-field-opt panel-field-opt-radio"> |
| 341 |
<label v-if="option_field.title"> |
| 342 |
{{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text> |
| 343 |
</label> |
| 344 |
|
| 345 |
<ul :class="[option_field.inline ? 'list-inline' : '']"> |
| 346 |
<li v-for="(option, key) in option_field.options"> |
| 347 |
<label> |
| 348 |
<input type="radio" :value="key" v-model="selected"> {{ option }} |
| 349 |
</label> |
| 350 |
</li> |
| 351 |
</ul> |
| 352 |
|
| 353 |
<div v-if="'logged_in' === selected" class="condiotional-logic-container"> |
| 354 |
|
| 355 |
<?php $roles = get_editable_roles(); ?> |
| 356 |
|
| 357 |
<ul> |
| 358 |
<?php |
| 359 |
foreach ( $roles as $role => $value ) { |
| 360 |
$role_name = $value['name']; |
| 361 |
|
| 362 |
$output = '<li>'; |
| 363 |
$output .= "<label><input type='checkbox' v-model='choices' value='{$role}'> {$role_name} </label>"; |
| 364 |
$output .= '</li>'; |
| 365 |
|
| 366 |
echo $output; |
| 367 |
} |
| 368 |
?> |
| 369 |
</ul> |
| 370 |
</div> |
| 371 |
|
| 372 |
<div v-if="'subscribed_users' === selected" class="condiotional-logic-container"> |
| 373 |
|
| 374 |
<ul> |
| 375 |
<?php |
| 376 |
|
| 377 |
if ( class_exists( 'WPUF_Subscription' ) ) { |
| 378 |
$subscriptions = WPUF_Subscription::init()->get_subscriptions(); |
| 379 |
|
| 380 |
if ( $subscriptions ) { |
| 381 |
foreach ( $subscriptions as $pack ) { |
| 382 |
$output = '<li>'; |
| 383 |
$output .= "<label><input type='checkbox' v-model='choices' value='{$pack->ID}' > {$pack->post_title} </label>"; |
| 384 |
$output .= '</li>'; |
| 385 |
|
| 386 |
echo $output; |
| 387 |
} |
| 388 |
} else { |
| 389 |
_e( 'No subscription plan found.', 'wp-user-frontend' ); |
| 390 |
} |
| 391 |
} |
| 392 |
?> |
| 393 |
</ul> |
| 394 |
|
| 395 |
</div> |
| 396 |
</div></script> |
| 397 |
|
| 398 |
<script type="text/x-template" id="tmpl-wpuf-form-checkbox_field"> |
| 399 |
<div class="wpuf-fields"> |
| 400 |
<ul :class="['wpuf-fields-list', ('yes' === field.inline) ? 'wpuf-list-inline' : '']"> |
| 401 |
<li v-if="has_options" v-for="(label, val) in field.options"> |
| 402 |
<label> |
| 403 |
<input |
| 404 |
type="checkbox" |
| 405 |
:value="val" |
| 406 |
:checked="is_selected(val)" |
| 407 |
:class="class_names('checkbox_btns')" |
| 408 |
> {{ label }} |
| 409 |
</label> |
| 410 |
</li> |
| 411 |
</ul> |
| 412 |
|
| 413 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 414 |
</div> |
| 415 |
</script> |
| 416 |
|
| 417 |
<script type="text/x-template" id="tmpl-wpuf-form-column_field"> |
| 418 |
<div v-bind:class="['wpuf-field-columns', 'has-columns-'+field.columns]"> |
| 419 |
<div class="wpuf-column-field-inner-columns"> |
| 420 |
<div class="wpuf-column"> |
| 421 |
<!-- don't change column class names --> |
| 422 |
<div v-for="column in columnClasses" :class="[column, 'items-of-column-'+field.columns, 'wpuf-column-inner-fields']" :style="{ width: field.inner_columns_size[column], paddingRight: field.column_space+'px'}"> |
| 423 |
<ul class="wpuf-column-fields-sortable-list"> |
| 424 |
<li |
| 425 |
v-for="(field, index) in column_fields[column]" |
| 426 |
:key="field.id" |
| 427 |
:class="[ |
| 428 |
'column-field-items', 'wpuf-el', field.name, field.css, 'form-field-' + field.template, |
| 429 |
field.width ? 'field-size-' + field.width : '', |
| 430 |
parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : '' |
| 431 |
]" |
| 432 |
:column-field-index="index" |
| 433 |
:in-column="column" |
| 434 |
data-source="column-field-stage" |
| 435 |
> |
| 436 |
<div v-if="!is_full_width(field.template)" class="wpuf-label wpuf-column-field-label"> |
| 437 |
<label v-if="!is_invisible(field)" :for="'wpuf-' + field.name ? field.name : 'cls'"> |
| 438 |
{{ field.label }} <span v-if="field.required && 'yes' === field.required" class="required">*</span> |
| 439 |
</label> |
| 440 |
</div> |
| 441 |
|
| 442 |
<component v-if="is_template_available(field)" :is="'form-' + field.template" :field="field"></component> |
| 443 |
|
| 444 |
<div v-if="is_pro_feature(field.template)" class="stage-pro-alert"> |
| 445 |
<label class="wpuf-pro-text-alert"> |
| 446 |
<a :href="pro_link" target="_blank"><strong>{{ get_field_name(field.template) }}</strong> <?php _e( 'is available in Pro Version', 'wp-user-frontend' ); ?></a> |
| 447 |
</label> |
| 448 |
</div> |
| 449 |
|
| 450 |
<div class="wpuf-column-field-control-buttons"> |
| 451 |
<p> |
| 452 |
<i class="fa fa-arrows move"></i> |
| 453 |
<i class="fa fa-pencil" @click="open_column_field_settings(field, index, column)"></i> |
| 454 |
<i class="fa fa-clone" @click="clone_column_field(field, index, column)"></i> |
| 455 |
<i class="fa fa-trash-o" @click="delete_column_field(index, column)"></i> |
| 456 |
</p> |
| 457 |
</div> |
| 458 |
</li> |
| 459 |
|
| 460 |
</ul> |
| 461 |
</div> |
| 462 |
</div> |
| 463 |
</div> |
| 464 |
</div></script> |
| 465 |
|
| 466 |
<script type="text/x-template" id="tmpl-wpuf-form-custom_hidden_field"> |
| 467 |
<div class="wpuf-fields"> |
| 468 |
<input |
| 469 |
type="text" |
| 470 |
:class="class_names('textfield')" |
| 471 |
:placeholder="field.placeholder" |
| 472 |
:value="field.default" |
| 473 |
:size="field.size" |
| 474 |
> |
| 475 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 476 |
</div> |
| 477 |
</script> |
| 478 |
|
| 479 |
<script type="text/x-template" id="tmpl-wpuf-form-custom_html"> |
| 480 |
<div class="wpuf-fields" v-html="field.html"></div> |
| 481 |
</script> |
| 482 |
|
| 483 |
<script type="text/x-template" id="tmpl-wpuf-form-dropdown_field"> |
| 484 |
<div class="wpuf-fields"> |
| 485 |
<select |
| 486 |
:class="class_names('select_lbl')" |
| 487 |
> |
| 488 |
<option v-if="field.first" value="">{{ field.first }}</option> |
| 489 |
|
| 490 |
<option |
| 491 |
v-if="has_options" |
| 492 |
v-for="(label, val) in field.options" |
| 493 |
:value="label" |
| 494 |
:selected="is_selected(label)" |
| 495 |
>{{ label }}</option> |
| 496 |
</select> |
| 497 |
|
| 498 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 499 |
</div> |
| 500 |
</script> |
| 501 |
|
| 502 |
<script type="text/x-template" id="tmpl-wpuf-form-email_address"> |
| 503 |
<div class="wpuf-fields"> |
| 504 |
<input |
| 505 |
type="email" |
| 506 |
:class="class_names('email')" |
| 507 |
:placeholder="field.placeholder" |
| 508 |
:value="field.default" |
| 509 |
:size="field.size" |
| 510 |
> |
| 511 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 512 |
</div> |
| 513 |
</script> |
| 514 |
|
| 515 |
<script type="text/x-template" id="tmpl-wpuf-form-featured_image"> |
| 516 |
<div class="wpuf-fields"> |
| 517 |
<div :id="'wpuf-img_label-' + field.id + '-upload-container'"> |
| 518 |
<div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes"> |
| 519 |
<a class="button file-selector" href="#"> |
| 520 |
<template v-if="field.button_label === ''"> |
| 521 |
<?php _e( 'Select Image', 'wp-user-frontend' ); ?> |
| 522 |
</template> |
| 523 |
<template v-else> |
| 524 |
{{ field.button_label }} |
| 525 |
</template> |
| 526 |
</a> |
| 527 |
</div> |
| 528 |
</div> |
| 529 |
|
| 530 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 531 |
</div> |
| 532 |
</script> |
| 533 |
|
| 534 |
<script type="text/x-template" id="tmpl-wpuf-form-fields"> |
| 535 |
<div class="wpuf-form-builder-form-fields"> |
| 536 |
<template v-for="(section, index) in panel_sections"> |
| 537 |
<div v-if="section.fields.length" class="panel-form-field-group clearfix"> |
| 538 |
<h3 class="clearfix" @click="panel_toggle(index)"> |
| 539 |
{{ section.title }} <i :class="[section.show ? 'fa fa-angle-down' : 'fa fa-angle-right']"></i> |
| 540 |
</h3> |
| 541 |
|
| 542 |
<transition name="slide-fade"> |
| 543 |
<ul |
| 544 |
v-show="section.show" |
| 545 |
class="panel-form-field-buttons clearfix" |
| 546 |
:id="'panel-form-field-buttons-' + section.id" |
| 547 |
> |
| 548 |
<template v-for="field in section.fields"> |
| 549 |
<li |
| 550 |
v-if="is_pro_feature(field)" |
| 551 |
class="button button-faded" |
| 552 |
:data-form-field="field" |
| 553 |
data-source="panel" |
| 554 |
@click="alert_pro_feature(field)" |
| 555 |
> |
| 556 |
<i v-if="field_settings[field].icon" :class="['fa fa-' + field_settings[field].icon]" aria-hidden="true"></i> {{ field_settings[field].title }} |
| 557 |
</li> |
| 558 |
|
| 559 |
<li |
| 560 |
v-if="is_failed_to_validate(field)" |
| 561 |
:class="['button', get_invalidate_btn_class(field)]" |
| 562 |
:data-form-field="field" |
| 563 |
data-source="panel" |
| 564 |
@click="alert_invalidate_msg(field)" |
| 565 |
> |
| 566 |
<i v-if="field_settings[field].icon" :class="['fa fa-' + field_settings[field].icon]" aria-hidden="true"></i> {{ field_settings[field].title }} |
| 567 |
</li> |
| 568 |
|
| 569 |
<li |
| 570 |
v-if="!is_pro_feature(field) && !is_failed_to_validate(field)" |
| 571 |
class="button" |
| 572 |
:data-form-field="field" |
| 573 |
data-source="panel" |
| 574 |
@click="add_form_field(field)" |
| 575 |
> |
| 576 |
<i v-if="field_settings[field].icon" :class="['fa fa-' + field_settings[field].icon]" aria-hidden="true"></i> {{ field_settings[field].title }} |
| 577 |
</li> |
| 578 |
</template> |
| 579 |
</ul> |
| 580 |
</transition> |
| 581 |
</div> |
| 582 |
</template> |
| 583 |
</div> |
| 584 |
</script> |
| 585 |
|
| 586 |
<script type="text/x-template" id="tmpl-wpuf-form-image_upload"> |
| 587 |
<div class="wpuf-fields"> |
| 588 |
<div :id="'wpuf-img_label-' + field.id + '-upload-container'"> |
| 589 |
<div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes"> |
| 590 |
<a class="button file-selector wpuf_img_label_148" href="#"> |
| 591 |
<template v-if="field.button_label === ''"> |
| 592 |
<?php _e( 'Select Image', 'wp-user-frontend' ); ?> |
| 593 |
</template> |
| 594 |
<template v-else> |
| 595 |
{{ field.button_label }} |
| 596 |
</template> |
| 597 |
</a> |
| 598 |
</div> |
| 599 |
</div> |
| 600 |
|
| 601 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 602 |
</div> |
| 603 |
</script> |
| 604 |
|
| 605 |
<script type="text/x-template" id="tmpl-wpuf-form-multiple_select"> |
| 606 |
<div class="wpuf-fields"> |
| 607 |
<select |
| 608 |
:class="class_names('multi_label')" |
| 609 |
multiple |
| 610 |
> |
| 611 |
<option v-if="field.first" value="">{{ field.first }}</option> |
| 612 |
|
| 613 |
<option |
| 614 |
v-if="has_options" |
| 615 |
v-for="(label, val) in field.options" |
| 616 |
:value="label" |
| 617 |
:selected="is_selected(label)" |
| 618 |
>{{ label }}</option> |
| 619 |
</select> |
| 620 |
|
| 621 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 622 |
</div> |
| 623 |
</script> |
| 624 |
|
| 625 |
<script type="text/x-template" id="tmpl-wpuf-form-post_content"> |
| 626 |
<div class="wpuf-fields"> |
| 627 |
<div class="wp-media-buttons" v-if="field.insert_image == 'yes'"> |
| 628 |
<button type="button" class="button insert-media add_media" data-editor="content"> |
| 629 |
<span class="dashicons dashicons-admin-media insert-photo-icon"></span> <?php _e( 'Insert Photo', 'wp-user-frontend' ); ?> |
| 630 |
</button> |
| 631 |
</div> |
| 632 |
<br v-if="field.insert_image == 'yes'" /> |
| 633 |
|
| 634 |
<textarea |
| 635 |
v-if="'no' === field.rich" |
| 636 |
:class="class_names('textareafield')" |
| 637 |
:placeholder="field.placeholder" |
| 638 |
:default_text="field.default" |
| 639 |
:rows="field.rows" |
| 640 |
:cols="field.cols" |
| 641 |
>{{ field.default }}</textarea> |
| 642 |
|
| 643 |
<text-editor v-if="'no' !== field.rich" :rich="field.rich" :default_text="field.default"></text-editor> |
| 644 |
|
| 645 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 646 |
</div> |
| 647 |
</script> |
| 648 |
|
| 649 |
<script type="text/x-template" id="tmpl-wpuf-form-post_excerpt"> |
| 650 |
<div class="wpuf-fields"> |
| 651 |
<textarea |
| 652 |
:class="class_names('textareafield')" |
| 653 |
:placeholder="field.placeholder" |
| 654 |
:rows="field.rows" |
| 655 |
:cols="field.cols" |
| 656 |
>{{ field.default }}</textarea> |
| 657 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 658 |
</div> |
| 659 |
</script> |
| 660 |
|
| 661 |
<script type="text/x-template" id="tmpl-wpuf-form-post_tags"> |
| 662 |
<div class="wpuf-fields"> |
| 663 |
<input |
| 664 |
type="text" |
| 665 |
:class="class_names('textfield')" |
| 666 |
:placeholder="field.placeholder" |
| 667 |
:value="field.default" |
| 668 |
:size="field.size" |
| 669 |
> |
| 670 |
|
| 671 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 672 |
</div> |
| 673 |
</script> |
| 674 |
|
| 675 |
<script type="text/x-template" id="tmpl-wpuf-form-post_title"> |
| 676 |
<div class="wpuf-fields"> |
| 677 |
<input |
| 678 |
type="text" |
| 679 |
:class="class_names('textfield')" |
| 680 |
:placeholder="field.placeholder" |
| 681 |
:value="field.default" |
| 682 |
:size="field.size" |
| 683 |
> |
| 684 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 685 |
</div> |
| 686 |
</script> |
| 687 |
|
| 688 |
<script type="text/x-template" id="tmpl-wpuf-form-radio_field"> |
| 689 |
<div class="wpuf-fields"> |
| 690 |
<ul :class="['wpuf-fields-list', ('yes' === field.inline) ? 'wpuf-list-inline' : '']"> |
| 691 |
<li v-if="has_options" v-for="(label, val) in field.options"> |
| 692 |
<label> |
| 693 |
<input |
| 694 |
type="radio" |
| 695 |
:value="val" |
| 696 |
:checked="is_selected(val)" |
| 697 |
:class="class_names('radio_btns')" |
| 698 |
> {{ label }} |
| 699 |
</label> |
| 700 |
</li> |
| 701 |
</ul> |
| 702 |
|
| 703 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 704 |
</div> |
| 705 |
</script> |
| 706 |
|
| 707 |
<script type="text/x-template" id="tmpl-wpuf-form-recaptcha"> |
| 708 |
<div class="wpuf-fields"> |
| 709 |
<template v-if="!has_recaptcha_api_keys"> |
| 710 |
<p v-html="no_api_keys_msg"></p> |
| 711 |
</template> |
| 712 |
|
| 713 |
<template v-else> |
| 714 |
<div v-if="'invisible_recaptcha' != field.recaptcha_type"> |
| 715 |
<img class="wpuf-recaptcha-placeholder" src="<?php echo WPUF_ASSET_URI . '/images/recaptcha-placeholder.png'; ?>" alt=""> |
| 716 |
</div> |
| 717 |
<div v-else><p><?php _e( 'Invisible reCaptcha', 'wp-user-frontend' ); ?></p></div> |
| 718 |
</template> |
| 719 |
</div> |
| 720 |
</script> |
| 721 |
|
| 722 |
<script type="text/x-template" id="tmpl-wpuf-form-humanpresence"> |
| 723 |
<div class="wpuf-fields"> |
| 724 |
<template v-if="!has_humanpresence_installed"> |
| 725 |
<p v-html="no_humanpresence_installed_msg"></p> |
| 726 |
</template> |
| 727 |
|
| 728 |
<template v-else> |
| 729 |
<div><p><i aria-hidden="true" class="fa fa-humanpresence"></i> <?php _e( 'Human Presence Anti-Spam Enabled (only visible to you).', 'wp-user-frontend' ); ?></p></div> |
| 730 |
</template> |
| 731 |
</div> |
| 732 |
</script> |
| 733 |
|
| 734 |
<script type="text/x-template" id="tmpl-wpuf-form-section_break"> |
| 735 |
<div class="wpuf-section-wrap"> |
| 736 |
<h2 class="wpuf-section-title">{{ field.label }}</h2> |
| 737 |
<div class="wpuf-section-details">{{ field.description }}</div> |
| 738 |
</div> |
| 739 |
</script> |
| 740 |
|
| 741 |
<script type="text/x-template" id="tmpl-wpuf-form-taxonomy"> |
| 742 |
<div class="wpuf-fields"> |
| 743 |
<select |
| 744 |
:class="field.name" |
| 745 |
v-html ="get_term_dropdown_options()" |
| 746 |
> |
| 747 |
</select> |
| 748 |
|
| 749 |
<div v-if="'ajax' === field.type" class="category-wrap"> |
| 750 |
<div> |
| 751 |
<select> |
| 752 |
<option><?php _e( '— Select —', 'wp-user-frontend' ); ?></option> |
| 753 |
<option v-for="term in sorted_terms" :value="term.id">{{ term.name }}</option> |
| 754 |
</select> |
| 755 |
</div> |
| 756 |
</div> |
| 757 |
|
| 758 |
<div v-if="'multiselect' === field.type" class="category-wrap"> |
| 759 |
<select |
| 760 |
:class="field.name" |
| 761 |
v-html="get_term_dropdown_options()" |
| 762 |
multiple |
| 763 |
> |
| 764 |
</select> |
| 765 |
</div> |
| 766 |
|
| 767 |
<div v-if="'checkbox' === field.type" class="category-wrap"> |
| 768 |
<div v-if="'yes' === field.show_inline" class="category-wrap"> |
| 769 |
<div v-html="get_term_checklist_inline()"></div> |
| 770 |
</div> |
| 771 |
<div v-else-if="'no' === field.show_inline" class="category-wrap"> |
| 772 |
<div v-html="get_term_checklist()"></div> |
| 773 |
</div> |
| 774 |
</div> |
| 775 |
|
| 776 |
|
| 777 |
<input |
| 778 |
v-if="'text' === field.type" |
| 779 |
class="textfield" |
| 780 |
type="text" |
| 781 |
value="" |
| 782 |
size="40" |
| 783 |
autocomplete="off" |
| 784 |
> |
| 785 |
|
| 786 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 787 |
</div> |
| 788 |
</script> |
| 789 |
|
| 790 |
<script type="text/x-template" id="tmpl-wpuf-form-text_field"> |
| 791 |
<div class="wpuf-fields"> |
| 792 |
<input |
| 793 |
type="text" |
| 794 |
:class="class_names('textfield')" |
| 795 |
:placeholder="field.placeholder" |
| 796 |
:value="field.default" |
| 797 |
:size="field.size" |
| 798 |
> |
| 799 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 800 |
</div> |
| 801 |
</script> |
| 802 |
|
| 803 |
<script type="text/x-template" id="tmpl-wpuf-form-textarea_field"> |
| 804 |
<div class="wpuf-fields"> |
| 805 |
<textarea |
| 806 |
v-if="'no' === field.rich" |
| 807 |
:class="class_names('textareafield')" |
| 808 |
:placeholder="field.placeholder" |
| 809 |
:deault="field.default" |
| 810 |
:rows="field.rows" |
| 811 |
:cols="field.cols" |
| 812 |
>{{ field.default }}</textarea> |
| 813 |
|
| 814 |
<text-editor v-if="'no' !== field.rich" :default_text="field.default" :rich="field.rich"></text-editor> |
| 815 |
|
| 816 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 817 |
</div> |
| 818 |
</script> |
| 819 |
|
| 820 |
<script type="text/x-template" id="tmpl-wpuf-form-website_url"> |
| 821 |
<div class="wpuf-fields"> |
| 822 |
<input |
| 823 |
type="url" |
| 824 |
:class="class_names('url')" |
| 825 |
:placeholder="field.placeholder" |
| 826 |
:value="field.default" |
| 827 |
:size="field.size" |
| 828 |
> |
| 829 |
<span v-if="field.help" class="wpuf-help">{{ field.help }}</span> |
| 830 |
</div> |
| 831 |
</script> |
| 832 |
|
| 833 |
<script type="text/x-template" id="tmpl-wpuf-help-text"> |
| 834 |
<i class="fa fa-question-circle field-helper-text wpuf-tooltip" data-placement="top" :title="text"></i> |
| 835 |
</script> |
| 836 |
|
| 837 |
<script type="text/x-template" id="tmpl-wpuf-text-editor"> |
| 838 |
<div class="wpuf-text-editor"> |
| 839 |
|
| 840 |
<div class="wp-core-ui wp-editor-wrap tmce-active"> |
| 841 |
<link rel="stylesheet" :href="site_url + 'wp-includes/css/editor.css'" type="text/css" media="all"> |
| 842 |
<link rel="stylesheet" :href="site_url + 'wp-includes/js/tinymce/skins/lightgray/skin.min.css'" type="text/css" media="all"> |
| 843 |
|
| 844 |
<div class="wp-editor-container"> |
| 845 |
<div class="mce-tinymce mce-container mce-panel" style="visibility: hidden; border-width: 1px;"> |
| 846 |
<div class="mce-container-body mce-stack-layout"> |
| 847 |
<div class="mce-toolbar-grp mce-container mce-panel mce-stack-layout-item"> |
| 848 |
<div class="mce-container-body mce-stack-layout"> |
| 849 |
<div class="mce-container mce-toolbar mce-stack-layout-item"> |
| 850 |
<div class="mce-container-body mce-flow-layout"> |
| 851 |
<div class="mce-container mce-flow-layout-item mce-btn-group"> |
| 852 |
<div> |
| 853 |
<div v-if="is_full" class="mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox mce-btn-has-text"><button type="button"><span class="mce-txt">Paragraph</span> <i class="mce-caret"></i></button></div> |
| 854 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-bold"></i></button></div> |
| 855 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-italic"></i></button></div> |
| 856 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-bullist"></i></button></div> |
| 857 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-numlist"></i></button></div> |
| 858 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-blockquote"></i></button></div> |
| 859 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-alignleft"></i></button></div> |
| 860 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-aligncenter"></i></button></div> |
| 861 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-alignright"></i></button></div> |
| 862 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-link"></i></button></div> |
| 863 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-unlink"></i></button></div> |
| 864 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-wp_more"></i></button></div> |
| 865 |
<div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-fullscreen"></i></button></div> |
| 866 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-wp_adv"></i></button></div> |
| 867 |
</div> |
| 868 |
</div> |
| 869 |
</div> |
| 870 |
</div> |
| 871 |
<div class="mce-container mce-toolbar mce-stack-layout-item"> |
| 872 |
<div class="mce-container-body mce-flow-layout"> |
| 873 |
<div class="mce-container mce-flow-layout-item mce-btn-group"> |
| 874 |
<div> |
| 875 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-strikethrough"></i></button></div> |
| 876 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-hr"></i></button></div> |
| 877 |
<div v-if="is_full" class="mce-widget mce-btn mce-colorbutton"><button type="button"><i class="mce-ico mce-i-forecolor"></i><span class="mce-preview"></span></button><button type="button" class="mce-open"> <i class="mce-caret"></i></button></div> |
| 878 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-pastetext"></i></button></div> |
| 879 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-removeformat"></i></button></div> |
| 880 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-charmap"></i></button></div> |
| 881 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-outdent"></i></button></div> |
| 882 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-indent"></i></button></div> |
| 883 |
<div class="mce-widget mce-btn mce-disabled"><button type="button"><i class="mce-ico mce-i-undo"></i></button></div> |
| 884 |
<div class="mce-widget mce-btn mce-disabled"><button type="button"><i class="mce-ico mce-i-redo"></i></button></div> |
| 885 |
<div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-wp_help"></i></button></div> |
| 886 |
</div> |
| 887 |
</div> |
| 888 |
</div> |
| 889 |
</div> |
| 890 |
</div> |
| 891 |
</div> |
| 892 |
<div class="mce-edit-area mce-container mce-panel mce-stack-layout-item" style="border-width: 1px 0px 0px;"> |
| 893 |
<div style="width: 100%; height: 150px; display: block;">{{default_text}}</div><!-- iframe replacement div --> |
| 894 |
</div> |
| 895 |
<div class="mce-statusbar mce-container mce-panel mce-stack-layout-item" style="border-width: 1px 0px 0px;"> |
| 896 |
<div class="mce-container-body mce-flow-layout"> |
| 897 |
<div class="mce-path mce-flow-layout-item"> |
| 898 |
<div class="mce-path-item" data-index="0" aria-level="0">p</div> |
| 899 |
</div> |
| 900 |
<div class="mce-flow-layout-item mce-resizehandle"><i class="mce-ico mce-i-resize"></i></div> |
| 901 |
</div> |
| 902 |
</div> |
| 903 |
</div> |
| 904 |
</div> |
| 905 |
</div> |
| 906 |
</div> |
| 907 |
</div> |
| 908 |
</script> |
| 909 |
|