<commit_before>define([
	'jquery',
	'Global/SQ',
	'SQ/Broadcaster',
	'SQ/Util',
	'ThirdParty/jquery.validate',
	'jqueryui'
], function(
	$,
	SQ,
	Broadcaster,
	Util
) {
	'use strict';

	return function ParentsForm() {

		var _me = this;
		var _util = new Util();
		var _$parents_form = null;
		var _father_data = {};
		var _mother_data = {};

		SQ.mixin(_me, new Broadcaster(['save_father', 'mother_father']));

		(function _init() {
		})();

		this.initialize = function($e) {
			_$parents_form = $e;
			_$parents_form.find('#father-form').validate({
				rules: {
					username : {
						required: true,
						remote: {
							url: '/ajax/login/editUsernameNotExist',
							type: 'post',
							data: {login_id: $e.find('[name="login_id"]').val()}
						}
					},
					password: {
						required: true
					},
					first_name: {
						required: true
					},
					last_name: {
						required: true
					},
					email: {
						required: true,
						email: true,
						remote: {
							url: '/ajax/login/editEmailNotExist',
							type: 'post',
							data: {login_id: $e.find('[name="login_id"]').val()}
						}
					},
					phone: {
						required: true,
						number: true
					}
				},
				messages: {
					username: {
						remote: 'Username has been taken'
					},
					email: {
						remote: 'Email has been taken'
					}
				},
				submitHandler: function(form) {
					_father_data = _util.serializeJSON($(form));
					_father_data.active = _$parents_form.find("#father-form [name='active']").prop('checked') ? 1 : 0;
					_father_data.type = 'father';
					_me.broadcast('save_father', _father_data);
				}
			});

			_$parents_form.find('#mother-form').validate({
				rules: {
					username : {
						required: true,
						remote: {
							url: '/ajax/login/editUsernameNotExist',
							type: 'post',
							data: {login_id: $e.find('[name="login_id"]').val()}
						}
					},
					password: {
						required: true
					},
					first_name: {
						required: true
					},
					last_name: {
						required: true
					},
					email: {
						required: true,
						email: true,
						remote: {
							url: '/ajax/login/editEmailNotExist',
							type: 'post',
							data: {login_id: $e.find('[name="login_id"]').val()}
						}
					},
					phone: {
						required: true,
						number: true
					}
				},
				messages: {
					username: {
						remote: 'Username has been taken'
					},
					email: {
						remote: 'Email has been taken'
					}
				},
				submitHandler: function(form) {
					_mother_data = _util.serializeJSON($(form));
					_mother_data.active = _$parents_form.find("#mother-form [name='active']").prop('checked') ? 1 : 0;
					_mother_data.type = 'mother';<commit_msg>Fixed mother form validation<commit_after>define([
	'jquery',
	'Global/SQ',
	'SQ/Broadcaster',
	'SQ/Util',
	'ThirdParty/jquery.validate',
	'jqueryui'
], function(
	$,
	SQ,
	Broadcaster,
	Util
) {
	'use strict';

	return function ParentsForm() {

		var _me = this;
		var _util = new Util();
		var _$parents_form = null;
		var _father_data = {};
		var _mother_data = {};

		SQ.mixin(_me, new Broadcaster(['save_father', 'mother_father']));

		(function _init() {
		})();

		this.initialize = function($e) {
			_$parents_form = $e;
			_$parents_form.find('#father-form').validate({
				rules: {
					username : {
						required: true,
						remote: {
							url: '/ajax/login/editUsernameNotExist',
							type: 'post',
							data: {login_id: $e.find('#father-form [name="login_id"]').val()}
						}
					},
					password: {
						required: true
					},
					first_name: {
						required: true
					},
					last_name: {
						required: true
					},
					email: {
						required: true,
						email: true,
						remote: {
							url: '/ajax/login/editEmailNotExist',
							type: 'post',
							data: {login_id: $e.find('#father-form [name="login_id"]').val()}
						}
					},
					phone: {
						required: true,
						number: true
					}
				},
				messages: {
					username: {
						remote: 'Username has been taken'
					},
					email: {
						remote: 'Email has been taken'
					}
				},
				submitHandler: function(form) {
					_father_data = _util.serializeJSON($(form));
					_father_data.active = _$parents_form.find("#father-form [name='active']").prop('checked') ? 1 : 0;
					_father_data.type = 'father';
					_me.broadcast('save_father', _father_data);
				}
			});

			_$parents_form.find('#mother-form').validate({
				rules: {
					username : {
						required: true,
						remote: {
							url: '/ajax/login/editUsernameNotExist',
							type: 'post',
							data: {login_id: $e.find('#mother-form [name="login_id"]').val()}
						}
					},
					password: {
						required: true
					},
					first_name: {
						required: true
					},
					last_name: {
						required: true
					},
					email: {
						required: true,
						email: true,
						remote: {
							url: '/ajax/login/editEmailNotExist',
							type: 'post',
							data: {login_id: $e.find('#mother-form [name="login_id"]').val()}
						}
					},
					phone: {
						required: true,
						number: true
					}
				},
				messages: {
					username: {
						remote: 'Username has been taken'
					},
					email: {
						remote: 'Email has been taken'
					}
				},
				submitHandler: function(form) {
					_mother_data = _util.serializeJSON($(form));
					_mother_data.active = _$parents_form.find("#mother-form [name='active']").prop('checked') ? 1 : 0;
					_mother_data.type = 'mother';
{'fraction_non_alphanumeric': 0.16474041460282518, 'fraction_numerical': 0.001467620620069712, 'mean_word_length': 2.2413793103448274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4440706', 'n_tokens_mistral': 2704, 'n_tokens_neox': 1833, 'n_words': 346}