From c59767a9c512258c9d64864ab186665a78dd3315 Mon Sep 17 00:00:00 2001 From: Tobias Kunze <r@rixx.de> Date: Sat, 12 Jun 2021 22:26:12 +0200 Subject: [PATCH] Show current user groups on self service page Refs #54 --- uffd/selfservice/templates/self.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/uffd/selfservice/templates/self.html b/uffd/selfservice/templates/self.html index 7cb7bf56..3942dd80 100644 --- a/uffd/selfservice/templates/self.html +++ b/uffd/selfservice/templates/self.html @@ -40,6 +40,22 @@ <label for="user-password2">Password Repeat</label> <input type="password" class="form-control" id="user-password2" name="password2" placeholder="●●●●●●●●"> </div> + <div> + {% if user.groups|length %} + {% if user.groups|length == 1 %} + You are currently a member in this group: + {% else %} + You are currently a member in these groups: + {% endif %} + <ul> + {% for group in user.groups|sort(attribute="name") %} + <li>{{ group.name }}</li> + {% endfor %} + </ul> + {% else %} + You are not a member in any groups. + {% endif %} + </div> <div class="form-group col-md-12"> <button type="submit" class="btn btn-primary float-right"><i class="fa fa-save" aria-hidden="true"></i> Save</button> </div> -- GitLab