added parsley validation on settings form - need to fix permissions
This commit is contained in:
@ -18,6 +18,7 @@ textarea.parsley-error
|
||||
list-style-type none
|
||||
font-size 0.9em
|
||||
line-height 0.9em
|
||||
color: #B94A48
|
||||
opacity 0
|
||||
transition all .3s ease-in
|
||||
-o-transition all .3s ease-in
|
||||
|
@ -57,13 +57,12 @@
|
||||
// on dom loaded
|
||||
$(function() {
|
||||
// save settings
|
||||
$('.mailpoet_settings_submit').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// $('.mailpoet_settings_submit').on('click', function(e) {
|
||||
$('#mailpoet_settings_form').parsley().on('form:submit', function(parsley) {
|
||||
// serialize form data
|
||||
var settings_data = $('#mailpoet_settings_form').serializeObject(),
|
||||
permissions = $('.mailpoet_role_permission'),
|
||||
permissions_data = []
|
||||
permissions_data = [];
|
||||
|
||||
// format permissions
|
||||
for(var i = permissions.length - 1; i >= 0; i--) {
|
||||
@ -108,6 +107,8 @@
|
||||
);
|
||||
MailPoet.Modal.loading(false);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// setup toggle checkboxes
|
||||
|
@ -46,7 +46,9 @@
|
||||
name="sender[name]"
|
||||
value="<%= settings.sender.name %>"
|
||||
placeholder="<%= __('Your name') %>" />
|
||||
<input type="text"
|
||||
<input type="email"
|
||||
data-parsley-type="email"
|
||||
data-parsley-error-message="<%= __('You need to specify a valid email address') %>"
|
||||
id="settings[from_email]"
|
||||
name="sender[address]"
|
||||
value="<%= settings.sender.address %>"
|
||||
@ -60,7 +62,9 @@
|
||||
name="reply_to[name]"
|
||||
value="<%= settings.reply_to.name %>"
|
||||
placeholder="<%= __('Your name') %>" />
|
||||
<input type="text"
|
||||
<input type="email"
|
||||
data-parsley-type="email"
|
||||
data-parsley-error-message="<%= __('You need to specify a valid email address') %>"
|
||||
id="settings[notification_reply_email]"
|
||||
name="reply_to[address]"
|
||||
value="<%= settings.reply_to.address %>"
|
||||
|
@ -607,8 +607,8 @@
|
||||
<td>
|
||||
<p>
|
||||
<input
|
||||
id="mailpoet_mta_test_email"
|
||||
type="text"
|
||||
id="mailpoet_mta_test_email"
|
||||
class="regular-text"
|
||||
value="<%= current_user.user_email %>"
|
||||
/>
|
||||
|
@ -59,8 +59,9 @@
|
||||
value="<%= settings.signup_confirmation.from.name %>"
|
||||
placeholder="<%= __('Your name') %>"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
<input type="email"
|
||||
data-parsley-type="email"
|
||||
data-parsley-error-message="<%= __('You need to specify a valid email address') %>"
|
||||
id="settings[signup_confirmation_from_email]"
|
||||
name="signup_confirmation[from][address]"
|
||||
value="<%= settings.signup_confirmation.from.address %>"
|
||||
@ -86,8 +87,9 @@
|
||||
value="<%= settings.signup_confirmation.reply_to.name %>"
|
||||
placeholder="<%= __('Your name') %>"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
<input type="email"
|
||||
data-parsley-type="email"
|
||||
data-parsley-error-message="<%= __('You need to specify a valid email address') %>"
|
||||
id="settings[signup_confirmation_reply_email]"
|
||||
name="signup_confirmation[reply_to][address]"
|
||||
value="<%= settings.signup_confirmation.reply_to.address %>"
|
||||
|
Reference in New Issue
Block a user