##// END OF EJS Templates
auth-plugins: use a nicer visual display of auth plugins that would highlight that order is...
marcink -
r2659:8b68aff1 default
parent child Browse files
Show More
@@ -145,7 +145,7 b' class AuthSettingsView(BaseAppView):'
145 145
146 146 # Create form default values and fill the form.
147 147 form_defaults = {
148 'auth_plugins': ','.join(enabled_plugins)
148 'auth_plugins': ',\n'.join(enabled_plugins)
149 149 }
150 150 form_defaults.update(defaults)
151 151 html = formencode.htmlfill.render(
@@ -54,11 +54,9 b''
54 54 <div class="textarea text-area editor">
55 55 ${h.textarea('auth_plugins',cols=23,rows=5,class_="medium")}
56 56 </div>
57 <p class="help-block">
58 ${_('Add a list of plugins, separated by commas. '
59 'The order of the plugins is also the order in which '
60 'RhodeCode Enterprise will try to authenticate a user.')}
61 </p>
57 <p class="help-block pre-formatting">${_('List of plugins, separated by commas.'
58 '\nThe order of the plugins is also the order in which '
59 'RhodeCode Enterprise will try to authenticate a user.')}</p>
62 60 </div>
63 61
64 62 <div class="field">
@@ -91,15 +89,19 b''
91 89 <script>
92 90 $('.toggle-plugin').click(function(e){
93 91 var auth_plugins_input = $('#auth_plugins');
94 var notEmpty = function(element, index, array) {
95 return (element != "");
96 };
97 var elems = auth_plugins_input.val().split(',').filter(notEmpty);
92 var elems = [];
93
94 $.each(auth_plugins_input.val().split(',') , function (index, element) {
95 if (element !== "") {
96 elems.push(element.strip())
97 }
98 });
99
98 100 var cur_button = e.currentTarget;
99 101 var plugin_id = $(cur_button).attr('plugin_id');
100 102 if($(cur_button).hasClass('btn-success')){
101 103 elems.splice(elems.indexOf(plugin_id), 1);
102 auth_plugins_input.val(elems.join(','));
104 auth_plugins_input.val(elems.join(',\n'));
103 105 $(cur_button).removeClass('btn-success');
104 106 cur_button.innerHTML = _gettext('disabled');
105 107 }
@@ -107,7 +109,7 b''
107 109 if(elems.indexOf(plugin_id) == -1){
108 110 elems.push(plugin_id);
109 111 }
110 auth_plugins_input.val(elems.join(','));
112 auth_plugins_input.val(elems.join(',\n'));
111 113 $(cur_button).addClass('btn-success');
112 114 cur_button.innerHTML = _gettext('enabled');
113 115 }
General Comments 0
You need to be logged in to leave comments. Login now