mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
improve security UI
This commit is contained in:
parent
625204c8bd
commit
2573935155
@ -105,6 +105,10 @@ Discourse.EditCategoryController = Discourse.ObjectController.extend(Discourse.M
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editPermissions: function(){
|
||||||
|
this.set('editingPermissions', true);
|
||||||
|
},
|
||||||
|
|
||||||
addPermission: function(group, permission_id){
|
addPermission: function(group, permission_id){
|
||||||
this.get('model').addPermission({group_name: group + "", permission: Discourse.PermissionType.create({id: permission_id})});
|
this.get('model').addPermission({group_name: group + "", permission: Discourse.PermissionType.create({id: permission_id})});
|
||||||
},
|
},
|
||||||
|
@ -66,13 +66,19 @@
|
|||||||
<span class="name"><span class="badge-group">{{group_name}}</span></span>
|
<span class="name"><span class="badge-group">{{group_name}}</span></span>
|
||||||
{{{i18n "category.can"}}}
|
{{{i18n "category.can"}}}
|
||||||
<span class="permission">{{permission.description}}</span>
|
<span class="permission">{{permission.description}}</span>
|
||||||
<a {{action removePermission this}}><i class="icon icon-remove-sign"></i></a>
|
{{#if controller.editingPermissions}}
|
||||||
|
<a {{action removePermission this}}><i class="icon icon-remove-sign"></i></a>
|
||||||
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{view Ember.Select contentBinding="availableGroups" valueBinding="selectedGroup"}}
|
{{#if controller.editingPermissions}}
|
||||||
{{view Ember.Select class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" contentBinding="availablePermissions" valueBinding="selectedPermission"}}
|
{{view Ember.Select contentBinding="availableGroups" valueBinding="selectedGroup"}}
|
||||||
<button {{action addPermission selectedGroup selectedPermission}} class="btn btn-small">{{i18n category.add_group}}</button>
|
{{view Ember.Select class="permission-selector" optionValuePath="content.id" optionLabelPath="content.description" contentBinding="availablePermissions" valueBinding="selectedPermission"}}
|
||||||
|
<button {{action addPermission selectedGroup selectedPermission}} class="btn btn-small">{{i18n category.add_permission}}</button>
|
||||||
|
{{else}}
|
||||||
|
<button {{action editPermissions}} class="btn btn-small">{{i18n category.edit_permissions}}</button>
|
||||||
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div {{bindAttr class=":modal-tab :options-tab settingsSelected::invisible"}}>
|
<div {{bindAttr class=":modal-tab :options-tab settingsSelected::invisible"}}>
|
||||||
|
@ -263,16 +263,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.permission-selector{
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
.permission-list{
|
.permission-list{
|
||||||
list-style:none;
|
list-style:none;
|
||||||
margin: 0 0 15px;
|
margin: 0 0 30px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
.name {
|
.name {
|
||||||
|
margin-right: 20px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 80px;
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
.permission {
|
||||||
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
.icon-remove-sign {
|
.icon-remove-sign {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
@ -905,12 +905,10 @@ en:
|
|||||||
change_in_category_topic: "Edit Description"
|
change_in_category_topic: "Edit Description"
|
||||||
hotness: "Hotness"
|
hotness: "Hotness"
|
||||||
already_used: 'This color has been used by another category'
|
already_used: 'This color has been used by another category'
|
||||||
is_secure: "Secure category?"
|
|
||||||
add_group: "Add Group"
|
|
||||||
security: "Security"
|
security: "Security"
|
||||||
allowed_groups: "Allowed Groups:"
|
|
||||||
auto_close_label: "Auto-close topics after:"
|
auto_close_label: "Auto-close topics after:"
|
||||||
|
edit_permissions: "Edit Permissions"
|
||||||
|
add_permission: "Add Permission"
|
||||||
|
|
||||||
flagging:
|
flagging:
|
||||||
title: 'Why are you flagging this post?'
|
title: 'Why are you flagging this post?'
|
||||||
@ -999,9 +997,9 @@ en:
|
|||||||
browser_update: 'Unfortunately, <a href="http://www.discourse.org/faq/#browser">your browser is too old to work on this Discourse forum</a>. Please <a href="http://browsehappy.com">upgrade your browser</a>.'
|
browser_update: 'Unfortunately, <a href="http://www.discourse.org/faq/#browser">your browser is too old to work on this Discourse forum</a>. Please <a href="http://browsehappy.com">upgrade your browser</a>.'
|
||||||
|
|
||||||
permission_types:
|
permission_types:
|
||||||
full: "CREATE / REPLY / SEE"
|
full: "Create / Reply / See"
|
||||||
create_post: "REPLY / SEE"
|
create_post: "Reply / See"
|
||||||
readonly: "SEE"
|
readonly: "See"
|
||||||
|
|
||||||
# This section is exported to the javascript for i18n in the admin section
|
# This section is exported to the javascript for i18n in the admin section
|
||||||
admin_js:
|
admin_js:
|
||||||
|
Loading…
Reference in New Issue
Block a user