mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 14:42:46 +08:00
Merge pull request #3936 from tgxworld/add_saving_status_to_groups_admin
Add saving status to groups admin
This commit is contained in:
commit
e4adfdb624
|
@ -4,6 +4,7 @@ import { propertyEqual } from 'discourse/lib/computed';
|
|||
export default Ember.Controller.extend({
|
||||
needs: ['adminGroupsType'],
|
||||
disableSave: false,
|
||||
savingStatus: '',
|
||||
|
||||
currentPage: function() {
|
||||
if (this.get("model.user_count") === 0) { return 0; }
|
||||
|
@ -95,12 +96,15 @@ export default Ember.Controller.extend({
|
|||
groupType = groupsController.get("type");
|
||||
|
||||
this.set('disableSave', true);
|
||||
this.set('savingStatus', I18n.t('saving'));
|
||||
|
||||
let promise = group.get("id") ? group.save() : group.create().then(() => groupsController.addObject(group));
|
||||
|
||||
promise.then(() => this.transitionToRoute("adminGroup", groupType, group.get('name')))
|
||||
.catch(popupAjaxError)
|
||||
.finally(() => this.set('disableSave', false));
|
||||
promise.then(() => {
|
||||
this.transitionToRoute("adminGroup", groupType, group.get('name'));
|
||||
this.set('savingStatus', I18n.t('saved'));
|
||||
}).catch(popupAjaxError)
|
||||
.finally(() => this.set('disableSave', false));
|
||||
},
|
||||
|
||||
destroy() {
|
||||
|
|
|
@ -21,6 +21,7 @@ export default Discourse.Route.extend({
|
|||
setupController: function(controller, model) {
|
||||
controller.set("model", model);
|
||||
controller.set("model.usernames", null);
|
||||
controller.set("savingStatus", '');
|
||||
model.findMembers();
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@
|
|||
{{#unless model.automatic}}
|
||||
<button {{action "destroy"}} class='btn btn-danger'>{{fa-icon "trash-o"}}{{i18n 'admin.customize.delete'}}</button>
|
||||
{{/unless}}
|
||||
<span {{bind-attr class=":saving savingStatus::hidden"}}>{{savingStatus}}</span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
|
@ -660,8 +660,7 @@ section.details {
|
|||
width: 100% !important;
|
||||
border-color: dark-light-choose(scale-color($primary, $lightness: 75%), scale-color($secondary, $lightness: 25%));
|
||||
.item {
|
||||
width: 190px;
|
||||
margin-right: 0 !important;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.next, .previous {
|
||||
|
|
Loading…
Reference in New Issue
Block a user