| 1 |
<form id="wpuf-form-builder" class="wpuf-form-builder-contact_form" method="post" action="" @submit.prevent="save_form_builder" v-cloak> |
| 2 |
<fieldset :class="[is_form_saving ? 'disabled' : '']" :disabled="is_form_saving"> |
| 3 |
|
| 4 |
<h2 class="nav-tab-wrapper"> |
| 5 |
<a href="#wpuf-form-builder-container" :class="['nav-tab', isActiveTab( 'editor' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActive('editor')"> |
| 6 |
<?php _e( 'Form Editor', 'weforms' ); ?> |
| 7 |
</a> |
| 8 |
|
| 9 |
<a href="#wpuf-form-builder-settings" :class="['nav-tab', isActiveTab( 'settings' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActive('settings')"> |
| 10 |
<?php _e( 'Settings', 'weforms' ); ?> |
| 11 |
</a> |
| 12 |
|
| 13 |
<?php do_action( 'wpuf-form-builder-tabs-contact_form' ); ?> |
| 14 |
|
| 15 |
<span class="pull-right"> |
| 16 |
<a :href="'<?php echo home_url( '/' ); ?>?weforms_preview=1&form_id=' + post.ID" target="_blank" class="button"><span class="dashicons dashicons-visibility" style="padding-top: 3px;"></span> <?php _e( 'Preview', 'weforms' ); ?></a> |
| 17 |
|
| 18 |
<button v-if="!is_form_saving" type="button" class="button button-primary weforms-save-form-builder" @click="save_form_builder"> |
| 19 |
<?php _e( 'Save Form', 'weforms' ); ?> |
| 20 |
</button> |
| 21 |
|
| 22 |
<button v-else type="button" class="button button-primary button-ajax-working" disabled> |
| 23 |
<span class="loader"></span> <?php _e( 'Saving Form Data', 'weforms' ); ?> |
| 24 |
</button> |
| 25 |
</span> |
| 26 |
</h2> |
| 27 |
|
| 28 |
<div class="tab-contents" v-if="!loading"> |
| 29 |
<div id="wpuf-form-builder-container" v-show="isActiveTab('editor')"> |
| 30 |
<div id="builder-stage"> |
| 31 |
<header class="clearfix"> |
| 32 |
<span v-if="!post_title_editing" title="<?php esc_attr_e( 'Click to edit the form name', 'weforms' ); ?>" class="form-title" @click.prevent="post_title_editing = true"><span class="dashicons dashicons-edit"></span> {{ post.post_title }}</span> |
| 33 |
|
| 34 |
<span v-show="post_title_editing"> |
| 35 |
<input type="text" v-model="post.post_title" name="post_title" /> |
| 36 |
<button type="button" class="button button-small" style="margin-top: 8px;" @click.prevent="post_title_editing = false"><i class="fa fa-check"></i></button> |
| 37 |
</span> |
| 38 |
|
| 39 |
<span class="form-id" title="<?php echo esc_attr_e( 'Click to copy shortcode', 'weforms' ); ?>" :data-clipboard-text='"[weforms id=\"" + post.ID + "\"]"'><i class="fa fa-clipboard" aria-hidden="true"></i> #{{ post.ID }}</span> |
| 40 |
|
| 41 |
<span :class="{ sharing_on : settings.sharing_on }" class="ann-form-btn form-id" @click="shareForm( '<?php echo site_url( '/' ); ?>',post)" title="<?php echo esc_attr_e( 'Share Your Form', 'weforms' ); ?>"> |
| 42 |
<i class="fa fa-share-alt" aria-hidden="true"></i> |
| 43 |
<?php _e( 'Share', 'Share' ); ?> |
| 44 |
</span> |
| 45 |
|
| 46 |
</header> |
| 47 |
|
| 48 |
<ul v-if="is_form_switcher" class="form-switcher-content"> |
| 49 |
|
| 50 |
</ul> |
| 51 |
|
| 52 |
<section> |
| 53 |
<div id="form-preview"> |
| 54 |
<builder-stage></builder-stage> |
| 55 |
</div> |
| 56 |
</section> |
| 57 |
</div><!-- #builder-stage --> |
| 58 |
|
| 59 |
<div id="builder-form-fields"> |
| 60 |
<header> |
| 61 |
<ul class="clearfix"> |
| 62 |
<li :class="['form-fields' === current_panel ? 'active' : '']"> |
| 63 |
<a href="#add-fields" @click.prevent="set_current_panel('form-fields')"> |
| 64 |
<?php _e( 'Add Fields', 'weforms' ); ?> |
| 65 |
</a> |
| 66 |
</li> |
| 67 |
|
| 68 |
<li :class="['field-options' === current_panel ? 'active' : '', !form_fields_count ? 'disabled' : '']"> |
| 69 |
<a href="#field-options" @click.prevent="set_current_panel('field-options')"> |
| 70 |
<?php _e( 'Field Options', 'weforms' ); ?> |
| 71 |
</a> |
| 72 |
</li> |
| 73 |
</ul> |
| 74 |
</header> |
| 75 |
|
| 76 |
<section> |
| 77 |
<div class="wpuf-form-builder-panel"> |
| 78 |
<component :is="current_panel"></component> |
| 79 |
</div> |
| 80 |
</section> |
| 81 |
</div><!-- #builder-form-fields --> |
| 82 |
</div><!-- #wpuf-form-builder-container --> |
| 83 |
|
| 84 |
<div id="wpuf-form-builder-settings" class="clearfix" v-show="isActiveTab('settings')"> |
| 85 |
<fieldset> |
| 86 |
<h2 id="wpuf-form-builder-settings-tabs" class="nav-tab-wrapper"> |
| 87 |
<?php do_action( 'wpuf-form-builder-settings-tabs-contact_form' ); ?> |
| 88 |
</h2><!-- #wpuf-form-builder-settings-tabs --> |
| 89 |
|
| 90 |
<div id="wpuf-form-builder-settings-contents" class="tab-contents"> |
| 91 |
<?php do_action( 'wpuf-form-builder-settings-tab-contents-contact_form' ); ?> |
| 92 |
</div><!-- #wpuf-form-builder-settings-contents --> |
| 93 |
</fieldset> |
| 94 |
</div><!-- #wpuf-form-builder-settings --> |
| 95 |
|
| 96 |
<?php do_action( 'wpuf-form-builder-tab-contents-contact_form' ); ?> |
| 97 |
</div> |
| 98 |
<div v-else> |
| 99 |
|
| 100 |
<div class="updating-message"> |
| 101 |
<p><?php _e( 'Loading the editor', 'weforms' ); ?></p> |
| 102 |
</div> |
| 103 |
</div> |
| 104 |
|
| 105 |
<input type="hidden" name="form_settings_key" value="wpuf_form_settings"> |
| 106 |
|
| 107 |
<?php wp_nonce_field( 'wpuf_form_builder_save_form', 'wpuf_form_builder_nonce' ); ?> |
| 108 |
|
| 109 |
<input type="hidden" name="wpuf_form_id" :value="post.ID"> |
| 110 |
</fieldset> |
| 111 |
</form><!-- #wpuf-form-builder --> |
| 112 |
|