##// END OF EJS Templates
fix(permissions): added a common way to update private flag via repo model...
fix(permissions): added a common way to update private flag via repo model - this allows to have a one and only one way to control the flag with the business logic shared - added test for that - changed view to use this method instead of DB update and custom permissions flush - fixed a case when update of repo settings didn't flush permissions actually while it should when private flag changed

File last commit:

r5505:3fc95e3b default
r5551:5b9b5ed2 default
Show More
auth_settings.mako
127 lines | 4.3 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <%inherit file="/base/base.mako"/>
<%def name="title()">
${_('Authentication Settings')}
%if c.rhodecode_name:
&middot; ${h.branding(c.rhodecode_name)}}
%endif
</%def>
nav: bring back quick filter and cleanup titles
r3589 <%def name="breadcrumbs_links()"></%def>
templating: use .mako as extensions for template files.
r1282
<%def name="menu_bar_nav()">
${self.menu_items(active='admin')}
</%def>
ui: navigation, fixed wrapping of new admin navigation items
r3566 <%def name="menu_bar_subnav()">
${self.admin_menu(active='authentication')}
</%def>
templating: use .mako as extensions for template files.
r1282 <%def name="main()">
<div class="box">
<div class='sidebar-col-wrapper'>
<div class="sidebar">
<ul class="nav nav-pills nav-stacked">
auth: UI changes...
r3257 % for item in resource.get_root().get_nav_list():
auth: updated saml docs, and re-order info on plugin details for easier setup
r5505
auth: fixed missing upper context navigation in plugin view
r3584 <li ${('class=active' if item == resource else '')}>
auth: updated saml docs, and re-order info on plugin details for easier setup
r5505 % if getattr(item, 'is_root', False):
<a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
% else:
<a style="padding-left: 10px" href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
% endif
templating: use .mako as extensions for template files.
r1282 </li>
% endfor
</ul>
</div>
<div class="main-content-full-width">
pyramid: if possible fetch csrf tokens from pyramid session....
r1918 ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)}
templating: use .mako as extensions for template files.
r1282 <div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_("Enabled and Available Plugins")}</h3>
</div>
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 <div class="panel-body">
templating: use .mako as extensions for template files.
r1282
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233
auth-plugin: show if plugin is activated and enabled in the list....
r3269 <div class="label">${_("Ordered Activated Plugins")}</div>
templating: use .mako as extensions for template files.
r1282 <div class="textarea text-area editor">
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 ${h.textarea('auth_plugins',cols=120,rows=20,class_="medium")}
templating: use .mako as extensions for template files.
r1282 </div>
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 <div class="field">
<p class="help-block pre-formatting">${_('List of plugins, separated by commas.'
auth-plugins: use a nicer visual display of auth plugins that would highlight that order is...
r2659 '\nThe order of the plugins is also the order in which '
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 'RhodeCode Enterprise will try to authenticate a user.')}
</p>
</div>
templating: use .mako as extensions for template files.
r1282
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 <table class="rctable">
<th>${_('Activate')}</th>
<th>${_('Plugin Name')}</th>
<th>${_('Documentation')}</th>
<th>${_('Plugin ID')}</th>
auth-plugin: show if plugin is activated and enabled in the list....
r3269 <th>${_('Enabled')}</th>
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 %for plugin in available_plugins:
auth: fixed missing upper context navigation in plugin view
r3584 <tr class="${('inactive' if (not plugin.is_active() and plugin.get_id() in enabled_plugins) else '')}">
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 <td>
auth: fixed missing upper context navigation in plugin view
r3584 <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${('btn-success' if plugin.get_id() in enabled_plugins else '')}">
${(_('activated') if plugin.get_id() in enabled_plugins else _('not active'))}
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 </span>
</td>
<td>${plugin.get_display_name()}</td>
<td>
% if plugin.docs():
<a href="${plugin.docs()}">docs</a>
% endif
</td>
<td>${plugin.get_id()}</td>
authentication: show icons only for activated plugins.
r3291 <td>${h.bool2icon(plugin.is_active(),show_at_false=False)}</td>
auth-plugins: updated UI for authentication plugins, and allow unsorted (in order of registration) display of plugins.
r3233 </tr>
%endfor
</table>
templating: use .mako as extensions for template files.
r1282
<div class="buttons">
${h.submit('save',_('Save'),class_="btn")}
</div>
</div>
</div>
${h.end_form()}
</div>
</div>
</div>
<script>
$('.toggle-plugin').click(function(e){
var auth_plugins_input = $('#auth_plugins');
auth-plugins: use a nicer visual display of auth plugins that would highlight that order is...
r2659 var elems = [];
$.each(auth_plugins_input.val().split(',') , function (index, element) {
if (element !== "") {
elems.push(element.strip())
}
});
templating: use .mako as extensions for template files.
r1282 var cur_button = e.currentTarget;
var plugin_id = $(cur_button).attr('plugin_id');
if($(cur_button).hasClass('btn-success')){
elems.splice(elems.indexOf(plugin_id), 1);
auth-plugins: use a nicer visual display of auth plugins that would highlight that order is...
r2659 auth_plugins_input.val(elems.join(',\n'));
templating: use .mako as extensions for template files.
r1282 $(cur_button).removeClass('btn-success');
auth-plugin: show if plugin is activated and enabled in the list....
r3269 cur_button.innerHTML = _gettext('not active');
templating: use .mako as extensions for template files.
r1282 }
else{
auth-plugins: indicate activate and not-enabled plugin with gre6;
r3285 if (elems.indexOf(plugin_id) === -1) {
elems.push(plugin_id);
templating: use .mako as extensions for template files.
r1282 }
auth-plugins: use a nicer visual display of auth plugins that would highlight that order is...
r2659 auth_plugins_input.val(elems.join(',\n'));
templating: use .mako as extensions for template files.
r1282 $(cur_button).addClass('btn-success');
auth-plugin: show if plugin is activated and enabled in the list....
r3269 cur_button.innerHTML = _gettext('activated');
templating: use .mako as extensions for template files.
r1282 }
});
</script>
</%def>