| 1 |
<div> |
| 2 |
<!-- <pre>{{ notifications.length }}</pre> --> |
| 3 |
<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> |
| 4 |
|
| 5 |
<div :class="[editing ? 'editing' : '', 'notification-wrap']"> |
| 6 |
<!-- notification-wrap --> |
| 7 |
|
| 8 |
<div class="notification-table-wrap"> |
| 9 |
<table class="wp-list-table widefat fixed striped posts wpuf-cf-notification-table"> |
| 10 |
<thead> |
| 11 |
<tr> |
| 12 |
<th class="col-toggle"> </th> |
| 13 |
<th class="col-name"><?php _e( 'Name', 'weforms' ); ?></th> |
| 14 |
<th class="col-subject"><?php _e( 'Subject', 'weforms' ); ?></th> |
| 15 |
<th class="col-action"> </th> |
| 16 |
</tr> |
| 17 |
</thead> |
| 18 |
<tbody> |
| 19 |
<tr v-for="(notification, index) in notifications"> |
| 20 |
<td class="col-toggle"> |
| 21 |
<a href="#" v-on:click.prevent="toggelNotification(index)"> |
| 22 |
<img v-if="notification.active" src="<?php echo WPUF_ASSET_URI; ?>/images/active.png" width="24" alt="status"> |
| 23 |
<img v-else src="<?php echo WPUF_ASSET_URI; ?>/images/inactive.png" width="24" alt="status"> |
| 24 |
</a> |
| 25 |
</td> |
| 26 |
<td class="col-name"><a href="#" v-on:click.prevent="editItem(index)">{{ notification.name }}</a></td> |
| 27 |
<td class="col-subject">{{ notification.type === 'email' ? notification.subject : notification.smsText }}</td> |
| 28 |
<td class="col-action"> |
| 29 |
<a href="#" v-on:click.prevent="duplicate(index)" title="<?php esc_attr_e( 'Duplicate', 'weforms' ); ?>"><span class="dashicons dashicons-admin-page"></span></a> |
| 30 |
<a href="#" v-on:click.prevent="editItem(index)" title="<?php esc_attr_e( 'Settings', 'weforms' ); ?>"><span class="dashicons dashicons-admin-generic"></span></a> |
| 31 |
</td> |
| 32 |
</tr> |
| 33 |
<tr v-if="!notifications.length"> |
| 34 |
<td colspan="4"><?php _e( 'No notifications found', 'weforms' ); ?></td> |
| 35 |
</tr> |
| 36 |
</tbody> |
| 37 |
</table> |
| 38 |
</div><!-- .notification-table-wrap --> |
| 39 |
|
| 40 |
<div class="notification-edit-area" v-if="notifications[editingIndex]"> |
| 41 |
|
| 42 |
<div class="notification-head"> |
| 43 |
<input type="text" name="" v-model="notifications[editingIndex].name" v-on:keyup.enter="editDone()" value="Admin Notification"> |
| 44 |
</div> |
| 45 |
|
| 46 |
<div class="form-fields"> |
| 47 |
|
| 48 |
<div class="notification-row notification-field"> |
| 49 |
<label for="notification-title"><?php _e( 'Type', 'weforms' ); ?></label> |
| 50 |
<select type="text" v-model="notifications[editingIndex].type"> |
| 51 |
<option value="email"><?php _e( 'Email Notification', 'weforms' ); ?></option> |
| 52 |
<option value="sms"><?php _e( 'SMS Notification', 'weforms' ); ?></option> |
| 53 |
</select> |
| 54 |
</div> |
| 55 |
|
| 56 |
<template v-if="notifications[editingIndex].type == 'email' "> |
| 57 |
<div class="notification-row"> |
| 58 |
<div class="row-one-half notification-field first"> |
| 59 |
<label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label> |
| 60 |
<input type="text" v-model="notifications[editingIndex].to"> |
| 61 |
<wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="to"></wpuf-merge-tags> |
| 62 |
</div> |
| 63 |
|
| 64 |
<div class="row-one-half notification-field"> |
| 65 |
<label for="notification-title"><?php _e( 'Reply To', 'weforms' ); ?></label> |
| 66 |
<input type="email" v-model="notifications[editingIndex].replyTo"> |
| 67 |
<wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="replyTo"></wpuf-merge-tags> |
| 68 |
</div> |
| 69 |
</div> |
| 70 |
|
| 71 |
<div class="notification-row notification-field"> |
| 72 |
<label for="notification-title"><?php _e( 'Subject', 'weforms' ); ?></label> |
| 73 |
<input type="text" v-model="notifications[editingIndex].subject"> |
| 74 |
<wpuf-merge-tags v-on:insert="insertValue" field="subject"></wpuf-merge-tags> |
| 75 |
</div> |
| 76 |
|
| 77 |
<div class="notification-row notification-field"> |
| 78 |
<label for="notification-title"><?php _e( 'Email Message', 'weforms' ); ?></label> |
| 79 |
|
| 80 |
<weforms-text-editor |
| 81 |
v-model="notifications[editingIndex].message" |
| 82 |
:i18n="i18n" |
| 83 |
:editingIndex="editingIndex" |
| 84 |
> |
| 85 |
</weforms-text-editor> |
| 86 |
|
| 87 |
<wpuf-merge-tags v-on:insert="insertValueEditor" field="message"></wpuf-merge-tags> |
| 88 |
</div> |
| 89 |
</template> |
| 90 |
<template v-else> |
| 91 |
<template v-if="has_sms"> |
| 92 |
<div class="notification-row notification-field"> |
| 93 |
<label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label> |
| 94 |
<input type="text" v-model="notifications[editingIndex].smsTo"> |
| 95 |
<wpuf-merge-tags v-on:insert="insertValue" field="smsTo"></wpuf-merge-tags> |
| 96 |
</div> |
| 97 |
<div class="notification-row notification-field"> |
| 98 |
<label for="notification-title"><?php _e( 'SMS Text', 'weforms' ); ?></label> |
| 99 |
<textarea name="" rows="6" v-model="notifications[editingIndex].smsText"></textarea> |
| 100 |
<wpuf-merge-tags v-on:insert="insertValue" field="smsText"></wpuf-merge-tags> |
| 101 |
</div> |
| 102 |
</template> |
| 103 |
<template v-else> |
| 104 |
<p> |
| 105 |
<label class="wpuf-pro-text-alert"> |
| 106 |
<a :href="pro_link" target="_blank"><?php _e( 'SMS notification moule not found', 'wpuf' ); ?></a> |
| 107 |
</label> |
| 108 |
</p> |
| 109 |
</template> |
| 110 |
</template> |
| 111 |
|
| 112 |
<section class="advanced-fields"> |
| 113 |
<a href="#" class="field-toggle" v-on:click.prevent="toggleAdvanced()"><span class="dashicons dashicons-arrow-right"></span><?php _e( ' Advanced', 'weforms' ); ?></a> |
| 114 |
|
| 115 |
<div class="advanced-field-wrap"> |
| 116 |
<p class="wpuf-pro-text-alert"><?php _e( 'Make sure that your mail server is configured properly for the following "From" fields', 'weforms' ); ?></p> |
| 117 |
<template v-if="notifications[editingIndex].type == 'email' "> |
| 118 |
<div class="notification-row"> |
| 119 |
<div class="row-one-half notification-field first"> |
| 120 |
<label for="notification-title"><?php _e( 'From Name', 'weforms' ); ?></label> |
| 121 |
<input type="text" v-model="notifications[editingIndex].fromName"> |
| 122 |
<wpuf-merge-tags v-on:insert="insertValue" field="fromName"></wpuf-merge-tags> |
| 123 |
</div> |
| 124 |
|
| 125 |
<div class="row-one-half notification-field"> |
| 126 |
<label for="notification-title"><?php _e( 'From Address', 'weforms' ); ?></label> |
| 127 |
<input type="email" name="" v-model="notifications[editingIndex].fromAddress"> |
| 128 |
<wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="fromAddress"></wpuf-merge-tags> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
|
| 132 |
<div class="notification-row"> |
| 133 |
<div class="row-one-half notification-field first"> |
| 134 |
<label for="notification-title"><?php _e( 'CC', 'weforms' ); ?></label> |
| 135 |
<input type="email" name="" v-model="notifications[editingIndex].cc"> |
| 136 |
<wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="cc"></wpuf-merge-tags> |
| 137 |
</div> |
| 138 |
|
| 139 |
<div class="row-one-half notification-field"> |
| 140 |
<label for="notification-title"><?php _e( 'BCC', 'weforms' ); ?></label> |
| 141 |
<input type="email" name="" v-model="notifications[editingIndex].bcc"> |
| 142 |
<wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="bcc"></wpuf-merge-tags> |
| 143 |
</div> |
| 144 |
</div> |
| 145 |
</template> |
| 146 |
|
| 147 |
<div class="notification-row notification-field"> |
| 148 |
<template v-if="is_pro"> |
| 149 |
|
| 150 |
<notification-conditional-logics |
| 151 |
:notification="notifications[editingIndex]" |
| 152 |
> |
| 153 |
</notification-conditional-logics> |
| 154 |
|
| 155 |
</template> |
| 156 |
<template v-else> |
| 157 |
<label class="wpuf-pro-text-alert"> |
| 158 |
<a :href="pro_link" target="_blank"><?php _e( 'Conditional Logics available in Pro Version', 'wpuf' ); ?></a> |
| 159 |
</label> |
| 160 |
</template> |
| 161 |
</div> |
| 162 |
</div> |
| 163 |
</section><!-- .advanced-fields --> |
| 164 |
</div> |
| 165 |
|
| 166 |
<div class="submit-area"> |
| 167 |
<a href="#" v-on:click.prevent="deleteItem(editingIndex)" title="<?php esc_attr_e( 'Delete', 'weforms' ); ?>"><span class="dashicons dashicons-trash"></span></a> |
| 168 |
<button class="button button-secondary" v-on:click.prevent="editDone()"><?php _e( 'Done', 'weforms' ); ?></button> |
| 169 |
</div> |
| 170 |
</div><!-- .notification-edit-area --> |
| 171 |
|
| 172 |
</div><!-- .notification-wrap --> |
| 173 |
</div> |
| 174 |
|