Show More
@@ -1,116 +1,116 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('Authentication Settings')} |
|
6 | 6 | %if c.rhodecode_name: |
|
7 | 7 | · ${h.branding(c.rhodecode_name)}} |
|
8 | 8 | %endif |
|
9 | 9 | </%def> |
|
10 | 10 | |
|
11 | 11 | <%def name="breadcrumbs_links()"> |
|
12 | 12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
13 | 13 | » |
|
14 | 14 | ${h.link_to(_('Authentication Plugins'),request.resource_path(resource.__parent__, route_name='auth_home'))} |
|
15 | 15 | » |
|
16 | 16 | ${resource.display_name} |
|
17 | 17 | </%def> |
|
18 | 18 | |
|
19 | 19 | <%def name="menu_bar_nav()"> |
|
20 | 20 | ${self.menu_items(active='admin')} |
|
21 | 21 | </%def> |
|
22 | 22 | |
|
23 | 23 | <%def name="main()"> |
|
24 | 24 | <div class="box"> |
|
25 | 25 | <div class="title"> |
|
26 | 26 | ${self.breadcrumbs()} |
|
27 | 27 | </div> |
|
28 | 28 | <div class='sidebar-col-wrapper'> |
|
29 | 29 | |
|
30 | 30 | ## TODO: This is repeated in the auth root template and should be merged |
|
31 | 31 | ## into a single solution. |
|
32 | 32 | <div class="sidebar"> |
|
33 | 33 | <ul class="nav nav-pills nav-stacked"> |
|
34 | 34 | % for item in resource.get_root().get_nav_list(): |
|
35 | 35 | <li ${'class=active' if item == resource else ''}> |
|
36 | 36 | <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a> |
|
37 | 37 | </li> |
|
38 | 38 | % endfor |
|
39 | 39 | </ul> |
|
40 | 40 | </div> |
|
41 | 41 | |
|
42 | 42 | <div class="main-content-full-width"> |
|
43 | 43 | <div class="panel panel-default"> |
|
44 | 44 | <div class="panel-heading"> |
|
45 | 45 | <h3 class="panel-title">${_('Plugin')}: ${resource.display_name}</h3> |
|
46 | 46 | </div> |
|
47 | 47 | <div class="panel-body"> |
|
48 | 48 | <div class="plugin_form"> |
|
49 | 49 | <div class="fields"> |
|
50 | 50 | ${h.secure_form(request.resource_path(resource, route_name='auth_home'))} |
|
51 | 51 | <div class="form"> |
|
52 | 52 | |
|
53 | 53 | %for node in plugin.get_settings_schema(): |
|
54 | 54 | <% label_css_class = ("label-checkbox" if (node.widget == "bool") else "") %> |
|
55 | 55 | <div class="field"> |
|
56 | 56 | <div class="label ${label_css_class}"><label for="${node.name}">${node.title}</label></div> |
|
57 | 57 | <div class="input"> |
|
58 | 58 | %if node.widget in ["string", "int", "unicode"]: |
|
59 | 59 | ${h.text(node.name, defaults.get(node.name), class_="medium")} |
|
60 | 60 | %elif node.widget == "password": |
|
61 | 61 | ${h.password(node.name, defaults.get(node.name), class_="medium")} |
|
62 | 62 | %elif node.widget == "bool": |
|
63 | 63 | <div class="checkbox">${h.checkbox(node.name, True, checked=defaults.get(node.name))}</div> |
|
64 | 64 | %elif node.widget == "select": |
|
65 | 65 | ${h.select(node.name, defaults.get(node.name), node.validator.choices)} |
|
66 | 66 | %elif node.widget == "readonly": |
|
67 | 67 | ${node.default} |
|
68 | 68 | %else: |
|
69 | 69 | This field is of type ${node.typ}, which cannot be displayed. Must be one of [string|int|bool|select]. |
|
70 | 70 | %endif |
|
71 | 71 | %if node.name in errors: |
|
72 | 72 | <span class="error-message">${errors.get(node.name)}</span> |
|
73 | 73 | <br /> |
|
74 | 74 | %endif |
|
75 | 75 | <p class="help-block">${node.description}</p> |
|
76 | 76 | </div> |
|
77 | 77 | </div> |
|
78 | 78 | %endfor |
|
79 | 79 | |
|
80 | 80 | ## Allow derived templates to add something below the form |
|
81 | 81 | ## input fields |
|
82 | 82 | %if hasattr(next, 'below_form_fields'): |
|
83 | 83 | ${next.below_form_fields()} |
|
84 | 84 | %endif |
|
85 | 85 | |
|
86 | 86 | <div class="buttons"> |
|
87 | 87 | ${h.submit('save',_('Save'),class_="btn")} |
|
88 | 88 | </div> |
|
89 | 89 | |
|
90 | 90 | </div> |
|
91 | 91 | ${h.end_form()} |
|
92 | 92 | </div> |
|
93 | 93 | </div> |
|
94 | 94 | </div> |
|
95 | 95 | </div> |
|
96 | 96 | </div> |
|
97 | 97 | |
|
98 | 98 | </div> |
|
99 | 99 | </div> |
|
100 | </%def> | |
|
101 | 100 | |
|
102 | 101 | ## TODO: Ugly hack to get ldap select elements to work. |
|
103 | 102 | ## Find a solution to integrate this nicely. |
|
104 | 103 | <script> |
|
105 | 104 | $(document).ready(function() { |
|
106 | 105 | var select2Options = { |
|
107 | 106 | containerCssClass: 'drop-menu', |
|
108 | 107 | dropdownCssClass: 'drop-menu-dropdown', |
|
109 | 108 | dropdownAutoWidth: true, |
|
110 | 109 | minimumResultsForSearch: -1 |
|
111 | 110 | }; |
|
112 | 111 | $("#tls_kind").select2(select2Options); |
|
113 | 112 | $("#tls_reqcert").select2(select2Options); |
|
114 | 113 | $("#search_scope").select2(select2Options); |
|
115 | 114 | }); |
|
116 | 115 | </script> |
|
116 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now