0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00
Return to invite new user; invite multiple users in one go
This commit is contained in:
Hannah Wolfe 2014-08-03 17:54:59 +01:00
commit b2be3bc365
3 changed files with 10 additions and 5 deletions

View file

@ -6,6 +6,7 @@ var InviteNewUserController = Ember.Controller.extend({
var authorRole = roles.findBy('name', 'Author');
//Initialize role as well.
self.set('role', authorRole);
self.set('authorRole', authorRole);
return authorRole;
});
}),
@ -48,10 +49,14 @@ var InviteNewUserController = Ember.Controller.extend({
}).catch(function (errors) {
newUser.deleteRecord();
self.notifications.showErrors(errors);
}).finally(function () {
//Reset
self.set('email', '');
self.set('role', self.get('authorRole'));
//Make sure the modal closes on confirm, no matter the
//method used to close it (enter in input vs Confirm click)
self.send('closeModal');
});
self.set('email', null);
self.set('role', null);
},
confirmReject: function () {

View file

@ -4,7 +4,7 @@
<fieldset>
<div class="form-group">
<label for="new-user-email">Email Address</label>
{{input class="email" id="new-user-email" type="email" placeholder="Email Address" name="email" autofocus="autofocus"
{{input action="confirmAccept" class="email" id="new-user-email" type="email" placeholder="Email Address" name="email" autofocus="autofocus"
autocapitalize="off" autocorrect="off" value=email}}
</div>

View file

@ -2,7 +2,7 @@
{{#link-to 'settings' class='button-back button'}}Back{{/link-to}}
<h2 class="title">Users</h2>
<section class="page-actions">
<button class="button-add" {{action "openModal" "invite-new-user" this}} >New&nbsp;User</button>
<button class="button-add" {{action "openModal" "invite-new-user"}} >New&nbsp;User</button>
</section>
</header>