<commit_before><div class="row">
	<%= simple_form_for(@user, :html => {:class => 'form-vertical' }, :wrapper => :vertical_form, :wrapper_mappings => {:boolean => :vertical_boolean}) do |f| %>
		<div class="col-md-3">
			<%= dialog_tag("#{@user.name}", {:icon => "fa fa-user", :class => "form_part"}) do %>
				<%= render(:partial => "summary", :locals =>{:user => @user}) %>
			<% end %>
	  </div>
		<div class="col-md-6">
			<%= dialog_tag('User', {:icon => 'fa fa-user', :class => "form_part"}) do %>
				<%= f.input :first_name, :placeholder => "User's first name...", :label => "First Name" %>
				<%= f.input :last_name, :placeholder => "User's last name...", :label => "Last Name" %>
				<%= f.input :email, :as => :email, :placeholder => "User's business email address..." %>
				<%= f.input :title, :placeholder => "User's public title" %>
				<div class="row">
					<div class="col-sm-9">
						<%= f.input :phone, :as => :tel, :placeholder => "Users primary phone number..." %>
					</div>
					<div class="col-sm-3">
						<%= f.input :phone_ext, :label => "Ext." %>
					</div>
				</div>
				<%= f.input :external_id, :placeholder => "External ID..." %>
				<%= f.input :address1 %>
				<%= f.input :address2 %>
			  <div class="row">
			    <div class="col-sm-6">
			      <%= f.input :city %>
		      </div>
			    <div class="col-sm-3">
			      <%= f.input :state, :as => :select, :collection => Country['US'].states, :include_blank => false %>
		      </div>
			    <div class="col-sm-3">
			      <%= f.input :zip %>
		      </div>
	      </div>
				<%= f.input :timezone, :as => :time_zone, priority: /US/, :prompt => "Select timezone..." %>
				<div class="col-md-12">
					<%= f.button :submit, :class => "btn btn-primary" %>
			</div>
			<% end %>
		</div>
		<div class="col-md-3">
			<%= dialog_tag("Info", {:icon => "fa fa-question-circle", :class => "form_part"}) do %>

			<% end %>
		</div>

	<% end %>
</div><commit_msg>[#86712820] JS for validating zip in users<commit_after><div class="row">
	<%= simple_form_for(@user, :html => {:class => 'form-vertical user_form' }, :wrapper => :vertical_form, :wrapper_mappings => {:boolean => :vertical_boolean}) do |f| %>
		<div class="col-md-3">
			<%= dialog_tag("#{@user.name}", {:icon => "fa fa-user", :class => "form_part"}) do %>
				<%= render(:partial => "summary", :locals =>{:user => @user}) %>
			<% end %>
	  </div>
		<div class="col-md-6">
			<%= dialog_tag('User', {:icon => 'fa fa-user', :class => "form_part"}) do %>
				<%= f.input :first_name, :placeholder => "User's first name...", :label => "First Name" %>
				<%= f.input :last_name, :placeholder => "User's last name...", :label => "Last Name" %>
				<%= f.input :email, :as => :email, :placeholder => "User's business email address..." %>
				<%= f.input :title, :placeholder => "User's public title" %>
				<div class="row">
					<div class="col-sm-9">
						<%= f.input :phone, :as => :tel, :placeholder => "Users primary phone number..." %>
					</div>
					<div class="col-sm-3">
						<%= f.input :phone_ext, :label => "Ext." %>
					</div>
				</div>
				<%= f.input :external_id, :placeholder => "External ID..." %>
				<%= f.input :address1 %>
				<%= f.input :address2 %>
			  <div class="row">
			    <div class="col-sm-6">
			      <%= f.input :city %>
		      </div>
			    <div class="col-sm-3">
			      <%= f.input :state, :as => :select, :collection => Country['US'].states, :include_blank => false %>
		      </div>
			    <div class="col-sm-3">
			      <%= f.input :zip %>
		      </div>
	      </div>
				<%= f.input :timezone, :as => :time_zone, priority: /US/, :prompt => "Select timezone..." %>
				<div class="col-md-12">
					<%= f.button :submit, :class => "btn btn-primary" %>
			</div>
			<% end %>
		</div>
		<div class="col-md-3">
			<%= dialog_tag("Info", {:icon => "fa fa-question-circle", :class => "form_part"}) do %>

			<% end %>
		</div>

	<% end %>
</div>

<script>
	// Override placement of validator msg on .input-groups
	$.validator.setDefaults({errorPlacement: function(error, element) {
			console.log(element);
			if(element.parents('.input-group').length) {
				error.insertAfter(element.parents('.input-group'));
			} else {
				error.insertAfter(element);
			}
		}
	});
	$('.user_form').validate({
		submitHandler: function(form) {
			form.submit();
		}
	});

	$.validator.addMethod(
			"regex",
			function(value, element, regexp) {
				var re = new RegExp(regexp);
			return this.optional(element) || re.test(value);
		},
		"Must be a valid zip code."
	);
	$("input[name='user[zip]']").rules("add", { regex: /^\d{5}([\-]?\d{4})?$/ })
</script>
{'fraction_non_alphanumeric': 0.24611734253666953, 'fraction_numerical': 0.007333908541846419, 'mean_word_length': 2.916385135135135, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 161, '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': '2950210', 'n_tokens_mistral': 2015, 'n_tokens_neox': 1624, 'n_words': 364}