Tweak permissions styles for view/edit of User, Role
per Buefy themes, but still compatible with jQuery theme also
This commit is contained in:
parent
40ab3cda9c
commit
ea0aff1a3e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
tal:omit-tag="">
|
||||
${field.start_mapping()}
|
||||
|
||||
<div class="permissions-outer">
|
||||
|
||||
<tal:loop tal:repeat="groupkey sorted(permissions, key=lambda k: permissions[k]['label'].lower())">
|
||||
<div tal:define="perms permissions[groupkey]['perms'];"
|
||||
class="group">
|
||||
<p class="group">${permissions[groupkey]['label']}</p>
|
||||
class="permissions-group">
|
||||
<p class="group-label">${permissions[groupkey]['label']}</p>
|
||||
|
||||
<tal:loop tal:repeat="key sorted(perms, key=lambda p: perms[p]['label'].lower())">
|
||||
<div class="perm">
|
||||
|
@ -24,5 +26,7 @@
|
|||
</div>
|
||||
</tal:loop>
|
||||
|
||||
</div>
|
||||
|
||||
${field.end_mapping()}
|
||||
</div>
|
||||
|
|
|
@ -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)"])
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue