<commit_before>extends ../../layouts/default

block content
	.container
		+flash-messages(messages)
		.row
			.col-sm-3
				.profile-form__section.sticky-content
					h4.heading-bordered= current.user.name.full
					p
						| You have started #{plural(current.user.topicCount, '* topic', '* topics')} 
						| and replied #{current.user.replyCount}
						| since joining on #{current.user._.joinedAt.format('D MMMM YYYY')}
					p: a(href=current.user.url).btn.btn-default
						span.entypo.entypo-user
						| View your profile
					//- p: button(type='button').btn.btn-link.btn-block.js-show-password-form Change Password
					
								
								
								
			.col-sm-9
				form(method='post', enctype='multipart/form-data', autocomplete='off', novalidate).profile-form.form-horizontal
					input(type='hidden', name='action', value='user.update')
					.profile-form__section
						h4.heading-bordered Your Profile
						.form-group
							label.col-sm-2.control-label Name
							.col-sm-10: .row
								.col-xs-6: input(type='text', name='name.first' value=current.user.name.first).form-control
								.col-xs-6: input(type='text', name='name.last' value=current.user.name.last).form-control
						.form-group
							label.col-sm-2.control-label Email
							.col-sm-10
								input(type='email', name='email' value=current.user.email).form-control.form-control-labelled
						.form-group
							label.col-sm-2.control-label Website
							.col-sm-10
								input(type='text', name='website' value=current.user.website).form-control.form-control-labelled
						.form-group
							label.col-sm-2.control-label Password
							.col-sm-10
								button(type='button', data-toggle='modal', data-target='#modal-password').btn.btn-link= current.user.password ? 'Change your password' : 'Set your password'
					
					.profile-form__section
						h4.heading-bordered Your Services
						p.help-block.mb-2 You can authenticate yourself on the KeystoneJS Forum with any of the services you connect. When connected, links to your Twitter and Github will be displayed on your profile.
						
						
						//- Unconfigured Services
						
						if !current.user.services.github.isConfigured
							.form-group
								label.col-sm-2.control-label Github
								.col-sm-10
									a(href=(current.user.services.github.isConfigured ? '?deauth=' : '/auth/') + 'github', title='Connect your Github account').btn.btn-github
										span.entypo-social.entypo-github
										| Connect your Github account
						if !current.user.services.twitter.isConfigured
							.form-group
								label.col-sm-2.control-label Twitter
								.col-sm-10
									a(href=(current.user.services.twitter.isConfigured ? '?deauth=' : '/auth/') + 'twitter', title='Connect your Twitter account').btn.btn-twitter
										span.entypo-social.entypo-twitter
										| Connect your Twitter account
						if !current.user.services.google.isConfigured
							.form-group
								label.col-sm-2.control-label Google
								.col-sm-10
									a(href=(current.user.services.google.isConfigured ? '?deauth=' : '/auth/') + 'google', title='Connect your Google account').btn.btn-google
										span(class='entypo-google-circles').entypo-social
										| Connect your Google account
						
						
						//- Configured Services
						
						if current.user.services.twitter.isConfigured || current.user.services.github.isConfigured || current.user.services.google.isConfigured
							hr.line-dashed
						if current.user.services.github.isConfigured
							.form-group
								label.col-sm-2.control-label Github
								.col-sm-10.text-muted.faux-label
									span.entypo-social.entypo-github
									|  Github account is connected. 
									a(href='?deauth=github', title='Revoke authorization of your Github account') Disconnect
						if current.user.services.twitter.isConfigured
							.form-group
								label.col-sm-2.control-label Twitter
								.col-sm-10.text-muted.faux-label
									span.entypo-social.entypo-twitter
									|  Twitter account is connected. 
									a(href='?deauth=twitter', title='Revoke authorization of your Twitter account') Disconnect
						if current.user.services.google.isConfigured
							.form-group
								label.col-sm-2.control-label Google
								.col-sm-10.text-muted.faux-label
									span.entypo-social.entypo-google
									|  Google account is connected. 
									a(href='?deauth=google', title='Revoke authorization of your Google account') Disconnect
						
					.profile-form__section
						h4.heading-bordered Public info
						.form-group
							label.col-sm-2.control-label Bio
								br
								a(href='http://daringfireball.net/projects/markdown/syntax', target='_blank', title='Markdown Guide (new window)').text-muted (markdown)
							.col-sm-10
								textarea(name='bio', rows=5).form-control=current.user.bio.md
						
						.form-group
							label.col-sm-2.control-label Photo
							.col-sm-10
								if current.user.photo.exists
									.row
										.col-sm-3: img(src=current.user._.photo.fill(120,120)).img-avatar
										.col-sm-9: input(type='file', name='photo_upload')
								else
									input(type='file', name='photo_upload')
						
					.profile-form__section
						h4.heading-bordered Email notifications
						.form-group
							label.col-sm-2.control-label Email me when
							.col-sm-10
								label.checkbox
									input(type='checkbox' name='notifications.topics', value='true', checked=current.user.notifications.topics ? 'checked' : null)
									|  Someone starts a topic
								.help-block You will receive an email for each new topic created on the forum
								label.checkbox
									input(type='checkbox' name='notifications.replies', value='true', checked='checked', disabled)
									|  Someone replies to a topic I've started
								.help-block By default you are watching topics you create. You can unwatch them at any time.


					.form-group
						.col-sm-10.col-sm-offset-2
							button(type='submit', data-loading-text="Saving...").btn.btn-primary Save profile


block modal
	#modal-password(tabindex="-1", role="dialog", aria-labelledby="passwordUpdate", aria-hidden="true").modal
		.modal-dialog
			.modal-content
				.modal-header
					button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
					h4.modal-title=current.user.password ? 'Change your password' : 'Set your password'
				.modal-body
					form(method='post', enctype='multipart/form-data', autocomplete='off', novalidate).profile-form
						input(type='hidden', name='action', value='user.password')
						if current.user.password
							.form-group
								label(for='change-password').sr-only Current Password
								input(type='password', name='currentPassword', placeholder='<PASSWORD>', id='change-password').form-control
						.form-group
							label(for='change-passwordNew').sr-only New Password
							input(type='password', name='password', placeholder='<PASSWORD>', id='change-passwordNew').form-control
						.form-group
							label(for='change-passwordConfirm').sr-only Confirm Password
							input(type='password', name='password_confirm', placeholder='<PASSWORD>', id='signin-passwordConfirm').form-control
						button(type='submit', data-loading-text="Saving...").btn.btn-primary Change
	
block js
	script(src='/js/lib/bootstrap/affix.js')
	script(src='/js/lib/bootstrap/modal.js')
	script.
		jQuery(function($){
			
			//- show password form
			$('.js-show-password-form').click(function() {
				$('.password-form').show().find('.form-control').eq(0).focus();
				$(this).hide();
			});
			
			//- fix the left col
			$('.sticky-content').each(function() {
				var self = $(this);
				self.affix({
					offset: {
						top: self.offset().top - 20
					}
				});
			});
			
		});<commit_msg>Focus the 1st field on the reset password modal<commit_after>extends ../../layouts/default

