From 6463df7224211bd1d82cfc08cbc8c8fba2c7f290 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 22 Jun 2020 14:59:17 -0500 Subject: [PATCH] Add dropdown, autohide magic when editing Role permissions only for Buefy theme though --- tailbone/templates/deform/permissions.pt | 59 +++++++++++++++++++++++- tailbone/templates/roles/edit.mako | 11 +++++ tailbone/views/roles.py | 5 +- 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/tailbone/templates/deform/permissions.pt b/tailbone/templates/deform/permissions.pt index bafa7563..f5cbeef4 100644 --- a/tailbone/templates/deform/permissions.pt +++ b/tailbone/templates/deform/permissions.pt @@ -1,6 +1,10 @@
+ +
${field.start_mapping()}
@@ -29,4 +33,57 @@
${field.end_mapping()} +
+ +
+ ${field.start_mapping()} + +
+
+
+ showing group: +
+
+ + + + + + + +
+
+
+ + +
+ +
+
+

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

+
+
+ +
+ +
+
+
+
+
+
+ + ${field.end_mapping()} +
diff --git a/tailbone/templates/roles/edit.mako b/tailbone/templates/roles/edit.mako index 6f89b44d..67f63013 100644 --- a/tailbone/templates/roles/edit.mako +++ b/tailbone/templates/roles/edit.mako @@ -6,4 +6,15 @@ ${h.stylesheet_link(request.static_url('tailbone:static/css/perms.css'))} +<%def name="modify_this_page_vars()"> + ${parent.modify_this_page_vars()} + + + ${parent.body()} diff --git a/tailbone/views/roles.py b/tailbone/views/roles.py index adac7fb5..d0dd8967 100644 --- a/tailbone/views/roles.py +++ b/tailbone/views/roles.py @@ -137,6 +137,7 @@ class RolesView(PrincipalMasterView): def configure_form(self, f): super(RolesView, self).configure_form(f) role = f.model_instance + use_buefy = self.get_use_buefy() # name f.set_validator('name', self.unique_name) @@ -148,7 +149,9 @@ class RolesView(PrincipalMasterView): self.tailbone_permissions = self.get_available_permissions() f.set_renderer('permissions', PermissionsRenderer(permissions=self.tailbone_permissions)) f.set_node('permissions', colander.Set()) - f.set_widget('permissions', PermissionsWidget(permissions=self.tailbone_permissions)) + f.set_widget('permissions', PermissionsWidget( + permissions=self.tailbone_permissions, + use_buefy=use_buefy)) if self.editing: granted = [] for groupkey in self.tailbone_permissions: