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