From 4dc9d4463ef34f7e87244ff32139b78a93e583b3 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Thu, 29 Nov 2018 18:15:55 +0100 Subject: [PATCH] auth: UI changes - make buttons wider to handle longer names for SAML plugins - make order of plugins sorted again because it tends to jump arround in order without that sorting. - social is now external auth --- rhodecode/authentication/routes.py | 6 +++--- rhodecode/public/css/buttons.less | 2 +- rhodecode/templates/admin/auth/auth_settings.mako | 2 +- rhodecode/templates/register.mako | 10 ++++++---- rhodecode/tests/auth_external_test.py | 2 +- rhodecode/tests/lib/auth_modules/test_auth_modules.py | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/rhodecode/authentication/routes.py b/rhodecode/authentication/routes.py index 03a90cb2..5de91e9f 100644 --- a/rhodecode/authentication/routes.py +++ b/rhodecode/authentication/routes.py @@ -88,15 +88,15 @@ class AuthnRootResource(AuthnResourceBase): # TODO: Store this info in the resource element. return self._resource_name_map[resource_name] - def get_sorted_list(self): + def get_sorted_list(self, sort_key=None): """ Returns a sorted list of sub resources for displaying purposes. """ - def sort_key(resource): + def default_sort_key(resource): return str.lower(safe_str(resource.display_name)) active = [item for item in self] - return sorted(active, key=sort_key) + return sorted(active, key=sort_key or default_sort_key) def get_nav_list(self, sort=True): """ diff --git a/rhodecode/public/css/buttons.less b/rhodecode/public/css/buttons.less index 014b56e4..b08e34fc 100644 --- a/rhodecode/public/css/buttons.less +++ b/rhodecode/public/css/buttons.less @@ -254,7 +254,7 @@ input[type="button"] { .btn-social { &:extend(.btn-default); margin: 5px 5px 5px 0px; - min-width: 150px; + min-width: 160px; } // TODO: johbo: check these exceptions diff --git a/rhodecode/templates/admin/auth/auth_settings.mako b/rhodecode/templates/admin/auth/auth_settings.mako index 751e1f30..3ed62d87 100644 --- a/rhodecode/templates/admin/auth/auth_settings.mako +++ b/rhodecode/templates/admin/auth/auth_settings.mako @@ -29,7 +29,7 @@