mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Merge pull request #3882 from JohnONolan/fix-profile
Fix up user profile
This commit is contained in:
commit
25e08d6af5
2 changed files with 85 additions and 89 deletions
|
@ -20,103 +20,99 @@
|
|||
</section>
|
||||
</header>
|
||||
|
||||
<section class="content settings-user">
|
||||
<figure class="user-cover" {{bind-attr style=cover}}>
|
||||
<button class="user-cover-edit js-modal-cover" {{action "openModal" "upload" user "cover"}}>Change Cover</button>
|
||||
</figure>
|
||||
|
||||
<header class="user-profile-header">
|
||||
<img id="user-cover" class="cover-image" {{bind-attr src=cover title=coverTitle}} />
|
||||
<button type="button" class="edit-cover-image js-modal-cover button" {{action "openModal" "upload" user "cover"}}>Change Cover</button>
|
||||
</header>
|
||||
<form class="user-profile" novalidate="novalidate" autocomplete="off">
|
||||
|
||||
<form class="user-profile" novalidate="novalidate" autocomplete="off">
|
||||
{{!-- Horrible hack to prevent Chrome from incorrectly auto-filling inputs --}}
|
||||
<input style="display:none;" type="text" name="fakeusernameremembered"/>
|
||||
<input style="display:none;" type="password" name="fakepasswordremembered"/>
|
||||
|
||||
{{!-- Horrible hack to prevent Chrome from incorrectly auto-filling inputs --}}
|
||||
<input style="display:none;" type="text" name="fakeusernameremembered"/>
|
||||
<input style="display:none;" type="password" name="fakepasswordremembered"/>
|
||||
<fieldset class="user-details-top">
|
||||
|
||||
<fieldset class="user-details-top">
|
||||
<figure class="user-image">
|
||||
<div id="user-image" class="img" {{bind-attr style=image}} href="#"><span class="hidden">{{name}}"s Picture</span></div>
|
||||
<button type="button" {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</button>
|
||||
</figure>
|
||||
|
||||
<figure class="user-image">
|
||||
<div id="user-image" class="img" {{bind-attr style=image}} href="#"><span class="hidden">{{name}}"s Picture</span></div>
|
||||
<button type="button" {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</button>
|
||||
</figure>
|
||||
<div class="form-group">
|
||||
<label for="user-name" class="sr-only">Full Name</label>
|
||||
{{input value=user.name id="user-name" class="user-name" placeholder="Full Name" autocorrect="off"}}
|
||||
<p>Use your real name so people can recognise you</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-name">Full Name</label>
|
||||
{{input value=user.name id="user-name" class="user-name" placeholder="Full Name" autocorrect="off"}}
|
||||
<p>Use your real name so people can recognise you</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</fieldset>
|
||||
<fieldset class="user-details-bottom">
|
||||
|
||||
<fieldset class="user-details-bottom">
|
||||
<div class="form-group">
|
||||
<label for="user-slug">Slug</label>
|
||||
{{gh-blur-input class="user-name" id="user-slug" value=slugValue name="user" action="updateSlug" placeholder="Slug" selectOnClick="true" autocorrect="off"}}
|
||||
<p>{{gh-blog-url}}/author/{{slugValue}}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-slug">Slug</label>
|
||||
{{gh-blur-input class="user-name" id="user-slug" value=slugValue name="user" action="updateSlug" placeholder="Slug" selectOnClick="true" autocorrect="off"}}
|
||||
<p>{{gh-blog-url}}/author/{{slugValue}}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-email">Email</label>
|
||||
{{input type="email" value=user.email id="user-email" placeholder="Email Address" autocapitalize="off" autocorrect="off" autocomplete="off"}}
|
||||
<p>Used for notifications</p>
|
||||
</div>
|
||||
{{#if view.rolesDropdownIsVisible}}
|
||||
<div class="form-group">
|
||||
<label for="user-role">Role</label>
|
||||
{{gh-role-selector
|
||||
initialValue=role
|
||||
onChange="changeRole"
|
||||
selectId="user-role"}}
|
||||
<p>What permissions should this user have?</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="form-group">
|
||||
<label for="user-location">Location</label>
|
||||
{{input type="text" value=user.location id="user-location"}}
|
||||
<p>Where in the world do you live?</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-email">Email</label>
|
||||
{{input type="email" value=user.email id="user-email" placeholder="Email Address" autocapitalize="off" autocorrect="off" autocomplete="off"}}
|
||||
<p>Used for notifications</p>
|
||||
</div>
|
||||
{{#if view.rolesDropdownIsVisible}}
|
||||
<div class="form-group">
|
||||
<label for="user-role">Role</label>
|
||||
{{gh-role-selector
|
||||
initialValue=role
|
||||
onChange="changeRole"
|
||||
selectId="user-role"}}
|
||||
<p>What permissions should this user have?</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="form-group">
|
||||
<label for="user-location">Location</label>
|
||||
{{input type="text" value=user.location id="user-location"}}
|
||||
<p>Where in the world do you live?</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-website">Website</label>
|
||||
{{input type="url" value=user.website id="user-website" autocapitalize="off" autocorrect="off" autocomplete="off"}}
|
||||
<p>Have a website or blog other than this one? Link it!</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-website">Website</label>
|
||||
{{input type="url" value=user.website id="user-website" autocapitalize="off" autocorrect="off" autocomplete="off"}}
|
||||
<p>Have a website or blog other than this one? Link it!</p>
|
||||
</div>
|
||||
<div class="form-group bio-container">
|
||||
<label for="user-bio">Bio</label>
|
||||
{{textarea id="user-bio" value=user.bio}}
|
||||
<p>
|
||||
Write about you, in 200 characters or less.
|
||||
{{gh-count-characters user.bio}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group bio-container">
|
||||
<label for="user-bio">Bio</label>
|
||||
{{textarea id="user-bio" value=user.bio}}
|
||||
<p>
|
||||
Write about you, in 200 characters or less.
|
||||
{{gh-count-characters user.bio}}
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<hr />
|
||||
</fieldset>
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="user-password-old">Old Password</label>
|
||||
{{input value=user.password type="password" id="user-password-old"}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-password-old">Old Password</label>
|
||||
{{input value=user.password type="password" id="user-password-old"}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-password-new">New Password</label>
|
||||
{{input value=user.newPassword type="password" id="user-password-new"}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-password-new">New Password</label>
|
||||
{{input value=user.newPassword type="password" id="user-password-new"}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-new-password-verification">Verify Password</label>
|
||||
{{input value=user.ne2Password type="password" id="user-new-password-verification"}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn btn-red button-change-password" {{action "password"}}>Change Password</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user-new-password-verification">Verify Password</label>
|
||||
{{input value=user.ne2Password type="password" id="user-new-password-verification"}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn btn-red button-change-password" {{action "password"}}>Change Password</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</section>
|
||||
</form>
|
|
@ -285,7 +285,7 @@ CasperTest.begin('User settings screen resets all whitespace slug to original va
|
|||
}, false);
|
||||
});
|
||||
|
||||
casper.thenClick('.content.settings-user');
|
||||
casper.thenClick('body');
|
||||
|
||||
casper.then(function checkSlugInputValue() {
|
||||
casper.wait(250);
|
||||
|
@ -309,7 +309,7 @@ CasperTest.begin('User settings screen change slug handles duplicate slug', 4, f
|
|||
}, false);
|
||||
});
|
||||
|
||||
casper.thenClick('.content.settings-user');
|
||||
casper.thenClick('body');
|
||||
|
||||
casper.waitForResource(/\/slugs\/user\//, function testGoodResponse(resource) {
|
||||
test.assert(400 > resource.status);
|
||||
|
@ -394,11 +394,11 @@ CasperTest.begin('Ensure user bio field length validation', 3, function suite(te
|
|||
test.assertUrlMatch(/ghost\/settings\/users\/test-user\/$/, 'Ghost doesn\'t require login this time');
|
||||
});
|
||||
|
||||
casper.waitForSelector('.settings-content .settings-user', function then() {
|
||||
casper.then(function setBioToInvalid() {
|
||||
this.fillSelectors('form.user-profile', {
|
||||
'#user-bio': new Array(202).join('a')
|
||||
});
|
||||
}, casper.failOnTimeout(test, 'waitForSelector .settings-content .settings-user timed out'));
|
||||
});
|
||||
|
||||
casper.thenClick('.page-actions .btn-blue');
|
||||
|
||||
|
@ -413,11 +413,11 @@ CasperTest.begin('Ensure user url field validation', 3, function suite(test) {
|
|||
test.assertUrlMatch(/ghost\/settings\/users\/test-user\/$/, 'Ghost doesn\'t require login this time');
|
||||
});
|
||||
|
||||
casper.waitForSelector('.settings-content .settings-user', function then() {
|
||||
casper.then(function setWebsiteToInvalid() {
|
||||
this.fillSelectors('form.user-profile', {
|
||||
'#user-website': 'notaurl'
|
||||
});
|
||||
}, casper.failOnTimeout(test, 'waitForSelector .settings-content .settings-user timed out'));
|
||||
});
|
||||
|
||||
casper.thenClick('.page-actions .btn-blue');
|
||||
|
||||
|
@ -432,11 +432,11 @@ CasperTest.begin('Ensure user location field length validation', 3, function sui
|
|||
test.assertUrlMatch(/ghost\/settings\/users\/test-user\/$/, 'Ghost doesn\'t require login this time');
|
||||
});
|
||||
|
||||
casper.waitForSelector('.settings-content .settings-user', function then() {
|
||||
casper.then(function setLocationToInvalid() {
|
||||
this.fillSelectors('form.user-profile', {
|
||||
'#user-location': new Array(1002).join('a')
|
||||
});
|
||||
}, casper.failOnTimeout(test, 'waitForSelector .settings-content .settings-user timed out'));
|
||||
});
|
||||
|
||||
casper.thenClick('.page-actions .btn-blue');
|
||||
|
||||
|
|
Loading…
Reference in a new issue