##// END OF EJS Templates
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
marcink -
r3233:4c12f36b default
parent child Browse files
Show More
@@ -19,6 +19,7 b''
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 21 import logging
22 import collections
22 23
23 24 from pyramid.exceptions import ConfigurationError
24 25
@@ -55,7 +56,7 b' class AuthnRootResource(AuthnResourceBas'
55 56 """
56 57
57 58 def __init__(self):
58 self._store = {}
59 self._store = collections.OrderedDict()
59 60 self._resource_name_map = {}
60 61 self.display_name = _('Global')
61 62
@@ -97,13 +98,17 b' class AuthnRootResource(AuthnResourceBas'
97 98 active = [item for item in self]
98 99 return sorted(active, key=sort_key)
99 100
100 def get_nav_list(self):
101 def get_nav_list(self, sort=True):
101 102 """
102 103 Returns a sorted list of resources for displaying the navigation.
103 104 """
104 list = self.get_sorted_list()
105 list.insert(0, self)
106 return list
105 if sort:
106 nav_list = self.get_sorted_list()
107 else:
108 nav_list = [item for item in self]
109
110 nav_list.insert(0, self)
111 return nav_list
107 112
108 113 def add_authn_resource(self, config, plugin_id, resource):
109 114 """
@@ -29,7 +29,7 b''
29 29
30 30 <div class="sidebar">
31 31 <ul class="nav nav-pills nav-stacked">
32 % for item in resource.get_root().get_nav_list():
32 % for item in resource.get_root().get_nav_list(sort=False):
33 33 <li ${'class=active' if item == resource else ''}>
34 34 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
35 35 </li>
@@ -39,48 +39,54 b''
39 39
40 40 <div class="main-content-full-width">
41 41 ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)}
42 <div class="form">
43
44 42 <div class="panel panel-default">
45 43
46 44 <div class="panel-heading">
47 45 <h3 class="panel-title">${_("Enabled and Available Plugins")}</h3>
48 46 </div>
49 47
50 <div class="fields panel-body">
48 <div class="panel-body">
51 49
52 <div class="field">
53 <div class="label">${_("Enabled Plugins")}</div>
50
51 <div class="label">${_("Ordered Enabled Plugins")}</div>
54 52 <div class="textarea text-area editor">
55 ${h.textarea('auth_plugins',cols=23,rows=5,class_="medium")}
53 ${h.textarea('auth_plugins',cols=120,rows=20,class_="medium")}
56 54 </div>
57 <p class="help-block pre-formatting">${_('List of plugins, separated by commas.'
55 <div class="field">
56 <p class="help-block pre-formatting">${_('List of plugins, separated by commas.'
58 57 '\nThe order of the plugins is also the order in which '
59 'RhodeCode Enterprise will try to authenticate a user.')}</p>
60 </div>
58 'RhodeCode Enterprise will try to authenticate a user.')}
59 </p>
60 </div>
61 61
62 <div class="field">
63 <div class="label">${_('Available Built-in Plugins')}</div>
64 <ul class="auth_plugins">
65 %for plugin in available_plugins:
66 <li>
67 <div class="auth_buttons">
68 <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${'btn-success' if plugin.get_id() in enabled_plugins else ''}">
69 ${_('enabled') if plugin.get_id() in enabled_plugins else _('disabled')}
70 </span>
71 ${plugin.get_display_name()} (${plugin.get_id()})
72 </div>
73 </li>
74 %endfor
75 </ul>
76 </div>
62 <table class="rctable">
63 <th>${_('Activate')}</th>
64 <th>${_('Plugin Name')}</th>
65 <th>${_('Documentation')}</th>
66 <th>${_('Plugin ID')}</th>
67 %for plugin in available_plugins:
68 <tr>
69 <td>
70 <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${'btn-success' if plugin.get_id() in enabled_plugins else ''}">
71 ${_('enabled') if plugin.get_id() in enabled_plugins else _('disabled')}
72 </span>
73 </td>
74 <td>${plugin.get_display_name()}</td>
75 <td>
76 % if plugin.docs():
77 <a href="${plugin.docs()}">docs</a>
78 % endif
79 </td>
80 <td>${plugin.get_id()}</td>
81 </tr>
82 %endfor
83 </table>
77 84
78 85 <div class="buttons">
79 86 ${h.submit('save',_('Save'),class_="btn")}
80 87 </div>
81 88 </div>
82 89 </div>
83 </div>
84 90 ${h.end_form()}
85 91 </div>
86 92 </div>
@@ -263,7 +263,7 b''
263 263 // Alternative logo from static folder
264 264 $('.sign-in-image').attr("src", "/_static/rhodecode/images/RhodeCode_Logo_Black.png");
265 265
266 // set width/height
266 // option to set width/height, adjust if required to make your image look good.
267 267 $('.sign-in-image').css({"width": "300px", "height": "345px"});
268 268
269 269 // 2) Header logo on top bar
General Comments 0
You need to be logged in to leave comments. Login now