Show More
@@ -1,42 +1,42 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Admin audit logs')} |
|
5 | ${_('Admin audit logs')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.form(None, id_="filter_form", method="get")} |
|
12 | ${h.form(None, id_="filter_form", method="get")} | |
13 | <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or ''}" placeholder="${_('filter...')}"/> |
|
13 | <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or ''}" placeholder="${_('filter...')}"/> | |
14 | <input type='submit' value="${_('filter')}" class="btn" /> |
|
14 | <input type='submit' value="${_('filter')}" class="btn" /> | |
15 | ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)} |
|
15 | ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)} | |
16 | ${h.end_form()} |
|
16 | ${h.end_form()} | |
17 | <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p> |
|
17 | <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p> | |
18 | <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre> |
|
18 | <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre> | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="menu_bar_nav()"> |
|
21 | <%def name="menu_bar_nav()"> | |
22 | ${self.menu_items(active='admin')} |
|
22 | ${self.menu_items(active='admin')} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="main()"> |
|
25 | <%def name="main()"> | |
26 | <div class="box"> |
|
26 | <div class="box"> | |
27 | <!-- box / title --> |
|
27 | <!-- box / title --> | |
28 | <div class="title"> |
|
28 | <div class="title"> | |
29 |
${self. |
|
29 | ${self.admin_menu()} | |
30 | </div> |
|
30 | </div> | |
31 | <!-- end box / title --> |
|
31 | <!-- end box / title --> | |
32 | <div class="table"> |
|
32 | <div class="table"> | |
33 | <div id="user_log"> |
|
33 | <div id="user_log"> | |
34 | <%include file="/admin/admin_log_base.mako" /> |
|
34 | <%include file="/admin/admin_log_base.mako" /> | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 | </div> |
|
37 | </div> | |
38 |
|
38 | |||
39 | <script> |
|
39 | <script> | |
40 | $('#j_filter').autoGrowInput(); |
|
40 | $('#j_filter').autoGrowInput(); | |
41 | </script> |
|
41 | </script> | |
42 | </%def> |
|
42 | </%def> |
@@ -1,126 +1,126 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Authentication Settings')} |
|
5 | ${_('Authentication Settings')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)}} |
|
7 | · ${h.branding(c.rhodecode_name)}} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Authentication Plugins')} |
|
14 | ${_('Authentication Plugins')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_nav()"> |
|
17 | <%def name="menu_bar_nav()"> | |
18 | ${self.menu_items(active='admin')} |
|
18 | ${self.menu_items(active='admin')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 |
|
22 | |||
23 | <div class="box"> |
|
23 | <div class="box"> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 |
${self. |
|
25 | ${self.admin_menu()} | |
26 | </div> |
|
26 | </div> | |
27 |
|
27 | |||
28 | <div class='sidebar-col-wrapper'> |
|
28 | <div class='sidebar-col-wrapper'> | |
29 |
|
29 | |||
30 | <div class="sidebar"> |
|
30 | <div class="sidebar"> | |
31 | <ul class="nav nav-pills nav-stacked"> |
|
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(): | |
33 | <li ${'class=active' if item == resource else ''}> |
|
33 | <li ${'class=active' if item == resource else ''}> | |
34 | <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a> |
|
34 | <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a> | |
35 | </li> |
|
35 | </li> | |
36 | % endfor |
|
36 | % endfor | |
37 | </ul> |
|
37 | </ul> | |
38 | </div> |
|
38 | </div> | |
39 |
|
39 | |||
40 | <div class="main-content-full-width"> |
|
40 | <div class="main-content-full-width"> | |
41 | ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)} |
|
41 | ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)} | |
42 | <div class="panel panel-default"> |
|
42 | <div class="panel panel-default"> | |
43 |
|
43 | |||
44 | <div class="panel-heading"> |
|
44 | <div class="panel-heading"> | |
45 | <h3 class="panel-title">${_("Enabled and Available Plugins")}</h3> |
|
45 | <h3 class="panel-title">${_("Enabled and Available Plugins")}</h3> | |
46 | </div> |
|
46 | </div> | |
47 |
|
47 | |||
48 | <div class="panel-body"> |
|
48 | <div class="panel-body"> | |
49 |
|
49 | |||
50 |
|
50 | |||
51 | <div class="label">${_("Ordered Activated Plugins")}</div> |
|
51 | <div class="label">${_("Ordered Activated Plugins")}</div> | |
52 | <div class="textarea text-area editor"> |
|
52 | <div class="textarea text-area editor"> | |
53 | ${h.textarea('auth_plugins',cols=120,rows=20,class_="medium")} |
|
53 | ${h.textarea('auth_plugins',cols=120,rows=20,class_="medium")} | |
54 | </div> |
|
54 | </div> | |
55 | <div class="field"> |
|
55 | <div class="field"> | |
56 | <p class="help-block pre-formatting">${_('List of plugins, separated by commas.' |
|
56 | <p class="help-block pre-formatting">${_('List of plugins, separated by commas.' | |
57 | '\nThe order of the plugins is also the order in which ' |
|
57 | '\nThe order of the plugins is also the order in which ' | |
58 | 'RhodeCode Enterprise will try to authenticate a user.')} |
|
58 | 'RhodeCode Enterprise will try to authenticate a user.')} | |
59 | </p> |
|
59 | </p> | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 | <table class="rctable"> |
|
62 | <table class="rctable"> | |
63 | <th>${_('Activate')}</th> |
|
63 | <th>${_('Activate')}</th> | |
64 | <th>${_('Plugin Name')}</th> |
|
64 | <th>${_('Plugin Name')}</th> | |
65 | <th>${_('Documentation')}</th> |
|
65 | <th>${_('Documentation')}</th> | |
66 | <th>${_('Plugin ID')}</th> |
|
66 | <th>${_('Plugin ID')}</th> | |
67 | <th>${_('Enabled')}</th> |
|
67 | <th>${_('Enabled')}</th> | |
68 | %for plugin in available_plugins: |
|
68 | %for plugin in available_plugins: | |
69 | <tr class="${'inactive' if (not plugin.is_active() and plugin.get_id() in enabled_plugins) else ''}"> |
|
69 | <tr class="${'inactive' if (not plugin.is_active() and plugin.get_id() in enabled_plugins) else ''}"> | |
70 | <td> |
|
70 | <td> | |
71 | <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${'btn-success' if plugin.get_id() in enabled_plugins else ''}"> |
|
71 | <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${'btn-success' if plugin.get_id() in enabled_plugins else ''}"> | |
72 | ${_('activated') if plugin.get_id() in enabled_plugins else _('not active')} |
|
72 | ${_('activated') if plugin.get_id() in enabled_plugins else _('not active')} | |
73 | </span> |
|
73 | </span> | |
74 | </td> |
|
74 | </td> | |
75 | <td>${plugin.get_display_name()}</td> |
|
75 | <td>${plugin.get_display_name()}</td> | |
76 | <td> |
|
76 | <td> | |
77 | % if plugin.docs(): |
|
77 | % if plugin.docs(): | |
78 | <a href="${plugin.docs()}">docs</a> |
|
78 | <a href="${plugin.docs()}">docs</a> | |
79 | % endif |
|
79 | % endif | |
80 | </td> |
|
80 | </td> | |
81 | <td>${plugin.get_id()}</td> |
|
81 | <td>${plugin.get_id()}</td> | |
82 | <td>${h.bool2icon(plugin.is_active(),show_at_false=False)}</td> |
|
82 | <td>${h.bool2icon(plugin.is_active(),show_at_false=False)}</td> | |
83 | </tr> |
|
83 | </tr> | |
84 | %endfor |
|
84 | %endfor | |
85 | </table> |
|
85 | </table> | |
86 |
|
86 | |||
87 | <div class="buttons"> |
|
87 | <div class="buttons"> | |
88 | ${h.submit('save',_('Save'),class_="btn")} |
|
88 | ${h.submit('save',_('Save'),class_="btn")} | |
89 | </div> |
|
89 | </div> | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 | ${h.end_form()} |
|
92 | ${h.end_form()} | |
93 | </div> |
|
93 | </div> | |
94 | </div> |
|
94 | </div> | |
95 | </div> |
|
95 | </div> | |
96 |
|
96 | |||
97 | <script> |
|
97 | <script> | |
98 | $('.toggle-plugin').click(function(e){ |
|
98 | $('.toggle-plugin').click(function(e){ | |
99 | var auth_plugins_input = $('#auth_plugins'); |
|
99 | var auth_plugins_input = $('#auth_plugins'); | |
100 | var elems = []; |
|
100 | var elems = []; | |
101 |
|
101 | |||
102 | $.each(auth_plugins_input.val().split(',') , function (index, element) { |
|
102 | $.each(auth_plugins_input.val().split(',') , function (index, element) { | |
103 | if (element !== "") { |
|
103 | if (element !== "") { | |
104 | elems.push(element.strip()) |
|
104 | elems.push(element.strip()) | |
105 | } |
|
105 | } | |
106 | }); |
|
106 | }); | |
107 |
|
107 | |||
108 | var cur_button = e.currentTarget; |
|
108 | var cur_button = e.currentTarget; | |
109 | var plugin_id = $(cur_button).attr('plugin_id'); |
|
109 | var plugin_id = $(cur_button).attr('plugin_id'); | |
110 | if($(cur_button).hasClass('btn-success')){ |
|
110 | if($(cur_button).hasClass('btn-success')){ | |
111 | elems.splice(elems.indexOf(plugin_id), 1); |
|
111 | elems.splice(elems.indexOf(plugin_id), 1); | |
112 | auth_plugins_input.val(elems.join(',\n')); |
|
112 | auth_plugins_input.val(elems.join(',\n')); | |
113 | $(cur_button).removeClass('btn-success'); |
|
113 | $(cur_button).removeClass('btn-success'); | |
114 | cur_button.innerHTML = _gettext('not active'); |
|
114 | cur_button.innerHTML = _gettext('not active'); | |
115 | } |
|
115 | } | |
116 | else{ |
|
116 | else{ | |
117 | if (elems.indexOf(plugin_id) === -1) { |
|
117 | if (elems.indexOf(plugin_id) === -1) { | |
118 | elems.push(plugin_id); |
|
118 | elems.push(plugin_id); | |
119 | } |
|
119 | } | |
120 | auth_plugins_input.val(elems.join(',\n')); |
|
120 | auth_plugins_input.val(elems.join(',\n')); | |
121 | $(cur_button).addClass('btn-success'); |
|
121 | $(cur_button).addClass('btn-success'); | |
122 | cur_button.innerHTML = _gettext('activated'); |
|
122 | cur_button.innerHTML = _gettext('activated'); | |
123 | } |
|
123 | } | |
124 | }); |
|
124 | }); | |
125 | </script> |
|
125 | </script> | |
126 | </%def> |
|
126 | </%def> |
@@ -1,42 +1,42 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Repositories defaults')} |
|
5 | ${_('Repositories defaults')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Repositories defaults')} |
|
14 | ${_('Repositories defaults')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_nav()"> |
|
17 | <%def name="menu_bar_nav()"> | |
18 | ${self.menu_items(active='admin')} |
|
18 | ${self.menu_items(active='admin')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 |
${self. |
|
24 | ${self.admin_menu()} | |
25 | </div> |
|
25 | </div> | |
26 |
|
26 | |||
27 | ##main |
|
27 | ##main | |
28 | <div class="sidebar-col-wrapper"> |
|
28 | <div class="sidebar-col-wrapper"> | |
29 | <div class="sidebar"> |
|
29 | <div class="sidebar"> | |
30 | <ul class="nav nav-pills nav-stacked"> |
|
30 | <ul class="nav nav-pills nav-stacked"> | |
31 | <li class="${'active' if c.active=='repositories' else ''}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Repository')}</a></li> |
|
31 | <li class="${'active' if c.active=='repositories' else ''}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Repository')}</a></li> | |
32 | </ul> |
|
32 | </ul> | |
33 | </div> |
|
33 | </div> | |
34 |
|
34 | |||
35 | <div class="main-content-full-width"> |
|
35 | <div class="main-content-full-width"> | |
36 | <%include file="/admin/defaults/defaults_${c.active}.mako"/> |
|
36 | <%include file="/admin/defaults/defaults_${c.active}.mako"/> | |
37 | </div> |
|
37 | </div> | |
38 |
|
38 | |||
39 | </div> |
|
39 | </div> | |
40 | </div> |
|
40 | </div> | |
41 |
|
41 | |||
42 | </%def> |
|
42 | </%def> |
@@ -1,49 +1,49 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Settings administration')} |
|
5 | ${_('Settings administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Settings')} |
|
14 | ${_('Settings')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_nav()"> |
|
17 | <%def name="menu_bar_nav()"> | |
18 | ${self.menu_items(active='admin')} |
|
18 | ${self.menu_items(active='admin')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="side_bar_nav()"> |
|
21 | <%def name="side_bar_nav()"> | |
22 |
|
22 | |||
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="main_content()"> |
|
25 | <%def name="main_content()"> | |
26 | Hello Admin |
|
26 | Hello Admin | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%def name="main()"> |
|
29 | <%def name="main()"> | |
30 | <div class="box"> |
|
30 | <div class="box"> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 |
${self. |
|
32 | ${self.admin_menu()} | |
33 | </div> |
|
33 | </div> | |
34 |
|
34 | |||
35 | ##main |
|
35 | ##main | |
36 | <div class='sidebar-col-wrapper'> |
|
36 | <div class='sidebar-col-wrapper'> | |
37 | <div class="sidebar"> |
|
37 | <div class="sidebar"> | |
38 | <ul class="nav nav-pills nav-stacked"> |
|
38 | <ul class="nav nav-pills nav-stacked"> | |
39 | ${self.side_bar_nav()} |
|
39 | ${self.side_bar_nav()} | |
40 | </ul> |
|
40 | </ul> | |
41 | </div> |
|
41 | </div> | |
42 |
|
42 | |||
43 | <div class="main-content-auto-width"> |
|
43 | <div class="main-content-auto-width"> | |
44 | ${self.main_content()} |
|
44 | ${self.main_content()} | |
45 | </div> |
|
45 | </div> | |
46 | </div> |
|
46 | </div> | |
47 | </div> |
|
47 | </div> | |
48 |
|
48 | |||
49 | </%def> No newline at end of file |
|
49 | </%def> |
@@ -1,65 +1,65 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Permissions Administration')} |
|
5 | ${_('Permissions Administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Permissions')} |
|
14 | ${_('Permissions')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_nav()"> |
|
17 | <%def name="menu_bar_nav()"> | |
18 | ${self.menu_items(active='admin')} |
|
18 | ${self.menu_items(active='admin')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | <div class="box"> |
|
23 | <div class="box"> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 |
${self. |
|
25 | ${self.admin_menu()} | |
26 | </div> |
|
26 | </div> | |
27 |
|
27 | |||
28 | <div class="sidebar-col-wrapper scw-small"> |
|
28 | <div class="sidebar-col-wrapper scw-small"> | |
29 | ##main |
|
29 | ##main | |
30 | <div class="sidebar"> |
|
30 | <div class="sidebar"> | |
31 | <ul class="nav nav-pills nav-stacked"> |
|
31 | <ul class="nav nav-pills nav-stacked"> | |
32 | <li class="${'active' if c.active=='application' else ''}"> |
|
32 | <li class="${'active' if c.active=='application' else ''}"> | |
33 | <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a> |
|
33 | <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a> | |
34 | </li> |
|
34 | </li> | |
35 | <li class="${'active' if c.active=='global' else ''}"> |
|
35 | <li class="${'active' if c.active=='global' else ''}"> | |
36 | <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a> |
|
36 | <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a> | |
37 | </li> |
|
37 | </li> | |
38 | <li class="${'active' if c.active=='objects' else ''}"> |
|
38 | <li class="${'active' if c.active=='objects' else ''}"> | |
39 | <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a> |
|
39 | <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a> | |
40 | </li> |
|
40 | </li> | |
41 | <li class="${'active' if c.active=='branch' else ''}"> |
|
41 | <li class="${'active' if c.active=='branch' else ''}"> | |
42 | <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a> |
|
42 | <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a> | |
43 | </li> |
|
43 | </li> | |
44 | <li class="${'active' if c.active=='ips' else ''}"> |
|
44 | <li class="${'active' if c.active=='ips' else ''}"> | |
45 | <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a> |
|
45 | <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a> | |
46 | </li> |
|
46 | </li> | |
47 | <li class="${'active' if c.active=='auth_token_access' else ''}"> |
|
47 | <li class="${'active' if c.active=='auth_token_access' else ''}"> | |
48 | <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a> |
|
48 | <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a> | |
49 | </li> |
|
49 | </li> | |
50 | <li class="${'active' if c.active=='ssh_keys' else ''}"> |
|
50 | <li class="${'active' if c.active=='ssh_keys' else ''}"> | |
51 | <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a> |
|
51 | <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a> | |
52 | </li> |
|
52 | </li> | |
53 | <li class="${'active' if c.active=='perms' else ''}"> |
|
53 | <li class="${'active' if c.active=='perms' else ''}"> | |
54 | <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a> |
|
54 | <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a> | |
55 | </li> |
|
55 | </li> | |
56 | </ul> |
|
56 | </ul> | |
57 | </div> |
|
57 | </div> | |
58 |
|
58 | |||
59 | <div class="main-content-full-width"> |
|
59 | <div class="main-content-full-width"> | |
60 | <%include file="/admin/permissions/permissions_${c.active}.mako"/> |
|
60 | <%include file="/admin/permissions/permissions_${c.active}.mako"/> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 | </div> |
|
63 | </div> | |
64 |
|
64 | |||
65 | </%def> |
|
65 | </%def> |
@@ -1,97 +1,97 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Repository groups administration')} |
|
5 | ${_('Repository groups administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="repo_group_count">0</span> ${_('repository groups')} |
|
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="repo_group_count">0</span> ${_('repository groups')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 |
${self. |
|
23 | ${self.admin_menu()} | |
24 | <ul class="links"> |
|
24 | <ul class="links"> | |
25 | %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')(): |
|
25 | %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')(): | |
26 | <li> |
|
26 | <li> | |
27 | <a href="${h.route_path('repo_group_new')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a> |
|
27 | <a href="${h.route_path('repo_group_new')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a> | |
28 | </li> |
|
28 | </li> | |
29 | %endif |
|
29 | %endif | |
30 | </ul> |
|
30 | </ul> | |
31 | </div> |
|
31 | </div> | |
32 | <div id="repos_list_wrap"> |
|
32 | <div id="repos_list_wrap"> | |
33 | <table id="group_list_table" class="display"></table> |
|
33 | <table id="group_list_table" class="display"></table> | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | <script> |
|
37 | <script> | |
38 | $(document).ready(function() { |
|
38 | $(document).ready(function() { | |
39 |
|
39 | |||
40 | var get_datatable_count = function(){ |
|
40 | var get_datatable_count = function(){ | |
41 | var api = $('#group_list_table').dataTable().api(); |
|
41 | var api = $('#group_list_table').dataTable().api(); | |
42 | $('#repo_group_count').text(api.page.info().recordsDisplay); |
|
42 | $('#repo_group_count').text(api.page.info().recordsDisplay); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 | // repo group list |
|
45 | // repo group list | |
46 | $('#group_list_table').DataTable({ |
|
46 | $('#group_list_table').DataTable({ | |
47 | data: ${c.data|n}, |
|
47 | data: ${c.data|n}, | |
48 | dom: 'rtp', |
|
48 | dom: 'rtp', | |
49 | pageLength: ${c.visual.admin_grid_items}, |
|
49 | pageLength: ${c.visual.admin_grid_items}, | |
50 | order: [[ 0, "asc" ]], |
|
50 | order: [[ 0, "asc" ]], | |
51 | columns: [ |
|
51 | columns: [ | |
52 | { data: {"_": "name", |
|
52 | { data: {"_": "name", | |
53 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
53 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
54 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, |
|
54 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |
55 | { data: {"_": "desc", |
|
55 | { data: {"_": "desc", | |
56 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
56 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
57 | { data: {"_": "last_change", |
|
57 | { data: {"_": "last_change", | |
58 | "sort": "last_change_raw", |
|
58 | "sort": "last_change_raw", | |
59 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, |
|
59 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, | |
60 | { data: {"_": "top_level_repos", |
|
60 | { data: {"_": "top_level_repos", | |
61 | "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" }, |
|
61 | "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" }, | |
62 | { data: {"_": "owner", |
|
62 | { data: {"_": "owner", | |
63 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
63 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
64 | { data: {"_": "action", |
|
64 | { data: {"_": "action", | |
65 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
65 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
66 | ], |
|
66 | ], | |
67 | language: { |
|
67 | language: { | |
68 | paginate: DEFAULT_GRID_PAGINATION, |
|
68 | paginate: DEFAULT_GRID_PAGINATION, | |
69 | emptyTable: _gettext("No repository groups available yet.") |
|
69 | emptyTable: _gettext("No repository groups available yet.") | |
70 | }, |
|
70 | }, | |
71 | "initComplete": function( settings, json ) { |
|
71 | "initComplete": function( settings, json ) { | |
72 | get_datatable_count(); |
|
72 | get_datatable_count(); | |
73 | quick_repo_menu(); |
|
73 | quick_repo_menu(); | |
74 | } |
|
74 | } | |
75 | }); |
|
75 | }); | |
76 |
|
76 | |||
77 | // update the counter when doing search |
|
77 | // update the counter when doing search | |
78 | $('#group_list_table').on( 'search.dt', function (e,settings) { |
|
78 | $('#group_list_table').on( 'search.dt', function (e,settings) { | |
79 | get_datatable_count(); |
|
79 | get_datatable_count(); | |
80 | }); |
|
80 | }); | |
81 |
|
81 | |||
82 | // filter, filter both grids |
|
82 | // filter, filter both grids | |
83 | $('#q_filter').on( 'keyup', function () { |
|
83 | $('#q_filter').on( 'keyup', function () { | |
84 |
|
84 | |||
85 | var repo_group_api = $('#group_list_table').dataTable().api(); |
|
85 | var repo_group_api = $('#group_list_table').dataTable().api(); | |
86 | repo_group_api |
|
86 | repo_group_api | |
87 | .columns(0) |
|
87 | .columns(0) | |
88 | .search(this.value) |
|
88 | .search(this.value) | |
89 | .draw(); |
|
89 | .draw(); | |
90 | }); |
|
90 | }); | |
91 |
|
91 | |||
92 | // refilter table if page load via back button |
|
92 | // refilter table if page load via back button | |
93 | $("#q_filter").trigger('keyup'); |
|
93 | $("#q_filter").trigger('keyup'); | |
94 | }); |
|
94 | }); | |
95 | </script> |
|
95 | </script> | |
96 | </%def> |
|
96 | </%def> | |
97 |
|
97 |
@@ -1,101 +1,101 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Repositories administration')} |
|
5 | ${_('Repositories administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="repo_count">0</span> ${_('repositories')} |
|
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="repo_count">0</span> ${_('repositories')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 |
${self. |
|
23 | ${self.admin_menu()} | |
24 | <ul class="links"> |
|
24 | <ul class="links"> | |
25 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
|
25 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
26 | <li> |
|
26 | <li> | |
27 | <a href="${h.route_path('repo_new')}" class="btn btn-small btn-success">${_(u'Add Repository')}</a> |
|
27 | <a href="${h.route_path('repo_new')}" class="btn btn-small btn-success">${_(u'Add Repository')}</a> | |
28 | </li> |
|
28 | </li> | |
29 | %endif |
|
29 | %endif | |
30 | </ul> |
|
30 | </ul> | |
31 | </div> |
|
31 | </div> | |
32 | <div id="repos_list_wrap"> |
|
32 | <div id="repos_list_wrap"> | |
33 | <table id="repo_list_table" class="display"></table> |
|
33 | <table id="repo_list_table" class="display"></table> | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | <script> |
|
37 | <script> | |
38 | $(document).ready(function() { |
|
38 | $(document).ready(function() { | |
39 |
|
39 | |||
40 | var get_datatable_count = function(){ |
|
40 | var get_datatable_count = function(){ | |
41 | var api = $('#repo_list_table').dataTable().api(); |
|
41 | var api = $('#repo_list_table').dataTable().api(); | |
42 | $('#repo_count').text(api.page.info().recordsDisplay); |
|
42 | $('#repo_count').text(api.page.info().recordsDisplay); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | // repo list |
|
46 | // repo list | |
47 | $('#repo_list_table').DataTable({ |
|
47 | $('#repo_list_table').DataTable({ | |
48 | data: ${c.data|n}, |
|
48 | data: ${c.data|n}, | |
49 | dom: 'rtp', |
|
49 | dom: 'rtp', | |
50 | pageLength: ${c.visual.admin_grid_items}, |
|
50 | pageLength: ${c.visual.admin_grid_items}, | |
51 | order: [[ 0, "asc" ]], |
|
51 | order: [[ 0, "asc" ]], | |
52 | columns: [ |
|
52 | columns: [ | |
53 | { data: {"_": "name", |
|
53 | { data: {"_": "name", | |
54 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
54 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
55 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, |
|
55 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |
56 | { data: {"_": "desc", |
|
56 | { data: {"_": "desc", | |
57 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
57 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
58 | { data: {"_": "last_change", |
|
58 | { data: {"_": "last_change", | |
59 | "sort": "last_change_raw", |
|
59 | "sort": "last_change_raw", | |
60 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, |
|
60 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, | |
61 | { data: {"_": "last_changeset", |
|
61 | { data: {"_": "last_changeset", | |
62 | "sort": "last_changeset_raw", |
|
62 | "sort": "last_changeset_raw", | |
63 | "type": Number}, title: "${_('Commit')}", className: "td-commit" }, |
|
63 | "type": Number}, title: "${_('Commit')}", className: "td-commit" }, | |
64 | { data: {"_": "owner", |
|
64 | { data: {"_": "owner", | |
65 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
65 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
66 | { data: {"_": "state", |
|
66 | { data: {"_": "state", | |
67 | "sort": "state"}, title: "${_('State')}", className: "td-tags td-state" }, |
|
67 | "sort": "state"}, title: "${_('State')}", className: "td-tags td-state" }, | |
68 | { data: {"_": "action", |
|
68 | { data: {"_": "action", | |
69 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
69 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
70 | ], |
|
70 | ], | |
71 | language: { |
|
71 | language: { | |
72 | paginate: DEFAULT_GRID_PAGINATION, |
|
72 | paginate: DEFAULT_GRID_PAGINATION, | |
73 | emptyTable:_gettext("No repositories available yet.") |
|
73 | emptyTable:_gettext("No repositories available yet.") | |
74 | }, |
|
74 | }, | |
75 | "initComplete": function( settings, json ) { |
|
75 | "initComplete": function( settings, json ) { | |
76 | get_datatable_count(); |
|
76 | get_datatable_count(); | |
77 | quick_repo_menu(); |
|
77 | quick_repo_menu(); | |
78 | } |
|
78 | } | |
79 | }); |
|
79 | }); | |
80 |
|
80 | |||
81 | // update the counter when doing search |
|
81 | // update the counter when doing search | |
82 | $('#repo_list_table').on( 'search.dt', function (e,settings) { |
|
82 | $('#repo_list_table').on( 'search.dt', function (e,settings) { | |
83 | get_datatable_count(); |
|
83 | get_datatable_count(); | |
84 | }); |
|
84 | }); | |
85 |
|
85 | |||
86 | // filter, filter both grids |
|
86 | // filter, filter both grids | |
87 | $('#q_filter').on( 'keyup', function () { |
|
87 | $('#q_filter').on( 'keyup', function () { | |
88 | var repo_api = $('#repo_list_table').dataTable().api(); |
|
88 | var repo_api = $('#repo_list_table').dataTable().api(); | |
89 | repo_api |
|
89 | repo_api | |
90 | .columns(0) |
|
90 | .columns(0) | |
91 | .search(this.value) |
|
91 | .search(this.value) | |
92 | .draw(); |
|
92 | .draw(); | |
93 | }); |
|
93 | }); | |
94 |
|
94 | |||
95 | // refilter table if page load via back button |
|
95 | // refilter table if page load via back button | |
96 | $("#q_filter").trigger('keyup'); |
|
96 | $("#q_filter").trigger('keyup'); | |
97 | }); |
|
97 | }); | |
98 |
|
98 | |||
99 | </script> |
|
99 | </script> | |
100 |
|
100 | |||
101 | </%def> |
|
101 | </%def> |
@@ -1,53 +1,53 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Settings administration')} |
|
5 | ${_('Settings administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Settings')} |
|
14 | ${_('Settings')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_nav()"> |
|
17 | <%def name="menu_bar_nav()"> | |
18 | ${self.menu_items(active='admin')} |
|
18 | ${self.menu_items(active='admin')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="side_bar_nav()"> |
|
21 | <%def name="side_bar_nav()"> | |
22 | % for navitem in c.navlist: |
|
22 | % for navitem in c.navlist: | |
23 | <li class="${'active' if c.active in navitem.active_list else ''}"> |
|
23 | <li class="${'active' if c.active in navitem.active_list else ''}"> | |
24 | <a href="${navitem.url}">${navitem.name}</a> |
|
24 | <a href="${navitem.url}">${navitem.name}</a> | |
25 | </li> |
|
25 | </li> | |
26 | % endfor |
|
26 | % endfor | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%def name="main_content()"> |
|
29 | <%def name="main_content()"> | |
30 | <%include file="/admin/settings/settings_${c.active}.mako"/> |
|
30 | <%include file="/admin/settings/settings_${c.active}.mako"/> | |
31 | </%def> |
|
31 | </%def> | |
32 |
|
32 | |||
33 | <%def name="main()"> |
|
33 | <%def name="main()"> | |
34 | <div class="box"> |
|
34 | <div class="box"> | |
35 | <div class="title"> |
|
35 | <div class="title"> | |
36 |
${self. |
|
36 | ${self.admin_menu()} | |
37 | </div> |
|
37 | </div> | |
38 |
|
38 | |||
39 | ##main |
|
39 | ##main | |
40 | <div class='sidebar-col-wrapper'> |
|
40 | <div class='sidebar-col-wrapper'> | |
41 | <div class="sidebar"> |
|
41 | <div class="sidebar"> | |
42 | <ul class="nav nav-pills nav-stacked"> |
|
42 | <ul class="nav nav-pills nav-stacked"> | |
43 | ${self.side_bar_nav()} |
|
43 | ${self.side_bar_nav()} | |
44 | </ul> |
|
44 | </ul> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <div class="main-content-auto-width"> |
|
47 | <div class="main-content-auto-width"> | |
48 | ${self.main_content()} |
|
48 | ${self.main_content()} | |
49 | </div> |
|
49 | </div> | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 |
|
52 | |||
53 | </%def> No newline at end of file |
|
53 | </%def> |
@@ -1,115 +1,115 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('User groups administration')} |
|
5 | ${_('User groups administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="user_group_count">0</span> |
|
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="user_group_count">0</span> | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 |
|
22 | |||
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 |
${self. |
|
24 | ${self.admin_menu()} | |
25 | <ul class="links"> |
|
25 | <ul class="links"> | |
26 | %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')(): |
|
26 | %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')(): | |
27 | <li> |
|
27 | <li> | |
28 | <a href="${h.route_path('user_groups_new')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a> |
|
28 | <a href="${h.route_path('user_groups_new')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a> | |
29 | </li> |
|
29 | </li> | |
30 | %endif |
|
30 | %endif | |
31 | </ul> |
|
31 | </ul> | |
32 | </div> |
|
32 | </div> | |
33 |
|
33 | |||
34 | <div id="repos_list_wrap"> |
|
34 | <div id="repos_list_wrap"> | |
35 | <table id="user_group_list_table" class="display"></table> |
|
35 | <table id="user_group_list_table" class="display"></table> | |
36 | </div> |
|
36 | </div> | |
37 |
|
37 | |||
38 | </div> |
|
38 | </div> | |
39 | <script> |
|
39 | <script> | |
40 | $(document).ready(function() { |
|
40 | $(document).ready(function() { | |
41 | var $userGroupsListTable = $('#user_group_list_table'); |
|
41 | var $userGroupsListTable = $('#user_group_list_table'); | |
42 |
|
42 | |||
43 | // user list |
|
43 | // user list | |
44 | $userGroupsListTable.DataTable({ |
|
44 | $userGroupsListTable.DataTable({ | |
45 | processing: true, |
|
45 | processing: true, | |
46 | serverSide: true, |
|
46 | serverSide: true, | |
47 | ajax: { |
|
47 | ajax: { | |
48 | "url": "${h.route_path('user_groups_data')}", |
|
48 | "url": "${h.route_path('user_groups_data')}", | |
49 | "dataSrc": function (json) { |
|
49 | "dataSrc": function (json) { | |
50 | var filteredCount = json.recordsFiltered; |
|
50 | var filteredCount = json.recordsFiltered; | |
51 | var filteredInactiveCount = json.recordsFilteredInactive; |
|
51 | var filteredInactiveCount = json.recordsFilteredInactive; | |
52 | var totalInactive = json.recordsTotalInactive; |
|
52 | var totalInactive = json.recordsTotalInactive; | |
53 | var total = json.recordsTotal; |
|
53 | var total = json.recordsTotal; | |
54 |
|
54 | |||
55 | var _text = _gettext( |
|
55 | var _text = _gettext( | |
56 | "{0} ({1} inactive) of {2} user groups ({3} inactive)").format( |
|
56 | "{0} ({1} inactive) of {2} user groups ({3} inactive)").format( | |
57 | filteredCount, filteredInactiveCount, total, totalInactive); |
|
57 | filteredCount, filteredInactiveCount, total, totalInactive); | |
58 |
|
58 | |||
59 | if (total === filteredCount) { |
|
59 | if (total === filteredCount) { | |
60 | _text = _gettext( |
|
60 | _text = _gettext( | |
61 | "{0} user groups ({1} inactive)").format(total, totalInactive); |
|
61 | "{0} user groups ({1} inactive)").format(total, totalInactive); | |
62 | } |
|
62 | } | |
63 | $('#user_group_count').text(_text); |
|
63 | $('#user_group_count').text(_text); | |
64 | return json.data; |
|
64 | return json.data; | |
65 | }, |
|
65 | }, | |
66 | }, |
|
66 | }, | |
67 |
|
67 | |||
68 | dom: 'rtp', |
|
68 | dom: 'rtp', | |
69 | pageLength: ${c.visual.admin_grid_items}, |
|
69 | pageLength: ${c.visual.admin_grid_items}, | |
70 | order: [[ 0, "asc" ]], |
|
70 | order: [[ 0, "asc" ]], | |
71 | columns: [ |
|
71 | columns: [ | |
72 | { data: {"_": "users_group_name", |
|
72 | { data: {"_": "users_group_name", | |
73 | "sort": "users_group_name"}, title: "${_('Name')}", className: "td-componentname" }, |
|
73 | "sort": "users_group_name"}, title: "${_('Name')}", className: "td-componentname" }, | |
74 | { data: {"_": "description", |
|
74 | { data: {"_": "description", | |
75 | "sort": "description"}, title: "${_('Description')}", className: "td-description" }, |
|
75 | "sort": "description"}, title: "${_('Description')}", className: "td-description" }, | |
76 | { data: {"_": "members", |
|
76 | { data: {"_": "members", | |
77 | "sort": "members"}, title: "${_('Members')}", className: "td-number" }, |
|
77 | "sort": "members"}, title: "${_('Members')}", className: "td-number" }, | |
78 | { data: {"_": "sync", |
|
78 | { data: {"_": "sync", | |
79 | "sort": "sync"}, title: "${_('Sync')}", className: "td-sync" }, |
|
79 | "sort": "sync"}, title: "${_('Sync')}", className: "td-sync" }, | |
80 | { data: {"_": "active", |
|
80 | { data: {"_": "active", | |
81 | "sort": "active"}, title: "${_('Active')}", className: "td-active" }, |
|
81 | "sort": "active"}, title: "${_('Active')}", className: "td-active" }, | |
82 | { data: {"_": "owner", |
|
82 | { data: {"_": "owner", | |
83 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
83 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
84 | { data: {"_": "action", |
|
84 | { data: {"_": "action", | |
85 | "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false} |
|
85 | "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false} | |
86 | ], |
|
86 | ], | |
87 | language: { |
|
87 | language: { | |
88 | paginate: DEFAULT_GRID_PAGINATION, |
|
88 | paginate: DEFAULT_GRID_PAGINATION, | |
89 | sProcessing: _gettext('loading...'), |
|
89 | sProcessing: _gettext('loading...'), | |
90 | emptyTable: _gettext("No user groups available yet.") |
|
90 | emptyTable: _gettext("No user groups available yet.") | |
91 | } |
|
91 | } | |
92 | }); |
|
92 | }); | |
93 |
|
93 | |||
94 | $userGroupsListTable.on('xhr.dt', function(e, settings, json, xhr){ |
|
94 | $userGroupsListTable.on('xhr.dt', function(e, settings, json, xhr){ | |
95 | $userGroupsListTable.css('opacity', 1); |
|
95 | $userGroupsListTable.css('opacity', 1); | |
96 | }); |
|
96 | }); | |
97 |
|
97 | |||
98 | $userGroupsListTable.on('preXhr.dt', function(e, settings, data){ |
|
98 | $userGroupsListTable.on('preXhr.dt', function(e, settings, data){ | |
99 | $userGroupsListTable.css('opacity', 0.3); |
|
99 | $userGroupsListTable.css('opacity', 0.3); | |
100 | }); |
|
100 | }); | |
101 |
|
101 | |||
102 | // filter |
|
102 | // filter | |
103 | $('#q_filter').on('keyup', |
|
103 | $('#q_filter').on('keyup', | |
104 | $.debounce(250, function() { |
|
104 | $.debounce(250, function() { | |
105 | $('#user_group_list_table').DataTable().search( |
|
105 | $('#user_group_list_table').DataTable().search( | |
106 | $('#q_filter').val() |
|
106 | $('#q_filter').val() | |
107 | ).draw(); |
|
107 | ).draw(); | |
108 | }) |
|
108 | }) | |
109 | ); |
|
109 | ); | |
110 |
|
110 | |||
111 | }); |
|
111 | }); | |
112 |
|
112 | |||
113 | </script> |
|
113 | </script> | |
114 |
|
114 | |||
115 | </%def> |
|
115 | </%def> |
@@ -1,123 +1,123 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Users administration')} |
|
5 | ${_('Users administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="user_count">0</span> |
|
13 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} » <span id="user_count">0</span> | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 |
|
21 | |||
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 |
|
23 | |||
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 |
${self. |
|
25 | ${self.admin_menu()} | |
26 | <ul class="links"> |
|
26 | <ul class="links"> | |
27 | <li> |
|
27 | <li> | |
28 | <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a> |
|
28 | <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a> | |
29 | </li> |
|
29 | </li> | |
30 | </ul> |
|
30 | </ul> | |
31 | </div> |
|
31 | </div> | |
32 |
|
32 | |||
33 | <div id="repos_list_wrap"> |
|
33 | <div id="repos_list_wrap"> | |
34 | <table id="user_list_table" class="display"></table> |
|
34 | <table id="user_list_table" class="display"></table> | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 |
|
37 | |||
38 | <script type="text/javascript"> |
|
38 | <script type="text/javascript"> | |
39 |
|
39 | |||
40 | $(document).ready(function() { |
|
40 | $(document).ready(function() { | |
41 | var $userListTable = $('#user_list_table'); |
|
41 | var $userListTable = $('#user_list_table'); | |
42 | // user list |
|
42 | // user list | |
43 | $userListTable.DataTable({ |
|
43 | $userListTable.DataTable({ | |
44 | processing: true, |
|
44 | processing: true, | |
45 | serverSide: true, |
|
45 | serverSide: true, | |
46 | ajax: { |
|
46 | ajax: { | |
47 | "url": "${h.route_path('users_data')}", |
|
47 | "url": "${h.route_path('users_data')}", | |
48 | "dataSrc": function ( json ) { |
|
48 | "dataSrc": function ( json ) { | |
49 | var filteredCount = json.recordsFiltered; |
|
49 | var filteredCount = json.recordsFiltered; | |
50 | var filteredInactiveCount = json.recordsFilteredInactive; |
|
50 | var filteredInactiveCount = json.recordsFilteredInactive; | |
51 | var totalInactive = json.recordsTotalInactive; |
|
51 | var totalInactive = json.recordsTotalInactive; | |
52 | var total = json.recordsTotal; |
|
52 | var total = json.recordsTotal; | |
53 |
|
53 | |||
54 | var _text = _gettext( |
|
54 | var _text = _gettext( | |
55 | "{0} ({1} inactive) of {2} users ({3} inactive)").format( |
|
55 | "{0} ({1} inactive) of {2} users ({3} inactive)").format( | |
56 | filteredCount, filteredInactiveCount, total, totalInactive); |
|
56 | filteredCount, filteredInactiveCount, total, totalInactive); | |
57 |
|
57 | |||
58 | if(total === filteredCount){ |
|
58 | if(total === filteredCount){ | |
59 | _text = _gettext( |
|
59 | _text = _gettext( | |
60 | "{0} users ({1} inactive)").format(total, totalInactive); |
|
60 | "{0} users ({1} inactive)").format(total, totalInactive); | |
61 | } |
|
61 | } | |
62 | $('#user_count').text(_text); |
|
62 | $('#user_count').text(_text); | |
63 | return json.data; |
|
63 | return json.data; | |
64 | } |
|
64 | } | |
65 | }, |
|
65 | }, | |
66 | dom: 'rtp', |
|
66 | dom: 'rtp', | |
67 | pageLength: ${c.visual.admin_grid_items}, |
|
67 | pageLength: ${c.visual.admin_grid_items}, | |
68 | order: [[ 0, "asc" ]], |
|
68 | order: [[ 0, "asc" ]], | |
69 | columns: [ |
|
69 | columns: [ | |
70 | { data: {"_": "username", |
|
70 | { data: {"_": "username", | |
71 | "sort": "username"}, title: "${_('Username')}", className: "td-user" }, |
|
71 | "sort": "username"}, title: "${_('Username')}", className: "td-user" }, | |
72 | { data: {"_": "email", |
|
72 | { data: {"_": "email", | |
73 | "sort": "email"}, title: "${_('Email')}", className: "td-email" }, |
|
73 | "sort": "email"}, title: "${_('Email')}", className: "td-email" }, | |
74 | { data: {"_": "first_name", |
|
74 | { data: {"_": "first_name", | |
75 | "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" }, |
|
75 | "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" }, | |
76 | { data: {"_": "last_name", |
|
76 | { data: {"_": "last_name", | |
77 | "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" }, |
|
77 | "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" }, | |
78 | { data: {"_": "last_activity", |
|
78 | { data: {"_": "last_activity", | |
79 | "sort": "last_activity", |
|
79 | "sort": "last_activity", | |
80 | "type": Number}, title: "${_('Last activity')}", className: "td-time" }, |
|
80 | "type": Number}, title: "${_('Last activity')}", className: "td-time" }, | |
81 | { data: {"_": "active", |
|
81 | { data: {"_": "active", | |
82 | "sort": "active"}, title: "${_('Active')}", className: "td-active" }, |
|
82 | "sort": "active"}, title: "${_('Active')}", className: "td-active" }, | |
83 | { data: {"_": "admin", |
|
83 | { data: {"_": "admin", | |
84 | "sort": "admin"}, title: "${_('Super admin')}", className: "td-admin" }, |
|
84 | "sort": "admin"}, title: "${_('Super admin')}", className: "td-admin" }, | |
85 | { data: {"_": "extern_type", |
|
85 | { data: {"_": "extern_type", | |
86 | "sort": "extern_type"}, title: "${_('Auth type')}", className: "td-type" }, |
|
86 | "sort": "extern_type"}, title: "${_('Auth type')}", className: "td-type" }, | |
87 | { data: {"_": "action", |
|
87 | { data: {"_": "action", | |
88 | "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false } |
|
88 | "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false } | |
89 | ], |
|
89 | ], | |
90 | language: { |
|
90 | language: { | |
91 | paginate: DEFAULT_GRID_PAGINATION, |
|
91 | paginate: DEFAULT_GRID_PAGINATION, | |
92 | sProcessing: _gettext('loading...'), |
|
92 | sProcessing: _gettext('loading...'), | |
93 | emptyTable: _gettext("No users available yet.") |
|
93 | emptyTable: _gettext("No users available yet.") | |
94 | }, |
|
94 | }, | |
95 |
|
95 | |||
96 | "createdRow": function ( row, data, index ) { |
|
96 | "createdRow": function ( row, data, index ) { | |
97 | if (!data['active_raw']){ |
|
97 | if (!data['active_raw']){ | |
98 | $(row).addClass('closed') |
|
98 | $(row).addClass('closed') | |
99 | } |
|
99 | } | |
100 | } |
|
100 | } | |
101 | }); |
|
101 | }); | |
102 |
|
102 | |||
103 | $userListTable.on('xhr.dt', function(e, settings, json, xhr){ |
|
103 | $userListTable.on('xhr.dt', function(e, settings, json, xhr){ | |
104 | $userListTable.css('opacity', 1); |
|
104 | $userListTable.css('opacity', 1); | |
105 | }); |
|
105 | }); | |
106 |
|
106 | |||
107 | $userListTable.on('preXhr.dt', function(e, settings, data){ |
|
107 | $userListTable.on('preXhr.dt', function(e, settings, data){ | |
108 | $userListTable.css('opacity', 0.3); |
|
108 | $userListTable.css('opacity', 0.3); | |
109 | }); |
|
109 | }); | |
110 |
|
110 | |||
111 | // filter |
|
111 | // filter | |
112 | $('#q_filter').on('keyup', |
|
112 | $('#q_filter').on('keyup', | |
113 | $.debounce(250, function() { |
|
113 | $.debounce(250, function() { | |
114 | $userListTable.DataTable().search( |
|
114 | $userListTable.DataTable().search( | |
115 | $('#q_filter').val() |
|
115 | $('#q_filter').val() | |
116 | ).draw(); |
|
116 | ).draw(); | |
117 | }) |
|
117 | }) | |
118 | ); |
|
118 | ); | |
119 |
|
119 | |||
120 | }); |
|
120 | }); | |
121 | </script> |
|
121 | </script> | |
122 |
|
122 | |||
123 | </%def> |
|
123 | </%def> |
@@ -1,915 +1,911 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="root.mako"/> |
|
2 | <%inherit file="root.mako"/> | |
3 |
|
3 | |||
4 | <%include file="/ejs_templates/templates.html"/> |
|
4 | <%include file="/ejs_templates/templates.html"/> | |
5 |
|
5 | |||
6 | <div class="outerwrapper"> |
|
6 | <div class="outerwrapper"> | |
7 | <!-- HEADER --> |
|
7 | <!-- HEADER --> | |
8 | <div class="header"> |
|
8 | <div class="header"> | |
9 | <div id="header-inner" class="wrapper"> |
|
9 | <div id="header-inner" class="wrapper"> | |
10 | <div id="logo"> |
|
10 | <div id="logo"> | |
11 | <div class="logo-wrapper"> |
|
11 | <div class="logo-wrapper"> | |
12 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a> |
|
12 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a> | |
13 | </div> |
|
13 | </div> | |
14 | % if c.rhodecode_name: |
|
14 | % if c.rhodecode_name: | |
15 | <div class="branding"> |
|
15 | <div class="branding"> | |
16 | <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a> |
|
16 | <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a> | |
17 | </div> |
|
17 | </div> | |
18 | % endif |
|
18 | % endif | |
19 | </div> |
|
19 | </div> | |
20 | <!-- MENU BAR NAV --> |
|
20 | <!-- MENU BAR NAV --> | |
21 | ${self.menu_bar_nav()} |
|
21 | ${self.menu_bar_nav()} | |
22 | <!-- END MENU BAR NAV --> |
|
22 | <!-- END MENU BAR NAV --> | |
23 | </div> |
|
23 | </div> | |
24 | </div> |
|
24 | </div> | |
25 | ${self.menu_bar_subnav()} |
|
25 | ${self.menu_bar_subnav()} | |
26 | <!-- END HEADER --> |
|
26 | <!-- END HEADER --> | |
27 |
|
27 | |||
28 | <!-- CONTENT --> |
|
28 | <!-- CONTENT --> | |
29 | <div id="content" class="wrapper"> |
|
29 | <div id="content" class="wrapper"> | |
30 |
|
30 | |||
31 | <rhodecode-toast id="notifications"></rhodecode-toast> |
|
31 | <rhodecode-toast id="notifications"></rhodecode-toast> | |
32 |
|
32 | |||
33 | <div class="main"> |
|
33 | <div class="main"> | |
34 | ${next.main()} |
|
34 | ${next.main()} | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 | <!-- END CONTENT --> |
|
37 | <!-- END CONTENT --> | |
38 |
|
38 | |||
39 | </div> |
|
39 | </div> | |
40 | <!-- FOOTER --> |
|
40 | <!-- FOOTER --> | |
41 | <div id="footer"> |
|
41 | <div id="footer"> | |
42 | <div id="footer-inner" class="title wrapper"> |
|
42 | <div id="footer-inner" class="title wrapper"> | |
43 | <div> |
|
43 | <div> | |
44 | <p class="footer-link-right"> |
|
44 | <p class="footer-link-right"> | |
45 | % if c.visual.show_version: |
|
45 | % if c.visual.show_version: | |
46 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} |
|
46 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} | |
47 | % endif |
|
47 | % endif | |
48 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. |
|
48 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. | |
49 | % if c.visual.rhodecode_support_url: |
|
49 | % if c.visual.rhodecode_support_url: | |
50 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
|
50 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> | |
51 | % endif |
|
51 | % endif | |
52 | </p> |
|
52 | </p> | |
53 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> |
|
53 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> | |
54 | <p class="server-instance" style="display:${sid}"> |
|
54 | <p class="server-instance" style="display:${sid}"> | |
55 | ## display hidden instance ID if specially defined |
|
55 | ## display hidden instance ID if specially defined | |
56 | % if c.rhodecode_instanceid: |
|
56 | % if c.rhodecode_instanceid: | |
57 | ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)} |
|
57 | ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)} | |
58 | % endif |
|
58 | % endif | |
59 | </p> |
|
59 | </p> | |
60 | </div> |
|
60 | </div> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 |
|
63 | |||
64 | <!-- END FOOTER --> |
|
64 | <!-- END FOOTER --> | |
65 |
|
65 | |||
66 | ### MAKO DEFS ### |
|
66 | ### MAKO DEFS ### | |
67 |
|
67 | |||
68 | <%def name="menu_bar_subnav()"> |
|
68 | <%def name="menu_bar_subnav()"> | |
69 | </%def> |
|
69 | </%def> | |
70 |
|
70 | |||
71 | <%def name="breadcrumbs(class_='breadcrumbs')"> |
|
71 | <%def name="breadcrumbs(class_='breadcrumbs')"> | |
72 | <div class="${class_}"> |
|
72 | <div class="${class_}"> | |
73 | ${self.breadcrumbs_links()} |
|
73 | ${self.breadcrumbs_links()} | |
74 | </div> |
|
74 | </div> | |
75 | </%def> |
|
75 | </%def> | |
76 |
|
76 | |||
77 | <%def name="admin_menu()"> |
|
77 | <%def name="admin_menu()"> | |
78 | <ul class="admin_menu submenu"> |
|
78 | ||
79 | <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> |
|
79 | <ul id="context-pages" class="navigation horizontal-list"> | |
80 | <li><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
80 | <% | |
81 | <li><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
|
81 | repositories=c.rhodecode_user.repositories_admin | |
82 | <li><a href="${h.route_path('users')}">${_('Users')}</a></li> |
|
82 | repository_groups=c.rhodecode_user.repository_groups_admin | |
83 | <li><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> |
|
83 | user_groups=c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')() | |
84 | <li><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li> |
|
84 | %> | |
85 | <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> |
|
85 | ## super admin case | |
86 | <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> |
|
86 | % if c.rhodecode_user.is_admin: | |
87 |
<li><a href="${h.route_path('admin_ |
|
87 | <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> | |
88 |
<li |
|
88 | <li><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> | |
89 | </ul> |
|
89 | <li><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> | |
|
90 | <li><a href="${h.route_path('users')}">${_('Users')}</a></li> | |||
|
91 | <li><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> | |||
|
92 | <li><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li> | |||
|
93 | <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> | |||
|
94 | <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> | |||
|
95 | <li><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li> | |||
|
96 | <li><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li> | |||
|
97 | ||||
|
98 | ## delegated admin | |||
|
99 | % elif repositories or repository_groups or user_groups: | |||
|
100 | ||||
|
101 | %if repositories: | |||
|
102 | <li class="local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> | |||
|
103 | %endif | |||
|
104 | %if repository_groups: | |||
|
105 | <li class="local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> | |||
|
106 | %endif | |||
|
107 | %if user_groups: | |||
|
108 | <li class="local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> | |||
|
109 | %endif | |||
|
110 | % endif | |||
|
111 | </ul> | |||
90 | </%def> |
|
112 | </%def> | |
91 |
|
113 | |||
92 |
|
114 | |||
93 | <%def name="dt_info_panel(elements)"> |
|
115 | <%def name="dt_info_panel(elements)"> | |
94 | <dl class="dl-horizontal"> |
|
116 | <dl class="dl-horizontal"> | |
95 | %for dt, dd, title, show_items in elements: |
|
117 | %for dt, dd, title, show_items in elements: | |
96 | <dt>${dt}:</dt> |
|
118 | <dt>${dt}:</dt> | |
97 | <dd title="${h.tooltip(title)}"> |
|
119 | <dd title="${h.tooltip(title)}"> | |
98 | %if callable(dd): |
|
120 | %if callable(dd): | |
99 | ## allow lazy evaluation of elements |
|
121 | ## allow lazy evaluation of elements | |
100 | ${dd()} |
|
122 | ${dd()} | |
101 | %else: |
|
123 | %else: | |
102 | ${dd} |
|
124 | ${dd} | |
103 | %endif |
|
125 | %endif | |
104 | %if show_items: |
|
126 | %if show_items: | |
105 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> |
|
127 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> | |
106 | %endif |
|
128 | %endif | |
107 | </dd> |
|
129 | </dd> | |
108 |
|
130 | |||
109 | %if show_items: |
|
131 | %if show_items: | |
110 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> |
|
132 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> | |
111 | %for item in show_items: |
|
133 | %for item in show_items: | |
112 | <dt></dt> |
|
134 | <dt></dt> | |
113 | <dd>${item}</dd> |
|
135 | <dd>${item}</dd> | |
114 | %endfor |
|
136 | %endfor | |
115 | </div> |
|
137 | </div> | |
116 | %endif |
|
138 | %endif | |
117 |
|
139 | |||
118 | %endfor |
|
140 | %endfor | |
119 | </dl> |
|
141 | </dl> | |
120 | </%def> |
|
142 | </%def> | |
121 |
|
143 | |||
122 |
|
144 | |||
123 | <%def name="gravatar(email, size=16)"> |
|
145 | <%def name="gravatar(email, size=16)"> | |
124 | <% |
|
146 | <% | |
125 | if (size > 16): |
|
147 | if (size > 16): | |
126 | gravatar_class = 'gravatar gravatar-large' |
|
148 | gravatar_class = 'gravatar gravatar-large' | |
127 | else: |
|
149 | else: | |
128 | gravatar_class = 'gravatar' |
|
150 | gravatar_class = 'gravatar' | |
129 | %> |
|
151 | %> | |
130 | <%doc> |
|
152 | <%doc> | |
131 | TODO: johbo: For now we serve double size images to make it smooth |
|
153 | TODO: johbo: For now we serve double size images to make it smooth | |
132 | for retina. This is how it worked until now. Should be replaced |
|
154 | for retina. This is how it worked until now. Should be replaced | |
133 | with a better solution at some point. |
|
155 | with a better solution at some point. | |
134 | </%doc> |
|
156 | </%doc> | |
135 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> |
|
157 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> | |
136 | </%def> |
|
158 | </%def> | |
137 |
|
159 | |||
138 |
|
160 | |||
139 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> |
|
161 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> | |
140 | <% email = h.email_or_none(contact) %> |
|
162 | <% email = h.email_or_none(contact) %> | |
141 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> |
|
163 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
142 | ${self.gravatar(email, size)} |
|
164 | ${self.gravatar(email, size)} | |
143 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> |
|
165 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> | |
144 | </div> |
|
166 | </div> | |
145 | </%def> |
|
167 | </%def> | |
146 |
|
168 | |||
147 |
|
169 | |||
148 | ## admin menu used for people that have some admin resources |
|
|||
149 | <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)"> |
|
|||
150 | <ul class="submenu"> |
|
|||
151 | %if repositories: |
|
|||
152 | <li class="local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
|||
153 | %endif |
|
|||
154 | %if repository_groups: |
|
|||
155 | <li class="local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
|
|||
156 | %endif |
|
|||
157 | %if user_groups: |
|
|||
158 | <li class="local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> |
|
|||
159 | %endif |
|
|||
160 | </ul> |
|
|||
161 | </%def> |
|
|||
162 |
|
||||
163 | <%def name="repo_page_title(repo_instance)"> |
|
170 | <%def name="repo_page_title(repo_instance)"> | |
164 | <div class="title-content"> |
|
171 | <div class="title-content"> | |
165 | <div class="title-main"> |
|
172 | <div class="title-main"> | |
166 | ## SVN/HG/GIT icons |
|
173 | ## SVN/HG/GIT icons | |
167 | %if h.is_hg(repo_instance): |
|
174 | %if h.is_hg(repo_instance): | |
168 | <i class="icon-hg"></i> |
|
175 | <i class="icon-hg"></i> | |
169 | %endif |
|
176 | %endif | |
170 | %if h.is_git(repo_instance): |
|
177 | %if h.is_git(repo_instance): | |
171 | <i class="icon-git"></i> |
|
178 | <i class="icon-git"></i> | |
172 | %endif |
|
179 | %endif | |
173 | %if h.is_svn(repo_instance): |
|
180 | %if h.is_svn(repo_instance): | |
174 | <i class="icon-svn"></i> |
|
181 | <i class="icon-svn"></i> | |
175 | %endif |
|
182 | %endif | |
176 |
|
183 | |||
177 | ## public/private |
|
184 | ## public/private | |
178 | %if repo_instance.private: |
|
185 | %if repo_instance.private: | |
179 | <i class="icon-repo-private"></i> |
|
186 | <i class="icon-repo-private"></i> | |
180 | %else: |
|
187 | %else: | |
181 | <i class="icon-repo-public"></i> |
|
188 | <i class="icon-repo-public"></i> | |
182 | %endif |
|
189 | %endif | |
183 |
|
190 | |||
184 | ## repo name with group name |
|
191 | ## repo name with group name | |
185 | ${h.breadcrumb_repo_link(repo_instance)} |
|
192 | ${h.breadcrumb_repo_link(repo_instance)} | |
186 |
|
193 | |||
187 | </div> |
|
194 | </div> | |
188 |
|
195 | |||
189 | ## FORKED |
|
196 | ## FORKED | |
190 | %if repo_instance.fork: |
|
197 | %if repo_instance.fork: | |
191 | <p> |
|
198 | <p> | |
192 | <i class="icon-code-fork"></i> ${_('Fork of')} |
|
199 | <i class="icon-code-fork"></i> ${_('Fork of')} | |
193 | ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))} |
|
200 | ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))} | |
194 | </p> |
|
201 | </p> | |
195 | %endif |
|
202 | %endif | |
196 |
|
203 | |||
197 | ## IMPORTED FROM REMOTE |
|
204 | ## IMPORTED FROM REMOTE | |
198 | %if repo_instance.clone_uri: |
|
205 | %if repo_instance.clone_uri: | |
199 | <p> |
|
206 | <p> | |
200 | <i class="icon-code-fork"></i> ${_('Clone from')} |
|
207 | <i class="icon-code-fork"></i> ${_('Clone from')} | |
201 | <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a> |
|
208 | <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a> | |
202 | </p> |
|
209 | </p> | |
203 | %endif |
|
210 | %endif | |
204 |
|
211 | |||
205 | ## LOCKING STATUS |
|
212 | ## LOCKING STATUS | |
206 | %if repo_instance.locked[0]: |
|
213 | %if repo_instance.locked[0]: | |
207 | <p class="locking_locked"> |
|
214 | <p class="locking_locked"> | |
208 | <i class="icon-repo-lock"></i> |
|
215 | <i class="icon-repo-lock"></i> | |
209 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} |
|
216 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} | |
210 | </p> |
|
217 | </p> | |
211 | %elif repo_instance.enable_locking: |
|
218 | %elif repo_instance.enable_locking: | |
212 | <p class="locking_unlocked"> |
|
219 | <p class="locking_unlocked"> | |
213 | <i class="icon-repo-unlock"></i> |
|
220 | <i class="icon-repo-unlock"></i> | |
214 | ${_('Repository not locked. Pull repository to lock it.')} |
|
221 | ${_('Repository not locked. Pull repository to lock it.')} | |
215 | </p> |
|
222 | </p> | |
216 | %endif |
|
223 | %endif | |
217 |
|
224 | |||
218 | </div> |
|
225 | </div> | |
219 | </%def> |
|
226 | </%def> | |
220 |
|
227 | |||
221 | <%def name="repo_menu(active=None)"> |
|
228 | <%def name="repo_menu(active=None)"> | |
222 | <% |
|
229 | <% | |
223 | def is_active(selected): |
|
230 | def is_active(selected): | |
224 | if selected == active: |
|
231 | if selected == active: | |
225 | return "active" |
|
232 | return "active" | |
226 | %> |
|
233 | %> | |
227 |
|
234 | |||
228 | <!--- CONTEXT BAR --> |
|
235 | <!--- CONTEXT BAR --> | |
229 | <div id="context-bar"> |
|
236 | <div id="context-bar"> | |
230 | <div class="wrapper"> |
|
237 | <div class="wrapper"> | |
231 |
|
238 | |||
232 | <div class="title"> |
|
239 | <div class="title"> | |
233 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
240 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
234 | </div> |
|
241 | </div> | |
235 |
|
242 | |||
236 | <ul id="context-pages" class="navigation horizontal-list"> |
|
243 | <ul id="context-pages" class="navigation horizontal-list"> | |
237 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> |
|
244 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> | |
238 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> |
|
245 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> | |
239 | <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li> |
|
246 | <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li> | |
240 | <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li> |
|
247 | <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li> | |
241 |
|
248 | |||
242 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" |
|
249 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" | |
243 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
250 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
244 | <li class="${is_active('showpullrequest')}"> |
|
251 | <li class="${is_active('showpullrequest')}"> | |
245 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}"> |
|
252 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}"> | |
246 | %if c.repository_pull_requests: |
|
253 | %if c.repository_pull_requests: | |
247 | <span class="pr_notifications">${c.repository_pull_requests}</span> |
|
254 | <span class="pr_notifications">${c.repository_pull_requests}</span> | |
248 | %endif |
|
255 | %endif | |
249 | <div class="menulabel">${_('Pull Requests')}</div> |
|
256 | <div class="menulabel">${_('Pull Requests')}</div> | |
250 | </a> |
|
257 | </a> | |
251 | </li> |
|
258 | </li> | |
252 | %endif |
|
259 | %endif | |
253 |
|
260 | |||
254 | <li class="${is_active('options')}"> |
|
261 | <li class="${is_active('options')}"> | |
255 | <a class="menulink dropdown"> |
|
262 | <a class="menulink dropdown"> | |
256 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
263 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |
257 | </a> |
|
264 | </a> | |
258 | <ul class="submenu"> |
|
265 | <ul class="submenu"> | |
259 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
266 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
260 | <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Repository Settings')}</a></li> |
|
267 | <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Repository Settings')}</a></li> | |
261 | %endif |
|
268 | %endif | |
262 | %if c.rhodecode_db_repo.fork: |
|
269 | %if c.rhodecode_db_repo.fork: | |
263 | <li> |
|
270 | <li> | |
264 | <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" |
|
271 | <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" | |
265 | href="${h.route_path('repo_compare', |
|
272 | href="${h.route_path('repo_compare', | |
266 | repo_name=c.rhodecode_db_repo.fork.repo_name, |
|
273 | repo_name=c.rhodecode_db_repo.fork.repo_name, | |
267 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], |
|
274 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], | |
268 | source_ref=c.rhodecode_db_repo.landing_rev[1], |
|
275 | source_ref=c.rhodecode_db_repo.landing_rev[1], | |
269 | target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], |
|
276 | target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], | |
270 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], |
|
277 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], | |
271 | _query=dict(merge=1))}" |
|
278 | _query=dict(merge=1))}" | |
272 | > |
|
279 | > | |
273 | ${_('Compare fork')} |
|
280 | ${_('Compare fork')} | |
274 | </a> |
|
281 | </a> | |
275 | </li> |
|
282 | </li> | |
276 | %endif |
|
283 | %endif | |
277 |
|
284 | |||
278 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: |
|
285 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
279 | %if c.rhodecode_db_repo.locked[0]: |
|
286 | %if c.rhodecode_db_repo.locked[0]: | |
280 | <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> |
|
287 | <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> | |
281 | %else: |
|
288 | %else: | |
282 | <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> |
|
289 | <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> | |
283 | %endif |
|
290 | %endif | |
284 | %endif |
|
291 | %endif | |
285 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
292 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
286 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
293 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
287 | <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li> |
|
294 | <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li> | |
288 | <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> |
|
295 | <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> | |
289 | %endif |
|
296 | %endif | |
290 | %endif |
|
297 | %endif | |
291 | </ul> |
|
298 | </ul> | |
292 | </li> |
|
299 | </li> | |
293 | </ul> |
|
300 | </ul> | |
294 | </div> |
|
301 | </div> | |
295 | <div class="clear"></div> |
|
302 | <div class="clear"></div> | |
296 | </div> |
|
303 | </div> | |
297 | % if c.rhodecode_db_repo.archived: |
|
304 | % if c.rhodecode_db_repo.archived: | |
298 | <div class="alert alert-warning text-center"> |
|
305 | <div class="alert alert-warning text-center"> | |
299 | <strong>${_('This repository has been archived. It is now read-only.')}</strong> |
|
306 | <strong>${_('This repository has been archived. It is now read-only.')}</strong> | |
300 | </div> |
|
307 | </div> | |
301 | % endif |
|
308 | % endif | |
302 | <!--- END CONTEXT BAR --> |
|
309 | <!--- END CONTEXT BAR --> | |
303 |
|
310 | |||
304 | </%def> |
|
311 | </%def> | |
305 |
|
312 | |||
306 | <%def name="repo_group_page_title(repo_group_instance)"> |
|
313 | <%def name="repo_group_page_title(repo_group_instance)"> | |
307 | <div class="title-content"> |
|
314 | <div class="title-content"> | |
308 | <div class="title-main"> |
|
315 | <div class="title-main"> | |
309 | ## Repository Group icon |
|
316 | ## Repository Group icon | |
310 | <i class="icon-folder-close"></i> |
|
317 | <i class="icon-folder-close"></i> | |
311 |
|
318 | |||
312 | ## repo name with group name |
|
319 | ## repo name with group name | |
313 | ${h.breadcrumb_repo_group_link(repo_group_instance)} |
|
320 | ${h.breadcrumb_repo_group_link(repo_group_instance)} | |
314 | </div> |
|
321 | </div> | |
315 |
|
322 | |||
316 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
323 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> | |
317 | <div class="repo-group-desc"> |
|
324 | <div class="repo-group-desc"> | |
318 | ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)} |
|
325 | ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)} | |
319 | </div> |
|
326 | </div> | |
320 |
|
327 | |||
321 | </div> |
|
328 | </div> | |
322 | </%def> |
|
329 | </%def> | |
323 |
|
330 | |||
324 | <%def name="repo_group_menu(active=None)"> |
|
331 | <%def name="repo_group_menu(active=None)"> | |
325 | <% |
|
332 | <% | |
326 | def is_active(selected): |
|
333 | def is_active(selected): | |
327 | if selected == active: |
|
334 | if selected == active: | |
328 | return "active" |
|
335 | return "active" | |
329 |
|
336 | |||
330 | is_admin = h.HasPermissionAny('hg.admin')('can create repos index page') |
|
337 | is_admin = h.HasPermissionAny('hg.admin')('can create repos index page') | |
331 |
|
338 | |||
332 | gr_name = c.repo_group.group_name if c.repo_group else None |
|
339 | gr_name = c.repo_group.group_name if c.repo_group else None | |
333 | # create repositories with write permission on group is set to true |
|
340 | # create repositories with write permission on group is set to true | |
334 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() |
|
341 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() | |
335 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') |
|
342 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') | |
336 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') |
|
343 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') | |
337 |
|
344 | |||
338 | %> |
|
345 | %> | |
339 |
|
346 | |||
340 | <!--- CONTEXT BAR --> |
|
347 | <!--- CONTEXT BAR --> | |
341 | <div id="context-bar"> |
|
348 | <div id="context-bar"> | |
342 | <div class="wrapper"> |
|
349 | <div class="wrapper"> | |
343 | <ul id="context-pages" class="navigation horizontal-list"> |
|
350 | <ul id="context-pages" class="navigation horizontal-list"> | |
344 | <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li> |
|
351 | <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li> | |
345 |
|
352 | |||
346 | <li class="${is_active('options')}"> |
|
353 | <li class="${is_active('options')}"> | |
347 | <a class="menulink dropdown"> |
|
354 | <a class="menulink dropdown"> | |
348 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
355 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |
349 | </a> |
|
356 | </a> | |
350 | <ul class="submenu"> |
|
357 | <ul class="submenu"> | |
351 | %if is_admin or group_admin: |
|
358 | %if is_admin or group_admin: | |
352 | <li><a href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}">${_('Group Settings')}</a></li> |
|
359 | <li><a href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}">${_('Group Settings')}</a></li> | |
353 | %endif |
|
360 | %endif | |
354 | %if is_admin or group_admin or (group_write and create_on_write): |
|
361 | %if is_admin or group_admin or (group_write and create_on_write): | |
355 | <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li> |
|
362 | <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li> | |
356 | %endif |
|
363 | %endif | |
357 | %if is_admin or group_admin: |
|
364 | %if is_admin or group_admin: | |
358 | <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li> |
|
365 | <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li> | |
359 | %endif |
|
366 | %endif | |
360 | </ul> |
|
367 | </ul> | |
361 | </li> |
|
368 | </li> | |
362 | </ul> |
|
369 | </ul> | |
363 | </div> |
|
370 | </div> | |
364 | <div class="clear"></div> |
|
371 | <div class="clear"></div> | |
365 | </div> |
|
372 | </div> | |
366 |
|
373 | |||
367 | <!--- END CONTEXT BAR --> |
|
374 | <!--- END CONTEXT BAR --> | |
368 |
|
375 | |||
369 | </%def> |
|
376 | </%def> | |
370 |
|
377 | |||
371 |
|
378 | |||
372 | <%def name="usermenu(active=False)"> |
|
379 | <%def name="usermenu(active=False)"> | |
373 | ## USER MENU |
|
380 | ## USER MENU | |
374 | <li id="quick_login_li" class="${'active' if active else ''}"> |
|
381 | <li id="quick_login_li" class="${'active' if active else ''}"> | |
375 | % if c.rhodecode_user.username == h.DEFAULT_USER: |
|
382 | % if c.rhodecode_user.username == h.DEFAULT_USER: | |
376 | <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}"> |
|
383 | <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}"> | |
377 | ${gravatar(c.rhodecode_user.email, 20)} |
|
384 | ${gravatar(c.rhodecode_user.email, 20)} | |
378 | <span class="user"> |
|
385 | <span class="user"> | |
379 | <span>${_('Sign in')}</span> |
|
386 | <span>${_('Sign in')}</span> | |
380 | </span> |
|
387 | </span> | |
381 | </a> |
|
388 | </a> | |
382 | % else: |
|
389 | % else: | |
383 | ## logged in user |
|
390 | ## logged in user | |
384 | <a id="quick_login_link" class="menulink childs"> |
|
391 | <a id="quick_login_link" class="menulink childs"> | |
385 | ${gravatar(c.rhodecode_user.email, 20)} |
|
392 | ${gravatar(c.rhodecode_user.email, 20)} | |
386 | <span class="user"> |
|
393 | <span class="user"> | |
387 | <span class="menu_link_user">${c.rhodecode_user.username}</span> |
|
394 | <span class="menu_link_user">${c.rhodecode_user.username}</span> | |
388 | <div class="show_more"></div> |
|
395 | <div class="show_more"></div> | |
389 | </span> |
|
396 | </span> | |
390 | </a> |
|
397 | </a> | |
391 | ## subnav with menu for logged in user |
|
398 | ## subnav with menu for logged in user | |
392 | <div class="user-menu submenu"> |
|
399 | <div class="user-menu submenu"> | |
393 | <div id="quick_login"> |
|
400 | <div id="quick_login"> | |
394 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
401 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
395 | <div class=""> |
|
402 | <div class=""> | |
396 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> |
|
403 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> | |
397 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> |
|
404 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> | |
398 | <div class="email">${c.rhodecode_user.email}</div> |
|
405 | <div class="email">${c.rhodecode_user.email}</div> | |
399 | </div> |
|
406 | </div> | |
400 | <div class=""> |
|
407 | <div class=""> | |
401 | <ol class="links"> |
|
408 | <ol class="links"> | |
402 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> |
|
409 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> | |
403 | % if c.rhodecode_user.personal_repo_group: |
|
410 | % if c.rhodecode_user.personal_repo_group: | |
404 | <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li> |
|
411 | <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li> | |
405 | % endif |
|
412 | % endif | |
406 | <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li> |
|
413 | <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li> | |
407 | ## bookmark-items |
|
414 | ## bookmark-items | |
408 | <li class="bookmark-items"> |
|
415 | <li class="bookmark-items"> | |
409 | ${_('Bookmarks')} |
|
416 | ${_('Bookmarks')} | |
410 | <div class="pull-right"> |
|
417 | <div class="pull-right"> | |
411 | <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a> |
|
418 | <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a> | |
412 | </div> |
|
419 | </div> | |
413 | </li> |
|
420 | </li> | |
414 | % if not c.bookmark_items: |
|
421 | % if not c.bookmark_items: | |
415 | <li> |
|
422 | <li> | |
416 | <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a> |
|
423 | <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a> | |
417 | </li> |
|
424 | </li> | |
418 | % endif |
|
425 | % endif | |
419 | % for item in c.bookmark_items: |
|
426 | % for item in c.bookmark_items: | |
420 | <li> |
|
427 | <li> | |
421 | % if item.repository: |
|
428 | % if item.repository: | |
422 | <div> |
|
429 | <div> | |
423 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
430 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
424 | <code>${item.position}</code> |
|
431 | <code>${item.position}</code> | |
425 | % if item.repository.repo_type == 'hg': |
|
432 | % if item.repository.repo_type == 'hg': | |
426 | <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i> |
|
433 | <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i> | |
427 | % elif item.repository.repo_type == 'git': |
|
434 | % elif item.repository.repo_type == 'git': | |
428 | <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i> |
|
435 | <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i> | |
429 | % elif item.repository.repo_type == 'svn': |
|
436 | % elif item.repository.repo_type == 'svn': | |
430 | <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i> |
|
437 | <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i> | |
431 | % endif |
|
438 | % endif | |
432 | ${(item.title or h.shorter(item.repository.repo_name, 30))} |
|
439 | ${(item.title or h.shorter(item.repository.repo_name, 30))} | |
433 | </a> |
|
440 | </a> | |
434 | </div> |
|
441 | </div> | |
435 | % elif item.repository_group: |
|
442 | % elif item.repository_group: | |
436 | <div> |
|
443 | <div> | |
437 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
444 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
438 | <code>${item.position}</code> |
|
445 | <code>${item.position}</code> | |
439 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> |
|
446 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> | |
440 | ${(item.title or h.shorter(item.repository_group.group_name, 30))} |
|
447 | ${(item.title or h.shorter(item.repository_group.group_name, 30))} | |
441 | </a> |
|
448 | </a> | |
442 | </div> |
|
449 | </div> | |
443 | % else: |
|
450 | % else: | |
444 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
451 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
445 | <code>${item.position}</code> |
|
452 | <code>${item.position}</code> | |
446 | ${item.title} |
|
453 | ${item.title} | |
447 | </a> |
|
454 | </a> | |
448 | % endif |
|
455 | % endif | |
449 | </li> |
|
456 | </li> | |
450 | % endfor |
|
457 | % endfor | |
451 |
|
458 | |||
452 | <li class="logout"> |
|
459 | <li class="logout"> | |
453 | ${h.secure_form(h.route_path('logout'), request=request)} |
|
460 | ${h.secure_form(h.route_path('logout'), request=request)} | |
454 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} |
|
461 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} | |
455 | ${h.end_form()} |
|
462 | ${h.end_form()} | |
456 | </li> |
|
463 | </li> | |
457 | </ol> |
|
464 | </ol> | |
458 | </div> |
|
465 | </div> | |
459 | %endif |
|
466 | %endif | |
460 | </div> |
|
467 | </div> | |
461 | </div> |
|
468 | </div> | |
462 | ## unread counter |
|
469 | ## unread counter | |
463 | <div class="pill_container"> |
|
470 | <div class="pill_container"> | |
464 | <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a> |
|
471 | <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a> | |
465 | </div> |
|
472 | </div> | |
466 | % endif |
|
473 | % endif | |
467 | </li> |
|
474 | </li> | |
468 | </%def> |
|
475 | </%def> | |
469 |
|
476 | |||
470 | <%def name="menu_items(active=None)"> |
|
477 | <%def name="menu_items(active=None)"> | |
471 | <% |
|
478 | <% | |
472 | def is_active(selected): |
|
479 | def is_active(selected): | |
473 | if selected == active: |
|
480 | if selected == active: | |
474 | return "active" |
|
481 | return "active" | |
475 | return "" |
|
482 | return "" | |
476 | %> |
|
483 | %> | |
477 |
|
484 | |||
478 | <ul id="quick" class="main_nav navigation horizontal-list"> |
|
485 | <ul id="quick" class="main_nav navigation horizontal-list"> | |
479 | ## notice box for important system messages |
|
486 | ## notice box for important system messages | |
480 | <li style="display: none"> |
|
487 | <li style="display: none"> | |
481 | <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false"> |
|
488 | <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false"> | |
482 | <div class="menulabel-notice" > |
|
489 | <div class="menulabel-notice" > | |
483 | 0 |
|
490 | 0 | |
484 | </div> |
|
491 | </div> | |
485 | </a> |
|
492 | </a> | |
486 | </li> |
|
493 | </li> | |
487 |
|
494 | |||
488 | ## Main filter |
|
495 | ## Main filter | |
489 | <li> |
|
496 | <li> | |
490 | <div class="menulabel main_filter_box"> |
|
497 | <div class="menulabel main_filter_box"> | |
491 | <div class="main_filter_input_box"> |
|
498 | <div class="main_filter_input_box"> | |
492 | <ul class="searchItems"> |
|
499 | <ul class="searchItems"> | |
493 |
|
500 | |||
494 | % if c.template_context['search_context']['repo_id']: |
|
501 | % if c.template_context['search_context']['repo_id']: | |
495 | <li class="searchTag searchTagFilter searchTagHidable" > |
|
502 | <li class="searchTag searchTagFilter searchTagHidable" > | |
496 | ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}"> |
|
503 | ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}"> | |
497 | <span class="tag"> |
|
504 | <span class="tag"> | |
498 | This repo |
|
505 | This repo | |
499 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> |
|
506 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> | |
500 | </span> |
|
507 | </span> | |
501 | ##</a> |
|
508 | ##</a> | |
502 | </li> |
|
509 | </li> | |
503 | % elif c.template_context['search_context']['repo_group_id']: |
|
510 | % elif c.template_context['search_context']['repo_group_id']: | |
504 | <li class="searchTag searchTagFilter searchTagHidable"> |
|
511 | <li class="searchTag searchTagFilter searchTagHidable"> | |
505 | ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}"> |
|
512 | ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}"> | |
506 | <span class="tag"> |
|
513 | <span class="tag"> | |
507 | This group |
|
514 | This group | |
508 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> |
|
515 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> | |
509 | </span> |
|
516 | </span> | |
510 | ##</a> |
|
517 | ##</a> | |
511 | </li> |
|
518 | </li> | |
512 | % endif |
|
519 | % endif | |
513 |
|
520 | |||
514 | <li class="searchTagInput"> |
|
521 | <li class="searchTagInput"> | |
515 | <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" /> |
|
522 | <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" /> | |
516 | </li> |
|
523 | </li> | |
517 | <li class="searchTag searchTagHelp"> |
|
524 | <li class="searchTag searchTagHelp"> | |
518 | <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a> |
|
525 | <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a> | |
519 | </li> |
|
526 | </li> | |
520 | </ul> |
|
527 | </ul> | |
521 | </div> |
|
528 | </div> | |
522 | </div> |
|
529 | </div> | |
523 |
|
530 | |||
524 | <div id="main_filter_help" style="display: none"> |
|
531 | <div id="main_filter_help" style="display: none"> | |
525 | - Use '/' key to quickly access this field. |
|
532 | - Use '/' key to quickly access this field. | |
526 |
|
533 | |||
527 | - Enter a name of repository, or repository group for quick search. |
|
534 | - Enter a name of repository, or repository group for quick search. | |
528 |
|
535 | |||
529 | - Prefix query to allow special search: |
|
536 | - Prefix query to allow special search: | |
530 |
|
537 | |||
531 | user:admin, to search for usernames, always global |
|
538 | user:admin, to search for usernames, always global | |
532 |
|
539 | |||
533 | user_group:devops, to search for user groups, always global |
|
540 | user_group:devops, to search for user groups, always global | |
534 |
|
541 | |||
535 | commit:efced4, to search for commits, scoped to repositories or groups |
|
542 | commit:efced4, to search for commits, scoped to repositories or groups | |
536 |
|
543 | |||
537 | file:models.py, to search for file paths, scoped to repositories or groups |
|
544 | file:models.py, to search for file paths, scoped to repositories or groups | |
538 |
|
545 | |||
539 | % if c.template_context['search_context']['repo_id']: |
|
546 | % if c.template_context['search_context']['repo_id']: | |
540 | For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a> |
|
547 | For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a> | |
541 | % elif c.template_context['search_context']['repo_group_id']: |
|
548 | % elif c.template_context['search_context']['repo_group_id']: | |
542 | For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a> |
|
549 | For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a> | |
543 | % else: |
|
550 | % else: | |
544 | For advanced full text search visit: <a href="${h.route_path('search')}">global search</a> |
|
551 | For advanced full text search visit: <a href="${h.route_path('search')}">global search</a> | |
545 | % endif |
|
552 | % endif | |
546 | </div> |
|
553 | </div> | |
547 | </li> |
|
554 | </li> | |
548 |
|
555 | |||
549 | ## ROOT MENU |
|
556 | ## ROOT MENU | |
550 | <li class="${is_active('home')}"> |
|
557 | <li class="${is_active('home')}"> | |
551 | <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}"> |
|
558 | <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}"> | |
552 | <div class="menulabel">${_('Home')}</div> |
|
559 | <div class="menulabel">${_('Home')}</div> | |
553 | </a> |
|
560 | </a> | |
554 | </li> |
|
561 | </li> | |
555 |
|
562 | |||
556 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
563 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
557 | <li class="${is_active('journal')}"> |
|
564 | <li class="${is_active('journal')}"> | |
558 | <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}"> |
|
565 | <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}"> | |
559 | <div class="menulabel">${_('Journal')}</div> |
|
566 | <div class="menulabel">${_('Journal')}</div> | |
560 | </a> |
|
567 | </a> | |
561 | </li> |
|
568 | </li> | |
562 | %else: |
|
569 | %else: | |
563 | <li class="${is_active('journal')}"> |
|
570 | <li class="${is_active('journal')}"> | |
564 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}"> |
|
571 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}"> | |
565 | <div class="menulabel">${_('Public journal')}</div> |
|
572 | <div class="menulabel">${_('Public journal')}</div> | |
566 | </a> |
|
573 | </a> | |
567 | </li> |
|
574 | </li> | |
568 | %endif |
|
575 | %endif | |
569 |
|
576 | |||
570 | <li class="${is_active('gists')}"> |
|
577 | <li class="${is_active('gists')}"> | |
571 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}"> |
|
578 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}"> | |
572 | <div class="menulabel">${_('Gists')}</div> |
|
579 | <div class="menulabel">${_('Gists')}</div> | |
573 | </a> |
|
580 | </a> | |
574 | </li> |
|
581 | </li> | |
575 |
|
|
582 | ||
576 | % if h.HasPermissionAll('hg.admin')('access admin main page'): |
|
|||
577 | <li class="${is_active('admin')}"> |
|
583 | <li class="${is_active('admin')}"> | |
578 |
<a class="menulink childs" title="${_('Admin settings')}" href=" |
|
584 | <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}"> | |
579 |
<div class="menulabel">${_('Admin')} < |
|
585 | <div class="menulabel">${_('Admin')} </div> | |
580 | </a> |
|
586 | </a> | |
581 | ${admin_menu()} |
|
|||
582 | </li> |
|
587 | </li> | |
583 | % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin: |
|
588 | ||
584 | <li class="${is_active('admin')}"> |
|
|||
585 | <a class="menulink childs" title="${_('Delegated Admin settings')}"> |
|
|||
586 | <div class="menulabel">${_('Admin')} <div class="show_more"></div></div> |
|
|||
587 | </a> |
|
|||
588 | ${admin_menu_simple(c.rhodecode_user.repositories_admin, |
|
|||
589 | c.rhodecode_user.repository_groups_admin, |
|
|||
590 | c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())} |
|
|||
591 | </li> |
|
|||
592 | % endif |
|
|||
593 | ## render extra user menu |
|
589 | ## render extra user menu | |
594 |
|
|
590 | ${usermenu(active=(active=='my_account'))} | |
595 |
|
591 | |||
596 | % if c.debug_style: |
|
592 | % if c.debug_style: | |
597 | <li> |
|
593 | <li> | |
598 | <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}"> |
|
594 | <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}"> | |
599 | <div class="menulabel">${_('[Style]')}</div> |
|
595 | <div class="menulabel">${_('[Style]')}</div> | |
600 | </a> |
|
596 | </a> | |
601 | </li> |
|
597 | </li> | |
602 | % endif |
|
598 | % endif | |
603 | </ul> |
|
599 | </ul> | |
604 |
|
600 | |||
605 | <script type="text/javascript"> |
|
601 | <script type="text/javascript"> | |
606 | var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True"; |
|
602 | var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True"; | |
607 |
|
603 | |||
608 | var formatRepoResult = function(result, container, query, escapeMarkup) { |
|
604 | var formatRepoResult = function(result, container, query, escapeMarkup) { | |
609 | return function(data, escapeMarkup) { |
|
605 | return function(data, escapeMarkup) { | |
610 | if (!data.repo_id){ |
|
606 | if (!data.repo_id){ | |
611 | return data.text; // optgroup text Repositories |
|
607 | return data.text; // optgroup text Repositories | |
612 | } |
|
608 | } | |
613 |
|
609 | |||
614 | var tmpl = ''; |
|
610 | var tmpl = ''; | |
615 | var repoType = data['repo_type']; |
|
611 | var repoType = data['repo_type']; | |
616 | var repoName = data['text']; |
|
612 | var repoName = data['text']; | |
617 |
|
613 | |||
618 | if(data && data.type == 'repo'){ |
|
614 | if(data && data.type == 'repo'){ | |
619 | if(repoType === 'hg'){ |
|
615 | if(repoType === 'hg'){ | |
620 | tmpl += '<i class="icon-hg"></i> '; |
|
616 | tmpl += '<i class="icon-hg"></i> '; | |
621 | } |
|
617 | } | |
622 | else if(repoType === 'git'){ |
|
618 | else if(repoType === 'git'){ | |
623 | tmpl += '<i class="icon-git"></i> '; |
|
619 | tmpl += '<i class="icon-git"></i> '; | |
624 | } |
|
620 | } | |
625 | else if(repoType === 'svn'){ |
|
621 | else if(repoType === 'svn'){ | |
626 | tmpl += '<i class="icon-svn"></i> '; |
|
622 | tmpl += '<i class="icon-svn"></i> '; | |
627 | } |
|
623 | } | |
628 | if(data['private']){ |
|
624 | if(data['private']){ | |
629 | tmpl += '<i class="icon-lock" ></i> '; |
|
625 | tmpl += '<i class="icon-lock" ></i> '; | |
630 | } |
|
626 | } | |
631 | else if(visualShowPublicIcon){ |
|
627 | else if(visualShowPublicIcon){ | |
632 | tmpl += '<i class="icon-unlock-alt"></i> '; |
|
628 | tmpl += '<i class="icon-unlock-alt"></i> '; | |
633 | } |
|
629 | } | |
634 | } |
|
630 | } | |
635 | tmpl += escapeMarkup(repoName); |
|
631 | tmpl += escapeMarkup(repoName); | |
636 | return tmpl; |
|
632 | return tmpl; | |
637 |
|
633 | |||
638 | }(result, escapeMarkup); |
|
634 | }(result, escapeMarkup); | |
639 | }; |
|
635 | }; | |
640 |
|
636 | |||
641 | var formatRepoGroupResult = function(result, container, query, escapeMarkup) { |
|
637 | var formatRepoGroupResult = function(result, container, query, escapeMarkup) { | |
642 | return function(data, escapeMarkup) { |
|
638 | return function(data, escapeMarkup) { | |
643 | if (!data.repo_group_id){ |
|
639 | if (!data.repo_group_id){ | |
644 | return data.text; // optgroup text Repositories |
|
640 | return data.text; // optgroup text Repositories | |
645 | } |
|
641 | } | |
646 |
|
642 | |||
647 | var tmpl = ''; |
|
643 | var tmpl = ''; | |
648 | var repoGroupName = data['text']; |
|
644 | var repoGroupName = data['text']; | |
649 |
|
645 | |||
650 | if(data){ |
|
646 | if(data){ | |
651 |
|
647 | |||
652 | tmpl += '<i class="icon-folder-close"></i> '; |
|
648 | tmpl += '<i class="icon-folder-close"></i> '; | |
653 |
|
649 | |||
654 | } |
|
650 | } | |
655 | tmpl += escapeMarkup(repoGroupName); |
|
651 | tmpl += escapeMarkup(repoGroupName); | |
656 | return tmpl; |
|
652 | return tmpl; | |
657 |
|
653 | |||
658 | }(result, escapeMarkup); |
|
654 | }(result, escapeMarkup); | |
659 | }; |
|
655 | }; | |
660 |
|
656 | |||
661 | var escapeRegExChars = function (value) { |
|
657 | var escapeRegExChars = function (value) { | |
662 | return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
658 | return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
663 | }; |
|
659 | }; | |
664 |
|
660 | |||
665 | var getRepoIcon = function(repo_type) { |
|
661 | var getRepoIcon = function(repo_type) { | |
666 | if (repo_type === 'hg') { |
|
662 | if (repo_type === 'hg') { | |
667 | return '<i class="icon-hg"></i> '; |
|
663 | return '<i class="icon-hg"></i> '; | |
668 | } |
|
664 | } | |
669 | else if (repo_type === 'git') { |
|
665 | else if (repo_type === 'git') { | |
670 | return '<i class="icon-git"></i> '; |
|
666 | return '<i class="icon-git"></i> '; | |
671 | } |
|
667 | } | |
672 | else if (repo_type === 'svn') { |
|
668 | else if (repo_type === 'svn') { | |
673 | return '<i class="icon-svn"></i> '; |
|
669 | return '<i class="icon-svn"></i> '; | |
674 | } |
|
670 | } | |
675 | return '' |
|
671 | return '' | |
676 | }; |
|
672 | }; | |
677 |
|
673 | |||
678 | var autocompleteMainFilterFormatResult = function (data, value, org_formatter) { |
|
674 | var autocompleteMainFilterFormatResult = function (data, value, org_formatter) { | |
679 |
|
675 | |||
680 | if (value.split(':').length === 2) { |
|
676 | if (value.split(':').length === 2) { | |
681 | value = value.split(':')[1] |
|
677 | value = value.split(':')[1] | |
682 | } |
|
678 | } | |
683 |
|
679 | |||
684 | var searchType = data['type']; |
|
680 | var searchType = data['type']; | |
685 | var valueDisplay = data['value_display']; |
|
681 | var valueDisplay = data['value_display']; | |
686 |
|
682 | |||
687 | var pattern = '(' + escapeRegExChars(value) + ')'; |
|
683 | var pattern = '(' + escapeRegExChars(value) + ')'; | |
688 |
|
684 | |||
689 | valueDisplay = Select2.util.escapeMarkup(valueDisplay); |
|
685 | valueDisplay = Select2.util.escapeMarkup(valueDisplay); | |
690 |
|
686 | |||
691 | // highlight match |
|
687 | // highlight match | |
692 | if (searchType != 'text') { |
|
688 | if (searchType != 'text') { | |
693 | valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>'); |
|
689 | valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>'); | |
694 | } |
|
690 | } | |
695 |
|
691 | |||
696 | var icon = ''; |
|
692 | var icon = ''; | |
697 |
|
693 | |||
698 | if (searchType === 'hint') { |
|
694 | if (searchType === 'hint') { | |
699 | icon += '<i class="icon-folder-close"></i> '; |
|
695 | icon += '<i class="icon-folder-close"></i> '; | |
700 | } |
|
696 | } | |
701 | // full text search |
|
697 | // full text search | |
702 | else if (searchType === 'search') { |
|
698 | else if (searchType === 'search') { | |
703 | icon += '<i class="icon-more"></i> '; |
|
699 | icon += '<i class="icon-more"></i> '; | |
704 | } |
|
700 | } | |
705 | // repository |
|
701 | // repository | |
706 | else if (searchType === 'repo') { |
|
702 | else if (searchType === 'repo') { | |
707 |
|
703 | |||
708 | var repoIcon = getRepoIcon(data['repo_type']); |
|
704 | var repoIcon = getRepoIcon(data['repo_type']); | |
709 | icon += repoIcon; |
|
705 | icon += repoIcon; | |
710 |
|
706 | |||
711 | if (data['private']) { |
|
707 | if (data['private']) { | |
712 | icon += '<i class="icon-lock" ></i> '; |
|
708 | icon += '<i class="icon-lock" ></i> '; | |
713 | } |
|
709 | } | |
714 | else if (visualShowPublicIcon) { |
|
710 | else if (visualShowPublicIcon) { | |
715 | icon += '<i class="icon-unlock-alt"></i> '; |
|
711 | icon += '<i class="icon-unlock-alt"></i> '; | |
716 | } |
|
712 | } | |
717 | } |
|
713 | } | |
718 | // repository groups |
|
714 | // repository groups | |
719 | else if (searchType === 'repo_group') { |
|
715 | else if (searchType === 'repo_group') { | |
720 | icon += '<i class="icon-folder-close"></i> '; |
|
716 | icon += '<i class="icon-folder-close"></i> '; | |
721 | } |
|
717 | } | |
722 | // user group |
|
718 | // user group | |
723 | else if (searchType === 'user_group') { |
|
719 | else if (searchType === 'user_group') { | |
724 | icon += '<i class="icon-group"></i> '; |
|
720 | icon += '<i class="icon-group"></i> '; | |
725 | } |
|
721 | } | |
726 | // user |
|
722 | // user | |
727 | else if (searchType === 'user') { |
|
723 | else if (searchType === 'user') { | |
728 | icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']); |
|
724 | icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']); | |
729 | } |
|
725 | } | |
730 | // commit |
|
726 | // commit | |
731 | else if (searchType === 'commit') { |
|
727 | else if (searchType === 'commit') { | |
732 | var repo_data = data['repo_data']; |
|
728 | var repo_data = data['repo_data']; | |
733 | var repoIcon = getRepoIcon(repo_data['repository_type']); |
|
729 | var repoIcon = getRepoIcon(repo_data['repository_type']); | |
734 | if (repoIcon) { |
|
730 | if (repoIcon) { | |
735 | icon += repoIcon; |
|
731 | icon += repoIcon; | |
736 | } else { |
|
732 | } else { | |
737 | icon += '<i class="icon-tag"></i>'; |
|
733 | icon += '<i class="icon-tag"></i>'; | |
738 | } |
|
734 | } | |
739 | } |
|
735 | } | |
740 | // file |
|
736 | // file | |
741 | else if (searchType === 'file') { |
|
737 | else if (searchType === 'file') { | |
742 | var repo_data = data['repo_data']; |
|
738 | var repo_data = data['repo_data']; | |
743 | var repoIcon = getRepoIcon(repo_data['repository_type']); |
|
739 | var repoIcon = getRepoIcon(repo_data['repository_type']); | |
744 | if (repoIcon) { |
|
740 | if (repoIcon) { | |
745 | icon += repoIcon; |
|
741 | icon += repoIcon; | |
746 | } else { |
|
742 | } else { | |
747 | icon += '<i class="icon-tag"></i>'; |
|
743 | icon += '<i class="icon-tag"></i>'; | |
748 | } |
|
744 | } | |
749 | } |
|
745 | } | |
750 | // generic text |
|
746 | // generic text | |
751 | else if (searchType === 'text') { |
|
747 | else if (searchType === 'text') { | |
752 | icon = ''; |
|
748 | icon = ''; | |
753 | } |
|
749 | } | |
754 |
|
750 | |||
755 | var tmpl = '<div class="ac-container-wrap">{0}{1}</div>'; |
|
751 | var tmpl = '<div class="ac-container-wrap">{0}{1}</div>'; | |
756 | return tmpl.format(icon, valueDisplay); |
|
752 | return tmpl.format(icon, valueDisplay); | |
757 | }; |
|
753 | }; | |
758 |
|
754 | |||
759 | var handleSelect = function(element, suggestion) { |
|
755 | var handleSelect = function(element, suggestion) { | |
760 | if (suggestion.type === "hint") { |
|
756 | if (suggestion.type === "hint") { | |
761 | // we skip action |
|
757 | // we skip action | |
762 | $('#main_filter').focus(); |
|
758 | $('#main_filter').focus(); | |
763 | } |
|
759 | } | |
764 | else if (suggestion.type === "text") { |
|
760 | else if (suggestion.type === "text") { | |
765 | // we skip action |
|
761 | // we skip action | |
766 | $('#main_filter').focus(); |
|
762 | $('#main_filter').focus(); | |
767 |
|
763 | |||
768 | } else { |
|
764 | } else { | |
769 | window.location = suggestion['url']; |
|
765 | window.location = suggestion['url']; | |
770 | } |
|
766 | } | |
771 | }; |
|
767 | }; | |
772 |
|
768 | |||
773 | var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { |
|
769 | var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { | |
774 | if (queryLowerCase.split(':').length === 2) { |
|
770 | if (queryLowerCase.split(':').length === 2) { | |
775 | queryLowerCase = queryLowerCase.split(':')[1] |
|
771 | queryLowerCase = queryLowerCase.split(':')[1] | |
776 | } |
|
772 | } | |
777 | if (suggestion.type === "text") { |
|
773 | if (suggestion.type === "text") { | |
778 | // special case we don't want to "skip" display for |
|
774 | // special case we don't want to "skip" display for | |
779 | return true |
|
775 | return true | |
780 | } |
|
776 | } | |
781 | return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; |
|
777 | return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; | |
782 | }; |
|
778 | }; | |
783 |
|
779 | |||
784 | var cleanContext = { |
|
780 | var cleanContext = { | |
785 | repo_view_type: null, |
|
781 | repo_view_type: null, | |
786 |
|
782 | |||
787 | repo_id: null, |
|
783 | repo_id: null, | |
788 | repo_name: "", |
|
784 | repo_name: "", | |
789 |
|
785 | |||
790 | repo_group_id: null, |
|
786 | repo_group_id: null, | |
791 | repo_group_name: null |
|
787 | repo_group_name: null | |
792 | }; |
|
788 | }; | |
793 | var removeGoToFilter = function () { |
|
789 | var removeGoToFilter = function () { | |
794 | $('.searchTagHidable').hide(); |
|
790 | $('.searchTagHidable').hide(); | |
795 | $('#main_filter').autocomplete( |
|
791 | $('#main_filter').autocomplete( | |
796 | 'setOptions', {params:{search_context: cleanContext}}); |
|
792 | 'setOptions', {params:{search_context: cleanContext}}); | |
797 | }; |
|
793 | }; | |
798 |
|
794 | |||
799 | $('#main_filter').autocomplete({ |
|
795 | $('#main_filter').autocomplete({ | |
800 | serviceUrl: pyroutes.url('goto_switcher_data'), |
|
796 | serviceUrl: pyroutes.url('goto_switcher_data'), | |
801 | params: { |
|
797 | params: { | |
802 | "search_context": templateContext.search_context |
|
798 | "search_context": templateContext.search_context | |
803 | }, |
|
799 | }, | |
804 | minChars:2, |
|
800 | minChars:2, | |
805 | maxHeight:400, |
|
801 | maxHeight:400, | |
806 | deferRequestBy: 300, //miliseconds |
|
802 | deferRequestBy: 300, //miliseconds | |
807 | tabDisabled: true, |
|
803 | tabDisabled: true, | |
808 | autoSelectFirst: false, |
|
804 | autoSelectFirst: false, | |
809 | formatResult: autocompleteMainFilterFormatResult, |
|
805 | formatResult: autocompleteMainFilterFormatResult, | |
810 | lookupFilter: autocompleteMainFilterResult, |
|
806 | lookupFilter: autocompleteMainFilterResult, | |
811 | onSelect: function (element, suggestion) { |
|
807 | onSelect: function (element, suggestion) { | |
812 | handleSelect(element, suggestion); |
|
808 | handleSelect(element, suggestion); | |
813 | return false; |
|
809 | return false; | |
814 | }, |
|
810 | }, | |
815 | onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { |
|
811 | onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { | |
816 | if (jqXHR !== 'abort') { |
|
812 | if (jqXHR !== 'abort') { | |
817 | alert("Error during search.\nError code: {0}".format(textStatus)); |
|
813 | alert("Error during search.\nError code: {0}".format(textStatus)); | |
818 | window.location = ''; |
|
814 | window.location = ''; | |
819 | } |
|
815 | } | |
820 | } |
|
816 | } | |
821 | }); |
|
817 | }); | |
822 |
|
818 | |||
823 | showMainFilterBox = function () { |
|
819 | showMainFilterBox = function () { | |
824 | $('#main_filter_help').toggle(); |
|
820 | $('#main_filter_help').toggle(); | |
825 | }; |
|
821 | }; | |
826 |
|
822 | |||
827 | $('#main_filter').on('keydown.autocomplete', function (e) { |
|
823 | $('#main_filter').on('keydown.autocomplete', function (e) { | |
828 |
|
824 | |||
829 | var BACKSPACE = 8; |
|
825 | var BACKSPACE = 8; | |
830 | var el = $(e.currentTarget); |
|
826 | var el = $(e.currentTarget); | |
831 | if(e.which === BACKSPACE){ |
|
827 | if(e.which === BACKSPACE){ | |
832 | var inputVal = el.val(); |
|
828 | var inputVal = el.val(); | |
833 | if (inputVal === ""){ |
|
829 | if (inputVal === ""){ | |
834 | removeGoToFilter() |
|
830 | removeGoToFilter() | |
835 | } |
|
831 | } | |
836 | } |
|
832 | } | |
837 | }); |
|
833 | }); | |
838 |
|
834 | |||
839 | </script> |
|
835 | </script> | |
840 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> |
|
836 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> | |
841 | </%def> |
|
837 | </%def> | |
842 |
|
838 | |||
843 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
|
839 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
844 | <div class="modal-dialog"> |
|
840 | <div class="modal-dialog"> | |
845 | <div class="modal-content"> |
|
841 | <div class="modal-content"> | |
846 | <div class="modal-header"> |
|
842 | <div class="modal-header"> | |
847 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
843 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
848 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> |
|
844 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> | |
849 | </div> |
|
845 | </div> | |
850 | <div class="modal-body"> |
|
846 | <div class="modal-body"> | |
851 | <div class="block-left"> |
|
847 | <div class="block-left"> | |
852 | <table class="keyboard-mappings"> |
|
848 | <table class="keyboard-mappings"> | |
853 | <tbody> |
|
849 | <tbody> | |
854 | <tr> |
|
850 | <tr> | |
855 | <th></th> |
|
851 | <th></th> | |
856 | <th>${_('Site-wide shortcuts')}</th> |
|
852 | <th>${_('Site-wide shortcuts')}</th> | |
857 | </tr> |
|
853 | </tr> | |
858 | <% |
|
854 | <% | |
859 | elems = [ |
|
855 | elems = [ | |
860 | ('/', 'Use quick search box'), |
|
856 | ('/', 'Use quick search box'), | |
861 | ('g h', 'Goto home page'), |
|
857 | ('g h', 'Goto home page'), | |
862 | ('g g', 'Goto my private gists page'), |
|
858 | ('g g', 'Goto my private gists page'), | |
863 | ('g G', 'Goto my public gists page'), |
|
859 | ('g G', 'Goto my public gists page'), | |
864 | ('g 0-9', 'Goto bookmarked items from 0-9'), |
|
860 | ('g 0-9', 'Goto bookmarked items from 0-9'), | |
865 | ('n r', 'New repository page'), |
|
861 | ('n r', 'New repository page'), | |
866 | ('n g', 'New gist page'), |
|
862 | ('n g', 'New gist page'), | |
867 | ] |
|
863 | ] | |
868 | %> |
|
864 | %> | |
869 | %for key, desc in elems: |
|
865 | %for key, desc in elems: | |
870 | <tr> |
|
866 | <tr> | |
871 | <td class="keys"> |
|
867 | <td class="keys"> | |
872 | <span class="key tag">${key}</span> |
|
868 | <span class="key tag">${key}</span> | |
873 | </td> |
|
869 | </td> | |
874 | <td>${desc}</td> |
|
870 | <td>${desc}</td> | |
875 | </tr> |
|
871 | </tr> | |
876 | %endfor |
|
872 | %endfor | |
877 | </tbody> |
|
873 | </tbody> | |
878 | </table> |
|
874 | </table> | |
879 | </div> |
|
875 | </div> | |
880 | <div class="block-left"> |
|
876 | <div class="block-left"> | |
881 | <table class="keyboard-mappings"> |
|
877 | <table class="keyboard-mappings"> | |
882 | <tbody> |
|
878 | <tbody> | |
883 | <tr> |
|
879 | <tr> | |
884 | <th></th> |
|
880 | <th></th> | |
885 | <th>${_('Repositories')}</th> |
|
881 | <th>${_('Repositories')}</th> | |
886 | </tr> |
|
882 | </tr> | |
887 | <% |
|
883 | <% | |
888 | elems = [ |
|
884 | elems = [ | |
889 | ('g s', 'Goto summary page'), |
|
885 | ('g s', 'Goto summary page'), | |
890 | ('g c', 'Goto changelog page'), |
|
886 | ('g c', 'Goto changelog page'), | |
891 | ('g f', 'Goto files page'), |
|
887 | ('g f', 'Goto files page'), | |
892 | ('g F', 'Goto files page with file search activated'), |
|
888 | ('g F', 'Goto files page with file search activated'), | |
893 | ('g p', 'Goto pull requests page'), |
|
889 | ('g p', 'Goto pull requests page'), | |
894 | ('g o', 'Goto repository settings'), |
|
890 | ('g o', 'Goto repository settings'), | |
895 | ('g O', 'Goto repository permissions settings'), |
|
891 | ('g O', 'Goto repository permissions settings'), | |
896 | ] |
|
892 | ] | |
897 | %> |
|
893 | %> | |
898 | %for key, desc in elems: |
|
894 | %for key, desc in elems: | |
899 | <tr> |
|
895 | <tr> | |
900 | <td class="keys"> |
|
896 | <td class="keys"> | |
901 | <span class="key tag">${key}</span> |
|
897 | <span class="key tag">${key}</span> | |
902 | </td> |
|
898 | </td> | |
903 | <td>${desc}</td> |
|
899 | <td>${desc}</td> | |
904 | </tr> |
|
900 | </tr> | |
905 | %endfor |
|
901 | %endfor | |
906 | </tbody> |
|
902 | </tbody> | |
907 | </table> |
|
903 | </table> | |
908 | </div> |
|
904 | </div> | |
909 | </div> |
|
905 | </div> | |
910 | <div class="modal-footer"> |
|
906 | <div class="modal-footer"> | |
911 | </div> |
|
907 | </div> | |
912 | </div><!-- /.modal-content --> |
|
908 | </div><!-- /.modal-content --> | |
913 | </div><!-- /.modal-dialog --> |
|
909 | </div><!-- /.modal-dialog --> | |
914 | </div><!-- /.modal --> |
|
910 | </div><!-- /.modal --> | |
915 |
|
911 |
@@ -1,222 +1,216 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | %if c.repo_name: |
|
5 | %if c.repo_name: | |
6 | ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)} |
|
6 | ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)} | |
7 | %elif c.repo_group_name: |
|
7 | %elif c.repo_group_name: | |
8 | ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)} |
|
8 | ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)} | |
9 | %else: |
|
9 | %else: | |
10 | ${_('Search inside all accessible repositories')} |
|
10 | ${_('Search inside all accessible repositories')} | |
11 | %endif |
|
11 | %endif | |
12 | %if c.rhodecode_name: |
|
12 | %if c.rhodecode_name: | |
13 | · ${h.branding(c.rhodecode_name)} |
|
13 | · ${h.branding(c.rhodecode_name)} | |
14 | %endif |
|
14 | %endif | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="breadcrumbs_links()"> |
|
17 | <%def name="breadcrumbs_links()"> | |
18 | %if c.repo_name: |
|
18 | %if c.repo_name: | |
19 | ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)} |
|
19 | ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)} | |
20 | %elif c.repo_group_name: |
|
20 | %elif c.repo_group_name: | |
21 | ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)} |
|
21 | ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)} | |
22 | %else: |
|
22 | %else: | |
23 | ${_('Search inside all accessible repositories')} |
|
23 | ${_('Search inside all accessible repositories')} | |
24 | %endif |
|
24 | %endif | |
25 |
|
25 | |||
26 | </%def> |
|
26 | </%def> | |
27 |
|
27 | |||
28 | <%def name="menu_bar_nav()"> |
|
28 | <%def name="menu_bar_nav()"> | |
29 | %if c.repo_name: |
|
29 | %if c.repo_name: | |
30 | ${self.menu_items(active='search')} |
|
30 | ${self.menu_items(active='search')} | |
31 | %elif c.repo_group_name: |
|
31 | %elif c.repo_group_name: | |
32 | ${self.menu_items(active='search')} |
|
32 | ${self.menu_items(active='search')} | |
33 | %else: |
|
33 | %else: | |
34 | ${self.menu_items(active='search')} |
|
34 | ${self.menu_items(active='search')} | |
35 | %endif |
|
35 | %endif | |
36 | </%def> |
|
36 | </%def> | |
37 |
|
37 | |||
38 | <%def name="menu_bar_subnav()"> |
|
38 | <%def name="menu_bar_subnav()"> | |
39 | %if c.repo_name: |
|
39 | %if c.repo_name: | |
40 | ${self.repo_menu(active='summary')} |
|
40 | ${self.repo_menu(active='summary')} | |
41 | %elif c.repo_group_name: |
|
41 | %elif c.repo_group_name: | |
42 | ${self.repo_group_menu(active='home')} |
|
42 | ${self.repo_group_menu(active='home')} | |
43 | %endif |
|
43 | %endif | |
44 | </%def> |
|
44 | </%def> | |
45 |
|
45 | |||
46 | <%def name="repo_icon(db_repo)"> |
|
46 | <%def name="repo_icon(db_repo)"> | |
47 | %if h.is_hg(db_repo): |
|
47 | %if h.is_hg(db_repo): | |
48 | <i class="icon-hg"></i> |
|
48 | <i class="icon-hg"></i> | |
49 | %endif |
|
49 | %endif | |
50 | %if h.is_git(db_repo): |
|
50 | %if h.is_git(db_repo): | |
51 | <i class="icon-git"></i> |
|
51 | <i class="icon-git"></i> | |
52 | %endif |
|
52 | %endif | |
53 | %if h.is_svn(db_repo): |
|
53 | %if h.is_svn(db_repo): | |
54 | <i class="icon-svn"></i> |
|
54 | <i class="icon-svn"></i> | |
55 | %endif |
|
55 | %endif | |
56 | </%def> |
|
56 | </%def> | |
57 |
|
57 | |||
58 | <%def name="repo_group_icon()"> |
|
58 | <%def name="repo_group_icon()"> | |
59 | <i class="icon-folder-close"></i> |
|
59 | <i class="icon-folder-close"></i> | |
60 | </%def> |
|
60 | </%def> | |
61 |
|
61 | |||
62 | <%def name="main()"> |
|
62 | <%def name="main()"> | |
63 | <div class="box"> |
|
63 | <div class="box"> | |
64 | %if c.repo_name: |
|
64 | %if c.repo_name: | |
65 | <!-- box / title --> |
|
65 | <!-- box / title --> | |
66 | <!--div class="title"> |
|
|||
67 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
|||
68 | </div--> |
|
|||
69 | ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')} |
|
66 | ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')} | |
70 | %elif c.repo_group_name: |
|
67 | %elif c.repo_group_name: | |
71 | <!-- box / title --> |
|
68 | <!-- box / title --> | |
72 | <!--div class="title"> |
|
|||
73 | ${self.repo_group_page_title(c.repo_group)} |
|
|||
74 | </div--> |
|
|||
75 | ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')} |
|
69 | ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')} | |
76 | %else: |
|
70 | %else: | |
77 | <!-- box / title --> |
|
71 | <!-- box / title --> | |
78 | <div class="title"> |
|
72 | <div class="title"> | |
79 | ${self.breadcrumbs()} |
|
73 | ${self.breadcrumbs()} | |
80 | <ul class="links"> </ul> |
|
74 | <ul class="links"> </ul> | |
81 | </div> |
|
75 | </div> | |
82 | <!-- end box / title --> |
|
76 | <!-- end box / title --> | |
83 | ${h.form(h.route_path('search'), method='get')} |
|
77 | ${h.form(h.route_path('search'), method='get')} | |
84 | %endif |
|
78 | %endif | |
85 | <div class="form search-form"> |
|
79 | <div class="form search-form"> | |
86 | <div class="fields"> |
|
80 | <div class="fields"> | |
87 |
|
81 | |||
88 | ${h.text('q', c.cur_query, placeholder="Enter query...")} |
|
82 | ${h.text('q', c.cur_query, placeholder="Enter query...")} | |
89 |
|
83 | |||
90 | ${h.select('type',c.search_type,[('content',_('Files')), ('path',_('File path')),('commit',_('Commits'))],id='id_search_type')} |
|
84 | ${h.select('type',c.search_type,[('content',_('Files')), ('path',_('File path')),('commit',_('Commits'))],id='id_search_type')} | |
91 | ${h.hidden('max_lines', '10')} |
|
85 | ${h.hidden('max_lines', '10')} | |
92 |
|
86 | |||
93 | <input type="submit" value="${_('Search')}" class="btn"/> |
|
87 | <input type="submit" value="${_('Search')}" class="btn"/> | |
94 | <br/> |
|
88 | <br/> | |
95 |
|
89 | |||
96 | <div class="search-tags"> |
|
90 | <div class="search-tags"> | |
97 | <span class="tag tag8"> |
|
91 | <span class="tag tag8"> | |
98 | %if c.repo_name: |
|
92 | %if c.repo_name: | |
99 | <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a> |
|
93 | <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a> | |
100 | %elif c.repo_group_name: |
|
94 | %elif c.repo_group_name: | |
101 | <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a> |
|
95 | <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a> | |
102 | % else: |
|
96 | % else: | |
103 | ${_('Global Search')} |
|
97 | ${_('Global Search')} | |
104 | %endif |
|
98 | %endif | |
105 | </span> |
|
99 | </span> | |
106 |
|
100 | |||
107 | %if c.repo_name: |
|
101 | %if c.repo_name: | |
108 | Β» |
|
102 | Β» | |
109 | <span class="tag tag8"> |
|
103 | <span class="tag tag8"> | |
110 | ${repo_icon(c.rhodecode_db_repo)} |
|
104 | ${repo_icon(c.rhodecode_db_repo)} | |
111 | ${c.repo_name} |
|
105 | ${c.repo_name} | |
112 | </span> |
|
106 | </span> | |
113 |
|
107 | |||
114 | %elif c.repo_group_name: |
|
108 | %elif c.repo_group_name: | |
115 | Β» |
|
109 | Β» | |
116 | <span class="tag tag8"> |
|
110 | <span class="tag tag8"> | |
117 | ${repo_group_icon()} |
|
111 | ${repo_group_icon()} | |
118 | ${c.repo_group_name} |
|
112 | ${c.repo_group_name} | |
119 | </span> |
|
113 | </span> | |
120 | %endif |
|
114 | %endif | |
121 |
|
115 | |||
122 |
|
116 | |||
123 | % for search_tag in c.search_tags: |
|
117 | % for search_tag in c.search_tags: | |
124 | <br/><span class="tag disabled" style="margin-top: 3px">${search_tag}</span> |
|
118 | <br/><span class="tag disabled" style="margin-top: 3px">${search_tag}</span> | |
125 | % endfor |
|
119 | % endfor | |
126 |
|
120 | |||
127 | </div> |
|
121 | </div> | |
128 |
|
122 | |||
129 | <div class="search-feedback-items"> |
|
123 | <div class="search-feedback-items"> | |
130 | % for error in c.errors: |
|
124 | % for error in c.errors: | |
131 | <span class="error-message"> |
|
125 | <span class="error-message"> | |
132 | % for k,v in error.asdict().items(): |
|
126 | % for k,v in error.asdict().items(): | |
133 | ${k} - ${v} |
|
127 | ${k} - ${v} | |
134 | % endfor |
|
128 | % endfor | |
135 | </span> |
|
129 | </span> | |
136 | % endfor |
|
130 | % endfor | |
137 | <div class="field"> |
|
131 | <div class="field"> | |
138 | <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Query Langague examples')}</p> |
|
132 | <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Query Langague examples')}</p> | |
139 | <pre id="search-help" style="display: none">\ |
|
133 | <pre id="search-help" style="display: none">\ | |
140 |
|
134 | |||
141 | % if c.searcher.name == 'whoosh': |
|
135 | % if c.searcher.name == 'whoosh': | |
142 | Example filter terms for `Whoosh` search: |
|
136 | Example filter terms for `Whoosh` search: | |
143 | query lang: <a href="${c.searcher.query_lang_doc}">Whoosh Query Language</a> |
|
137 | query lang: <a href="${c.searcher.query_lang_doc}">Whoosh Query Language</a> | |
144 | Whoosh has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition. |
|
138 | Whoosh has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition. | |
145 |
|
139 | |||
146 | Generate wildcards using '*' character: |
|
140 | Generate wildcards using '*' character: | |
147 | "repo_name:vcs*" - search everything starting with 'vcs' |
|
141 | "repo_name:vcs*" - search everything starting with 'vcs' | |
148 | "repo_name:*vcs*" - search for repository containing 'vcs' |
|
142 | "repo_name:*vcs*" - search for repository containing 'vcs' | |
149 |
|
143 | |||
150 | Optional AND / OR operators in queries |
|
144 | Optional AND / OR operators in queries | |
151 | "repo_name:vcs OR repo_name:test" |
|
145 | "repo_name:vcs OR repo_name:test" | |
152 | "owner:test AND repo_name:test*" AND extension:py |
|
146 | "owner:test AND repo_name:test*" AND extension:py | |
153 |
|
147 | |||
154 | Move advanced search is available via ElasticSearch6 backend in EE edition. |
|
148 | Move advanced search is available via ElasticSearch6 backend in EE edition. | |
155 | % elif c.searcher.name == 'elasticsearch' and c.searcher.es_version == '2': |
|
149 | % elif c.searcher.name == 'elasticsearch' and c.searcher.es_version == '2': | |
156 | Example filter terms for `ElasticSearch-${c.searcher.es_version}`search: |
|
150 | Example filter terms for `ElasticSearch-${c.searcher.es_version}`search: | |
157 | ElasticSearch-2 has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition. |
|
151 | ElasticSearch-2 has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition. | |
158 |
|
152 | |||
159 | search type: content (File Content) |
|
153 | search type: content (File Content) | |
160 | indexed fields: content |
|
154 | indexed fields: content | |
161 |
|
155 | |||
162 | # search for `fix` string in all files |
|
156 | # search for `fix` string in all files | |
163 | fix |
|
157 | fix | |
164 |
|
158 | |||
165 | search type: commit (Commit message) |
|
159 | search type: commit (Commit message) | |
166 | indexed fields: message |
|
160 | indexed fields: message | |
167 |
|
161 | |||
168 | search type: path (File name) |
|
162 | search type: path (File name) | |
169 | indexed fields: path |
|
163 | indexed fields: path | |
170 |
|
164 | |||
171 | % else: |
|
165 | % else: | |
172 | Example filter terms for `ElasticSearch-${c.searcher.es_version}`search: |
|
166 | Example filter terms for `ElasticSearch-${c.searcher.es_version}`search: | |
173 | query lang: <a href="${c.searcher.query_lang_doc}">ES 6 Query Language</a> |
|
167 | query lang: <a href="${c.searcher.query_lang_doc}">ES 6 Query Language</a> | |
174 | The reserved characters needed espace by `\`: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ / |
|
168 | The reserved characters needed espace by `\`: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ / | |
175 | % for handler in c.searcher.get_handlers().values(): |
|
169 | % for handler in c.searcher.get_handlers().values(): | |
176 |
|
170 | |||
177 | search type: ${handler.search_type_label} |
|
171 | search type: ${handler.search_type_label} | |
178 | *indexed fields*: ${', '.join( [('\n ' if x[0]%4==0 else '')+x[1] for x in enumerate(handler.es_6_field_names)])} |
|
172 | *indexed fields*: ${', '.join( [('\n ' if x[0]%4==0 else '')+x[1] for x in enumerate(handler.es_6_field_names)])} | |
179 | % for entry in handler.es_6_example_queries: |
|
173 | % for entry in handler.es_6_example_queries: | |
180 | ${entry.rstrip()} |
|
174 | ${entry.rstrip()} | |
181 | % endfor |
|
175 | % endfor | |
182 | % endfor |
|
176 | % endfor | |
183 |
|
177 | |||
184 | % endif |
|
178 | % endif | |
185 | </pre> |
|
179 | </pre> | |
186 | </div> |
|
180 | </div> | |
187 |
|
181 | |||
188 | <div class="field">${c.runtime}</div> |
|
182 | <div class="field">${c.runtime}</div> | |
189 | </div> |
|
183 | </div> | |
190 | </div> |
|
184 | </div> | |
191 | </div> |
|
185 | </div> | |
192 |
|
186 | |||
193 | ${h.end_form()} |
|
187 | ${h.end_form()} | |
194 | <div class="search"> |
|
188 | <div class="search"> | |
195 | % if c.search_type == 'content': |
|
189 | % if c.search_type == 'content': | |
196 | <%include file='search_content.mako'/> |
|
190 | <%include file='search_content.mako'/> | |
197 | % elif c.search_type == 'path': |
|
191 | % elif c.search_type == 'path': | |
198 | <%include file='search_path.mako'/> |
|
192 | <%include file='search_path.mako'/> | |
199 | % elif c.search_type == 'commit': |
|
193 | % elif c.search_type == 'commit': | |
200 | <%include file='search_commit.mako'/> |
|
194 | <%include file='search_commit.mako'/> | |
201 | % elif c.search_type == 'repository': |
|
195 | % elif c.search_type == 'repository': | |
202 | <%include file='search_repository.mako'/> |
|
196 | <%include file='search_repository.mako'/> | |
203 | % endif |
|
197 | % endif | |
204 | </div> |
|
198 | </div> | |
205 | </div> |
|
199 | </div> | |
206 | <script> |
|
200 | <script> | |
207 | $(document).ready(function(){ |
|
201 | $(document).ready(function(){ | |
208 | $("#id_search_type").select2({ |
|
202 | $("#id_search_type").select2({ | |
209 | 'containerCssClass': "drop-menu", |
|
203 | 'containerCssClass': "drop-menu", | |
210 | 'dropdownCssClass': "drop-menu-dropdown", |
|
204 | 'dropdownCssClass': "drop-menu-dropdown", | |
211 | 'dropdownAutoWidth': true, |
|
205 | 'dropdownAutoWidth': true, | |
212 | 'minimumResultsForSearch': -1 |
|
206 | 'minimumResultsForSearch': -1 | |
213 | }); |
|
207 | }); | |
214 |
|
208 | |||
215 | $('#q').autoGrowInput({maxWidth: 920}); |
|
209 | $('#q').autoGrowInput({maxWidth: 920}); | |
216 |
|
210 | |||
217 | setTimeout(function() { |
|
211 | setTimeout(function() { | |
218 | $('#q').keyup() |
|
212 | $('#q').keyup() | |
219 | }, 1); |
|
213 | }, 1); | |
220 | }) |
|
214 | }) | |
221 | </script> |
|
215 | </script> | |
222 | </%def> |
|
216 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now