##// END OF EJS Templates
auth: UI changes...
marcink -
r3257:92a130b7 default
parent child Browse files
Show More
@@ -88,15 +88,15 b' class AuthnRootResource(AuthnResourceBas'
88 # TODO: Store this info in the resource element.
88 # TODO: Store this info in the resource element.
89 return self._resource_name_map[resource_name]
89 return self._resource_name_map[resource_name]
90
90
91 def get_sorted_list(self):
91 def get_sorted_list(self, sort_key=None):
92 """
92 """
93 Returns a sorted list of sub resources for displaying purposes.
93 Returns a sorted list of sub resources for displaying purposes.
94 """
94 """
95 def sort_key(resource):
95 def default_sort_key(resource):
96 return str.lower(safe_str(resource.display_name))
96 return str.lower(safe_str(resource.display_name))
97
97
98 active = [item for item in self]
98 active = [item for item in self]
99 return sorted(active, key=sort_key)
99 return sorted(active, key=sort_key or default_sort_key)
100
100
101 def get_nav_list(self, sort=True):
101 def get_nav_list(self, sort=True):
102 """
102 """
@@ -254,7 +254,7 b' input[type="button"] {'
254 .btn-social {
254 .btn-social {
255 &:extend(.btn-default);
255 &:extend(.btn-default);
256 margin: 5px 5px 5px 0px;
256 margin: 5px 5px 5px 0px;
257 min-width: 150px;
257 min-width: 160px;
258 }
258 }
259
259
260 // TODO: johbo: check these exceptions
260 // TODO: johbo: check these exceptions
@@ -29,7 +29,7 b''
29
29
30 <div class="sidebar">
30 <div class="sidebar">
31 <ul class="nav nav-pills nav-stacked">
31 <ul class="nav nav-pills nav-stacked">
32 % for item in resource.get_root().get_nav_list(sort=False):
32 % for item in resource.get_root().get_nav_list():
33 <li ${'class=active' if item == resource else ''}>
33 <li ${'class=active' if item == resource else ''}>
34 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
34 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
35 </li>
35 </li>
@@ -32,8 +32,8 b''
32 <div id="register" class="right-column">
32 <div id="register" class="right-column">
33 <!-- login -->
33 <!-- login -->
34 <div class="sign-in-title">
34 <div class="sign-in-title">
35 % if social_auth_provider:
35 % if external_auth_provider:
36 <h1>${_('Create an account linked with {}').format(social_auth_provider)}</h1>
36 <h1>${_('Create an account linked with {}').format(external_auth_provider)}</h1>
37 % else:
37 % else:
38 <h1>${_('Create an account')}</h1>
38 <h1>${_('Create an account')}</h1>
39 % endif
39 % endif
@@ -50,7 +50,9 b''
50 <br />
50 <br />
51 %endif
51 %endif
52
52
53 % if social_auth_provider:
53 % if external_auth_provider:
54 ## store internal marker about external identity
55 ${h.hidden('external_identity', external_auth_provider)}
54 ## hide password prompts for social auth
56 ## hide password prompts for social auth
55 <div style="display: none">
57 <div style="display: none">
56 % endif
58 % endif
@@ -69,7 +71,7 b''
69 <br />
71 <br />
70 %endif
72 %endif
71
73
72 % if social_auth_provider:
74 % if external_auth_provider:
73 ## hide password prompts for social auth
75 ## hide password prompts for social auth
74 </div>
76 </div>
75 % endif
77 % endif
@@ -45,7 +45,7 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
45
45
46 @hybrid_property
46 @hybrid_property
47 def name(self):
47 def name(self):
48 return "external_test"
48 return u"external_test"
49
49
50 def settings(self):
50 def settings(self):
51 settings = [
51 settings = [
@@ -30,7 +30,7 b' from rhodecode.model import db'
30 class RcTestAuthPlugin(RhodeCodeAuthPluginBase):
30 class RcTestAuthPlugin(RhodeCodeAuthPluginBase):
31
31
32 def name(self):
32 def name(self):
33 return 'stub_auth'
33 return u'stub_auth'
34
34
35
35
36 def test_authenticate_returns_from_auth(stub_auth_data):
36 def test_authenticate_returns_from_auth(stub_auth_data):
General Comments 0
You need to be logged in to leave comments. Login now