From 6eece6f7ff09403d90452728298d671c2a50f5e1 Mon Sep 17 00:00:00 2001 From: kakwa Date: Fri, 12 Jun 2015 00:25:17 +0200 Subject: [PATCH] implementing notification to explain automatic adding of roles --- ldapcherry/__init__.py | 6 +++++- resources/templates/base.tmpl | 1 + resources/templates/roles.tmpl | 19 ++++++++++++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 3405066..326e897 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -464,8 +464,12 @@ class LdapCherry(object): p = list(self.roles.graph[r]['parent_roles']) graph[r] = { 'sub_roles': s, 'parent_roles': p} graph_js = json.dumps(graph, separators=(',',':')) + display_names = {} + for r in self.roles.flatten: + display_names[r] = self.roles.flatten[r]['display_name'] + roles_js = json.dumps(display_names, separators=(',',':')) form = self.temp_form.render(attributes=self.attributes.attributes, values=None) - roles = self.temp_roles.render(roles=self.roles.flatten, graph=self.roles.graph, graph_js=graph_js) + roles = self.temp_roles.render(roles=self.roles.flatten, graph=self.roles.graph, graph_js=graph_js, roles_js=roles_js) return self.temp_adduser.render(form=form, roles=roles, is_admin=is_admin) @cherrypy.expose diff --git a/resources/templates/base.tmpl b/resources/templates/base.tmpl index 71c7fbc..3e1263f 100644 --- a/resources/templates/base.tmpl +++ b/resources/templates/base.tmpl @@ -34,6 +34,7 @@ + diff --git a/resources/templates/roles.tmpl b/resources/templates/roles.tmpl index 97233ab..3e37fab 100644 --- a/resources/templates/roles.tmpl +++ b/resources/templates/roles.tmpl @@ -1,19 +1,32 @@