block content
	.container
		+flash-messages(messages)
		.row
			.col-sm-3
				.profile-form__section.sticky-content
					h4.heading-bordered= current.user.name.full
					p
						| You have started #{plural(current.user.topicCount, '* topic', '* topics')} 
						| and replied #{current.user.replyCount}
						| since joining on #{current.user._.joinedAt.format('D MMMM YYYY')}
					p: a(href=current.user.url).btn.btn-default
						span.entypo.entypo-user
						| View your profile
					//- p: button(type='button').btn.btn-link.btn-block.js-show-password-form Change Password
					
								
								
								
			.col-sm-9
				form(method='post', enctype='multipart/form-data', autocomplete='off', novalidate).profile-form.form-horizontal
					input(type='hidden', name='action', value='user.update')
					.profile-form__section
						h4.heading-bordered Your Profile
						.form-group
							label.col-sm-2.control-label Name
							.col-sm-10: .row
								.col-xs-6: input(type='text', name='name.first' value=current.user.name.first).form-control
								.col-xs-6: input(type='text', name='name.last' value=current.user.name.last).form-control
						.form-group
							label.col-sm-2.control-label Email
							.col-sm-10
								input(type='email', name='email' value=current.user.email).form-control.form-control-labelled
						.form-group
							label.col-sm-2.control-label Website
							.col-sm-10
								input(type='text', name='website' value=current.user.website).form-control.form-control-labelled
						.form-group
							label.col-sm-2.control-label Password
							.col-sm-10
								button(type='button', data-toggle='modal', data-target='#modal-password').btn.btn-link= current.user.password ? 'Change your password' : 'Set your password'
					
					.profile-form__section
						h4.heading-bordered Your Services
						p.help-block.mb-2 You can authenticate yourself on the KeystoneJS Forum with any of the services you connect. When connected, links to your Twitter and Github will be displayed on your profile.
						
						
						//- Unconfigured Services
						
						if !current.user.services.github.isConfigured
							.form-group
								label.col-sm-2.control-label Github
								.col-sm-10
									a(href=(current.user.services.github.isConfigured ? '?deauth=' : '/auth/') + 'github', title='Connect your Github account').btn.btn-github
										span.entypo-social.entypo-github
										| Connect your Github account
						if !current.user.services.twitter.isConfigured
							.form-group
								label.col-sm-2.control-label Twitter
								.col-sm-10
									a(href=(current.user.services.twitter.isConfigured ? '?deauth=' : '/auth/') + 'twitter', title='Connect your Twitter account').btn.btn-twitter
										span.entypo-social.entypo-twitter
										| Connect your Twitter account
						if !current.user.services.google.isConfigured
							.form-group
								label.col-sm-2.control-label Google
								.col-sm-10
									a(href=(current.user.services.google.isConfigured ? '?deauth=' : '/auth/') + 'google', title='Connect your Google account').btn.btn-google
										span(class='entypo-google-circles').entypo-social
										| Connect your Google account
						
						
						//- Configured Services
						
						if current.user.services.twitter.isConfigured || current.user.services.github.isConfigured || current.user.services.google.isConfigured
							hr.line-dashed
						if current.user.services.github.isConfigured
							.form-group
								label.col-sm-2.control-label Github
								.col-sm-10.text-muted.faux-label
									span.entypo-social.entypo-github
									|  Github account is connected. 
									a(href='?deauth=github', title='Revoke authorization of your Github account') Disconnect
						if current.user.services.twitter.isConfigured
							.form-group
								label.col-sm-2.control-label Twitter
								.col-sm-10.text-muted.faux-label
									span.entypo-social.entypo-twitter
									|  Twitter account is connected. 
									a(href='?deauth=twitter', title='Revoke authorization of your Twitter account') Disconnect
						if current.user.services.google.isConfigured
							.form-group
								label.col-sm-2.control-label Google
								.col-sm-10.text-muted.faux-label
									span.entypo-social.entypo-google
									|  Google account is connected. 
									a(href='?deauth=google', title='Revoke authorization of your Google account') Disconnect
						
					.profile-form__section
						h4.heading-bordered Public info
						.form-group
							label.col-sm-2.control-label Bio
								br
								a(href='http://daringfireball.net/projects/markdown/syntax', target='_blank', title='Markdown Guide (new window)').text-muted (markdown)
							.col-sm-10
								textarea(name='bio', rows=5).form-control=current.user.bio.md
						
						.form-group
							label.col-sm-2.control-label Photo
							.col-sm-10
								if current.user.photo.exists
									.row
										.col-sm-3: img(src=current.user._.photo.fill(120,120)).img-avatar
										.col-sm-9: input(type='file', name='photo_upload')
								else
									input(type='file', name='photo_upload')
						
					.profile-form__section
						h4.heading-bordered Email notifications
						.form-group
							label.col-sm-2.control-label Email me when
							.col-sm-10
								label.checkbox
									input(type='checkbox' name='notifications.topics', value='true', checked=current.user.notifications.topics ? 'checked' : null)
									|  Someone starts a topic
								.help-block You will receive an email for each new topic created on the forum
								label.checkbox
									input(type='checkbox' name='notifications.replies', value='true', checked='checked', disabled)
									|  Someone replies to a topic I've started
								.help-block By default you are watching topics you create. You can unwatch them at any time.


					.form-group
						.col-sm-10.col-sm-offset-2
							button(type='submit', data-loading-text="Saving...").btn.btn-primary Save profile


block modal
	#modal-password(tabindex="-1", role="dialog", aria-labelledby="passwordUpdate", aria-hidden="true").modal
		.modal-dialog
			.modal-content
				.modal-header
					button(type="button", data-dismiss="modal", aria-hidden="true").close &times;
					h4.modal-title=current.user.password ? 'Change your password' : 'Set your password'
				.modal-body
					form(method='post', enctype='multipart/form-data', autocomplete='off', novalidate).profile-form
						input(type='hidden', name='action', value='user.password')
						//- if current.user.password
							.form-group
								label(for='change-password').sr-only Current Password
								input(type='password', name='currentPassword', placeholder='<PASSWORD>', id='change-password').form-control
						.form-group
							label(for='change-passwordNew').sr-only New Password
							input(type='password', name='password', placeholder='<PASSWORD>', id='change-passwordNew').form-control
						.form-group
							label(for='change-passwordConfirm').sr-only Confirm Password
							input(type='password', name='password_confirm', placeholder='<PASSWORD>', id='signin-passwordConfirm').form-control
						button(type='submit', data-loading-text="Saving...").btn.btn-primary Change
						button(type="button", data-dismiss="modal", aria-hidden="true").btn.btn-link Cancel
	
block js
	script(src='/js/lib/bootstrap/affix.js')
	script(src='/js/lib/bootstrap/modal.js')
	script.
		jQuery(function($){
			
			//- password form
			$('#modal-password').on('shown.bs.modal', function() {
				$(this).find('.form-control').eq(0).focus();
			});
			
			//- fix the left col
			$('.sticky-content').each(function() {
				var self = $(this);
				self.affix({
					offset: {
						top: self.offset().top - 20
					}
				});
			});
			
		});
{'fraction_non_alphanumeric': 0.14001910219675262, 'fraction_numerical': 0.008468640560331104, 'mean_word_length': 2.6679121905651564, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3085425', 'n_tokens_mistral': 6707, 'n_tokens_neox': 4702, 'n_words': 876}