# HG changeset patch # User Marcin Kuzminski # Date 2018-11-21 17:44:21 # Node ID 4c12f36bf11489da9d3d27d80f000eb9f115197a # Parent 683a85b03323295aaf569648e2cf05a8a1be6043 auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins. diff --git a/rhodecode/authentication/routes.py b/rhodecode/authentication/routes.py --- a/rhodecode/authentication/routes.py +++ b/rhodecode/authentication/routes.py @@ -19,6 +19,7 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging +import collections from pyramid.exceptions import ConfigurationError @@ -55,7 +56,7 @@ class AuthnRootResource(AuthnResourceBas """ def __init__(self): - self._store = {} + self._store = collections.OrderedDict() self._resource_name_map = {} self.display_name = _('Global') @@ -97,13 +98,17 @@ class AuthnRootResource(AuthnResourceBas active = [item for item in self] return sorted(active, key=sort_key) - def get_nav_list(self): + def get_nav_list(self, sort=True): """ Returns a sorted list of resources for displaying the navigation. """ - list = self.get_sorted_list() - list.insert(0, self) - return list + if sort: + nav_list = self.get_sorted_list() + else: + nav_list = [item for item in self] + + nav_list.insert(0, self) + return nav_list def add_authn_resource(self, config, plugin_id, resource): """ diff --git a/rhodecode/templates/admin/auth/auth_settings.mako b/rhodecode/templates/admin/auth/auth_settings.mako --- a/rhodecode/templates/admin/auth/auth_settings.mako +++ b/rhodecode/templates/admin/auth/auth_settings.mako @@ -29,7 +29,7 @@