plugin_settings.html
116 lines
| 4.2 KiB
| text/html
|
HtmlLexer
r1 | ## -*- coding: utf-8 -*- | |||
<%inherit file="/base/base.html"/> | ||||
<%def name="title()"> | ||||
${_('Authentication Settings')} | ||||
%if c.rhodecode_name: | ||||
· ${h.branding(c.rhodecode_name)}} | ||||
%endif | ||||
</%def> | ||||
<%def name="breadcrumbs_links()"> | ||||
${h.link_to(_('Admin'),h.url('admin_home'))} | ||||
» | ||||
${h.link_to(_('Authentication Plugins'),request.resource_path(resource.__parent__, route_name='auth_home'))} | ||||
» | ||||
${resource.display_name} | ||||
</%def> | ||||
<%def name="menu_bar_nav()"> | ||||
${self.menu_items(active='admin')} | ||||
</%def> | ||||
<%def name="main()"> | ||||
<div class="box"> | ||||
<div class="title"> | ||||
${self.breadcrumbs()} | ||||
</div> | ||||
<div class='sidebar-col-wrapper'> | ||||
## TODO: This is repeated in the auth root template and should be merged | ||||
## into a single solution. | ||||
<div class="sidebar"> | ||||
<ul class="nav nav-pills nav-stacked"> | ||||
% for item in resource.get_root().get_nav_list(): | ||||
<li ${'class=active' if item == resource else ''}> | ||||
<a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a> | ||||
</li> | ||||
% endfor | ||||
</ul> | ||||
</div> | ||||
<div class="main-content-full-width"> | ||||
<div class="panel panel-default"> | ||||
<div class="panel-heading"> | ||||
<h3 class="panel-title">${_('Plugin')}: ${resource.display_name}</h3> | ||||
</div> | ||||
<div class="panel-body"> | ||||
<div class="plugin_form"> | ||||
<div class="fields"> | ||||
${h.secure_form(request.resource_path(resource, route_name='auth_home'))} | ||||
<div class="form"> | ||||
r88 | ||||
r1 | %for node in plugin.get_settings_schema(): | |||
r86 | <% label_css_class = ("label-checkbox" if (node.widget == "bool") else "") %> | |||
r1 | <div class="field"> | |||
r86 | <div class="label ${label_css_class}"><label for="${node.name}">${node.title}</label></div> | |||
<div class="input"> | ||||
%if node.widget in ["string", "int", "unicode"]: | ||||
r90 | ${h.text(node.name, defaults.get(node.name), class_="medium")} | |||
r86 | %elif node.widget == "password": | |||
r90 | ${h.password(node.name, defaults.get(node.name), class_="medium")} | |||
r86 | %elif node.widget == "bool": | |||
r90 | <div class="checkbox">${h.checkbox(node.name, True, checked=defaults.get(node.name))}</div> | |||
r86 | %elif node.widget == "select": | |||
r90 | ${h.select(node.name, defaults.get(node.name), node.validator.choices)} | |||
r86 | %elif node.widget == "readonly": | |||
r1 | ${node.default} | |||
r86 | %else: | |||
r1 | This field is of type ${node.typ}, which cannot be displayed. Must be one of [string|int|bool|select]. | |||
r86 | %endif | |||
%if node.name in errors: | ||||
<span class="error-message">${errors.get(node.name)}</span> | ||||
<br /> | ||||
%endif | ||||
<p class="help-block">${node.description}</p> | ||||
</div> | ||||
r1 | </div> | |||
%endfor | ||||
r88 | ||||
## Allow derived templates to add something below the form | ||||
## input fields | ||||
%if hasattr(next, 'below_form_fields'): | ||||
${next.below_form_fields()} | ||||
%endif | ||||
r1 | <div class="buttons"> | |||
${h.submit('save',_('Save'),class_="btn")} | ||||
</div> | ||||
r88 | ||||
r1 | </div> | |||
${h.end_form()} | ||||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
## TODO: Ugly hack to get ldap select elements to work. | ||||
## Find a solution to integrate this nicely. | ||||
<script> | ||||
$(document).ready(function() { | ||||
var select2Options = { | ||||
containerCssClass: 'drop-menu', | ||||
dropdownCssClass: 'drop-menu-dropdown', | ||||
dropdownAutoWidth: true, | ||||
minimumResultsForSearch: -1 | ||||
}; | ||||
$("#tls_kind").select2(select2Options); | ||||
$("#tls_reqcert").select2(select2Options); | ||||
$("#search_scope").select2(select2Options); | ||||
}); | ||||
</script> | ||||
r516 | </%def> | |||