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"}}} {{permission.description}} - + {{#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}}
diff --git a/app/assets/stylesheets/application/modal.css.scss b/app/assets/stylesheets/application/modal.css.scss index df574efb6a6..92e059b6f15 100644 --- a/app/assets/stylesheets/application/modal.css.scss +++ b/app/assets/stylesheets/application/modal.css.scss @@ -263,16 +263,17 @@ } } -.permission-selector{ - width: 300px; -} .permission-list{ list-style:none; - margin: 0 0 15px; + margin: 0 0 30px; padding: 0; .name { + margin-right: 20px; display: inline-block; - min-width: 80px; + min-width: 100px; + } + .permission { + margin-left: 20px; } .icon-remove-sign { margin-left: 5px; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 1d5a9735fd8..e83302dc6df 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -905,12 +905,10 @@ en: change_in_category_topic: "Edit Description" hotness: "Hotness" already_used: 'This color has been used by another category' - is_secure: "Secure category?" - add_group: "Add Group" security: "Security" - allowed_groups: "Allowed Groups:" auto_close_label: "Auto-close topics after:" - + edit_permissions: "Edit Permissions" + add_permission: "Add Permission" flagging: title: 'Why are you flagging this post?' @@ -999,9 +997,9 @@ en: browser_update: 'Unfortunately, your browser is too old to work on this Discourse forum. Please upgrade your browser.' permission_types: - full: "CREATE / REPLY / SEE" - create_post: "REPLY / SEE" - readonly: "SEE" + full: "Create / Reply / See" + create_post: "Reply / See" + readonly: "See" # This section is exported to the javascript for i18n in the admin section admin_js: