diff --git a/tailbone/static/css/perms.css b/tailbone/static/css/perms.css index b83ae7d9..45cdcb15 100644 --- a/tailbone/static/css/perms.css +++ b/tailbone/static/css/perms.css @@ -3,12 +3,13 @@ * Permission Lists ******************************/ -.field-wrapper.permissions .field .group { +.permissions-group { margin-bottom: 10px; } -.field-wrapper.permissions .field .group p { +.permissions-group .group-label { font-weight: bold; + margin-bottom: 10px; } .field-wrapper.permissions .field label { @@ -21,12 +22,12 @@ margin-right: 10px; } -.field-wrapper.permissions .field .group p.perm { +.permissions-group .perm { font-weight: normal; margin-left: 15px; } -.field-wrapper.permissions .field .group p.perm span { +.permissions-group p.perm span { font-family: monospace; margin-right: 10px; } diff --git a/tailbone/templates/deform/permissions.pt b/tailbone/templates/deform/permissions.pt index 4a9cb0f9..bafa7563 100644 --- a/tailbone/templates/deform/permissions.pt +++ b/tailbone/templates/deform/permissions.pt @@ -3,10 +3,12 @@ tal:omit-tag=""> ${field.start_mapping()} +
+
-

${permissions[groupkey]['label']}

+ class="permissions-group"> +

${permissions[groupkey]['label']}

@@ -24,5 +26,7 @@
+
+ ${field.end_mapping()}
diff --git a/tailbone/views/principal.py b/tailbone/views/principal.py index d780cfca..e22e2554 100644 --- a/tailbone/views/principal.py +++ b/tailbone/views/principal.py @@ -147,7 +147,7 @@ class PermissionsRenderer(Object): principal = self.principal html = '' for groupkey in sorted(self.permissions, key=lambda k: self.permissions[k]['label'].lower()): - inner = HTML.tag('p', c=self.permissions[groupkey]['label']) + inner = HTML.tag('p', class_='group-label', c=self.permissions[groupkey]['label']) perms = self.permissions[groupkey]['perms'] rendered = False for key in sorted(perms, key=lambda p: perms[p]['label'].lower()): @@ -160,5 +160,5 @@ class PermissionsRenderer(Object): inner += HTML.tag('p', class_='perm', c=[span, HTML(' '), label]) rendered = True if rendered: - html += HTML.tag('div', class_='group', c=[inner]) - return html or "(none granted)" + html += HTML.tag('div', class_='permissions-group', c=[inner]) + return HTML.tag('div', class_='permissions-outer', c=[html or "(none granted)"]) diff --git a/tailbone/views/roles.py b/tailbone/views/roles.py index b5e665e7..403cfde3 100644 --- a/tailbone/views/roles.py +++ b/tailbone/views/roles.py @@ -93,6 +93,8 @@ class RolesView(PrincipalMasterView): if has_permission(self.Session(), role, key, include_guest=False, include_authenticated=False): granted.append(key) f.set_default('permissions', granted) + elif self.deleting: + f.remove_field('permissions') # session_timeout f.set_renderer('session_timeout', self.render_session_timeout)