diff --git a/app/assets/javascripts/discourse/controllers/edit_category_controller.js b/app/assets/javascripts/discourse/controllers/edit_category_controller.js index 4c5d7080e4d..e19cb975772 100644 --- a/app/assets/javascripts/discourse/controllers/edit_category_controller.js +++ b/app/assets/javascripts/discourse/controllers/edit_category_controller.js @@ -105,6 +105,10 @@ Discourse.EditCategoryController = Discourse.ObjectController.extend(Discourse.M return false; }, + editPermissions: function(){ + this.set('editingPermissions', true); + }, + addPermission: function(group, permission_id){ this.get('model').addPermission({group_name: group + "", permission: Discourse.PermissionType.create({id: permission_id})}); }, diff --git a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars index b9b5e972025..900cb157a8b 100644 --- a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars @@ -66,13 +66,19 @@ {{group_name}} {{{i18n "category.can"}}} - + {{#if controller.editingPermissions}} + + {{/if}} {{/each}} - {{view Ember.Select contentBinding="availableGroups" valueBinding="selectedGroup"}} - {{view Ember.Select class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" contentBinding="availablePermissions" valueBinding="selectedPermission"}} - + {{#if controller.editingPermissions}} + {{view Ember.Select contentBinding="availableGroups" valueBinding="selectedGroup"}} + {{view Ember.Select class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" contentBinding="availablePermissions" valueBinding="selectedPermission"}} + + {{else}} + + {{/if}}