You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by gc...@apache.org on 2022/07/20 14:37:27 UTC

[allura] branch gc/8446 updated: fixup! [#8446] fixed tooltip loading for profile links, converted new setting to boolean

This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8446
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/gc/8446 by this push:
     new 76a59f875 fixup! [#8446] fixed tooltip loading for profile links, converted new setting to boolean
76a59f875 is described below

commit 76a59f875ddb593830dbb8507ef10ef877249219
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Wed Jul 20 08:37:08 2022 -0600

    fixup! [#8446] fixed tooltip loading for profile links, converted new setting to boolean
---
 Allura/allura/controllers/project.py       | 16 +++++++++-------
 Allura/allura/templates/macro/members.html |  2 +-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 94b48a17c..cf6ba15e1 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -375,17 +375,19 @@ class ProjectController(FeedController):
             roles = M.ProjectRole.query.find(
                 {'_id': {'$in': M.ProjectRole.by_user(user).roles}})
             roles = {r.name for r in roles}
-            u = dict(
-                display_name=user.display_name,
-                username=user.username,
-                url=user.url(),
-                roles=', '.join(sorted(roles)))
             _user = user
             _user['roles'] = ', '.join(sorted(roles))
-            users.append(_user)
+            if 'Admin' in roles:
+                admins.append(_user)
+            elif 'Developer' in roles:
+                developers.append(_user)
+            else:
+                users.append(_user)
         get_username = lambda user: user['username']
+        admins = sorted(admins, key=get_username)
+        developers = sorted(developers, key=get_username)
         users = sorted(users, key=get_username)
-        return dict(users=users)
+        return dict(users=admins + developers + users)
 
     def _check_security(self):
         require_access(c.project, 'read')
diff --git a/Allura/allura/templates/macro/members.html b/Allura/allura/templates/macro/members.html
index 8f7a874e5..c90ab7a8c 100644
--- a/Allura/allura/templates/macro/members.html
+++ b/Allura/allura/templates/macro/members.html
@@ -20,7 +20,7 @@
 	<ul class="md-users-list">
         {% set profile_path = 'profile/' if g.user_profile_urls_with_profile_path  else '' %}
 		{% for user in users -%}
-			<li><a href="{{ user.url ~ profile_path}}">{{user.name}}</a>{{user.admin}}</li>
+			<li><a href="{{user.url ~ profile_path}}">{{user.name}}</a>{{user.admin}}</li>
 		{%- endfor %}
 		{% if over_limit -%}
 				<li class="md-users-list-more"><a href="{{c.project.url()}}_members">All Members</a></li>