simplify account.jade view for github integration
This commit is contained in:
@@ -2,112 +2,27 @@ extends ../layout
|
||||
block content
|
||||
script.
|
||||
var challengeName = 'Account View'
|
||||
.panel.panel-info.min-height-1000(ng-controller="profileValidationController")
|
||||
.panel.panel-info(ng-controller="profileValidationController")
|
||||
.panel-heading.text-center Update your portfolio here:
|
||||
.panel-body
|
||||
.container.text-center
|
||||
if (!user.github)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/auth/github')
|
||||
i.fa.fa-github
|
||||
| Link GitHub with my account
|
||||
.col-xs-12
|
||||
form.form-horizontal(action='/account/profile', method='POST', novalidate='novalidate', name='profileForm' ng-show="asyncComplete")
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
|
||||
.col-sm-4.col-sm-offset-5
|
||||
h2 Bio
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='name') Name *
|
||||
.col-sm-4
|
||||
input.form-control(type='text', placeholder='Name', name='name', autocomplete="off", ng-model='user.name', ng-minlength='3', ng-maxlength='50', required='required', id='name')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.name.$invalid && profileForm.name.$error.required")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled(id='#name-error')
|
||||
| Your name is required.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show='profileForm.name.$error.minlength && !profileForm.name.$pristine')
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your name must be at least 3 characters.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show='profileForm.name.$error.maxlength && !profileForm.name.$pristine')
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your name must be fewer than 50 characters.
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='username') Username (path to public profile) *
|
||||
.col-sm-4
|
||||
input.form-control(type='text', placeholder='username' name='username', autocomplete="off", id='username', ng-model='user.username', required='required', ng-minlength='5', ng-maxlength='20', ng-keypress='', unique-username='', ng-pattern="/^[A-z0-9_]+$/", ng-disabled='user.isGithubCool')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.pattern")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your username should only contain letters, numbers and underscores (az10_).
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.required")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your username is required.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.minlength && !profileForm.username.$pristine")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your username must be at least 5 characters.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.maxlength && !profileForm.username.$pristine")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your username must be fewer than 15 characters.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.unique && !profileForm.username.$pristine && $scope.storedUsername !== user.username")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| That username is already in use.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="user.isGithubCool")
|
||||
alert(type='info')
|
||||
span.ion-close-circled
|
||||
| You are GithubCool! Your username cannot be changed.
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Email *
|
||||
.col-sm-4
|
||||
input.form-control(type='email', name='email', id='email', autocomplete="off", ng-model='user.email', required='required', ng-keypress='', unique-email='')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.email.$error.required")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your email address is required.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.$error.email && !profileForm.email.$pristine")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Please enter a valid email format.
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.email.$error.unique && !profileForm.email.$pristine")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| That email is already in use.
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='location') Location
|
||||
.col-sm-4
|
||||
input.form-control(type='text', name='location', autocomplete="off", id='location', ng-model='user.location')
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Link to Profile Photo (1:1 ratio)
|
||||
.col-sm-4
|
||||
input.form-control(type='url', name='picture', id='picture', ng-model='user.picture', placeholder='http://www.example.com/image.jpg')
|
||||
.col-sm-4.col-sm-offset-5(ng-show="profileForm.picture.$error.url && !profileForm.picture.$pristine")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Please enter a valid URL format (http://www.example.com/image.jpg).
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='bio') Bio (140 characters)
|
||||
label.col-sm-3.col-sm-offset-1.control-label(for='bio') Bio (140 characters)
|
||||
.col-sm-4
|
||||
input.form-control(type='text', name='bio', autocomplete="off", ng-model='user.bio', ng-maxlength='140', id='bio')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show='profileForm.bio.$error.maxlength && !profileForm.bio.$pristine')
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your bio must be fewer than 140 characters.
|
||||
|
||||
.form-group
|
||||
.col-sm-offset-5.col-sm-4
|
||||
button.btn.btn-primary.btn-block(type='submit', ng-disabled='profileForm.$invalid')
|
||||
span.ion-edit
|
||||
| Update my Bio
|
||||
|
||||
.col-sm-4.col-sm-offset-5
|
||||
h2 Social Profiles
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Twitter
|
||||
label.col-sm-3.col-sm-offset-1.control-label(for='email') Twitter
|
||||
.col-sm-4
|
||||
.input-group.twitter-input
|
||||
span.input-group-addon @
|
||||
@@ -120,17 +35,9 @@ block content
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Your name must be fewer than 15 characters.
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') GitHub
|
||||
.col-sm-4
|
||||
input.form-control(type='url', name='githubProfile', id='githubProfile', autocomplete="off", ng-model='user.githubProfile', placeholder='http://')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.githubProfile.$error.url && !profileForm.githubProfile.$pristine")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| Please enter a valid URL format (http://www.example.com).
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') CodePen
|
||||
label.col-sm-3.col-sm-offset-1.control-label(for='email') CodePen
|
||||
.col-sm-4
|
||||
input.form-control(type='url', name='codepenProfile', id='codepenProfile', autocomplete="off", ng-model='user.codepenProfile', placeholder='http://')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.codepenProfile.$error.url && !profileForm.codepenProfile.$pristine")
|
||||
@@ -139,7 +46,7 @@ block content
|
||||
| Please enter a valid URL format (http://www.example.com).
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') LinkedIn
|
||||
label.col-sm-3.col-sm-offset-1.control-label(for='email') LinkedIn
|
||||
.col-sm-4
|
||||
input.form-control(type='url', name='linkedinProfile', id='linkedinProfile', autocomplete="off", ng-model='user.linkedinProfile', placeholder='http://')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.linkedinProfile.$error.url && !profileForm.linkedinProfile.$pristine")
|
||||
@@ -148,7 +55,7 @@ block content
|
||||
| Please enter a valid URL format (http://www.example.com).
|
||||
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Facebook
|
||||
label.col-sm-3.col-sm-offset-1.control-label(for='email') Facebook
|
||||
.col-sm-4
|
||||
input.form-control(type='url', name='facebookProfile', id='facebookProfile', autocomplete="off", ng-model='user.facebookProfile', placeholder='http://')
|
||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.facebookProfile.$error.url && !profileForm.facebookProfile.$pristine")
|
||||
@@ -156,21 +63,14 @@ block content
|
||||
span.ion-close-circled
|
||||
| Please enter a valid URL format (http://www.example.com).
|
||||
|
||||
.form-group
|
||||
.col-sm-offset-5.col-sm-4
|
||||
button.btn.btn-primary.btn-block(type='submit', ng-disabled='profileForm.$invalid')
|
||||
span.ion-edit
|
||||
| Update my Social Links
|
||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(type='submit', ng-disabled='profileForm.$invalid')
|
||||
i.fa.fa-submit
|
||||
| Update my info
|
||||
|
||||
.panel.panel-info
|
||||
.panel-heading.text-center Manage your account here:
|
||||
.panel-body
|
||||
if (!user.google || !user.facebook || !user.linkedin || !user.twitter)
|
||||
if (!user.github)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/auth/github')
|
||||
i.fa.fa-github
|
||||
| Link GitHub with my account
|
||||
if (!user.twitter)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-twitter.btn-link-social.disabled(href='#')
|
||||
|
Reference in New Issue
Block a user