0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -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 e12f8bb624
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'); var authorRole = roles.findBy('name', 'Author');
//Initialize role as well. //Initialize role as well.
self.set('role', authorRole); self.set('role', authorRole);
self.set('authorRole', authorRole);
return authorRole; return authorRole;
}); });
}), }),
@ -48,10 +49,14 @@ var InviteNewUserController = Ember.Controller.extend({
}).catch(function (errors) { }).catch(function (errors) {
newUser.deleteRecord(); newUser.deleteRecord();
self.notifications.showErrors(errors); 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 () { confirmReject: function () {

View file

@ -4,7 +4,7 @@
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
<label for="new-user-email">Email Address</label> <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}} autocapitalize="off" autocorrect="off" value=email}}
</div> </div>

View file

@ -2,7 +2,7 @@
{{#link-to 'settings' class='button-back button'}}Back{{/link-to}} {{#link-to 'settings' class='button-back button'}}Back{{/link-to}}
<h2 class="title">Users</h2> <h2 class="title">Users</h2>
<section class="page-actions"> <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> </section>
</header> </header>