##// END OF EJS Templates
templates: removed utf8 marker for python3 migration
super-admin -
r5037:bd722d6e default
parent child Browse files
Show More
@@ -1,115 +1,114 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
4
3
5 <%def name="title()">
4 <%def name="title()">
6 ${_('Admin audit log entry')}
5 ${_('Admin audit log entry')}
7 %if c.rhodecode_name:
6 %if c.rhodecode_name:
8 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
9 %endif
8 %endif
10 </%def>
9 </%def>
11
10
12 <%def name="breadcrumbs_links()"></%def>
11 <%def name="breadcrumbs_links()"></%def>
13
12
14 <%def name="menu_bar_nav()">
13 <%def name="menu_bar_nav()">
15 ${self.menu_items(active='admin')}
14 ${self.menu_items(active='admin')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_subnav()">
17 <%def name="menu_bar_subnav()">
19 ${self.admin_menu(active='audit_logs')}
18 ${self.admin_menu(active='audit_logs')}
20 </%def>
19 </%def>
21
20
22 <%def name="main()">
21 <%def name="main()">
23 <div class="box">
22 <div class="box">
24
23
25 <div class="title">
24 <div class="title">
26 ${_('Audit long entry')} ${c.audit_log_entry.entry_id}
25 ${_('Audit long entry')} ${c.audit_log_entry.entry_id}
27 </div>
26 </div>
28
27
29 <div class="table">
28 <div class="table">
30 <div id="user_log">
29 <div id="user_log">
31 <table class="rctable audit-log">
30 <table class="rctable audit-log">
32 <tr>
31 <tr>
33 <td>
32 <td>
34 ${_('User')}:
33 ${_('User')}:
35 </td>
34 </td>
36 <td>
35 <td>
37 %if c.audit_log_entry.user is not None:
36 %if c.audit_log_entry.user is not None:
38 ${base.gravatar_with_user(c.audit_log_entry.user.email)}
37 ${base.gravatar_with_user(c.audit_log_entry.user.email)}
39 %else:
38 %else:
40 ${c.audit_log_entry.username}
39 ${c.audit_log_entry.username}
41 %endif
40 %endif
42 </td>
41 </td>
43 </tr>
42 </tr>
44 <tr>
43 <tr>
45 <td>
44 <td>
46 ${_('Date')}:
45 ${_('Date')}:
47 </td>
46 </td>
48 <td>
47 <td>
49 ${h.format_date(c.audit_log_entry.action_date)}
48 ${h.format_date(c.audit_log_entry.action_date)}
50 </td>
49 </td>
51 </tr>
50 </tr>
52 <tr>
51 <tr>
53 <td>
52 <td>
54 ${_('IP')}:
53 ${_('IP')}:
55 </td>
54 </td>
56 <td>
55 <td>
57 ${c.audit_log_entry.user_ip}
56 ${c.audit_log_entry.user_ip}
58 </td>
57 </td>
59 </tr>
58 </tr>
60
59
61 <tr>
60 <tr>
62 <td>
61 <td>
63 ${_('Action')}:
62 ${_('Action')}:
64 </td>
63 </td>
65 <td>
64 <td>
66 % if c.audit_log_entry.version == c.audit_log_entry.VERSION_1:
65 % if c.audit_log_entry.version == c.audit_log_entry.VERSION_1:
67 ${h.action_parser(request, l)[0]()}
66 ${h.action_parser(request, l)[0]()}
68 % else:
67 % else:
69 ${h.literal(c.audit_log_entry.action)}
68 ${h.literal(c.audit_log_entry.action)}
70 % endif
69 % endif
71
70
72 <div class="journal_action_params">
71 <div class="journal_action_params">
73 % if c.audit_log_entry.version == c.audit_log_entry.VERSION_1:
72 % if c.audit_log_entry.version == c.audit_log_entry.VERSION_1:
74 ${h.literal(h.action_parser(request, l)[1]())}
73 ${h.literal(h.action_parser(request, l)[1]())}
75 % endif
74 % endif
76 </div>
75 </div>
77 </td>
76 </td>
78 </tr>
77 </tr>
79 <tr>
78 <tr>
80 <td>
79 <td>
81 ${_('Action Data')}:
80 ${_('Action Data')}:
82 </td>
81 </td>
83 <td class="td-journalaction">
82 <td class="td-journalaction">
84 % if c.audit_log_entry.version == c.audit_log_entry.VERSION_2:
83 % if c.audit_log_entry.version == c.audit_log_entry.VERSION_2:
85 <div>
84 <div>
86 <pre>${h.formatted_str_json(c.audit_log_entry.action_data)}</pre>
85 <pre>${h.formatted_str_json(c.audit_log_entry.action_data)}</pre>
87 </div>
86 </div>
88 % else:
87 % else:
89 <pre title="${_('data not available for v1 entries type')}">-</pre>
88 <pre title="${_('data not available for v1 entries type')}">-</pre>
90 % endif
89 % endif
91 </td>
90 </td>
92 </tr>
91 </tr>
93 <tr>
92 <tr>
94 <td>
93 <td>
95 ${_('Repository')}:
94 ${_('Repository')}:
96 </td>
95 </td>
97 <td class="td-journalaction">
96 <td class="td-journalaction">
98 %if c.audit_log_entry.repository is not None:
97 %if c.audit_log_entry.repository is not None:
99 ${h.link_to(c.audit_log_entry.repository.repo_name, h.route_path('repo_summary',repo_name=c.audit_log_entry.repository.repo_name))}
98 ${h.link_to(c.audit_log_entry.repository.repo_name, h.route_path('repo_summary',repo_name=c.audit_log_entry.repository.repo_name))}
100 %else:
99 %else:
101 ${c.audit_log_entry.repository_name or '-'}
100 ${c.audit_log_entry.repository_name or '-'}
102 %endif
101 %endif
103 </td>
102 </td>
104 </tr>
103 </tr>
105
104
106 </table>
105 </table>
107
106
108 </div>
107 </div>
109 </div>
108 </div>
110 </div>
109 </div>
111
110
112 <script>
111 <script>
113 $('#j_filter').autoGrowInput();
112 $('#j_filter').autoGrowInput();
114 </script>
113 </script>
115 </%def>
114 </%def>
@@ -1,43 +1,42 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Admin audit logs')}
4 ${_('Admin audit logs')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='audit_logs')}
17 ${self.admin_menu(active='audit_logs')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23 <div class="title">
22 <div class="title">
24 ${h.form(None, id_="filter_form", method="get")}
23 ${h.form(None, id_="filter_form", method="get")}
25 <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...')}"/>
24 <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...')}"/>
26 <input type='submit' value="${_('filter')}" class="btn" />
25 <input type='submit' value="${_('filter')}" class="btn" />
27 ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
26 ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
28 ${h.end_form()}
27 ${h.end_form()}
29 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
28 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
30 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
29 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
31 </div>
30 </div>
32
31
33 <div class="table">
32 <div class="table">
34 <div id="user_log">
33 <div id="user_log">
35 <%include file="/admin/admin_log_base.mako" />
34 <%include file="/admin/admin_log_base.mako" />
36 </div>
35 </div>
37 </div>
36 </div>
38 </div>
37 </div>
39
38
40 <script>
39 <script>
41 $('#j_filter').autoGrowInput();
40 $('#j_filter').autoGrowInput();
42 </script>
41 </script>
43 </%def>
42 </%def>
@@ -1,39 +1,38 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Artifacts Admin')}
4 ${_('Artifacts Admin')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='artifacts')}
17 ${self.admin_menu(active='artifacts')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22
21
23 <div class="box">
22 <div class="box">
24
23
25 <div class="panel panel-default">
24 <div class="panel panel-default">
26 <div class="panel-heading">
25 <div class="panel-heading">
27 <h3 class="panel-title">${_('Artifacts Administration.')}</h3>
26 <h3 class="panel-title">${_('Artifacts Administration.')}</h3>
28 </div>
27 </div>
29 <div class="panel-body">
28 <div class="panel-body">
30 <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4>
29 <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4>
31
30
32 </div>
31 </div>
33 </div>
32 </div>
34
33
35 </div>
34 </div>
36
35
37
36
38 </%def>
37 </%def>
39
38
@@ -1,123 +1,122 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Authentication Settings')}
4 ${_('Authentication Settings')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}}
6 &middot; ${h.branding(c.rhodecode_name)}}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='authentication')}
17 ${self.admin_menu(active='authentication')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22
21
23 <div class="box">
22 <div class="box">
24
23
25 <div class='sidebar-col-wrapper'>
24 <div class='sidebar-col-wrapper'>
26
25
27 <div class="sidebar">
26 <div class="sidebar">
28 <ul class="nav nav-pills nav-stacked">
27 <ul class="nav nav-pills nav-stacked">
29 % for item in resource.get_root().get_nav_list():
28 % for item in resource.get_root().get_nav_list():
30 <li ${('class=active' if item == resource else '')}>
29 <li ${('class=active' if item == resource else '')}>
31 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
30 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
32 </li>
31 </li>
33 % endfor
32 % endfor
34 </ul>
33 </ul>
35 </div>
34 </div>
36
35
37 <div class="main-content-full-width">
36 <div class="main-content-full-width">
38 ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)}
37 ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)}
39 <div class="panel panel-default">
38 <div class="panel panel-default">
40
39
41 <div class="panel-heading">
40 <div class="panel-heading">
42 <h3 class="panel-title">${_("Enabled and Available Plugins")}</h3>
41 <h3 class="panel-title">${_("Enabled and Available Plugins")}</h3>
43 </div>
42 </div>
44
43
45 <div class="panel-body">
44 <div class="panel-body">
46
45
47
46
48 <div class="label">${_("Ordered Activated Plugins")}</div>
47 <div class="label">${_("Ordered Activated Plugins")}</div>
49 <div class="textarea text-area editor">
48 <div class="textarea text-area editor">
50 ${h.textarea('auth_plugins',cols=120,rows=20,class_="medium")}
49 ${h.textarea('auth_plugins',cols=120,rows=20,class_="medium")}
51 </div>
50 </div>
52 <div class="field">
51 <div class="field">
53 <p class="help-block pre-formatting">${_('List of plugins, separated by commas.'
52 <p class="help-block pre-formatting">${_('List of plugins, separated by commas.'
54 '\nThe order of the plugins is also the order in which '
53 '\nThe order of the plugins is also the order in which '
55 'RhodeCode Enterprise will try to authenticate a user.')}
54 'RhodeCode Enterprise will try to authenticate a user.')}
56 </p>
55 </p>
57 </div>
56 </div>
58
57
59 <table class="rctable">
58 <table class="rctable">
60 <th>${_('Activate')}</th>
59 <th>${_('Activate')}</th>
61 <th>${_('Plugin Name')}</th>
60 <th>${_('Plugin Name')}</th>
62 <th>${_('Documentation')}</th>
61 <th>${_('Documentation')}</th>
63 <th>${_('Plugin ID')}</th>
62 <th>${_('Plugin ID')}</th>
64 <th>${_('Enabled')}</th>
63 <th>${_('Enabled')}</th>
65 %for plugin in available_plugins:
64 %for plugin in available_plugins:
66 <tr class="${('inactive' if (not plugin.is_active() and plugin.get_id() in enabled_plugins) else '')}">
65 <tr class="${('inactive' if (not plugin.is_active() and plugin.get_id() in enabled_plugins) else '')}">
67 <td>
66 <td>
68 <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${('btn-success' if plugin.get_id() in enabled_plugins else '')}">
67 <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${('btn-success' if plugin.get_id() in enabled_plugins else '')}">
69 ${(_('activated') if plugin.get_id() in enabled_plugins else _('not active'))}
68 ${(_('activated') if plugin.get_id() in enabled_plugins else _('not active'))}
70 </span>
69 </span>
71 </td>
70 </td>
72 <td>${plugin.get_display_name()}</td>
71 <td>${plugin.get_display_name()}</td>
73 <td>
72 <td>
74 % if plugin.docs():
73 % if plugin.docs():
75 <a href="${plugin.docs()}">docs</a>
74 <a href="${plugin.docs()}">docs</a>
76 % endif
75 % endif
77 </td>
76 </td>
78 <td>${plugin.get_id()}</td>
77 <td>${plugin.get_id()}</td>
79 <td>${h.bool2icon(plugin.is_active(),show_at_false=False)}</td>
78 <td>${h.bool2icon(plugin.is_active(),show_at_false=False)}</td>
80 </tr>
79 </tr>
81 %endfor
80 %endfor
82 </table>
81 </table>
83
82
84 <div class="buttons">
83 <div class="buttons">
85 ${h.submit('save',_('Save'),class_="btn")}
84 ${h.submit('save',_('Save'),class_="btn")}
86 </div>
85 </div>
87 </div>
86 </div>
88 </div>
87 </div>
89 ${h.end_form()}
88 ${h.end_form()}
90 </div>
89 </div>
91 </div>
90 </div>
92 </div>
91 </div>
93
92
94 <script>
93 <script>
95 $('.toggle-plugin').click(function(e){
94 $('.toggle-plugin').click(function(e){
96 var auth_plugins_input = $('#auth_plugins');
95 var auth_plugins_input = $('#auth_plugins');
97 var elems = [];
96 var elems = [];
98
97
99 $.each(auth_plugins_input.val().split(',') , function (index, element) {
98 $.each(auth_plugins_input.val().split(',') , function (index, element) {
100 if (element !== "") {
99 if (element !== "") {
101 elems.push(element.strip())
100 elems.push(element.strip())
102 }
101 }
103 });
102 });
104
103
105 var cur_button = e.currentTarget;
104 var cur_button = e.currentTarget;
106 var plugin_id = $(cur_button).attr('plugin_id');
105 var plugin_id = $(cur_button).attr('plugin_id');
107 if($(cur_button).hasClass('btn-success')){
106 if($(cur_button).hasClass('btn-success')){
108 elems.splice(elems.indexOf(plugin_id), 1);
107 elems.splice(elems.indexOf(plugin_id), 1);
109 auth_plugins_input.val(elems.join(',\n'));
108 auth_plugins_input.val(elems.join(',\n'));
110 $(cur_button).removeClass('btn-success');
109 $(cur_button).removeClass('btn-success');
111 cur_button.innerHTML = _gettext('not active');
110 cur_button.innerHTML = _gettext('not active');
112 }
111 }
113 else{
112 else{
114 if (elems.indexOf(plugin_id) === -1) {
113 if (elems.indexOf(plugin_id) === -1) {
115 elems.push(plugin_id);
114 elems.push(plugin_id);
116 }
115 }
117 auth_plugins_input.val(elems.join(',\n'));
116 auth_plugins_input.val(elems.join(',\n'));
118 $(cur_button).addClass('btn-success');
117 $(cur_button).addClass('btn-success');
119 cur_button.innerHTML = _gettext('activated');
118 cur_button.innerHTML = _gettext('activated');
120 }
119 }
121 });
120 });
122 </script>
121 </script>
123 </%def>
122 </%def>
@@ -1,135 +1,134 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Authentication Settings')}
4 ${_('Authentication Settings')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}}
6 &middot; ${h.branding(c.rhodecode_name)}}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${h.link_to(_('Authentication Plugins'),request.resource_path(resource.__parent__, route_name='auth_home'))}
13 ${h.link_to(_('Authentication Plugins'),request.resource_path(resource.__parent__, route_name='auth_home'))}
15 &raquo;
14 &raquo;
16 ${resource.display_name}
15 ${resource.display_name}
17 </%def>
16 </%def>
18
17
19 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
20 ${self.menu_items(active='admin')}
19 ${self.menu_items(active='admin')}
21 </%def>
20 </%def>
22
21
23 <%def name="menu_bar_subnav()">
22 <%def name="menu_bar_subnav()">
24 ${self.admin_menu(active='authentication')}
23 ${self.admin_menu(active='authentication')}
25 </%def>
24 </%def>
26
25
27 <%def name="main()">
26 <%def name="main()">
28
27
29 <div class="box">
28 <div class="box">
30
29
31 <div class='sidebar-col-wrapper'>
30 <div class='sidebar-col-wrapper'>
32
31
33 <div class="sidebar">
32 <div class="sidebar">
34 <ul class="nav nav-pills nav-stacked">
33 <ul class="nav nav-pills nav-stacked">
35 % for item in resource.get_root().get_nav_list():
34 % for item in resource.get_root().get_nav_list():
36 <li ${('class=active' if item == resource else '')}>
35 <li ${('class=active' if item == resource else '')}>
37 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
36 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
38 </li>
37 </li>
39 % endfor
38 % endfor
40 </ul>
39 </ul>
41 </div>
40 </div>
42
41
43 <div class="main-content-full-width">
42 <div class="main-content-full-width">
44 <div class="panel panel-default">
43 <div class="panel panel-default">
45 <div class="panel-heading">
44 <div class="panel-heading">
46 <h3 class="panel-title">${_('Plugin')}: ${resource.display_name}</h3>
45 <h3 class="panel-title">${_('Plugin')}: ${resource.display_name}</h3>
47 </div>
46 </div>
48 <div class="panel-body">
47 <div class="panel-body">
49 <div class="plugin_form">
48 <div class="plugin_form">
50 <div class="fields">
49 <div class="fields">
51 ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)}
50 ${h.secure_form(request.resource_path(resource, route_name='auth_home'), request=request)}
52 <div class="form">
51 <div class="form">
53
52
54 %for node in plugin.get_settings_schema():
53 %for node in plugin.get_settings_schema():
55 <%
54 <%
56 label_to_type = {'label-checkbox': 'bool', 'label-textarea': 'textarea'}
55 label_to_type = {'label-checkbox': 'bool', 'label-textarea': 'textarea'}
57 %>
56 %>
58
57
59 <div class="field">
58 <div class="field">
60 <div class="label ${label_to_type.get(node.widget)}"><label for="${node.name}">${node.title}</label></div>
59 <div class="label ${label_to_type.get(node.widget)}"><label for="${node.name}">${node.title}</label></div>
61 <div class="input">
60 <div class="input">
62 %if node.widget in ["string", "int", "unicode"]:
61 %if node.widget in ["string", "int", "unicode"]:
63 ${h.text(node.name, defaults.get(node.name), class_="large")}
62 ${h.text(node.name, defaults.get(node.name), class_="large")}
64 %elif node.widget == "password":
63 %elif node.widget == "password":
65 ${h.password(node.name, defaults.get(node.name), class_="large")}
64 ${h.password(node.name, defaults.get(node.name), class_="large")}
66 %elif node.widget == "bool":
65 %elif node.widget == "bool":
67 <div class="checkbox">${h.checkbox(node.name, True, checked=defaults.get(node.name))}</div>
66 <div class="checkbox">${h.checkbox(node.name, True, checked=defaults.get(node.name))}</div>
68 %elif node.widget == "select":
67 %elif node.widget == "select":
69 ${h.select(node.name, defaults.get(node.name), node.validator.choices, class_="select2AuthSetting")}
68 ${h.select(node.name, defaults.get(node.name), node.validator.choices, class_="select2AuthSetting")}
70 %elif node.widget == "select_with_labels":
69 %elif node.widget == "select_with_labels":
71 ${h.select(node.name, defaults.get(node.name), node.choices, class_="select2AuthSetting")}
70 ${h.select(node.name, defaults.get(node.name), node.choices, class_="select2AuthSetting")}
72 %elif node.widget == "textarea":
71 %elif node.widget == "textarea":
73 <div class="textarea" style="margin-left: 0px">${h.textarea(node.name, defaults.get(node.name), rows=10)}</div>
72 <div class="textarea" style="margin-left: 0px">${h.textarea(node.name, defaults.get(node.name), rows=10)}</div>
74 %elif node.widget == "readonly":
73 %elif node.widget == "readonly":
75 ${node.default}
74 ${node.default}
76 %else:
75 %else:
77 This field is of type ${node.typ}, which cannot be displayed. Must be one of [string|int|bool|select].
76 This field is of type ${node.typ}, which cannot be displayed. Must be one of [string|int|bool|select].
78 %endif
77 %endif
79
78
80 %if node.name in errors:
79 %if node.name in errors:
81 <span class="error-message">${errors.get(node.name)}</span>
80 <span class="error-message">${errors.get(node.name)}</span>
82 <br />
81 <br />
83 %endif
82 %endif
84 <p class="help-block pre-formatting">${node.description}</p>
83 <p class="help-block pre-formatting">${node.description}</p>
85 </div>
84 </div>
86 </div>
85 </div>
87 %endfor
86 %endfor
88
87
89 ## Allow derived templates to add something below the form
88 ## Allow derived templates to add something below the form
90 ## input fields
89 ## input fields
91 %if hasattr(next, 'below_form_fields'):
90 %if hasattr(next, 'below_form_fields'):
92 ${next.below_form_fields()}
91 ${next.below_form_fields()}
93 %endif
92 %endif
94
93
95 <div class="buttons">
94 <div class="buttons">
96 ${h.submit('save',_('Save'),class_="btn")}
95 ${h.submit('save',_('Save'),class_="btn")}
97 </div>
96 </div>
98
97
99 </div>
98 </div>
100 ${h.end_form()}
99 ${h.end_form()}
101 </div>
100 </div>
102 </div>
101 </div>
103
102
104 % if request.GET.get('schema'):
103 % if request.GET.get('schema'):
105 ## this is for development and creation of example configurations for documentation
104 ## this is for development and creation of example configurations for documentation
106 <pre>
105 <pre>
107 % for node in plugin.get_settings_schema():
106 % for node in plugin.get_settings_schema():
108 *option*: `${node.name}` => `${defaults.get(node.name)}`${'\n # '.join(['']+node.description.splitlines())}
107 *option*: `${node.name}` => `${defaults.get(node.name)}`${'\n # '.join(['']+node.description.splitlines())}
109
108
110 % endfor
109 % endfor
111 </pre>
110 </pre>
112
111
113 % endif
112 % endif
114
113
115 </div>
114 </div>
116 </div>
115 </div>
117 </div>
116 </div>
118
117
119 </div>
118 </div>
120 </div>
119 </div>
121
120
122
121
123 <script>
122 <script>
124 $(document).ready(function() {
123 $(document).ready(function() {
125 var select2Options = {
124 var select2Options = {
126 containerCssClass: 'drop-menu',
125 containerCssClass: 'drop-menu',
127 dropdownCssClass: 'drop-menu-dropdown',
126 dropdownCssClass: 'drop-menu-dropdown',
128 dropdownAutoWidth: true,
127 dropdownAutoWidth: true,
129 minimumResultsForSearch: -1
128 minimumResultsForSearch: -1
130 };
129 };
131 $('.select2AuthSetting').select2(select2Options);
130 $('.select2AuthSetting').select2(select2Options);
132
131
133 });
132 });
134 </script>
133 </script>
135 </%def>
134 </%def>
@@ -1,43 +1,42 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Repositories defaults')}
4 ${_('Repositories defaults')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${_('Repositories defaults')}
13 ${_('Repositories defaults')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='admin')}
17 ${self.menu_items(active='admin')}
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_subnav()">
20 <%def name="menu_bar_subnav()">
22 ${self.admin_menu(active='defaults')}
21 ${self.admin_menu(active='defaults')}
23 </%def>
22 </%def>
24
23
25 <%def name="main()">
24 <%def name="main()">
26 <div class="box">
25 <div class="box">
27
26
28 ##main
27 ##main
29 <div class="sidebar-col-wrapper">
28 <div class="sidebar-col-wrapper">
30 <div class="sidebar">
29 <div class="sidebar">
31 <ul class="nav nav-pills nav-stacked">
30 <ul class="nav nav-pills nav-stacked">
32 <li class="${h.is_active('repositories', c.active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Repository')}</a></li>
31 <li class="${h.is_active('repositories', c.active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Repository')}</a></li>
33 </ul>
32 </ul>
34 </div>
33 </div>
35
34
36 <div class="main-content-full-width">
35 <div class="main-content-full-width">
37 <%include file="/admin/defaults/defaults_${c.active}.mako"/>
36 <%include file="/admin/defaults/defaults_${c.active}.mako"/>
38 </div>
37 </div>
39
38
40 </div>
39 </div>
41 </div>
40 </div>
42
41
43 </%def>
42 </%def>
@@ -1,137 +1,136 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Edit Gist')} &middot; ${c.gist.gist_access_id}
4 ${_('Edit Gist')} &middot; ${c.gist.gist_access_id}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='gists')}
13 ${self.menu_items(active='gists')}
15 </%def>
14 </%def>
16
15
17 <%def name="main()">
16 <%def name="main()">
18 <div class="box">
17 <div class="box">
19 <!-- box / title -->
18 <!-- box / title -->
20 <div class="title">
19 <div class="title">
21
20
22 </div>
21 </div>
23
22
24 <div class="table">
23 <div class="table">
25 <div id="files_data">
24 <div id="files_data">
26 ${h.secure_form(h.route_path('gist_update', gist_id=c.gist.gist_access_id), id='eform', request=request)}
25 ${h.secure_form(h.route_path('gist_update', gist_id=c.gist.gist_access_id), id='eform', request=request)}
27 <div>
26 <div>
28 <input type="hidden" value="${c.file_last_commit.raw_id}" name="parent_hash">
27 <input type="hidden" value="${c.file_last_commit.raw_id}" name="parent_hash">
29 <div>
28 <div>
30 <span class="gist-gravatar">
29 <span class="gist-gravatar">
31 ${self.gravatar(h.email_or_none(c.rhodecode_user.full_contact), 30)}
30 ${self.gravatar(h.email_or_none(c.rhodecode_user.full_contact), 30)}
32 </span>
31 </span>
33 <label for='lifetime'>${_('Gist lifetime')}</label>
32 <label for='lifetime'>${_('Gist lifetime')}</label>
34 ${h.dropdownmenu('lifetime', '0', c.lifetime_options)}
33 ${h.dropdownmenu('lifetime', '0', c.lifetime_options)}
35
34
36 <label for='gist_acl_level'>${_('Gist access level')}</label>
35 <label for='gist_acl_level'>${_('Gist access level')}</label>
37 ${h.dropdownmenu('gist_acl_level', c.gist.acl_level, c.acl_options)}
36 ${h.dropdownmenu('gist_acl_level', c.gist.acl_level, c.acl_options)}
38
37
39 <textarea style="margin-top: 5px; border-color: #dbd9da" id="description" name="description"
38 <textarea style="margin-top: 5px; border-color: #dbd9da" id="description" name="description"
40 placeholder="${_('Gist description ...')}">${c.gist.gist_description}</textarea>
39 placeholder="${_('Gist description ...')}">${c.gist.gist_description}</textarea>
41 </div>
40 </div>
42 </div>
41 </div>
43
42
44 ## peppercorn schema
43 ## peppercorn schema
45 <input type="hidden" name="__start__" value="nodes:sequence"/>
44 <input type="hidden" name="__start__" value="nodes:sequence"/>
46 % for cnt, file in enumerate(c.files):
45 % for cnt, file in enumerate(c.files):
47 <input type="hidden" name="__start__" value="file:mapping"/>
46 <input type="hidden" name="__start__" value="file:mapping"/>
48 <div id="codeblock" class="codeblock" >
47 <div id="codeblock" class="codeblock" >
49 <div class="code-header">
48 <div class="code-header">
50 <div class="form">
49 <div class="form">
51 <div class="fields">
50 <div class="fields">
52 <input type="hidden" name="filename_org" value="${file.path}" >
51 <input type="hidden" name="filename_org" value="${file.path}" >
53 <input id="filename_${h.FID('f',file.path)}" name="filename" size="30" type="text" value="${file.path}">
52 <input id="filename_${h.FID('f',file.path)}" name="filename" size="30" type="text" value="${file.path}">
54 ${h.dropdownmenu('mimetype' ,'plain',[('plain',_('plain'))],enable_filter=True, id='mimetype_'+h.FID('f',file.path))}
53 ${h.dropdownmenu('mimetype' ,'plain',[('plain',_('plain'))],enable_filter=True, id='mimetype_'+h.FID('f',file.path))}
55 </div>
54 </div>
56 </div>
55 </div>
57 </div>
56 </div>
58 <div class="editor_container">
57 <div class="editor_container">
59 <pre id="editor_pre"></pre>
58 <pre id="editor_pre"></pre>
60 <textarea id="editor_${h.FID('f',file.path)}" name="content" >${file.content}</textarea>
59 <textarea id="editor_${h.FID('f',file.path)}" name="content" >${file.content}</textarea>
61 </div>
60 </div>
62 </div>
61 </div>
63 <input type="hidden" name="__end__" />
62 <input type="hidden" name="__end__" />
64
63
65 ## dynamic edit box.
64 ## dynamic edit box.
66 <script type="text/javascript">
65 <script type="text/javascript">
67 $(document).ready(function(){
66 $(document).ready(function(){
68 var myCodeMirror = initCodeMirror(
67 var myCodeMirror = initCodeMirror(
69 "editor_${h.FID('f',file.path)}", '');
68 "editor_${h.FID('f',file.path)}", '');
70
69
71 var modes_select = $("#mimetype_${h.FID('f',file.path)}");
70 var modes_select = $("#mimetype_${h.FID('f',file.path)}");
72 fillCodeMirrorOptions(modes_select);
71 fillCodeMirrorOptions(modes_select);
73
72
74 // try to detect the mode based on the file we edit
73 // try to detect the mode based on the file we edit
75 var mimetype = "${file.mimetype}";
74 var mimetype = "${file.mimetype}";
76 var detected_mode = detectCodeMirrorMode(
75 var detected_mode = detectCodeMirrorMode(
77 "${file.path}", mimetype);
76 "${file.path}", mimetype);
78
77
79 if(detected_mode){
78 if(detected_mode){
80 $(modes_select).select2("val", mimetype);
79 $(modes_select).select2("val", mimetype);
81 $(modes_select).change();
80 $(modes_select).change();
82 setCodeMirrorMode(myCodeMirror, detected_mode);
81 setCodeMirrorMode(myCodeMirror, detected_mode);
83 }
82 }
84
83
85 var filename_selector = "#filename_${h.FID('f',file.path)}";
84 var filename_selector = "#filename_${h.FID('f',file.path)}";
86 // on change of select field set mode
85 // on change of select field set mode
87 setCodeMirrorModeFromSelect(
86 setCodeMirrorModeFromSelect(
88 modes_select, filename_selector, myCodeMirror, null);
87 modes_select, filename_selector, myCodeMirror, null);
89
88
90 // on entering the new filename set mode, from given extension
89 // on entering the new filename set mode, from given extension
91 setCodeMirrorModeFromInput(
90 setCodeMirrorModeFromInput(
92 modes_select, filename_selector, myCodeMirror, null);
91 modes_select, filename_selector, myCodeMirror, null);
93 });
92 });
94 </script>
93 </script>
95 %endfor
94 %endfor
96 <input type="hidden" name="__end__" />
95 <input type="hidden" name="__end__" />
97
96
98 <div class="pull-left">
97 <div class="pull-left">
99 ${h.submit('update',_('Update Gist'),class_="btn btn-success")}
98 ${h.submit('update',_('Update Gist'),class_="btn btn-success")}
100 <a class="btn" href="${h.route_path('gist_show', gist_id=c.gist.gist_access_id)}">${_('Cancel')}</a>
99 <a class="btn" href="${h.route_path('gist_show', gist_id=c.gist.gist_access_id)}">${_('Cancel')}</a>
101 </div>
100 </div>
102 ${h.end_form()}
101 ${h.end_form()}
103 </div>
102 </div>
104 </div>
103 </div>
105
104
106 </div>
105 </div>
107 <script>
106 <script>
108 $('#update').on('click', function(e){
107 $('#update').on('click', function(e){
109 e.preventDefault();
108 e.preventDefault();
110
109
111 $(this).val('Updating...');
110 $(this).val('Updating...');
112 $(this).attr('disabled', 'disabled');
111 $(this).attr('disabled', 'disabled');
113 // check for newer version.
112 // check for newer version.
114 $.ajax({
113 $.ajax({
115 url: "${h.route_path('gist_edit_check_revision', gist_id=c.gist.gist_access_id)}",
114 url: "${h.route_path('gist_edit_check_revision', gist_id=c.gist.gist_access_id)}",
116 data: {
115 data: {
117 'revision': '${c.file_last_commit.raw_id}'
116 'revision': '${c.file_last_commit.raw_id}'
118 },
117 },
119 dataType: 'json',
118 dataType: 'json',
120 type: 'GET',
119 type: 'GET',
121 success: function(data) {
120 success: function(data) {
122 if(data.success === false){
121 if(data.success === false){
123 message = '${h.literal(_('Gist was updated since you started editing. Copy your changes and click %(here)s to reload the new version.')
122 message = '${h.literal(_('Gist was updated since you started editing. Copy your changes and click %(here)s to reload the new version.')
124 % {'here': h.link_to('here', h.route_path('gist_edit', gist_id=c.gist.gist_access_id))})}'
123 % {'here': h.link_to('here', h.route_path('gist_edit', gist_id=c.gist.gist_access_id))})}'
125 alertMessage = [{"message": {
124 alertMessage = [{"message": {
126 "message": message, "force": "true", "level": "warning"}}];
125 "message": message, "force": "true", "level": "warning"}}];
127 $.Topic('/notifications').publish(alertMessage[0]);
126 $.Topic('/notifications').publish(alertMessage[0]);
128 }
127 }
129 else{
128 else{
130 $('#eform').submit();
129 $('#eform').submit();
131 }
130 }
132 }
131 }
133 });
132 });
134 })
133 })
135
134
136 </script>
135 </script>
137 </%def>
136 </%def>
@@ -1,147 +1,146 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 %if c.show_private:
4 %if c.show_private:
6 ${_('Private Gists for user {}').format(c.rhodecode_user.username)}
5 ${_('Private Gists for user {}').format(c.rhodecode_user.username)}
7 %elif c.show_public:
6 %elif c.show_public:
8 ${_('Public Gists for user {}').format(c.rhodecode_user.username)}
7 ${_('Public Gists for user {}').format(c.rhodecode_user.username)}
9 %else:
8 %else:
10 ${_('Public Gists')}
9 ${_('Public Gists')}
11 %endif
10 %endif
12 %if c.rhodecode_name:
11 %if c.rhodecode_name:
13 &middot; ${h.branding(c.rhodecode_name)}
12 &middot; ${h.branding(c.rhodecode_name)}
14 %endif
13 %endif
15 </%def>
14 </%def>
16
15
17 <%def name="breadcrumbs_links()"></%def>
16 <%def name="breadcrumbs_links()"></%def>
18
17
19 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
20 ${self.menu_items(active='gists')}
19 ${self.menu_items(active='gists')}
21 </%def>
20 </%def>
22
21
23 <%def name="main()">
22 <%def name="main()">
24
23
25 <div class="box">
24 <div class="box">
26 <div class="title">
25 <div class="title">
27
26
28 <ul class="button-links">
27 <ul class="button-links">
29 % if c.is_super_admin:
28 % if c.is_super_admin:
30 <li><a class="btn ${h.is_active('all', c.active)}" href="${h.route_path('gists_show', _query={'all': 1})}">${_('All gists')}</a></li>
29 <li><a class="btn ${h.is_active('all', c.active)}" href="${h.route_path('gists_show', _query={'all': 1})}">${_('All gists')}</a></li>
31 %endif
30 %endif
32 <li><a class="btn ${h.is_active('public', c.active)}" href="${h.route_path('gists_show')}">${_('All public')}</a></li>
31 <li><a class="btn ${h.is_active('public', c.active)}" href="${h.route_path('gists_show')}">${_('All public')}</a></li>
33 %if c.rhodecode_user.username != h.DEFAULT_USER:
32 %if c.rhodecode_user.username != h.DEFAULT_USER:
34 <li><a class="btn ${h.is_active('my_all', c.active)}" href="${h.route_path('gists_show', _query={'public':1, 'private': 1})}">${_('My gists')}</a></li>
33 <li><a class="btn ${h.is_active('my_all', c.active)}" href="${h.route_path('gists_show', _query={'public':1, 'private': 1})}">${_('My gists')}</a></li>
35 <li><a class="btn ${h.is_active('my_private', c.active)}" href="${h.route_path('gists_show', _query={'private': 1})}">${_('My private')}</a></li>
34 <li><a class="btn ${h.is_active('my_private', c.active)}" href="${h.route_path('gists_show', _query={'private': 1})}">${_('My private')}</a></li>
36 <li><a class="btn ${h.is_active('my_public', c.active)}" href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
35 <li><a class="btn ${h.is_active('my_public', c.active)}" href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
37 %endif
36 %endif
38 </ul>
37 </ul>
39
38
40 % if c.rhodecode_user.username != h.DEFAULT_USER:
39 % if c.rhodecode_user.username != h.DEFAULT_USER:
41 <div class="pull-right">
40 <div class="pull-right">
42 <a class="btn btn-primary" href="${h.route_path('gists_new')}" >
41 <a class="btn btn-primary" href="${h.route_path('gists_new')}" >
43 ${_(u'Create New Gist')}
42 ${_(u'Create New Gist')}
44 </a>
43 </a>
45 </div>
44 </div>
46 % endif
45 % endif
47
46
48 <div class="grid-quick-filter">
47 <div class="grid-quick-filter">
49 <ul class="grid-filter-box">
48 <ul class="grid-filter-box">
50 <li class="grid-filter-box-icon">
49 <li class="grid-filter-box-icon">
51 <i class="icon-search"></i>
50 <i class="icon-search"></i>
52 </li>
51 </li>
53 <li class="grid-filter-box-input">
52 <li class="grid-filter-box-input">
54 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
53 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
55 </li>
54 </li>
56 </ul>
55 </ul>
57 </div>
56 </div>
58
57
59 </div>
58 </div>
60
59
61 <div class="main-content-full-width">
60 <div class="main-content-full-width">
62 <div id="repos_list_wrap">
61 <div id="repos_list_wrap">
63 <table id="gist_list_table" class="display"></table>
62 <table id="gist_list_table" class="display"></table>
64 </div>
63 </div>
65 </div>
64 </div>
66
65
67 </div>
66 </div>
68
67
69 <script type="text/javascript">
68 <script type="text/javascript">
70 $(document).ready(function() {
69 $(document).ready(function() {
71
70
72 var get_datatable_count = function(){
71 var get_datatable_count = function(){
73 var api = $('#gist_list_table').dataTable().api();
72 var api = $('#gist_list_table').dataTable().api();
74 $('#gists_count').text(api.page.info().recordsDisplay);
73 $('#gists_count').text(api.page.info().recordsDisplay);
75 };
74 };
76
75
77
76
78 // custom filter that filters by access_id, description or author
77 // custom filter that filters by access_id, description or author
79 $.fn.dataTable.ext.search.push(
78 $.fn.dataTable.ext.search.push(
80 function( settings, data, dataIndex ) {
79 function( settings, data, dataIndex ) {
81 var query = $('#q_filter').val();
80 var query = $('#q_filter').val();
82 var author = data[0].strip();
81 var author = data[0].strip();
83 var access_id = data[2].strip();
82 var access_id = data[2].strip();
84 var description = data[3].strip();
83 var description = data[3].strip();
85
84
86 var query_str = (access_id + " " + author + " " + description).toLowerCase();
85 var query_str = (access_id + " " + author + " " + description).toLowerCase();
87
86
88 if(query_str.indexOf(query.toLowerCase()) !== -1){
87 if(query_str.indexOf(query.toLowerCase()) !== -1){
89 return true;
88 return true;
90 }
89 }
91 return false;
90 return false;
92 }
91 }
93 );
92 );
94
93
95 // gists list
94 // gists list
96 $('#gist_list_table').DataTable({
95 $('#gist_list_table').DataTable({
97 data: ${c.data|n},
96 data: ${c.data|n},
98 dom: 'rtp',
97 dom: 'rtp',
99 pageLength: ${c.visual.dashboard_items},
98 pageLength: ${c.visual.dashboard_items},
100 order: [[ 4, "desc" ]],
99 order: [[ 4, "desc" ]],
101 columns: [
100 columns: [
102 { data: {"_": "author",
101 { data: {"_": "author",
103 "sort": "author_raw"}, title: "${_("Author")}", width: "250px", className: "td-user" },
102 "sort": "author_raw"}, title: "${_("Author")}", width: "250px", className: "td-user" },
104 { data: {"_": "type",
103 { data: {"_": "type",
105 "sort": "type"}, title: "${_("Type")}", width: "100px", className: "td-gist-type" },
104 "sort": "type"}, title: "${_("Type")}", width: "100px", className: "td-gist-type" },
106 { data: {"_": "access_id",
105 { data: {"_": "access_id",
107 "sort": "access_id"}, title: "${_("Name")}", width:"150px", className: "td-componentname" },
106 "sort": "access_id"}, title: "${_("Name")}", width:"150px", className: "td-componentname" },
108 { data: {"_": "description",
107 { data: {"_": "description",
109 "sort": "description"}, title: "${_("Description")}", width: "250px", className: "td-description" },
108 "sort": "description"}, title: "${_("Description")}", width: "250px", className: "td-description" },
110 { data: {"_": "created_on",
109 { data: {"_": "created_on",
111 "sort": "created_on_raw"}, title: "${_("Created on")}", className: "td-time" },
110 "sort": "created_on_raw"}, title: "${_("Created on")}", className: "td-time" },
112 { data: {"_": "expires",
111 { data: {"_": "expires",
113 "sort": "expires"}, title: "${_("Expires")}", width: "200px", className: "td-expire" }
112 "sort": "expires"}, title: "${_("Expires")}", width: "200px", className: "td-expire" }
114 ],
113 ],
115 language: {
114 language: {
116 paginate: DEFAULT_GRID_PAGINATION,
115 paginate: DEFAULT_GRID_PAGINATION,
117 emptyTable: _gettext("No gists available yet.")
116 emptyTable: _gettext("No gists available yet.")
118 },
117 },
119 "initComplete": function( settings, json ) {
118 "initComplete": function( settings, json ) {
120 timeagoActivate();
119 timeagoActivate();
121 tooltipActivate();
120 tooltipActivate();
122 get_datatable_count();
121 get_datatable_count();
123 }
122 }
124 });
123 });
125
124
126 // update the counter when things change
125 // update the counter when things change
127 $('#gist_list_table').on('draw.dt', function() {
126 $('#gist_list_table').on('draw.dt', function() {
128 timeagoActivate();
127 timeagoActivate();
129 tooltipActivate();
128 tooltipActivate();
130 get_datatable_count();
129 get_datatable_count();
131 });
130 });
132
131
133 // filter, filter both grids
132 // filter, filter both grids
134 $('#q_filter').on( 'keyup', function () {
133 $('#q_filter').on( 'keyup', function () {
135 var repo_api = $('#gist_list_table').dataTable().api();
134 var repo_api = $('#gist_list_table').dataTable().api();
136 repo_api
135 repo_api
137 .draw();
136 .draw();
138 });
137 });
139
138
140 // refilter table if page load via back button
139 // refilter table if page load via back button
141 $("#q_filter").trigger('keyup');
140 $("#q_filter").trigger('keyup');
142
141
143 });
142 });
144
143
145 </script>
144 </script>
146 </%def>
145 </%def>
147
146
@@ -1,112 +1,111 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('New Gist')}
4 ${_('New Gist')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='gists')}
13 ${self.menu_items(active='gists')}
15 </%def>
14 </%def>
16
15
17 <%def name="main()">
16 <%def name="main()">
18 <div class="box">
17 <div class="box">
19 <!-- box / title -->
18 <!-- box / title -->
20 <div class="title">
19 <div class="title">
21
20
22 </div>
21 </div>
23
22
24 <div class="table">
23 <div class="table">
25 <div id="files_data">
24 <div id="files_data">
26 ${h.secure_form(h.route_path('gists_create'), id='eform', request=request)}
25 ${h.secure_form(h.route_path('gists_create'), id='eform', request=request)}
27 <div>
26 <div>
28 <span class="gist-gravatar">
27 <span class="gist-gravatar">
29 ${self.gravatar(c.rhodecode_user.email, 30)}
28 ${self.gravatar(c.rhodecode_user.email, 30)}
30 </span>
29 </span>
31 <label for='gistid'>${_('Gist id')}</label>
30 <label for='gistid'>${_('Gist id')}</label>
32 ${h.text('gistid', placeholder=_('Auto generated'))}
31 ${h.text('gistid', placeholder=_('Auto generated'))}
33
32
34 <label for='lifetime'>${_('Gist lifetime')}</label>
33 <label for='lifetime'>${_('Gist lifetime')}</label>
35 ${h.dropdownmenu('lifetime', '', c.lifetime_options)}
34 ${h.dropdownmenu('lifetime', '', c.lifetime_options)}
36
35
37 <label for='acl_level'>${_('Private Gist access level')}</label>
36 <label for='acl_level'>${_('Private Gist access level')}</label>
38 ${h.dropdownmenu('gist_acl_level', '', c.acl_options)}
37 ${h.dropdownmenu('gist_acl_level', '', c.acl_options)}
39
38
40 <textarea style="margin-top: 5px; border-color: #dbd9da" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
39 <textarea style="margin-top: 5px; border-color: #dbd9da" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
41 </div>
40 </div>
42
41
43 <div id="codeblock" class="codeblock">
42 <div id="codeblock" class="codeblock">
44 <div class="code-header">
43 <div class="code-header">
45 <div class="form">
44 <div class="form">
46 <div class="fields">
45 <div class="fields">
47 ${h.text('filename', size=30, placeholder=_('name gist file...'))}
46 ${h.text('filename', size=30, placeholder=_('name gist file...'))}
48 ${h.dropdownmenu('mimetype','plain',[('plain',_('plain'))],enable_filter=True)}
47 ${h.dropdownmenu('mimetype','plain',[('plain',_('plain'))],enable_filter=True)}
49 </div>
48 </div>
50 </div>
49 </div>
51 </div>
50 </div>
52
51
53 <div id="editor_container">
52 <div id="editor_container">
54 <div id="editor_pre"></div>
53 <div id="editor_pre"></div>
55 <textarea id="editor" name="content" ></textarea>
54 <textarea id="editor" name="content" ></textarea>
56 </div>
55 </div>
57 </div>
56 </div>
58
57
59 <div class="pull-left">
58 <div class="pull-left">
60 <div class="pull-right">
59 <div class="pull-right">
61 ${h.submit('create',_('Create Gist'),class_="btn")}
60 ${h.submit('create',_('Create Gist'),class_="btn")}
62 </div>
61 </div>
63 <div class="rcform-element pull-right">
62 <div class="rcform-element pull-right">
64 <div class="fields gist-type-fields">
63 <div class="fields gist-type-fields">
65 <fieldset>
64 <fieldset>
66 <div class="gist-type-fields-wrapper">
65 <div class="gist-type-fields-wrapper">
67
66
68 <input type="radio" id="private_gist" checked="" name="gist_type" value="private" onchange="setGistId('private')">
67 <input type="radio" id="private_gist" checked="" name="gist_type" value="private" onchange="setGistId('private')">
69 <label for="private_gist">${_('Private Gist')}</label>
68 <label for="private_gist">${_('Private Gist')}</label>
70 <span class="tooltip label" title="${_('Private Gists are not listed and only accessible through their secret url.')}">${_('Private Gist')}</span>
69 <span class="tooltip label" title="${_('Private Gists are not listed and only accessible through their secret url.')}">${_('Private Gist')}</span>
71
70
72 <input type="radio" id="public_gist" name="gist_type" value="public" onchange="setGistId('public')">
71 <input type="radio" id="public_gist" name="gist_type" value="public" onchange="setGistId('public')">
73 <label for="public_gist">${_('Public Gist')}</label>
72 <label for="public_gist">${_('Public Gist')}</label>
74 <span class="tooltip label" title="${_('Public Gists are accessible to anyone and listed in Gists page.')}">${_('Public Gist')}</span>
73 <span class="tooltip label" title="${_('Public Gists are accessible to anyone and listed in Gists page.')}">${_('Public Gist')}</span>
75 </div>
74 </div>
76 </fieldset>
75 </fieldset>
77 </div>
76 </div>
78 </div>
77 </div>
79
78
80 </div>
79 </div>
81 ${h.end_form()}
80 ${h.end_form()}
82 </div>
81 </div>
83 </div>
82 </div>
84
83
85 </div>
84 </div>
86
85
87 <script type="text/javascript">
86 <script type="text/javascript">
88 var myCodeMirror = initCodeMirror('editor', '');
87 var myCodeMirror = initCodeMirror('editor', '');
89
88
90 var modes_select = $('#mimetype');
89 var modes_select = $('#mimetype');
91 fillCodeMirrorOptions(modes_select);
90 fillCodeMirrorOptions(modes_select);
92
91
93 var filename_selector = '#filename';
92 var filename_selector = '#filename';
94 // on change of select field set mode
93 // on change of select field set mode
95 setCodeMirrorModeFromSelect(
94 setCodeMirrorModeFromSelect(
96 modes_select, filename_selector, myCodeMirror, null);
95 modes_select, filename_selector, myCodeMirror, null);
97
96
98 // on entering the new filename set mode, from given extension
97 // on entering the new filename set mode, from given extension
99 setCodeMirrorModeFromInput(
98 setCodeMirrorModeFromInput(
100 modes_select, filename_selector, myCodeMirror, null);
99 modes_select, filename_selector, myCodeMirror, null);
101
100
102 setGistId = function(gistType) {
101 setGistId = function(gistType) {
103 if (gistType === 'private') {
102 if (gistType === 'private') {
104 $('#gistid').removeAttr('disabled');
103 $('#gistid').removeAttr('disabled');
105 }
104 }
106 else {
105 else {
107 $('#gistid').val('');
106 $('#gistid').val('');
108 $('#gistid').attr('disabled', 'disabled')
107 $('#gistid').attr('disabled', 'disabled')
109 }
108 }
110 }
109 }
111 </script>
110 </script>
112 </%def>
111 </%def>
@@ -1,113 +1,112 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
2 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
4
3
5 <%def name="robots()">
4 <%def name="robots()">
6 %if c.gist.gist_type != 'public':
5 %if c.gist.gist_type != 'public':
7 <meta name="robots" content="noindex, nofollow">
6 <meta name="robots" content="noindex, nofollow">
8 %else:
7 %else:
9 ${parent.robots()}
8 ${parent.robots()}
10 %endif
9 %endif
11 </%def>
10 </%def>
12
11
13 <%def name="title()">
12 <%def name="title()">
14 ${_('Gist')} &middot; ${c.gist.gist_access_id}
13 ${_('Gist')} &middot; ${c.gist.gist_access_id}
15 %if c.rhodecode_name:
14 %if c.rhodecode_name:
16 &middot; ${h.branding(c.rhodecode_name)}
15 &middot; ${h.branding(c.rhodecode_name)}
17 %endif
16 %endif
18 </%def>
17 </%def>
19
18
20 <%def name="breadcrumbs_links()">
19 <%def name="breadcrumbs_links()">
21 ${_('Gist')} &middot; ${c.gist.gist_access_id}
20 ${_('Gist')} &middot; ${c.gist.gist_access_id}
22 </%def>
21 </%def>
23
22
24 <%def name="menu_bar_nav()">
23 <%def name="menu_bar_nav()">
25 ${self.menu_items(active='gists')}
24 ${self.menu_items(active='gists')}
26 </%def>
25 </%def>
27
26
28 <%def name="main()">
27 <%def name="main()">
29 <div class="box">
28 <div class="box">
30 <!-- box / title -->
29 <!-- box / title -->
31
30
32 <div class="table">
31 <div class="table">
33 <div id="files_data">
32 <div id="files_data">
34 <div id="codeblock" class="codeblock">
33 <div id="codeblock" class="codeblock">
35 <div class="code-header">
34 <div class="code-header">
36 <div class="gist_url">
35 <div class="gist_url">
37 <div class="pull-left">
36 <div class="pull-left">
38 <code>
37 <code>
39 ${dt.gist_type(c.gist.gist_type)}
38 ${dt.gist_type(c.gist.gist_type)}
40 <span class="tag disabled">${c.gist.gist_access_id}</span>
39 <span class="tag disabled">${c.gist.gist_access_id}</span>
41 ${c.gist.gist_url()} <span class="icon-clipboard clipboard-action" data-clipboard-text="${c.gist.gist_url()}" title="${_('Copy the url')}"></span>
40 ${c.gist.gist_url()} <span class="icon-clipboard clipboard-action" data-clipboard-text="${c.gist.gist_url()}" title="${_('Copy the url')}"></span>
42 </code>
41 </code>
43 </div>
42 </div>
44
43
45 <div class="pull-right buttons">
44 <div class="pull-right buttons">
46 ## only owner should see that
45 ## only owner should see that
47 <a href="#copySource" onclick="return false;" class="btn btn-mini icon-clipboard no-grey clipboard-action" data-clipboard-text="${c.files[0].content}">${_('Copy content')}</a>
46 <a href="#copySource" onclick="return false;" class="btn btn-mini icon-clipboard no-grey clipboard-action" data-clipboard-text="${c.files[0].content}">${_('Copy content')}</a>
48
47
49 %if c.is_super_admin or c.gist.gist_owner == c.rhodecode_user.user_id:
48 %if c.is_super_admin or c.gist.gist_owner == c.rhodecode_user.user_id:
50 ${h.link_to(_('Edit'), h.route_path('gist_edit', gist_id=c.gist.gist_access_id), class_="btn btn-mini")}
49 ${h.link_to(_('Edit'), h.route_path('gist_edit', gist_id=c.gist.gist_access_id), class_="btn btn-mini")}
51 %endif
50 %endif
52 ${h.link_to(_('Show as Raw'), h.route_path('gist_show_formatted', gist_id=c.gist.gist_access_id, revision='tip', format='raw'), class_="btn btn-mini")}
51 ${h.link_to(_('Show as Raw'), h.route_path('gist_show_formatted', gist_id=c.gist.gist_access_id, revision='tip', format='raw'), class_="btn btn-mini")}
53
52
54 %if c.is_super_admin or c.gist.gist_owner == c.rhodecode_user.user_id:
53 %if c.is_super_admin or c.gist.gist_owner == c.rhodecode_user.user_id:
55 <div class="pull-right remove_gist">
54 <div class="pull-right remove_gist">
56 ${h.secure_form(h.route_path('gist_delete', gist_id=c.gist.gist_access_id), request=request)}
55 ${h.secure_form(h.route_path('gist_delete', gist_id=c.gist.gist_access_id), request=request)}
57 <input class="btn btn-mini btn-danger" id="remove_gist" name="remove_gist"
56 <input class="btn btn-mini btn-danger" id="remove_gist" name="remove_gist"
58 onclick="submitConfirm(event, this, _gettext('Confirm to delete this gist'), _gettext('Delete'), '${c.gist.gist_access_id}')"
57 onclick="submitConfirm(event, this, _gettext('Confirm to delete this gist'), _gettext('Delete'), '${c.gist.gist_access_id}')"
59 type="submit" value="${_('Delete')}"
58 type="submit" value="${_('Delete')}"
60 >
59 >
61 ${h.end_form()}
60 ${h.end_form()}
62 </div>
61 </div>
63 %endif
62 %endif
64 </div>
63 </div>
65 </div>
64 </div>
66
65
67 <div class="gist-desc">
66 <div class="gist-desc">
68 <code>${c.gist.gist_description}</code>
67 <code>${c.gist.gist_description}</code>
69 </div>
68 </div>
70
69
71 <div class="author">
70 <div class="author">
72 <div title="${h.tooltip(c.file_last_commit.author)}">
71 <div title="${h.tooltip(c.file_last_commit.author)}">
73 ${self.gravatar_with_user(c.file_last_commit.author, 16, tooltip=True)} - ${_('created')} ${h.age_component(c.file_last_commit.date)},
72 ${self.gravatar_with_user(c.file_last_commit.author, 16, tooltip=True)} - ${_('created')} ${h.age_component(c.file_last_commit.date)},
74 ${_('expires')}:
73 ${_('expires')}:
75 %if c.gist.gist_expires == -1:
74 %if c.gist.gist_expires == -1:
76 ${_('never')}
75 ${_('never')}
77 %else:
76 %else:
78 ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))}
77 ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))}
79 %endif
78 %endif
80 </span>
79 </span>
81 </div>
80 </div>
82
81
83 </div>
82 </div>
84 <div class="commit">${h.urlify_commit_message(c.file_last_commit.message, None)}</div>
83 <div class="commit">${h.urlify_commit_message(c.file_last_commit.message, None)}</div>
85 </div>
84 </div>
86
85
87 ## iterate over the files
86 ## iterate over the files
88 % for gist_file in c.files:
87 % for gist_file in c.files:
89 <% renderer = c.render and h.renderer_from_filename(gist_file.path, exclude=['.txt', '.TXT'])%>
88 <% renderer = c.render and h.renderer_from_filename(gist_file.path, exclude=['.txt', '.TXT'])%>
90 <!--
89 <!--
91 <div id="${h.FID('G', gist_file.path)}" class="stats" >
90 <div id="${h.FID('G', gist_file.path)}" class="stats" >
92 <a href="${c.gist.gist_url()}">¶</a>
91 <a href="${c.gist.gist_url()}">¶</a>
93 <b >${gist_file.path}</b>
92 <b >${gist_file.path}</b>
94 <div>
93 <div>
95 ${h.link_to(_('Show as raw'), h.route_path('gist_show_formatted_path', gist_id=c.gist.gist_access_id, revision=gist_file.commit.raw_id, format='raw', f_path=gist_file.path), class_="btn btn-mini")}
94 ${h.link_to(_('Show as raw'), h.route_path('gist_show_formatted_path', gist_id=c.gist.gist_access_id, revision=gist_file.commit.raw_id, format='raw', f_path=gist_file.path), class_="btn btn-mini")}
96 </div>
95 </div>
97 </div>
96 </div>
98 -->
97 -->
99 <div class="code-body textarea text-area editor">
98 <div class="code-body textarea text-area editor">
100 %if renderer:
99 %if renderer:
101 ${h.render(gist_file.content, renderer=renderer)}
100 ${h.render(gist_file.content, renderer=renderer)}
102 %else:
101 %else:
103 ${h.pygmentize(gist_file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
102 ${h.pygmentize(gist_file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
104 %endif
103 %endif
105 </div>
104 </div>
106 %endfor
105 %endfor
107 </div>
106 </div>
108 </div>
107 </div>
109 </div>
108 </div>
110
109
111
110
112 </div>
111 </div>
113 </%def>
112 </%def>
@@ -1,36 +1,35 b''
1 ## -*- coding: utf-8 -*-
2 <%!
1 <%!
3 def inherit(context):
2 def inherit(context):
4 if context['c'].repo:
3 if context['c'].repo:
5 return "/admin/repos/repo_edit.mako"
4 return "/admin/repos/repo_edit.mako"
6 elif context['c'].repo_group:
5 elif context['c'].repo_group:
7 return "/admin/repo_groups/repo_group_edit.mako"
6 return "/admin/repo_groups/repo_group_edit.mako"
8 else:
7 else:
9 return "/admin/integrations/global.mako"
8 return "/admin/integrations/global.mako"
10 %>
9 %>
11 <%inherit file="${inherit(context)}" />
10 <%inherit file="${inherit(context)}" />
12
11
13 <%def name="title()">
12 <%def name="title()">
14 ${_('Integrations Settings')}
13 ${_('Integrations Settings')}
15 %if c.rhodecode_name:
14 %if c.rhodecode_name:
16 &middot; ${h.branding(c.rhodecode_name)}
15 &middot; ${h.branding(c.rhodecode_name)}
17 %endif
16 %endif
18 </%def>
17 </%def>
19
18
20 <%def name="breadcrumbs_links()">
19 <%def name="breadcrumbs_links()">
21 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
20 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
22 &raquo;
21 &raquo;
23 ${_('Integrations')}
22 ${_('Integrations')}
24 </%def>
23 </%def>
25
24
26 <%def name="menu_bar_nav()">
25 <%def name="menu_bar_nav()">
27 %if c.repo:
26 %if c.repo:
28 ${self.menu_items(active='repositories')}
27 ${self.menu_items(active='repositories')}
29 %else:
28 %else:
30 ${self.menu_items(active='admin')}
29 ${self.menu_items(active='admin')}
31 %endif
30 %endif
32 </%def>
31 </%def>
33
32
34 <%def name="main_content()">
33 <%def name="main_content()">
35 ${next.body()}
34 ${next.body()}
36 </%def>
35 </%def>
@@ -1,69 +1,68 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3
2
4 <%def name="breadcrumbs_links()">
3 <%def name="breadcrumbs_links()">
5 %if c.repo:
4 %if c.repo:
6 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
5 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
7 &raquo;
6 &raquo;
8 ${h.link_to(_('Integrations'),request.route_url(route_name='repo_integrations_home', repo_name=c.repo.repo_name))}
7 ${h.link_to(_('Integrations'),request.route_url(route_name='repo_integrations_home', repo_name=c.repo.repo_name))}
9 &raquo;
8 &raquo;
10 ${h.link_to(c.current_IntegrationType.display_name,
9 ${h.link_to(c.current_IntegrationType.display_name,
11 request.route_url(route_name='repo_integrations_list',
10 request.route_url(route_name='repo_integrations_list',
12 repo_name=c.repo.repo_name,
11 repo_name=c.repo.repo_name,
13 integration=c.current_IntegrationType.key))}
12 integration=c.current_IntegrationType.key))}
14 %elif c.repo_group:
13 %elif c.repo_group:
15 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
14 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
16 &raquo;
15 &raquo;
17 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
16 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
18 &raquo;
17 &raquo;
19 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
18 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
20 &raquo;
19 &raquo;
21 ${h.link_to(_('Integrations'),request.route_url(route_name='repo_group_integrations_home', repo_group_name=c.repo_group.group_name))}
20 ${h.link_to(_('Integrations'),request.route_url(route_name='repo_group_integrations_home', repo_group_name=c.repo_group.group_name))}
22 &raquo;
21 &raquo;
23 ${h.link_to(c.current_IntegrationType.display_name,
22 ${h.link_to(c.current_IntegrationType.display_name,
24 request.route_url(route_name='repo_group_integrations_list',
23 request.route_url(route_name='repo_group_integrations_list',
25 repo_group_name=c.repo_group.group_name,
24 repo_group_name=c.repo_group.group_name,
26 integration=c.current_IntegrationType.key))}
25 integration=c.current_IntegrationType.key))}
27 %else:
26 %else:
28 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
27 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
29 &raquo;
28 &raquo;
30 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
29 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
31 &raquo;
30 &raquo;
32 ${h.link_to(_('Integrations'),request.route_url(route_name='global_integrations_home'))}
31 ${h.link_to(_('Integrations'),request.route_url(route_name='global_integrations_home'))}
33 &raquo;
32 &raquo;
34 ${h.link_to(c.current_IntegrationType.display_name,
33 ${h.link_to(c.current_IntegrationType.display_name,
35 request.route_url(route_name='global_integrations_list',
34 request.route_url(route_name='global_integrations_list',
36 integration=c.current_IntegrationType.key))}
35 integration=c.current_IntegrationType.key))}
37 %endif
36 %endif
38
37
39 %if c.integration:
38 %if c.integration:
40 &raquo;
39 &raquo;
41 ${c.integration.name}
40 ${c.integration.name}
42 %elif c.current_IntegrationType:
41 %elif c.current_IntegrationType:
43 &raquo;
42 &raquo;
44 ${c.current_IntegrationType.display_name}
43 ${c.current_IntegrationType.display_name}
45 %endif
44 %endif
46 </%def>
45 </%def>
47
46
48 <style>
47 <style>
49 .control-inputs.item-options, .control-inputs.item-settings {
48 .control-inputs.item-options, .control-inputs.item-settings {
50 float: left;
49 float: left;
51 width: 100%;
50 width: 100%;
52 }
51 }
53 </style>
52 </style>
54 <div class="panel panel-default">
53 <div class="panel panel-default">
55 <div class="panel-heading">
54 <div class="panel-heading">
56 <h2 class="panel-title">
55 <h2 class="panel-title">
57 %if c.integration:
56 %if c.integration:
58 ${c.current_IntegrationType.display_name} - ${c.integration.name}
57 ${c.current_IntegrationType.display_name} - ${c.integration.name}
59 %else:
58 %else:
60 ${_('Create New %(integration_type)s Integration') % {
59 ${_('Create New %(integration_type)s Integration') % {
61 'integration_type': c.current_IntegrationType.display_name
60 'integration_type': c.current_IntegrationType.display_name
62 }}
61 }}
63 %endif
62 %endif
64 </h2>
63 </h2>
65 </div>
64 </div>
66 <div class="panel-body">
65 <div class="panel-body">
67 ${c.form.render() | n}
66 ${c.form.render() | n}
68 </div>
67 </div>
69 </div>
68 </div>
@@ -1,52 +1,51 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Integrations administration')}
4 ${_('Integrations administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${_('Integrations')}
13 ${_('Integrations')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='admin')}
17 ${self.menu_items(active='admin')}
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_subnav()">
20 <%def name="menu_bar_subnav()">
22 ${self.admin_menu(active='integrations')}
21 ${self.admin_menu(active='integrations')}
23 </%def>
22 </%def>
24
23
25 <%def name="side_bar_nav()">
24 <%def name="side_bar_nav()">
26 <li class="active">
25 <li class="active">
27 <a href="${h.route_path('global_integrations_home')}">Global</a>
26 <a href="${h.route_path('global_integrations_home')}">Global</a>
28 </li>
27 </li>
29 </%def>
28 </%def>
30
29
31 <%def name="main_content()">
30 <%def name="main_content()">
32 <%include file="/admin/settings/settings_${c.active}.mako"/>
31 <%include file="/admin/settings/settings_${c.active}.mako"/>
33 </%def>
32 </%def>
34
33
35 <%def name="main()">
34 <%def name="main()">
36 <div class="box">
35 <div class="box">
37
36
38 ##main
37 ##main
39 <div class='sidebar-col-wrapper'>
38 <div class='sidebar-col-wrapper'>
40 <div class="sidebar">
39 <div class="sidebar">
41 <ul class="nav nav-pills nav-stacked">
40 <ul class="nav nav-pills nav-stacked">
42 ${self.side_bar_nav()}
41 ${self.side_bar_nav()}
43 </ul>
42 </ul>
44 </div>
43 </div>
45
44
46 <div class="main-content-auto-width">
45 <div class="main-content-auto-width">
47 ${self.main_content()}
46 ${self.main_content()}
48 </div>
47 </div>
49 </div>
48 </div>
50 </div>
49 </div>
51
50
52 </%def>
51 </%def>
@@ -1,220 +1,219 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3
2
4 <%def name="breadcrumbs_links()">
3 <%def name="breadcrumbs_links()">
5 %if c.repo:
4 %if c.repo:
6 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
5 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
7 %elif c.repo_group:
6 %elif c.repo_group:
8 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
7 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
9 &raquo;
8 &raquo;
10 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
9 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
11 &raquo;
10 &raquo;
12 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
11 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
13 %else:
12 %else:
14 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
15 &raquo;
14 &raquo;
16 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
15 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
17 %endif
16 %endif
18 %if c.current_IntegrationType:
17 %if c.current_IntegrationType:
19 &raquo;
18 &raquo;
20 %if c.repo:
19 %if c.repo:
21 ${h.link_to(_('Integrations'),
20 ${h.link_to(_('Integrations'),
22 request.route_path(route_name='repo_integrations_home',
21 request.route_path(route_name='repo_integrations_home',
23 repo_name=c.repo.repo_name))}
22 repo_name=c.repo.repo_name))}
24 %elif c.repo_group:
23 %elif c.repo_group:
25 ${h.link_to(_('Integrations'),
24 ${h.link_to(_('Integrations'),
26 request.route_path(route_name='repo_group_integrations_home',
25 request.route_path(route_name='repo_group_integrations_home',
27 repo_group_name=c.repo_group.group_name))}
26 repo_group_name=c.repo_group.group_name))}
28 %else:
27 %else:
29 ${h.link_to(_('Integrations'),
28 ${h.link_to(_('Integrations'),
30 request.route_path(route_name='global_integrations_home'))}
29 request.route_path(route_name='global_integrations_home'))}
31 %endif
30 %endif
32 &raquo;
31 &raquo;
33 ${c.current_IntegrationType.display_name}
32 ${c.current_IntegrationType.display_name}
34 %else:
33 %else:
35 &raquo;
34 &raquo;
36 ${_('Integrations')}
35 ${_('Integrations')}
37 %endif
36 %endif
38 </%def>
37 </%def>
39
38
40 <div class="panel panel-default">
39 <div class="panel panel-default">
41 <div class="panel-heading">
40 <div class="panel-heading">
42 <h3 class="panel-title">
41 <h3 class="panel-title">
43 %if c.repo:
42 %if c.repo:
44 ${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
43 ${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
45 %elif c.repo_group:
44 %elif c.repo_group:
46 ${_('Repository Group Integrations: {}').format(c.repo_group.group_name)}</h3>
45 ${_('Repository Group Integrations: {}').format(c.repo_group.group_name)}</h3>
47 %else:
46 %else:
48 ${_('Current Integrations')}
47 ${_('Current Integrations')}
49 %endif
48 %endif
50 </h3>
49 </h3>
51 </div>
50 </div>
52 <div class="panel-body">
51 <div class="panel-body">
53
52
54 <%
53 <%
55 integration_type = c.current_IntegrationType and c.current_IntegrationType.display_name or ''
54 integration_type = c.current_IntegrationType and c.current_IntegrationType.display_name or ''
56
55
57 if c.repo:
56 if c.repo:
58 create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
57 create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
59 elif c.repo_group:
58 elif c.repo_group:
60 create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
59 create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
61 else:
60 else:
62 create_url = h.route_path('global_integrations_new')
61 create_url = h.route_path('global_integrations_new')
63 %>
62 %>
64 <p class="pull-right">
63 <p class="pull-right">
65 <a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
64 <a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
66 </p>
65 </p>
67
66
68 <table class="rctable integrations">
67 <table class="rctable integrations">
69 <thead>
68 <thead>
70 <tr>
69 <tr>
71 <th><a href="?sort=enabled:${c.rev_sort_dir}">${_('Enabled')}</a></th>
70 <th><a href="?sort=enabled:${c.rev_sort_dir}">${_('Enabled')}</a></th>
72 <th><a href="?sort=name:${c.rev_sort_dir}">${_('Name')}</a></th>
71 <th><a href="?sort=name:${c.rev_sort_dir}">${_('Name')}</a></th>
73 <th colspan="2"><a href="?sort=integration_type:${c.rev_sort_dir}">${_('Type')}</a></th>
72 <th colspan="2"><a href="?sort=integration_type:${c.rev_sort_dir}">${_('Type')}</a></th>
74 <th><a href="?sort=scope:${c.rev_sort_dir}">${_('Scope')}</a></th>
73 <th><a href="?sort=scope:${c.rev_sort_dir}">${_('Scope')}</a></th>
75 <th>${_('Actions')}</th>
74 <th>${_('Actions')}</th>
76 <th></th>
75 <th></th>
77 </tr>
76 </tr>
78 </thead>
77 </thead>
79 <tbody>
78 <tbody>
80 %if not c.integrations_list:
79 %if not c.integrations_list:
81 <tr>
80 <tr>
82 <td colspan="7">
81 <td colspan="7">
83
82
84 %if c.repo:
83 %if c.repo:
85 ${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
84 ${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
86 %elif c.repo_group:
85 %elif c.repo_group:
87 ${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
86 ${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
88 %else:
87 %else:
89 ${_('No {type} integrations exist yet.').format(type=integration_type)}
88 ${_('No {type} integrations exist yet.').format(type=integration_type)}
90 %endif
89 %endif
91
90
92 %if c.current_IntegrationType:
91 %if c.current_IntegrationType:
93 <%
92 <%
94 if c.repo:
93 if c.repo:
95 create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=c.current_IntegrationType.key)
94 create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=c.current_IntegrationType.key)
96 elif c.repo_group:
95 elif c.repo_group:
97 create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=c.current_IntegrationType.key)
96 create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=c.current_IntegrationType.key)
98 else:
97 else:
99 create_url = h.route_path('global_integrations_create', integration=c.current_IntegrationType.key)
98 create_url = h.route_path('global_integrations_create', integration=c.current_IntegrationType.key)
100 %>
99 %>
101 %endif
100 %endif
102
101
103 <a href="${create_url}">${_(u'Create one')}</a>
102 <a href="${create_url}">${_(u'Create one')}</a>
104 </td>
103 </td>
105 </tr>
104 </tr>
106 %endif
105 %endif
107 %for IntegrationType, integration in c.integrations_list:
106 %for IntegrationType, integration in c.integrations_list:
108 <tr id="integration_${integration.integration_id}">
107 <tr id="integration_${integration.integration_id}">
109 <td class="td-enabled">
108 <td class="td-enabled">
110 <div class="pull-left">
109 <div class="pull-left">
111 ${h.bool2icon(integration.enabled)}
110 ${h.bool2icon(integration.enabled)}
112 </div>
111 </div>
113 </td>
112 </td>
114 <td class="td-description">
113 <td class="td-description">
115 ${integration.name}
114 ${integration.name}
116 </td>
115 </td>
117 <td class="td-icon">
116 <td class="td-icon">
118 %if integration.integration_type in c.available_integrations:
117 %if integration.integration_type in c.available_integrations:
119 <div class="integration-icon">
118 <div class="integration-icon">
120 ${c.available_integrations[integration.integration_type].icon()|n}
119 ${c.available_integrations[integration.integration_type].icon()|n}
121 </div>
120 </div>
122 %else:
121 %else:
123 ?
122 ?
124 %endif
123 %endif
125 </td>
124 </td>
126 <td class="td-type">
125 <td class="td-type">
127 ${integration.integration_type}
126 ${integration.integration_type}
128 </td>
127 </td>
129 <td class="td-scope">
128 <td class="td-scope">
130 %if integration.repo:
129 %if integration.repo:
131 <a href="${h.route_path('repo_summary', repo_name=integration.repo.repo_name)}">
130 <a href="${h.route_path('repo_summary', repo_name=integration.repo.repo_name)}">
132 ${_('repo')}:${integration.repo.repo_name}
131 ${_('repo')}:${integration.repo.repo_name}
133 </a>
132 </a>
134 %elif integration.repo_group:
133 %elif integration.repo_group:
135 <a href="${h.route_path('repo_group_home', repo_group_name=integration.repo_group.group_name)}">
134 <a href="${h.route_path('repo_group_home', repo_group_name=integration.repo_group.group_name)}">
136 ${_('repogroup')}:${integration.repo_group.group_name}
135 ${_('repogroup')}:${integration.repo_group.group_name}
137 %if integration.child_repos_only:
136 %if integration.child_repos_only:
138 ${_('child repos only')}
137 ${_('child repos only')}
139 %else:
138 %else:
140 ${_('cascade to all')}
139 ${_('cascade to all')}
141 %endif
140 %endif
142 </a>
141 </a>
143 %else:
142 %else:
144 %if integration.child_repos_only:
143 %if integration.child_repos_only:
145 ${_('top level repos only')}
144 ${_('top level repos only')}
146 %else:
145 %else:
147 ${_('global')}
146 ${_('global')}
148 %endif
147 %endif
149 </td>
148 </td>
150 %endif
149 %endif
151 <td class="td-action">
150 <td class="td-action">
152 %if not IntegrationType:
151 %if not IntegrationType:
153 ${_('unknown integration')}
152 ${_('unknown integration')}
154 %else:
153 %else:
155 <%
154 <%
156 if c.repo:
155 if c.repo:
157 edit_url = request.route_path('repo_integrations_edit',
156 edit_url = request.route_path('repo_integrations_edit',
158 repo_name=c.repo.repo_name,
157 repo_name=c.repo.repo_name,
159 integration=integration.integration_type,
158 integration=integration.integration_type,
160 integration_id=integration.integration_id)
159 integration_id=integration.integration_id)
161 elif c.repo_group:
160 elif c.repo_group:
162 edit_url = request.route_path('repo_group_integrations_edit',
161 edit_url = request.route_path('repo_group_integrations_edit',
163 repo_group_name=c.repo_group.group_name,
162 repo_group_name=c.repo_group.group_name,
164 integration=integration.integration_type,
163 integration=integration.integration_type,
165 integration_id=integration.integration_id)
164 integration_id=integration.integration_id)
166 else:
165 else:
167 edit_url = request.route_path('global_integrations_edit',
166 edit_url = request.route_path('global_integrations_edit',
168 integration=integration.integration_type,
167 integration=integration.integration_type,
169 integration_id=integration.integration_id)
168 integration_id=integration.integration_id)
170 %>
169 %>
171 <div class="grid_edit">
170 <div class="grid_edit">
172 <a href="${edit_url}">${_('Edit')}</a>
171 <a href="${edit_url}">${_('Edit')}</a>
173 </div>
172 </div>
174 <div class="grid_delete">
173 <div class="grid_delete">
175 <a href="${edit_url}"
174 <a href="${edit_url}"
176 class="btn btn-link btn-danger delete_integration_entry"
175 class="btn btn-link btn-danger delete_integration_entry"
177 data-desc="${integration.name}"
176 data-desc="${integration.name}"
178 data-uid="${integration.integration_id}">
177 data-uid="${integration.integration_id}">
179 ${_('Delete')}
178 ${_('Delete')}
180 </a>
179 </a>
181 </div>
180 </div>
182 %endif
181 %endif
183 </td>
182 </td>
184 </tr>
183 </tr>
185 %endfor
184 %endfor
186 <tr id="last-row"></tr>
185 <tr id="last-row"></tr>
187 </tbody>
186 </tbody>
188 </table>
187 </table>
189 <div class="integrations-paginator">
188 <div class="integrations-paginator">
190 <div class="pagination-wh pagination-left">
189 <div class="pagination-wh pagination-left">
191 ${c.integrations_list.render()}
190 ${c.integrations_list.render()}
192 </div>
191 </div>
193 </div>
192 </div>
194 </div>
193 </div>
195 </div>
194 </div>
196 <script type="text/javascript">
195 <script type="text/javascript">
197 var delete_integration = function(entry) {
196 var delete_integration = function(entry) {
198 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
197 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
199 var request = $.ajax({
198 var request = $.ajax({
200 type: "POST",
199 type: "POST",
201 url: $(entry).attr('href'),
200 url: $(entry).attr('href'),
202 data: {
201 data: {
203 'delete': 'delete',
202 'delete': 'delete',
204 'csrf_token': CSRF_TOKEN
203 'csrf_token': CSRF_TOKEN
205 },
204 },
206 success: function(){
205 success: function(){
207 location.reload();
206 location.reload();
208 },
207 },
209 error: function(data, textStatus, errorThrown){
208 error: function(data, textStatus, errorThrown){
210 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
209 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
211 }
210 }
212 });
211 });
213 };
212 };
214 };
213 };
215
214
216 $('.delete_integration_entry').on('click', function(e){
215 $('.delete_integration_entry').on('click', function(e){
217 e.preventDefault();
216 e.preventDefault();
218 delete_integration(this);
217 delete_integration(this);
219 });
218 });
220 </script> No newline at end of file
219 </script>
@@ -1,60 +1,59 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="widgets" file="/widgets.mako"/>
2 <%namespace name="widgets" file="/widgets.mako"/>
4
3
5 <%def name="breadcrumbs_links()">
4 <%def name="breadcrumbs_links()">
6 %if c.repo:
5 %if c.repo:
7 ${_('Settings')}
6 ${_('Settings')}
8 %elif c.repo_group:
7 %elif c.repo_group:
9 ${_('Settings')}
8 ${_('Settings')}
10 %else:
9 %else:
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
10 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
12 &raquo;
11 &raquo;
13 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
12 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
14 &raquo;
13 &raquo;
15 ${h.link_to(_('Integrations'),request.route_url(route_name='global_integrations_home'))}
14 ${h.link_to(_('Integrations'),request.route_url(route_name='global_integrations_home'))}
16 %endif
15 %endif
17 &raquo;
16 &raquo;
18 ${_('Create new integration')}
17 ${_('Create new integration')}
19 </%def>
18 </%def>
20 <%widgets:panel class_='integrations'>
19 <%widgets:panel class_='integrations'>
21 <%def name="title()">
20 <%def name="title()">
22 %if c.repo:
21 %if c.repo:
23 ${_('Create New Integration for repository: {repo_name}').format(repo_name=c.repo.repo_name)}
22 ${_('Create New Integration for repository: {repo_name}').format(repo_name=c.repo.repo_name)}
24 %elif c.repo_group:
23 %elif c.repo_group:
25 ${_('Create New Integration for repository group: {repo_group_name}').format(repo_group_name=c.repo_group.group_name)}
24 ${_('Create New Integration for repository group: {repo_group_name}').format(repo_group_name=c.repo_group.group_name)}
26 %else:
25 %else:
27 ${_('Create New Global Integration')}
26 ${_('Create New Global Integration')}
28 %endif
27 %endif
29 </%def>
28 </%def>
30
29
31 %for integration, IntegrationObject in c.available_integrations.items():
30 %for integration, IntegrationObject in c.available_integrations.items():
32 <%
31 <%
33 if c.repo:
32 if c.repo:
34 create_url = request.route_path('repo_integrations_create',
33 create_url = request.route_path('repo_integrations_create',
35 repo_name=c.repo.repo_name,
34 repo_name=c.repo.repo_name,
36 integration=integration)
35 integration=integration)
37 elif c.repo_group:
36 elif c.repo_group:
38 create_url = request.route_path('repo_group_integrations_create',
37 create_url = request.route_path('repo_group_integrations_create',
39 repo_group_name=c.repo_group.group_name,
38 repo_group_name=c.repo_group.group_name,
40 integration=integration)
39 integration=integration)
41 else:
40 else:
42 create_url = request.route_path('global_integrations_create',
41 create_url = request.route_path('global_integrations_create',
43 integration=integration)
42 integration=integration)
44 if IntegrationObject.is_dummy:
43 if IntegrationObject.is_dummy:
45 create_url = request.current_route_path()
44 create_url = request.current_route_path()
46 %>
45 %>
47 <a href="${create_url}" class="integration-box ${'dummy-integration' if IntegrationObject.is_dummy else ''}">
46 <a href="${create_url}" class="integration-box ${'dummy-integration' if IntegrationObject.is_dummy else ''}">
48 <%widgets:panel>
47 <%widgets:panel>
49 <h2>
48 <h2>
50 <div class="integration-icon">
49 <div class="integration-icon">
51 ${IntegrationObject.icon()|n}
50 ${IntegrationObject.icon()|n}
52 </div>
51 </div>
53 ${IntegrationObject.display_name}
52 ${IntegrationObject.display_name}
54 </h2>
53 </h2>
55 ${IntegrationObject.description or _('No description available')}
54 ${IntegrationObject.description or _('No description available')}
56 </%widgets:panel>
55 </%widgets:panel>
57 </a>
56 </a>
58 %endfor
57 %endfor
59 <div style="clear:both"></div>
58 <div style="clear:both"></div>
60 </%widgets:panel>
59 </%widgets:panel>
@@ -1,68 +1,67 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Settings administration')}
4 ${_('Settings administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu()}
17 ${self.admin_menu()}
19 </%def>
18 </%def>
20
19
21 <%def name="side_bar_nav()">
20 <%def name="side_bar_nav()">
22
21
23 </%def>
22 </%def>
24
23
25 <%def name="main_content()">
24 <%def name="main_content()">
26 <h2>${_('Administration area')}</h2>
25 <h2>${_('Administration area')}</h2>
27
26
28 <table class="rctable">
27 <table class="rctable">
29 <tr>
28 <tr>
30 <td>${_('Repositories under administration')}</td>
29 <td>${_('Repositories under administration')}</td>
31 <td class="delegated-admin-repos">${len(c.auth_user.repositories_admin)}</td>
30 <td class="delegated-admin-repos">${len(c.auth_user.repositories_admin)}</td>
32 <td>
31 <td>
33 % if c.can_create_repo:
32 % if c.can_create_repo:
34 <a href="${h.route_path('repo_new')}" class="">${_('Add Repository')}</a>
33 <a href="${h.route_path('repo_new')}" class="">${_('Add Repository')}</a>
35 % endif
34 % endif
36 </td>
35 </td>
37 </tr>
36 </tr>
38 <tr>
37 <tr>
39 <td>${_('Repository groups under administration')}</td>
38 <td>${_('Repository groups under administration')}</td>
40 <td class="delegated-admin-repo-groups">${len(c.auth_user.repository_groups_admin)}</td>
39 <td class="delegated-admin-repo-groups">${len(c.auth_user.repository_groups_admin)}</td>
41 <td>
40 <td>
42 % if c.can_create_repo_group:
41 % if c.can_create_repo_group:
43 <a href="${h.route_path('repo_group_new')}" class="">${_(u'Add Repository Group')}</a>
42 <a href="${h.route_path('repo_group_new')}" class="">${_(u'Add Repository Group')}</a>
44 % endif
43 % endif
45 </td>
44 </td>
46 </tr>
45 </tr>
47 <tr>
46 <tr>
48 <td>${_('User groups under administration')}</td>
47 <td>${_('User groups under administration')}</td>
49 <td class="delegated-admin-user-groups">${len(c.auth_user.user_groups_admin)}</td>
48 <td class="delegated-admin-user-groups">${len(c.auth_user.user_groups_admin)}</td>
50 <td>
49 <td>
51 % if c.can_create_user_group:
50 % if c.can_create_user_group:
52 <a href="${h.route_path('user_groups_new')}" class="">${_(u'Add User Group')}</a>
51 <a href="${h.route_path('user_groups_new')}" class="">${_(u'Add User Group')}</a>
53 % endif
52 % endif
54 </td>
53 </td>
55 </tr>
54 </tr>
56 </table>
55 </table>
57 </%def>
56 </%def>
58
57
59 <%def name="main()">
58 <%def name="main()">
60 <div class="box">
59 <div class="box">
61
60
62 ##main
61 ##main
63 <div class="main-content-auto-width">
62 <div class="main-content-auto-width">
64 ${self.main_content()}
63 ${self.main_content()}
65 </div>
64 </div>
66 </div>
65 </div>
67
66
68 </%def> No newline at end of file
67 </%def>
@@ -1,57 +1,56 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('My account')} ${c.rhodecode_user.username}
4 ${_('My account')} ${c.rhodecode_user.username}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${_('My Account')}
11 ${_('My Account')}
13 </%def>
12 </%def>
14
13
15 <%def name="menu_bar_nav()">
14 <%def name="menu_bar_nav()">
16 ${self.menu_items(active='my_account')}
15 ${self.menu_items(active='my_account')}
17 </%def>
16 </%def>
18
17
19 <%def name="main()">
18 <%def name="main()">
20 <div class="box">
19 <div class="box">
21 <div class="title">
20 <div class="title">
22 ${self.breadcrumbs()}
21 ${self.breadcrumbs()}
23 </div>
22 </div>
24
23
25 <div class="sidebar-col-wrapper scw-small">
24 <div class="sidebar-col-wrapper scw-small">
26 ##main
25 ##main
27 <div class="sidebar">
26 <div class="sidebar">
28 <ul class="nav nav-pills nav-stacked">
27 <ul class="nav nav-pills nav-stacked">
29 <li class="${h.is_active(['profile', 'profile_edit'], c.active)}"><a href="${h.route_path('my_account_profile')}">${_('Profile')}</a></li>
28 <li class="${h.is_active(['profile', 'profile_edit'], c.active)}"><a href="${h.route_path('my_account_profile')}">${_('Profile')}</a></li>
30 <li class="${h.is_active('emails', c.active)}"><a href="${h.route_path('my_account_emails')}">${_('Emails')}</a></li>
29 <li class="${h.is_active('emails', c.active)}"><a href="${h.route_path('my_account_emails')}">${_('Emails')}</a></li>
31 <li class="${h.is_active('password', c.active)}"><a href="${h.route_path('my_account_password')}">${_('Password')}</a></li>
30 <li class="${h.is_active('password', c.active)}"><a href="${h.route_path('my_account_password')}">${_('Password')}</a></li>
32 <li class="${h.is_active('bookmarks', c.active)}"><a href="${h.route_path('my_account_bookmarks')}">${_('Bookmarks')}</a></li>
31 <li class="${h.is_active('bookmarks', c.active)}"><a href="${h.route_path('my_account_bookmarks')}">${_('Bookmarks')}</a></li>
33 <li class="${h.is_active('auth_tokens', c.active)}"><a href="${h.route_path('my_account_auth_tokens')}">${_('Auth Tokens')}</a></li>
32 <li class="${h.is_active('auth_tokens', c.active)}"><a href="${h.route_path('my_account_auth_tokens')}">${_('Auth Tokens')}</a></li>
34 <li class="${h.is_active(['ssh_keys', 'ssh_keys_generate'], c.active)}"><a href="${h.route_path('my_account_ssh_keys')}">${_('SSH Keys')}</a></li>
33 <li class="${h.is_active(['ssh_keys', 'ssh_keys_generate'], c.active)}"><a href="${h.route_path('my_account_ssh_keys')}">${_('SSH Keys')}</a></li>
35 <li class="${h.is_active('user_group_membership', c.active)}"><a href="${h.route_path('my_account_user_group_membership')}">${_('User Group Membership')}</a></li>
34 <li class="${h.is_active('user_group_membership', c.active)}"><a href="${h.route_path('my_account_user_group_membership')}">${_('User Group Membership')}</a></li>
36
35
37 ## TODO: Find a better integration of oauth/saml views into navigation.
36 ## TODO: Find a better integration of oauth/saml views into navigation.
38 <% my_account_external_url = h.route_path_or_none('my_account_external_identity') %>
37 <% my_account_external_url = h.route_path_or_none('my_account_external_identity') %>
39 % if my_account_external_url:
38 % if my_account_external_url:
40 <li class="${h.is_active('external_identity', c.active)}"><a href="${my_account_external_url}">${_('External Identities')}</a></li>
39 <li class="${h.is_active('external_identity', c.active)}"><a href="${my_account_external_url}">${_('External Identities')}</a></li>
41 % endif
40 % endif
42
41
43 <li class="${h.is_active('repos', c.active)}"><a href="${h.route_path('my_account_repos')}">${_('Owned Repositories')}</a></li>
42 <li class="${h.is_active('repos', c.active)}"><a href="${h.route_path('my_account_repos')}">${_('Owned Repositories')}</a></li>
44 <li class="${h.is_active('watched', c.active)}"><a href="${h.route_path('my_account_watched')}">${_('Watched Repositories')}</a></li>
43 <li class="${h.is_active('watched', c.active)}"><a href="${h.route_path('my_account_watched')}">${_('Watched Repositories')}</a></li>
45 <li class="${h.is_active('pullrequests', c.active)}"><a href="${h.route_path('my_account_pullrequests')}">${_('Pull Requests')}</a></li>
44 <li class="${h.is_active('pullrequests', c.active)}"><a href="${h.route_path('my_account_pullrequests')}">${_('Pull Requests')}</a></li>
46 <li class="${h.is_active('perms', c.active)}"><a href="${h.route_path('my_account_perms')}">${_('Permissions')}</a></li>
45 <li class="${h.is_active('perms', c.active)}"><a href="${h.route_path('my_account_perms')}">${_('Permissions')}</a></li>
47 <li class="${h.is_active('my_notifications', c.active)}"><a href="${h.route_path('my_account_notifications')}">${_('Live Notifications')}</a></li>
46 <li class="${h.is_active('my_notifications', c.active)}"><a href="${h.route_path('my_account_notifications')}">${_('Live Notifications')}</a></li>
48 </ul>
47 </ul>
49 </div>
48 </div>
50
49
51 <div class="main-content-full-width">
50 <div class="main-content-full-width">
52 <%include file="/admin/my_account/my_account_${c.active}.mako"/>
51 <%include file="/admin/my_account/my_account_${c.active}.mako"/>
53 </div>
52 </div>
54 </div>
53 </div>
55 </div>
54 </div>
56
55
57 </%def>
56 </%def>
@@ -1,75 +1,74 b''
1 ## -*- coding: utf-8 -*-
2
1
3 <div class="panel panel-default">
2 <div class="panel panel-default">
4 <div class="panel-heading">
3 <div class="panel-heading">
5 <h3 class="panel-title">${_('User Group Membership')}</h3>
4 <h3 class="panel-title">${_('User Group Membership')}</h3>
6 </div>
5 </div>
7
6
8 <div class="panel-body">
7 <div class="panel-body">
9 <div class="groups_management">
8 <div class="groups_management">
10 <div id="repos_list_wrap">
9 <div id="repos_list_wrap">
11 <table id="user_group_list_table" class="display"></table>
10 <table id="user_group_list_table" class="display"></table>
12 </div>
11 </div>
13 </div>
12 </div>
14 </div>
13 </div>
15 </div>
14 </div>
16
15
17
16
18 <script>
17 <script>
19 var api;
18 var api;
20 $(document).ready(function() {
19 $(document).ready(function() {
21
20
22 var get_datatable_count = function(){
21 var get_datatable_count = function(){
23 $('#user_group_count').text(api.page.info().recordsDisplay);
22 $('#user_group_count').text(api.page.info().recordsDisplay);
24 };
23 };
25
24
26 $('#user_group_list_table').on('click', 'a.editor_remove', function (e) {
25 $('#user_group_list_table').on('click', 'a.editor_remove', function (e) {
27 e.preventDefault();
26 e.preventDefault();
28 var row = api.row($(this).closest('tr'));
27 var row = api.row($(this).closest('tr'));
29 row.remove().draw();
28 row.remove().draw();
30 } );
29 } );
31
30
32 $('#user_group_list_table').DataTable({
31 $('#user_group_list_table').DataTable({
33 data: ${c.user_groups|n},
32 data: ${c.user_groups|n},
34 dom: 'rtp',
33 dom: 'rtp',
35 pageLength: ${c.visual.admin_grid_items},
34 pageLength: ${c.visual.admin_grid_items},
36 order: [[ 0, "asc" ]],
35 order: [[ 0, "asc" ]],
37 columns: [
36 columns: [
38 { data: {"_": "group_name",
37 { data: {"_": "group_name",
39 "sort": "group_name"}, title: "${_('Name')}", className: "td-componentname," ,
38 "sort": "group_name"}, title: "${_('Name')}", className: "td-componentname," ,
40 render: function (data,type,full,meta)
39 render: function (data,type,full,meta)
41 {return '<div><i class="icon-user-group" title="User group">'+data+'</i></div>'}},
40 {return '<div><i class="icon-user-group" title="User group">'+data+'</i></div>'}},
42
41
43 { data: {"_": "group_description",
42 { data: {"_": "group_description",
44 "sort": "group_description"}, title: "${_('Description')}", className: "td-description" },
43 "sort": "group_description"}, title: "${_('Description')}", className: "td-description" },
45 { data: {"_": "users_group_id"}, className: "td-user",
44 { data: {"_": "users_group_id"}, className: "td-user",
46 render: function (data,type,full,meta)
45 render: function (data,type,full,meta)
47 {return '<input type="hidden" name="users_group_id" value="'+data+'">'}},
46 {return '<input type="hidden" name="users_group_id" value="'+data+'">'}},
48 { data: {"_": "active",
47 { data: {"_": "active",
49 "sort": "active"}, title: "${_('Active')}", className: "td-active"},
48 "sort": "active"}, title: "${_('Active')}", className: "td-active"},
50 { data: {"_": "owner_data"}, title: "${_('Owner')}", className: "td-user",
49 { data: {"_": "owner_data"}, title: "${_('Owner')}", className: "td-user",
51 render: function (data,type,full,meta)
50 render: function (data,type,full,meta)
52 {return '<div class="rc-user tooltip">'+
51 {return '<div class="rc-user tooltip">'+
53 '<img class="gravatar" src="'+ data.owner_icon +'" height="16" width="16">'+
52 '<img class="gravatar" src="'+ data.owner_icon +'" height="16" width="16">'+
54 data.owner +'</div>'
53 data.owner +'</div>'
55 }
54 }
56 }
55 }
57 ],
56 ],
58 language: {
57 language: {
59 paginate: DEFAULT_GRID_PAGINATION,
58 paginate: DEFAULT_GRID_PAGINATION,
60 emptyTable: _gettext("No user groups available yet.")
59 emptyTable: _gettext("No user groups available yet.")
61 },
60 },
62 "initComplete": function( settings, json ) {
61 "initComplete": function( settings, json ) {
63 var data_grid = $('#user_group_list_table').dataTable();
62 var data_grid = $('#user_group_list_table').dataTable();
64 api = data_grid.api();
63 api = data_grid.api();
65 get_datatable_count();
64 get_datatable_count();
66 }
65 }
67 });
66 });
68
67
69 // update the counter when doing search
68 // update the counter when doing search
70 $('#user_group_list_table').on( 'search.dt', function (e,settings) {
69 $('#user_group_list_table').on( 'search.dt', function (e,settings) {
71 get_datatable_count();
70 get_datatable_count();
72 });
71 });
73
72
74 });
73 });
75 </script> No newline at end of file
74 </script>
@@ -1,52 +1,51 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Show notification')} ${c.rhodecode_user.username}
4 ${_('Show notification')} ${c.rhodecode_user.username}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('My Notifications'), h.route_path('notifications_show_all'))}
11 ${h.link_to(_('My Notifications'), h.route_path('notifications_show_all'))}
13 &raquo;
12 &raquo;
14 ${_('Show notification')}
13 ${_('Show notification')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='admin')}
17 ${self.menu_items(active='admin')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23 <!-- box / title -->
22 <!-- box / title -->
24 <div class="title">
23 <div class="title">
25 ${self.breadcrumbs()}
24 ${self.breadcrumbs()}
26 </div>
25 </div>
27 <div class="table">
26 <div class="table">
28 <div id="notification_${c.notification.notification_id}" class="main-content-full">
27 <div id="notification_${c.notification.notification_id}" class="main-content-full">
29 <div class="notification-header">
28 <div class="notification-header">
30 <div class="pull-left">
29 <div class="pull-left">
31 ${self.gravatar(c.notification.created_by_user.email, 30)}
30 ${self.gravatar(c.notification.created_by_user.email, 30)}
32 </div>
31 </div>
33 <div class="desc pull-left">
32 <div class="desc pull-left">
34 ${h.notification_description(c.notification, request)}
33 ${h.notification_description(c.notification, request)}
35 </div>
34 </div>
36 <div class="delete-notifications">
35 <div class="delete-notifications">
37 <span class="delete-notification tooltip" title="${_('Delete')}" onclick="deleteNotification(${c.notification.notification_id}, [function(){window.location=pyroutes.url('notifications_show_all')}])" class="delete-notification action"><i class="icon-delete" ></i></span>
36 <span class="delete-notification tooltip" title="${_('Delete')}" onclick="deleteNotification(${c.notification.notification_id}, [function(){window.location=pyroutes.url('notifications_show_all')}])" class="delete-notification action"><i class="icon-delete" ></i></span>
38 </div>
37 </div>
39 </div>
38 </div>
40 <div class="notification-body">
39 <div class="notification-body">
41 <div class="notification-subject">
40 <div class="notification-subject">
42 <h3>${_('Subject')}: ${c.notification.subject}</h3>
41 <h3>${_('Subject')}: ${c.notification.subject}</h3>
43 </div>
42 </div>
44 %if c.notification.body:
43 %if c.notification.body:
45 ${h.render(c.notification.body, renderer=c.visual.default_renderer, mentions=True)}
44 ${h.render(c.notification.body, renderer=c.visual.default_renderer, mentions=True)}
46 %endif
45 %endif
47 </div>
46 </div>
48 </div>
47 </div>
49 </div>
48 </div>
50 </div>
49 </div>
51
50
52 </%def>
51 </%def>
@@ -1,67 +1,66 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('My Notifications')} ${c.rhodecode_user.username}
4 ${_('My Notifications')} ${c.rhodecode_user.username}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='my_account')}
13 ${self.menu_items(active='my_account')}
15 </%def>
14 </%def>
16
15
17 <%def name="main()">
16 <%def name="main()">
18 <div class="box">
17 <div class="box">
19 <div class="title">
18 <div class="title">
20 ${_('My Notifications')}
19 ${_('My Notifications')}
21
20
22 <div class="notifications_buttons">
21 <div class="notifications_buttons">
23 %if c.notifications:
22 %if c.notifications:
24 <button id='mark_all_read' class="btn btn-default" type="submit">
23 <button id='mark_all_read' class="btn btn-default" type="submit">
25 ${_('Mark all as read')}
24 ${_('Mark all as read')}
26 </button>
25 </button>
27 %else:
26 %else:
28 <button class="btn btn-default" type="submit" disabled="disabled">
27 <button class="btn btn-default" type="submit" disabled="disabled">
29 ${_('Mark all as read')}
28 ${_('Mark all as read')}
30 </button>
29 </button>
31 %endif
30 %endif
32 </div>
31 </div>
33 </div>
32 </div>
34
33
35 <div class="sidebar-col-wrapper scw-small">
34 <div class="sidebar-col-wrapper scw-small">
36 ##main
35 ##main
37 <div class="sidebar">
36 <div class="sidebar">
38 <ul class="nav nav-pills nav-stacked">
37 <ul class="nav nav-pills nav-stacked">
39 <li id='unread' class="${'active' if c.current_filter=='unread' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.unread_type))}">${_('Unread')} (${c.unread_count})</a></li>
38 <li id='unread' class="${'active' if c.current_filter=='unread' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.unread_type))}">${_('Unread')} (${c.unread_count})</a></li>
40 <li id='all' class="${'active' if c.current_filter=='all' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.all_type))}">${_('All')}</a></li>
39 <li id='all' class="${'active' if c.current_filter=='all' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.all_type))}">${_('All')}</a></li>
41 <li id='comment' class="${'active' if c.current_filter=='comment' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.comment_type))}">${_('Comments')}</a></li>
40 <li id='comment' class="${'active' if c.current_filter=='comment' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.comment_type))}">${_('Comments')}</a></li>
42 <li id='pull_request' class="${'active' if c.current_filter=='pull_request' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.pull_request_type))}">${_('Pull Requests')}</a></li>
41 <li id='pull_request' class="${'active' if c.current_filter=='pull_request' else ''}"><a href="${h.route_path('notifications_show_all', _query=dict(type=c.pull_request_type))}">${_('Pull Requests')}</a></li>
43 </ul>
42 </ul>
44 </div>
43 </div>
45
44
46 <div class="main-content-full-width">
45 <div class="main-content-full-width">
47 <%include file='notifications_data.mako'/>
46 <%include file='notifications_data.mako'/>
48 </div>
47 </div>
49 </div>
48 </div>
50 </div>
49 </div>
51
50
52 <script type="text/javascript">
51 <script type="text/javascript">
53
52
54 $('#mark_all_read').on('click',function(e){
53 $('#mark_all_read').on('click',function(e){
55 //set notifications as read
54 //set notifications as read
56 var url = "${h.route_path('notifications_mark_all_read', _query=request.GET.mixed())}";
55 var url = "${h.route_path('notifications_mark_all_read', _query=request.GET.mixed())}";
57 $.post(url, {'csrf_token': CSRF_TOKEN}).
56 $.post(url, {'csrf_token': CSRF_TOKEN}).
58 done(function(data){
57 done(function(data){
59 window.location = "${request.current_route_path(_query=request.GET.mixed())}";
58 window.location = "${request.current_route_path(_query=request.GET.mixed())}";
60 })
59 })
61 .fail(function(data, textStatus, errorThrown){
60 .fail(function(data, textStatus, errorThrown){
62 alert("Error while saving notifications.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
61 alert("Error while saving notifications.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
63 });
62 });
64 });
63 });
65
64
66 </script>
65 </script>
67 </%def>
66 </%def>
@@ -1,65 +1,64 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Permissions Administration')}
4 ${_('Permissions Administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${_('Permissions')}
13 ${_('Permissions')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='admin')}
17 ${self.menu_items(active='admin')}
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_subnav()">
20 <%def name="menu_bar_subnav()">
22 ${self.admin_menu(active='permissions')}
21 ${self.admin_menu(active='permissions')}
23 </%def>
22 </%def>
24
23
25 <%def name="main()">
24 <%def name="main()">
26 <div class="box">
25 <div class="box">
27
26
28 <div class="sidebar-col-wrapper scw-small">
27 <div class="sidebar-col-wrapper scw-small">
29 ##main
28 ##main
30 <div class="sidebar">
29 <div class="sidebar">
31 <ul class="nav nav-pills nav-stacked">
30 <ul class="nav nav-pills nav-stacked">
32 <li class="${h.is_active('application', c.active)}">
31 <li class="${h.is_active('application', c.active)}">
33 <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a>
32 <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a>
34 </li>
33 </li>
35 <li class="${h.is_active('global', c.active)}">
34 <li class="${h.is_active('global', c.active)}">
36 <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a>
35 <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a>
37 </li>
36 </li>
38 <li class="${h.is_active('objects', c.active)}">
37 <li class="${h.is_active('objects', c.active)}">
39 <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a>
38 <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a>
40 </li>
39 </li>
41 <li class="${h.is_active('branch', c.active)}">
40 <li class="${h.is_active('branch', c.active)}">
42 <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a>
41 <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a>
43 </li>
42 </li>
44 <li class="${h.is_active('ips', c.active)}">
43 <li class="${h.is_active('ips', c.active)}">
45 <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a>
44 <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a>
46 </li>
45 </li>
47 <li class="${h.is_active('auth_token_access', c.active)}">
46 <li class="${h.is_active('auth_token_access', c.active)}">
48 <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a>
47 <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a>
49 </li>
48 </li>
50 <li class="${h.is_active('ssh_keys', c.active)}">
49 <li class="${h.is_active('ssh_keys', c.active)}">
51 <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a>
50 <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a>
52 </li>
51 </li>
53 <li class="${h.is_active('perms', c.active)}">
52 <li class="${h.is_active('perms', c.active)}">
54 <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a>
53 <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a>
55 </li>
54 </li>
56 </ul>
55 </ul>
57 </div>
56 </div>
58
57
59 <div class="main-content-full-width">
58 <div class="main-content-full-width">
60 <%include file="/admin/permissions/permissions_${c.active}.mako"/>
59 <%include file="/admin/permissions/permissions_${c.active}.mako"/>
61 </div>
60 </div>
62 </div>
61 </div>
63 </div>
62 </div>
64
63
65 </%def>
64 </%def>
@@ -1,122 +1,121 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Add repository group')}
4 ${_('Add repository group')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${h.link_to(_('Repository groups'),h.route_path('repo_groups'))}
13 ${h.link_to(_('Repository groups'),h.route_path('repo_groups'))}
15 &raquo;
14 &raquo;
16 ${_('Add Repository Group')}
15 ${_('Add Repository Group')}
17 </%def>
16 </%def>
18
17
19 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
20 ${self.menu_items(active='admin')}
19 ${self.menu_items(active='admin')}
21 </%def>
20 </%def>
22
21
23 <%def name="menu_bar_subnav()">
22 <%def name="menu_bar_subnav()">
24 ${self.admin_menu(active='repository_groups')}
23 ${self.admin_menu(active='repository_groups')}
25 </%def>
24 </%def>
26
25
27 <%def name="main()">
26 <%def name="main()">
28 <div class="box">
27 <div class="box">
29 ${h.secure_form(h.route_path('repo_group_create'), request=request)}
28 ${h.secure_form(h.route_path('repo_group_create'), request=request)}
30 <div class="form">
29 <div class="form">
31 <!-- fields -->
30 <!-- fields -->
32 <div class="fields">
31 <div class="fields">
33 <div class="field">
32 <div class="field">
34 <div class="label">
33 <div class="label">
35 <label for="group_name">${_('Group name')}:</label>
34 <label for="group_name">${_('Group name')}:</label>
36 </div>
35 </div>
37 <div class="input">
36 <div class="input">
38 ${h.text('group_name', class_="medium")}
37 ${h.text('group_name', class_="medium")}
39 </div>
38 </div>
40 </div>
39 </div>
41
40
42 <div class="field">
41 <div class="field">
43 <div class="label">
42 <div class="label">
44 <label for="group_parent_id">${_('Repository group')}:</label>
43 <label for="group_parent_id">${_('Repository group')}:</label>
45 </div>
44 </div>
46 <div class="select">
45 <div class="select">
47 ${h.select('group_parent_id', request.GET.get('parent_group'),c.repo_groups,class_="medium")}
46 ${h.select('group_parent_id', request.GET.get('parent_group'),c.repo_groups,class_="medium")}
48 % if c.personal_repo_group:
47 % if c.personal_repo_group:
49 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
48 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
50 ${_('Select my personal group ({})').format(c.personal_repo_group.group_name)}
49 ${_('Select my personal group ({})').format(c.personal_repo_group.group_name)}
51 </a>
50 </a>
52 % endif
51 % endif
53 </div>
52 </div>
54 </div>
53 </div>
55
54
56 <div class="field">
55 <div class="field">
57 <div class="label">
56 <div class="label">
58 <label for="group_description">${_('Description')}:</label>
57 <label for="group_description">${_('Description')}:</label>
59 </div>
58 </div>
60 <div class="textarea editor">
59 <div class="textarea editor">
61 ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
60 ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
62 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
61 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
63 <span class="help-block">
62 <span class="help-block">
64 % if c.visual.stylify_metatags:
63 % if c.visual.stylify_metatags:
65 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
64 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
66 % else:
65 % else:
67 ${_('Plain text format.')}
66 ${_('Plain text format.')}
68 % endif
67 % endif
69 </span>
68 </span>
70 <span id="meta-tags-desc" style="display: none">
69 <span id="meta-tags-desc" style="display: none">
71 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
70 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
72 ${dt.metatags_help()}
71 ${dt.metatags_help()}
73 </span>
72 </span>
74 </div>
73 </div>
75 </div>
74 </div>
76
75
77 <div id="copy_perms" class="field">
76 <div id="copy_perms" class="field">
78 <div class="label label-checkbox">
77 <div class="label label-checkbox">
79 <label for="group_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
78 <label for="group_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
80 </div>
79 </div>
81 <div class="checkboxes">
80 <div class="checkboxes">
82 ${h.checkbox('group_copy_permissions', value="True", checked="checked")}
81 ${h.checkbox('group_copy_permissions', value="True", checked="checked")}
83 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
82 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
84 </div>
83 </div>
85 </div>
84 </div>
86
85
87 <div class="buttons">
86 <div class="buttons">
88 ${h.submit('save',_('Create Repository Group'),class_="btn")}
87 ${h.submit('save',_('Create Repository Group'),class_="btn")}
89 </div>
88 </div>
90 </div>
89 </div>
91 </div>
90 </div>
92 ${h.end_form()}
91 ${h.end_form()}
93 </div>
92 </div>
94 <script>
93 <script>
95 $(document).ready(function(){
94 $(document).ready(function(){
96 var setCopyPermsOption = function(group_val){
95 var setCopyPermsOption = function(group_val){
97 if(group_val !== "-1"){
96 if(group_val !== "-1"){
98 $('#copy_perms').show()
97 $('#copy_perms').show()
99 }
98 }
100 else{
99 else{
101 $('#copy_perms').hide();
100 $('#copy_perms').hide();
102 }
101 }
103 };
102 };
104 $("#group_parent_id").select2({
103 $("#group_parent_id").select2({
105 'containerCssClass': "drop-menu",
104 'containerCssClass': "drop-menu",
106 'dropdownCssClass': "drop-menu-dropdown",
105 'dropdownCssClass': "drop-menu-dropdown",
107 'dropdownAutoWidth': true
106 'dropdownAutoWidth': true
108 });
107 });
109 setCopyPermsOption($('#group_parent_id').val());
108 setCopyPermsOption($('#group_parent_id').val());
110 $("#group_parent_id").on("change", function(e) {
109 $("#group_parent_id").on("change", function(e) {
111 setCopyPermsOption(e.val)
110 setCopyPermsOption(e.val)
112 });
111 });
113 $('#group_name').focus();
112 $('#group_name').focus();
114
113
115 $('#select_my_group').on('click', function(e){
114 $('#select_my_group').on('click', function(e){
116 e.preventDefault();
115 e.preventDefault();
117 $("#group_parent_id").val($(this).data('personalGroupId')).trigger("change");
116 $("#group_parent_id").val($(this).data('personalGroupId')).trigger("change");
118 })
117 })
119
118
120 })
119 })
121 </script>
120 </script>
122 </%def>
121 </%def>
@@ -1,44 +1,43 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('%s repository group settings') % c.repo_group.name}
4 ${_('%s repository group settings') % c.repo_group.name}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="menu_bar_nav()">
10 <%def name="menu_bar_nav()">
12 ${self.menu_items(active='admin')}
11 ${self.menu_items(active='admin')}
13 </%def>
12 </%def>
14
13
15 <%def name="menu_bar_subnav()">
14 <%def name="menu_bar_subnav()">
16 ${self.repo_group_menu(active='settings')}
15 ${self.repo_group_menu(active='settings')}
17 </%def>
16 </%def>
18
17
19 <%def name="main_content()">
18 <%def name="main_content()">
20 <%include file="/admin/repo_groups/repo_group_edit_${c.active}.mako"/>
19 <%include file="/admin/repo_groups/repo_group_edit_${c.active}.mako"/>
21 </%def>
20 </%def>
22
21
23 <%def name="main()">
22 <%def name="main()">
24
23
25 <div class="box">
24 <div class="box">
26 <div class="sidebar-col-wrapper">
25 <div class="sidebar-col-wrapper">
27 ##main
26 ##main
28 <div class="sidebar">
27 <div class="sidebar">
29 <ul class="nav nav-pills nav-stacked">
28 <ul class="nav nav-pills nav-stacked">
30 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
29 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
31 <li class="${h.is_active('permissions', c.active)}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Access Permissions')}</a></li>
30 <li class="${h.is_active('permissions', c.active)}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Access Permissions')}</a></li>
32 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
31 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
33 <li class="${h.is_active('integrations', c.active)}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
32 <li class="${h.is_active('integrations', c.active)}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
34 </ul>
33 </ul>
35 </div>
34 </div>
36
35
37 <div class="main-content-full-width">
36 <div class="main-content-full-width">
38 ${self.main_content()}
37 ${self.main_content()}
39 </div>
38 </div>
40
39
41 </div>
40 </div>
42 </div>
41 </div>
43
42
44 </%def>
43 </%def>
@@ -1,89 +1,88 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4 <div class="panel panel-default">
3 <div class="panel panel-default">
5 <div class="panel-heading">
4 <div class="panel-heading">
6 <h3 class="panel-title">${_('Repository Group Settings: {}').format(c.repo_group.name)}</h3>
5 <h3 class="panel-title">${_('Repository Group Settings: {}').format(c.repo_group.name)}</h3>
7 </div>
6 </div>
8 <div class="panel-body">
7 <div class="panel-body">
9 ${h.secure_form(h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name), request=request)}
8 ${h.secure_form(h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name), request=request)}
10 <div class="form">
9 <div class="form">
11 <!-- fields -->
10 <!-- fields -->
12 <div class="fields">
11 <div class="fields">
13 <div class="field">
12 <div class="field">
14 <div class="label">
13 <div class="label">
15 <label for="group_name">${_('Group name')}:</label>
14 <label for="group_name">${_('Group name')}:</label>
16 </div>
15 </div>
17 <div class="input">
16 <div class="input">
18 ${c.form['repo_group_name'].render(css_class='medium', oid='group_name')|n}
17 ${c.form['repo_group_name'].render(css_class='medium', oid='group_name')|n}
19 ${c.form.render_error(request, c.form['repo_group_name'])|n}
18 ${c.form.render_error(request, c.form['repo_group_name'])|n}
20 </div>
19 </div>
21 </div>
20 </div>
22
21
23 <div class="field">
22 <div class="field">
24 <div class="label">
23 <div class="label">
25 <label for="repo_group">${_('Repository group')}:</label>
24 <label for="repo_group">${_('Repository group')}:</label>
26 </div>
25 </div>
27 <div class="select">
26 <div class="select">
28 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
27 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
29 ${c.form.render_error(request, c.form['repo_group'])|n}
28 ${c.form.render_error(request, c.form['repo_group'])|n}
30
29
31 <p class="help-block">${_('Optional select a parent group to move this repository group into.')}</p>
30 <p class="help-block">${_('Optional select a parent group to move this repository group into.')}</p>
32 </div>
31 </div>
33 </div>
32 </div>
34
33
35 <div class="field badged-field">
34 <div class="field badged-field">
36 <div class="label">
35 <div class="label">
37 <label for="repo_group_owner">${_('Owner')}:</label>
36 <label for="repo_group_owner">${_('Owner')}:</label>
38 </div>
37 </div>
39 <div class="input">
38 <div class="input">
40 <div class="badge-input-container">
39 <div class="badge-input-container">
41 <div class="user-badge">
40 <div class="user-badge">
42 ${base.gravatar(c.repo_group.user.email, user=c.repo_group.user, tooltip=True)}
41 ${base.gravatar(c.repo_group.user.email, user=c.repo_group.user, tooltip=True)}
43 </div>
42 </div>
44 <div class="badge-input-wrap">
43 <div class="badge-input-wrap">
45 ${c.form['repo_group_owner'].render(css_class='medium', oid='repo_group_owner')|n}
44 ${c.form['repo_group_owner'].render(css_class='medium', oid='repo_group_owner')|n}
46 </div>
45 </div>
47 </div>
46 </div>
48 ${c.form.render_error(request, c.form['repo_group_owner'])|n}
47 ${c.form.render_error(request, c.form['repo_group_owner'])|n}
49 <p class="help-block">${_('Change owner of this repository group.')}</p>
48 <p class="help-block">${_('Change owner of this repository group.')}</p>
50 </div>
49 </div>
51 </div>
50 </div>
52
51
53 <div class="field">
52 <div class="field">
54 <div class="label label-textarea">
53 <div class="label label-textarea">
55 <label for="repo_group_description">${_('Description')}:</label>
54 <label for="repo_group_description">${_('Description')}:</label>
56 </div>
55 </div>
57 <div class="textarea text-area editor">
56 <div class="textarea text-area editor">
58 ${c.form['repo_group_description'].render(css_class='medium', oid='repo_group_description')|n}
57 ${c.form['repo_group_description'].render(css_class='medium', oid='repo_group_description')|n}
59 ${c.form.render_error(request, c.form['repo_group_description'])|n}
58 ${c.form.render_error(request, c.form['repo_group_description'])|n}
60
59
61 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
60 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
62 <span class="help-block">
61 <span class="help-block">
63 % if c.visual.stylify_metatags:
62 % if c.visual.stylify_metatags:
64 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
63 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
65 % else:
64 % else:
66 ${_('Plain text format.')}
65 ${_('Plain text format.')}
67 % endif
66 % endif
68 </span>
67 </span>
69 <span id="meta-tags-desc" style="display: none">
68 <span id="meta-tags-desc" style="display: none">
70 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
69 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
71 ${dt.metatags_help()}
70 ${dt.metatags_help()}
72 </span>
71 </span>
73 </div>
72 </div>
74 </div>
73 </div>
75
74
76 <div class="buttons">
75 <div class="buttons">
77 ${h.submit('save',_('Save'),class_="btn")}
76 ${h.submit('save',_('Save'),class_="btn")}
78 ${h.reset('reset',_('Reset'),class_="btn")}
77 ${h.reset('reset',_('Reset'),class_="btn")}
79 </div>
78 </div>
80 </div>
79 </div>
81 </div>
80 </div>
82 ${h.end_form()}
81 ${h.end_form()}
83 </div>
82 </div>
84 </div>
83 </div>
85 <script>
84 <script>
86 $(document).ready(function(){
85 $(document).ready(function(){
87 UsersAutoComplete('repo_group_owner', '${c.rhodecode_user.user_id}');
86 UsersAutoComplete('repo_group_owner', '${c.rhodecode_user.user_id}');
88 })
87 })
89 </script>
88 </script>
@@ -1,117 +1,116 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Repository groups administration')}
4 ${_('Repository groups administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='repository_groups')}
17 ${self.admin_menu(active='repository_groups')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23
22
24 <div class="title">
23 <div class="title">
25 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
24 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
26 <span id="repo_group_count"></span>
25 <span id="repo_group_count"></span>
27
26
28 <ul class="links">
27 <ul class="links">
29 %if c.can_create_repo_group:
28 %if c.can_create_repo_group:
30 <li>
29 <li>
31 <a href="${h.route_path('repo_group_new')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a>
30 <a href="${h.route_path('repo_group_new')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a>
32 </li>
31 </li>
33 %endif
32 %endif
34 </ul>
33 </ul>
35 </div>
34 </div>
36 <div id="repos_list_wrap">
35 <div id="repos_list_wrap">
37 <table id="group_list_table" class="display"></table>
36 <table id="group_list_table" class="display"></table>
38 </div>
37 </div>
39 </div>
38 </div>
40
39
41 <script>
40 <script>
42 $(document).ready(function() {
41 $(document).ready(function() {
43 var $repoGroupsListTable = $('#group_list_table');
42 var $repoGroupsListTable = $('#group_list_table');
44
43
45 // repo group list
44 // repo group list
46 $repoGroupsListTable.DataTable({
45 $repoGroupsListTable.DataTable({
47 processing: true,
46 processing: true,
48 serverSide: true,
47 serverSide: true,
49 ajax: {
48 ajax: {
50 "url": "${h.route_path('repo_groups_data')}",
49 "url": "${h.route_path('repo_groups_data')}",
51 "dataSrc": function (json) {
50 "dataSrc": function (json) {
52 var filteredCount = json.recordsFiltered;
51 var filteredCount = json.recordsFiltered;
53 var filteredInactiveCount = json.recordsFilteredInactive;
52 var filteredInactiveCount = json.recordsFilteredInactive;
54 var totalInactive = json.recordsTotalInactive;
53 var totalInactive = json.recordsTotalInactive;
55 var total = json.recordsTotal;
54 var total = json.recordsTotal;
56
55
57 var _text = _gettext(
56 var _text = _gettext(
58 "{0} of {1} repository groups").format(
57 "{0} of {1} repository groups").format(
59 filteredCount, total);
58 filteredCount, total);
60
59
61 if (total === filteredCount) {
60 if (total === filteredCount) {
62 _text = _gettext("{0} repository groups").format(total);
61 _text = _gettext("{0} repository groups").format(total);
63 }
62 }
64 $('#repo_group_count').text(_text);
63 $('#repo_group_count').text(_text);
65 return json.data;
64 return json.data;
66 },
65 },
67 },
66 },
68
67
69 dom: 'rtp',
68 dom: 'rtp',
70 pageLength: ${c.visual.admin_grid_items},
69 pageLength: ${c.visual.admin_grid_items},
71 order: [[ 0, "asc" ]],
70 order: [[ 0, "asc" ]],
72 columns: [
71 columns: [
73 { data: {"_": "name",
72 { data: {"_": "name",
74 "sort": "name"}, title: "${_('Name')}", className: "td-componentname" },
73 "sort": "name"}, title: "${_('Name')}", className: "td-componentname" },
75 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
74 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
76 { data: {"_": "desc",
75 { data: {"_": "desc",
77 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
76 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
78 { data: {"_": "last_change",
77 { data: {"_": "last_change",
79 "sort": "last_change",
78 "sort": "last_change",
80 "type": Number}, title: "${_('Last Change')}", className: "td-time" },
79 "type": Number}, title: "${_('Last Change')}", className: "td-time" },
81 { data: {"_": "top_level_repos",
80 { data: {"_": "top_level_repos",
82 "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" },
81 "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" },
83 { data: {"_": "owner",
82 { data: {"_": "owner",
84 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
83 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
85 { data: {"_": "action",
84 { data: {"_": "action",
86 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
85 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
87 ],
86 ],
88 language: {
87 language: {
89 paginate: DEFAULT_GRID_PAGINATION,
88 paginate: DEFAULT_GRID_PAGINATION,
90 sProcessing: _gettext('loading...'),
89 sProcessing: _gettext('loading...'),
91 emptyTable: _gettext("No repository groups available yet.")
90 emptyTable: _gettext("No repository groups available yet.")
92 },
91 },
93 });
92 });
94
93
95 $repoGroupsListTable.on('xhr.dt', function(e, settings, json, xhr){
94 $repoGroupsListTable.on('xhr.dt', function(e, settings, json, xhr){
96 $repoGroupsListTable.css('opacity', 1);
95 $repoGroupsListTable.css('opacity', 1);
97 });
96 });
98
97
99 $repoGroupsListTable.on('preXhr.dt', function(e, settings, data){
98 $repoGroupsListTable.on('preXhr.dt', function(e, settings, data){
100 $repoGroupsListTable.css('opacity', 0.3);
99 $repoGroupsListTable.css('opacity', 0.3);
101 });
100 });
102
101
103 // filter
102 // filter
104 $('#q_filter').on('keyup',
103 $('#q_filter').on('keyup',
105 $.debounce(250, function() {
104 $.debounce(250, function() {
106 $repoGroupsListTable.DataTable().search(
105 $repoGroupsListTable.DataTable().search(
107 $('#q_filter').val()
106 $('#q_filter').val()
108 ).draw();
107 ).draw();
109 })
108 })
110 );
109 );
111
110
112 });
111 });
113
112
114 </script>
113 </script>
115
114
116 </%def>
115 </%def>
117
116
@@ -1,37 +1,36 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Add repository')}
4 ${_('Add repository')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 %if c.rhodecode_user.is_admin:
11 %if c.rhodecode_user.is_admin:
13 ${h.link_to(_('Admin'), h.route_path('admin_home'))}
12 ${h.link_to(_('Admin'), h.route_path('admin_home'))}
14 &raquo;
13 &raquo;
15 ${h.link_to(_('Repositories'), h.route_path('repos'))}
14 ${h.link_to(_('Repositories'), h.route_path('repos'))}
16 %else:
15 %else:
17 ${_('Admin')}
16 ${_('Admin')}
18 &raquo;
17 &raquo;
19 ${_('Repositories')}
18 ${_('Repositories')}
20 %endif
19 %endif
21 &raquo;
20 &raquo;
22 ${_('Add Repository')}
21 ${_('Add Repository')}
23 </%def>
22 </%def>
24
23
25 <%def name="menu_bar_nav()">
24 <%def name="menu_bar_nav()">
26 ${self.menu_items(active='admin')}
25 ${self.menu_items(active='admin')}
27 </%def>
26 </%def>
28
27
29 <%def name="menu_bar_subnav()">
28 <%def name="menu_bar_subnav()">
30 ${self.admin_menu(active='repositories')}
29 ${self.admin_menu(active='repositories')}
31 </%def>
30 </%def>
32
31
33 <%def name="main()">
32 <%def name="main()">
34 <div class="box">
33 <div class="box">
35 <%include file="repo_add_base.mako"/>
34 <%include file="repo_add_base.mako"/>
36 </div>
35 </div>
37 </%def>
36 </%def>
@@ -1,169 +1,168 b''
1 ## -*- coding: utf-8 -*-
2
1
3 ${h.secure_form(h.route_path('repo_create'), request=request)}
2 ${h.secure_form(h.route_path('repo_create'), request=request)}
4 <div class="form">
3 <div class="form">
5 <!-- fields -->
4 <!-- fields -->
6 <div class="fields">
5 <div class="fields">
7 <div class="field">
6 <div class="field">
8 <div class="label">
7 <div class="label">
9 <label for="repo_name">${_('Repository name')}:</label>
8 <label for="repo_name">${_('Repository name')}:</label>
10 </div>
9 </div>
11 <div class="input">
10 <div class="input">
12 ${h.text('repo_name', class_="medium")}
11 ${h.text('repo_name', class_="medium")}
13 <div class="info-block">
12 <div class="info-block">
14 <a id="remote_clone_toggle" href="#">${_('Import Existing Repository ?')}</a>
13 <a id="remote_clone_toggle" href="#">${_('Import Existing Repository ?')}</a>
15 </div>
14 </div>
16 %if not c.rhodecode_user.is_admin:
15 %if not c.rhodecode_user.is_admin:
17 ${h.hidden('user_created',True)}
16 ${h.hidden('user_created',True)}
18 %endif
17 %endif
19 </div>
18 </div>
20 </div>
19 </div>
21 <div id="remote_clone" class="field" style="display: none;">
20 <div id="remote_clone" class="field" style="display: none;">
22 <div class="label">
21 <div class="label">
23 <label for="clone_uri">${_('Clone from')}:</label>
22 <label for="clone_uri">${_('Clone from')}:</label>
24 </div>
23 </div>
25 <div class="input">
24 <div class="input">
26 ${h.text('clone_uri', class_="medium")}
25 ${h.text('clone_uri', class_="medium")}
27 <span class="help-block">
26 <span class="help-block">
28 <pre>
27 <pre>
29 - The repository must be accessible over http:// or https://
28 - The repository must be accessible over http:// or https://
30 - For Git projects it's recommended appending .git to the end of clone url.
29 - For Git projects it's recommended appending .git to the end of clone url.
31 - Make sure to select proper repository type from the below selector before importing it.
30 - Make sure to select proper repository type from the below selector before importing it.
32 - If your HTTP[S] repository is not publicly accessible,
31 - If your HTTP[S] repository is not publicly accessible,
33 add authentication information to the URL: https://username:password@server.company.com/repo-name.
32 add authentication information to the URL: https://username:password@server.company.com/repo-name.
34 - The Git LFS/Mercurial Largefiles objects will not be imported.
33 - The Git LFS/Mercurial Largefiles objects will not be imported.
35 - For very large repositories, it's recommended to manually copy them into the
34 - For very large repositories, it's recommended to manually copy them into the
36 RhodeCode <a href="${h.route_path('admin_settings_vcs', _anchor='vcs-storage-options')}">storage location</a> and run <a href="${h.route_path('admin_settings_mapping')}">Remap and Rescan</a>.
35 RhodeCode <a href="${h.route_path('admin_settings_vcs', _anchor='vcs-storage-options')}">storage location</a> and run <a href="${h.route_path('admin_settings_mapping')}">Remap and Rescan</a>.
37 </pre>
36 </pre>
38 </span>
37 </span>
39 </div>
38 </div>
40 </div>
39 </div>
41 <div class="field">
40 <div class="field">
42 <div class="label">
41 <div class="label">
43 <label for="repo_group">${_('Repository group')}:</label>
42 <label for="repo_group">${_('Repository group')}:</label>
44 </div>
43 </div>
45 <div class="select">
44 <div class="select">
46 ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
45 ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
47 % if c.personal_repo_group:
46 % if c.personal_repo_group:
48 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
47 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
49 ${_('Select my personal group ({})').format(c.personal_repo_group.group_name)}
48 ${_('Select my personal group ({})').format(c.personal_repo_group.group_name)}
50 </a>
49 </a>
51 % endif
50 % endif
52 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
51 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
53 </div>
52 </div>
54 </div>
53 </div>
55
54
56 <div class="field">
55 <div class="field">
57 <div class="label">
56 <div class="label">
58 <label for="repo_type">${_('Type')}:</label>
57 <label for="repo_type">${_('Type')}:</label>
59 </div>
58 </div>
60 <div class="fields repo-type-radio">
59 <div class="fields repo-type-radio">
61
60
62
61
63 % for backend in c.backends:
62 % for backend in c.backends:
64 % if loop.index == 0:
63 % if loop.index == 0:
65 <input id="repo_type_${backend}" name="repo_type" type="radio" value="${backend}" checked="checked"/>
64 <input id="repo_type_${backend}" name="repo_type" type="radio" value="${backend}" checked="checked"/>
66 % else:
65 % else:
67 <input id="repo_type_${backend}" name="repo_type" type="radio" value="${backend}" />
66 <input id="repo_type_${backend}" name="repo_type" type="radio" value="${backend}" />
68 % endif
67 % endif
69
68
70 <label for="repo_type_${backend}">
69 <label for="repo_type_${backend}">
71 <i class="icon-${backend}" style="font-size: 16px"></i>
70 <i class="icon-${backend}" style="font-size: 16px"></i>
72 ${backend.upper()}
71 ${backend.upper()}
73 </label>
72 </label>
74
73
75 % endfor
74 % endfor
76
75
77
76
78 <span class="help-block">${_('Set the type of repository to create.')}</span>
77 <span class="help-block">${_('Set the type of repository to create.')}</span>
79 </div>
78 </div>
80 </div>
79 </div>
81 <div class="field">
80 <div class="field">
82 <div class="label">
81 <div class="label">
83 <label for="repo_description">${_('Description')}:</label>
82 <label for="repo_description">${_('Description')}:</label>
84 </div>
83 </div>
85 <div class="textarea editor">
84 <div class="textarea editor">
86 ${h.textarea('repo_description',cols=23,rows=5,class_="medium")}
85 ${h.textarea('repo_description',cols=23,rows=5,class_="medium")}
87 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
86 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
88 <span class="help-block">
87 <span class="help-block">
89 % if c.visual.stylify_metatags:
88 % if c.visual.stylify_metatags:
90 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
89 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
91 % else:
90 % else:
92 ${_('Plain text format.')}
91 ${_('Plain text format.')}
93 % endif
92 % endif
94 ${_('Add a README file for longer descriptions')}
93 ${_('Add a README file for longer descriptions')}
95 </span>
94 </span>
96 <span id="meta-tags-desc" style="display: none">
95 <span id="meta-tags-desc" style="display: none">
97 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
96 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
98 ${dt.metatags_help()}
97 ${dt.metatags_help()}
99 </span>
98 </span>
100 </div>
99 </div>
101 </div>
100 </div>
102 <div id="copy_perms" class="field">
101 <div id="copy_perms" class="field">
103 <div class="label label-checkbox">
102 <div class="label label-checkbox">
104 <label for="repo_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
103 <label for="repo_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
105 </div>
104 </div>
106 <div class="checkboxes">
105 <div class="checkboxes">
107 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
106 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
108 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
107 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
109 </div>
108 </div>
110 </div>
109 </div>
111 <div class="field">
110 <div class="field">
112 <div class="label label-checkbox">
111 <div class="label label-checkbox">
113 <label for="repo_private">${_('Private Repository')}:</label>
112 <label for="repo_private">${_('Private Repository')}:</label>
114 </div>
113 </div>
115 <div class="checkboxes">
114 <div class="checkboxes">
116 ${h.checkbox('repo_private',value="True")}
115 ${h.checkbox('repo_private',value="True")}
117 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
116 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
118 </div>
117 </div>
119 </div>
118 </div>
120 <div class="buttons">
119 <div class="buttons">
121 ${h.submit('save',_('Create Repository'),class_="btn")}
120 ${h.submit('save',_('Create Repository'),class_="btn")}
122 </div>
121 </div>
123 </div>
122 </div>
124 </div>
123 </div>
125 <script>
124 <script>
126 $(document).ready(function(){
125 $(document).ready(function(){
127 var setCopyPermsOption = function(group_val){
126 var setCopyPermsOption = function(group_val){
128 if(group_val != "-1"){
127 if(group_val != "-1"){
129 $('#copy_perms').show()
128 $('#copy_perms').show()
130 }
129 }
131 else{
130 else{
132 $('#copy_perms').hide();
131 $('#copy_perms').hide();
133 }
132 }
134 };
133 };
135
134
136 $('#remote_clone_toggle').on('click', function(e){
135 $('#remote_clone_toggle').on('click', function(e){
137 $('#remote_clone').show();
136 $('#remote_clone').show();
138 e.preventDefault();
137 e.preventDefault();
139 });
138 });
140
139
141 if($('#remote_clone input').hasClass('error')){
140 if($('#remote_clone input').hasClass('error')){
142 $('#remote_clone').show();
141 $('#remote_clone').show();
143 }
142 }
144 if($('#remote_clone input').val()){
143 if($('#remote_clone input').val()){
145 $('#remote_clone').show();
144 $('#remote_clone').show();
146 }
145 }
147
146
148 $("#repo_group").select2({
147 $("#repo_group").select2({
149 'containerCssClass': "drop-menu",
148 'containerCssClass': "drop-menu",
150 'dropdownCssClass': "drop-menu-dropdown",
149 'dropdownCssClass': "drop-menu-dropdown",
151 'dropdownAutoWidth': true,
150 'dropdownAutoWidth': true,
152 'width': "resolve"
151 'width': "resolve"
153 });
152 });
154
153
155 setCopyPermsOption($('#repo_group').val());
154 setCopyPermsOption($('#repo_group').val());
156 $("#repo_group").on("change", function(e) {
155 $("#repo_group").on("change", function(e) {
157 setCopyPermsOption(e.val)
156 setCopyPermsOption(e.val)
158 });
157 });
159
158
160 $('#repo_name').focus();
159 $('#repo_name').focus();
161
160
162 $('#select_my_group').on('click', function(e){
161 $('#select_my_group').on('click', function(e){
163 e.preventDefault();
162 e.preventDefault();
164 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
163 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
165 })
164 })
166
165
167 })
166 })
168 </script>
167 </script>
169 ${h.end_form()}
168 ${h.end_form()}
@@ -1,80 +1,79 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('{} Creating repository').format(c.repo_name)}
4 ${_('{} Creating repository').format(c.repo_name)}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${_('Creating repository')} ${c.repo_name}
11 ${_('Creating repository')} ${c.repo_name}
13 </%def>
12 </%def>
14
13
15 <%def name="menu_bar_nav()">
14 <%def name="menu_bar_nav()">
16 ${self.menu_items(active='repositories')}
15 ${self.menu_items(active='repositories')}
17 </%def>
16 </%def>
18 <%def name="main()">
17 <%def name="main()">
19 <div class="box">
18 <div class="box">
20 <!-- box / title -->
19 <!-- box / title -->
21 <div class="title">
20 <div class="title">
22 ${self.breadcrumbs()}
21 ${self.breadcrumbs()}
23 </div>
22 </div>
24
23
25 <div id="progress-message">
24 <div id="progress-message">
26 ${_('Repository "%(repo_name)s" is being created, you will be redirected when this process is finished.' % {'repo_name':c.repo_name})}
25 ${_('Repository "%(repo_name)s" is being created, you will be redirected when this process is finished.' % {'repo_name':c.repo_name})}
27 </div>
26 </div>
28
27
29 <div id="progress">
28 <div id="progress">
30 <div class="progress progress-striped active">
29 <div class="progress progress-striped active">
31 <div class="progress-bar progress-bar" role="progressbar"
30 <div class="progress-bar progress-bar" role="progressbar"
32 aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
31 aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
33 </div>
32 </div>
34 </div>
33 </div>
35 </div>
34 </div>
36 </div>
35 </div>
37
36
38 <script>
37 <script>
39 (function worker() {
38 (function worker() {
40 var skipCheck = false;
39 var skipCheck = false;
41 var url = "${h.route_path('repo_creating_check', repo_name=c.repo_name, _query=dict(task_id=c.task_id))}";
40 var url = "${h.route_path('repo_creating_check', repo_name=c.repo_name, _query=dict(task_id=c.task_id))}";
42 $.ajax({
41 $.ajax({
43 url: url,
42 url: url,
44 timeout: 60*1000, // sets timeout to 60 seconds
43 timeout: 60*1000, // sets timeout to 60 seconds
45 complete: function(resp) {
44 complete: function(resp) {
46 if (resp.status === 200) {
45 if (resp.status === 200) {
47 var jsonResponse = resp.responseJSON;
46 var jsonResponse = resp.responseJSON;
48
47
49 if (jsonResponse === undefined) {
48 if (jsonResponse === undefined) {
50 setTimeout(function () {
49 setTimeout(function () {
51 // we might have a backend problem, try dashboard again
50 // we might have a backend problem, try dashboard again
52 window.location = "${h.route_path('repo_summary', repo_name = c.repo_name)}";
51 window.location = "${h.route_path('repo_summary', repo_name = c.repo_name)}";
53 }, 3000);
52 }, 3000);
54 } else {
53 } else {
55 if (skipCheck || jsonResponse.result === true) {
54 if (skipCheck || jsonResponse.result === true) {
56 // success, means go to dashboard
55 // success, means go to dashboard
57 window.location = "${h.route_path('repo_summary', repo_name = c.repo_name)}";
56 window.location = "${h.route_path('repo_summary', repo_name = c.repo_name)}";
58 } else {
57 } else {
59 // Schedule the next request when the current one's complete
58 // Schedule the next request when the current one's complete
60 setTimeout(worker, 1000);
59 setTimeout(worker, 1000);
61 }
60 }
62 }
61 }
63 }
62 }
64 else {
63 else {
65 var currentUrl = "${h.current_route_path(request)}";
64 var currentUrl = "${h.current_route_path(request)}";
66 var message = _gettext('Fetching repository state failed. Error code: {0} {1}. Try <a href="{2}">refreshing</a> this page.').format(resp.status, resp.statusText, currentUrl);
65 var message = _gettext('Fetching repository state failed. Error code: {0} {1}. Try <a href="{2}">refreshing</a> this page.').format(resp.status, resp.statusText, currentUrl);
67 var payload = {
66 var payload = {
68 message: {
67 message: {
69 message: message,
68 message: message,
70 level: 'error',
69 level: 'error',
71 force: true
70 force: true
72 }
71 }
73 };
72 };
74 $.Topic('/notifications').publish(payload);
73 $.Topic('/notifications').publish(payload);
75 }
74 }
76 }
75 }
77 });
76 });
78 })();
77 })();
79 </script>
78 </script>
80 </%def>
79 </%def>
@@ -1,104 +1,103 b''
1 ## -*- coding: utf-8 -*-
2 ##
1 ##
3 ## See also repo_settings.html
2 ## See also repo_settings.html
4 ##
3 ##
5 <%inherit file="/base/base.mako"/>
4 <%inherit file="/base/base.mako"/>
6
5
7 <%def name="title()">
6 <%def name="title()">
8 ${_('{} repository settings').format(c.rhodecode_db_repo.repo_name)}
7 ${_('{} repository settings').format(c.rhodecode_db_repo.repo_name)}
9 %if c.rhodecode_name:
8 %if c.rhodecode_name:
10 &middot; ${h.branding(c.rhodecode_name)}
9 &middot; ${h.branding(c.rhodecode_name)}
11 %endif
10 %endif
12 </%def>
11 </%def>
13
12
14 <%def name="breadcrumbs_links()">
13 <%def name="breadcrumbs_links()">
15 ${_('Settings')}
14 ${_('Settings')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_nav()">
17 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='repositories')}
18 ${self.menu_items(active='repositories')}
20 </%def>
19 </%def>
21
20
22 <%def name="menu_bar_subnav()">
21 <%def name="menu_bar_subnav()">
23 ${self.repo_menu(active='settings')}
22 ${self.repo_menu(active='settings')}
24 </%def>
23 </%def>
25
24
26 <%def name="main_content()">
25 <%def name="main_content()">
27 % if hasattr(c, 'repo_edit_template'):
26 % if hasattr(c, 'repo_edit_template'):
28 <%include file="${c.repo_edit_template}"/>
27 <%include file="${c.repo_edit_template}"/>
29 % else:
28 % else:
30 <%include file="/admin/repos/repo_edit_${c.active}.mako"/>
29 <%include file="/admin/repos/repo_edit_${c.active}.mako"/>
31 % endif
30 % endif
32 </%def>
31 </%def>
33
32
34
33
35 <%def name="main()">
34 <%def name="main()">
36 <div class="box">
35 <div class="box">
37
36
38 <div class="sidebar-col-wrapper scw-small">
37 <div class="sidebar-col-wrapper scw-small">
39 <div class="sidebar">
38 <div class="sidebar">
40 <ul class="nav nav-pills nav-stacked">
39 <ul class="nav nav-pills nav-stacked">
41 <li class="${h.is_active('settings', c.active)}">
40 <li class="${h.is_active('settings', c.active)}">
42 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
41 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
43 </li>
42 </li>
44 <li class="${h.is_active('permissions', c.active)}">
43 <li class="${h.is_active('permissions', c.active)}">
45 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Access Permissions')}</a>
44 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Access Permissions')}</a>
46 </li>
45 </li>
47 <li class="${h.is_active('permissions_branch', c.active)}">
46 <li class="${h.is_active('permissions_branch', c.active)}">
48 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
47 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
49 </li>
48 </li>
50 <li class="${h.is_active('advanced', c.active)}">
49 <li class="${h.is_active('advanced', c.active)}">
51 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
50 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
52 </li>
51 </li>
53 <li class="${h.is_active('vcs', c.active)}">
52 <li class="${h.is_active('vcs', c.active)}">
54 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
53 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
55 </li>
54 </li>
56 <li class="${h.is_active('fields', c.active)}">
55 <li class="${h.is_active('fields', c.active)}">
57 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
56 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
58 </li>
57 </li>
59 <li class="${h.is_active('issuetracker', c.active)}">
58 <li class="${h.is_active('issuetracker', c.active)}">
60 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
59 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
61 </li>
60 </li>
62 <li class="${h.is_active('caches', c.active)}">
61 <li class="${h.is_active('caches', c.active)}">
63 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
62 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
64 </li>
63 </li>
65 %if c.rhodecode_db_repo.repo_type != 'svn':
64 %if c.rhodecode_db_repo.repo_type != 'svn':
66 <li class="${h.is_active('remote', c.active)}">
65 <li class="${h.is_active('remote', c.active)}">
67 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
66 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
68 </li>
67 </li>
69 %endif
68 %endif
70 <li class="${h.is_active('statistics', c.active)}">
69 <li class="${h.is_active('statistics', c.active)}">
71 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
70 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
72 </li>
71 </li>
73 <li class="${h.is_active('integrations', c.active)}">
72 <li class="${h.is_active('integrations', c.active)}">
74 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
73 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
75 </li>
74 </li>
76 %if c.rhodecode_db_repo.repo_type != 'svn':
75 %if c.rhodecode_db_repo.repo_type != 'svn':
77 <li class="${h.is_active('reviewers', c.active)}">
76 <li class="${h.is_active('reviewers', c.active)}">
78 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
77 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
79 </li>
78 </li>
80 %endif
79 %endif
81 <li class="${h.is_active('automation', c.active)}">
80 <li class="${h.is_active('automation', c.active)}">
82 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
81 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
83 </li>
82 </li>
84 <li class="${h.is_active('maintenance', c.active)}">
83 <li class="${h.is_active('maintenance', c.active)}">
85 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
84 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
86 </li>
85 </li>
87 <li class="${h.is_active('strip', c.active)}">
86 <li class="${h.is_active('strip', c.active)}">
88 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
87 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
89 </li>
88 </li>
90 <li class="${h.is_active('audit', c.active)}">
89 <li class="${h.is_active('audit', c.active)}">
91 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
90 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
92 </li>
91 </li>
93
92
94 </ul>
93 </ul>
95 </div>
94 </div>
96
95
97 <div class="main-content-full-width">
96 <div class="main-content-full-width">
98 ${self.main_content()}
97 ${self.main_content()}
99 </div>
98 </div>
100
99
101 </div>
100 </div>
102 </div>
101 </div>
103
102
104 </%def> No newline at end of file
103 </%def>
@@ -1,24 +1,23 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4
3
5 <div class="panel panel-default">
4 <div class="panel panel-default">
6 <div class="panel-heading">
5 <div class="panel-heading">
7 <h3 class="panel-title">${_('Repository Audit Logs')} -
6 <h3 class="panel-title">${_('Repository Audit Logs')} -
8 ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
7 ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
9 </h3>
8 </h3>
10 </div>
9 </div>
11 <div class="panel-body">
10 <div class="panel-body">
12
11
13 ${h.form(None, id_="filter_form", method="get")}
12 ${h.form(None, id_="filter_form", method="get")}
14 <input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
13 <input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
15 <input type='submit' value="${_('filter')}" class="btn" />
14 <input type='submit' value="${_('filter')}" class="btn" />
16 ${h.end_form()}
15 ${h.end_form()}
17
16
18 <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>
19 <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>
20
19
21 <%include file="/admin/admin_log_base.mako" />
20 <%include file="/admin/admin_log_base.mako" />
22
21
23 </div>
22 </div>
24 </div>
23 </div>
@@ -1,337 +1,336 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4 <div class="panel panel-default">
3 <div class="panel panel-default">
5 <div class="panel-heading">
4 <div class="panel-heading">
6 <h3 class="panel-title">${_('Settings for Repository: %s') % c.rhodecode_db_repo.repo_name}</h3>
5 <h3 class="panel-title">${_('Settings for Repository: %s') % c.rhodecode_db_repo.repo_name}</h3>
7 </div>
6 </div>
8 <div class="panel-body">
7 <div class="panel-body">
9 ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
8 ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
10 <div class="form">
9 <div class="form">
11 <!-- fields -->
10 <!-- fields -->
12 <div class="fields">
11 <div class="fields">
13
12
14 <div class="field">
13 <div class="field">
15 <div class="label">
14 <div class="label">
16 <label for="repo_name">${_('Name')}:</label>
15 <label for="repo_name">${_('Name')}:</label>
17 </div>
16 </div>
18 <div class="input">
17 <div class="input">
19 ${c.form['repo_name'].render(css_class='medium', oid='repo_name')|n}
18 ${c.form['repo_name'].render(css_class='medium', oid='repo_name')|n}
20 ${c.form.render_error(request, c.form['repo_name'])|n}
19 ${c.form.render_error(request, c.form['repo_name'])|n}
21
20
22 <p class="help-block">${_('permalink id')}: `_${c.rhodecode_db_repo.repo_id}` <span><a href="#" onclick="$('#clone_id').toggle();return false">${_('what is that ?')}</a></span></p>
21 <p class="help-block">${_('permalink id')}: `_${c.rhodecode_db_repo.repo_id}` <span><a href="#" onclick="$('#clone_id').toggle();return false">${_('what is that ?')}</a></span></p>
23 <p id="clone_id" style="display:none;">
22 <p id="clone_id" style="display:none;">
24 ${_('URL by id')}: `${c.rhodecode_db_repo.clone_url(with_id=True)}` <br/>
23 ${_('URL by id')}: `${c.rhodecode_db_repo.clone_url(with_id=True)}` <br/>
25 ${_('''In case this repository is renamed or moved into another group the repository url changes.
24 ${_('''In case this repository is renamed or moved into another group the repository url changes.
26 Using above url guarantees that this repository will always be accessible under such url.
25 Using above url guarantees that this repository will always be accessible under such url.
27 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
26 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
28 </div>
27 </div>
29 </div>
28 </div>
30
29
31 <div class="field">
30 <div class="field">
32 <div class="label">
31 <div class="label">
33 <label for="repo_group">${_('Repository group')}:</label>
32 <label for="repo_group">${_('Repository group')}:</label>
34 </div>
33 </div>
35 <div class="select">
34 <div class="select">
36 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
35 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
37 ${c.form.render_error(request, c.form['repo_group'])|n}
36 ${c.form.render_error(request, c.form['repo_group'])|n}
38
37
39 % if c.personal_repo_group:
38 % if c.personal_repo_group:
40 <a class="btn" href="#" data-personal-group-name="${c.personal_repo_group.group_name}" data-personal-group-id="${c.personal_repo_group.group_id}" onclick="selectMyGroup(this); return false">
39 <a class="btn" href="#" data-personal-group-name="${c.personal_repo_group.group_name}" data-personal-group-id="${c.personal_repo_group.group_id}" onclick="selectMyGroup(this); return false">
41 ${_('Select my personal group (`%(repo_group_name)s`)') % {'repo_group_name': c.personal_repo_group.group_name}}
40 ${_('Select my personal group (`%(repo_group_name)s`)') % {'repo_group_name': c.personal_repo_group.group_name}}
42 </a>
41 </a>
43 % endif
42 % endif
44 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
43 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
45 </div>
44 </div>
46 </div>
45 </div>
47
46
48 % if c.rhodecode_db_repo.repo_type != 'svn':
47 % if c.rhodecode_db_repo.repo_type != 'svn':
49 <% sync_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %>
48 <% sync_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %>
50 <div class="field">
49 <div class="field">
51 <div class="label">
50 <div class="label">
52 <label for="clone_uri">${_('Remote pull uri')}:</label>
51 <label for="clone_uri">${_('Remote pull uri')}:</label>
53 </div>
52 </div>
54 <div class="input">
53 <div class="input">
55 %if c.rhodecode_db_repo.clone_uri:
54 %if c.rhodecode_db_repo.clone_uri:
56 ## display, if we don't have any errors
55 ## display, if we don't have any errors
57 % if not c.form['repo_clone_uri'].error:
56 % if not c.form['repo_clone_uri'].error:
58 <div id="clone_uri_hidden" class='text-as-placeholder'>
57 <div id="clone_uri_hidden" class='text-as-placeholder'>
59 <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span>
58 <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span>
60 <span class="link" id="edit_clone_uri">${_('edit')}</span>
59 <span class="link" id="edit_clone_uri">${_('edit')}</span>
61 </div>
60 </div>
62 % endif
61 % endif
63
62
64 ## alter field
63 ## alter field
65 <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}">
64 <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}">
66 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
65 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
67 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
66 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
68 % if c.form['repo_clone_uri'].error:
67 % if c.form['repo_clone_uri'].error:
69 ## we got error from form subit, means we modify the url
68 ## we got error from form subit, means we modify the url
70 ${h.hidden('repo_clone_uri_change', 'MOD')}
69 ${h.hidden('repo_clone_uri_change', 'MOD')}
71 % else:
70 % else:
72 ${h.hidden('repo_clone_uri_change', 'OLD')}
71 ${h.hidden('repo_clone_uri_change', 'OLD')}
73 % endif
72 % endif
74
73
75 % if not c.form['repo_clone_uri'].error:
74 % if not c.form['repo_clone_uri'].error:
76 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
75 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
77 % endif
76 % endif
78
77
79 </div>
78 </div>
80 %else:
79 %else:
81 ## not set yet, display form to set it
80 ## not set yet, display form to set it
82 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n}
81 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n}
83 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
82 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
84 ${h.hidden('repo_clone_uri_change', 'NEW')}
83 ${h.hidden('repo_clone_uri_change', 'NEW')}
85 %endif
84 %endif
86 <p id="alter_clone_uri_help_block" class="help-block">
85 <p id="alter_clone_uri_help_block" class="help-block">
87 ${_('http[s] url where from repository was imported. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/>
86 ${_('http[s] url where from repository was imported. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/>
88 ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')}
87 ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')}
89 </p>
88 </p>
90 </div>
89 </div>
91 </div>
90 </div>
92 <div class="field">
91 <div class="field">
93 <div class="label">
92 <div class="label">
94 <label for="push_uri">${_('Remote push uri')}:</label>
93 <label for="push_uri">${_('Remote push uri')}:</label>
95 </div>
94 </div>
96 <div class="input">
95 <div class="input">
97 %if c.rhodecode_db_repo.push_uri:
96 %if c.rhodecode_db_repo.push_uri:
98 ## display, if we don't have any errors
97 ## display, if we don't have any errors
99 % if not c.form['repo_push_uri'].error:
98 % if not c.form['repo_push_uri'].error:
100 <div id="push_uri_hidden" class='text-as-placeholder'>
99 <div id="push_uri_hidden" class='text-as-placeholder'>
101 <span id="push_uri_hidden_value">${c.rhodecode_db_repo.push_uri_hidden}</span>
100 <span id="push_uri_hidden_value">${c.rhodecode_db_repo.push_uri_hidden}</span>
102 <span class="link" id="edit_push_uri">${_('edit')}</span>
101 <span class="link" id="edit_push_uri">${_('edit')}</span>
103 </div>
102 </div>
104 % endif
103 % endif
105
104
106 ## alter field
105 ## alter field
107 <div id="alter_push_uri" style="${'' if c.form['repo_push_uri'].error else 'display: none'}">
106 <div id="alter_push_uri" style="${'' if c.form['repo_push_uri'].error else 'display: none'}">
108 ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
107 ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
109 ${c.form.render_error(request, c.form['repo_push_uri'])|n}
108 ${c.form.render_error(request, c.form['repo_push_uri'])|n}
110 % if c.form['repo_push_uri'].error:
109 % if c.form['repo_push_uri'].error:
111 ## we got error from form subit, means we modify the url
110 ## we got error from form subit, means we modify the url
112 ${h.hidden('repo_push_uri_change', 'MOD')}
111 ${h.hidden('repo_push_uri_change', 'MOD')}
113 % else:
112 % else:
114 ${h.hidden('repo_push_uri_change', 'OLD')}
113 ${h.hidden('repo_push_uri_change', 'OLD')}
115 % endif
114 % endif
116
115
117 % if not c.form['repo_push_uri'].error:
116 % if not c.form['repo_push_uri'].error:
118 <span class="link" id="cancel_edit_push_uri">${_('cancel')}</span>
117 <span class="link" id="cancel_edit_push_uri">${_('cancel')}</span>
119 % endif
118 % endif
120
119
121 </div>
120 </div>
122 %else:
121 %else:
123 ## not set yet, display form to set it
122 ## not set yet, display form to set it
124 ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri')|n}
123 ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri')|n}
125 ${c.form.render_error(request, c.form['repo_push_uri'])|n}
124 ${c.form.render_error(request, c.form['repo_push_uri'])|n}
126 ${h.hidden('repo_push_uri_change', 'NEW')}
125 ${h.hidden('repo_push_uri_change', 'NEW')}
127 %endif
126 %endif
128 <p id="alter_push_uri_help_block" class="help-block">
127 <p id="alter_push_uri_help_block" class="help-block">
129 ${_('http[s] url to sync data back. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/>
128 ${_('http[s] url to sync data back. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/>
130 ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')}
129 ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')}
131 </p>
130 </p>
132 </div>
131 </div>
133 </div>
132 </div>
134 % else:
133 % else:
135 ${h.hidden('repo_clone_uri', '')}
134 ${h.hidden('repo_clone_uri', '')}
136 ${h.hidden('repo_push_uri', '')}
135 ${h.hidden('repo_push_uri', '')}
137 % endif
136 % endif
138
137
139 <div class="field">
138 <div class="field">
140 <div class="label">
139 <div class="label">
141 <label for="repo_landing_commit_ref">${_('Landing commit')}:</label>
140 <label for="repo_landing_commit_ref">${_('Landing commit')}:</label>
142 </div>
141 </div>
143 <div class="select">
142 <div class="select">
144 ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n}
143 ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n}
145 ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n}
144 ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n}
146 <p class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</p>
145 <p class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</p>
147 </div>
146 </div>
148 </div>
147 </div>
149
148
150 <div class="field badged-field">
149 <div class="field badged-field">
151 <div class="label">
150 <div class="label">
152 <label for="repo_owner">${_('Owner')}:</label>
151 <label for="repo_owner">${_('Owner')}:</label>
153 </div>
152 </div>
154 <div class="input">
153 <div class="input">
155 <div class="badge-input-container">
154 <div class="badge-input-container">
156 <div class="user-badge">
155 <div class="user-badge">
157 ${base.gravatar(c.rhodecode_db_repo.user.email or c.rhodecode_db_repo.user.username, user=c.rhodecode_db_repo.user, tooltip=True)}
156 ${base.gravatar(c.rhodecode_db_repo.user.email or c.rhodecode_db_repo.user.username, user=c.rhodecode_db_repo.user, tooltip=True)}
158 </div>
157 </div>
159 <div class="badge-input-wrap">
158 <div class="badge-input-wrap">
160 ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n}
159 ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n}
161 </div>
160 </div>
162 </div>
161 </div>
163 ${c.form.render_error(request, c.form['repo_owner'])|n}
162 ${c.form.render_error(request, c.form['repo_owner'])|n}
164 <p class="help-block">${_('Change owner of this repository.')}</p>
163 <p class="help-block">${_('Change owner of this repository.')}</p>
165 </div>
164 </div>
166 </div>
165 </div>
167
166
168 <div class="field">
167 <div class="field">
169 <div class="label label-textarea">
168 <div class="label label-textarea">
170 <label for="repo_description">${_('Description')}:</label>
169 <label for="repo_description">${_('Description')}:</label>
171 </div>
170 </div>
172 <div class="textarea text-area editor">
171 <div class="textarea text-area editor">
173 ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n}
172 ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n}
174 ${c.form.render_error(request, c.form['repo_description'])|n}
173 ${c.form.render_error(request, c.form['repo_description'])|n}
175
174
176 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
175 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
177 <span class="help-block">
176 <span class="help-block">
178 % if c.visual.stylify_metatags:
177 % if c.visual.stylify_metatags:
179 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
178 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
180 % else:
179 % else:
181 ${_('Plain text format.')}
180 ${_('Plain text format.')}
182 % endif
181 % endif
183 ${_('Add a README file for longer descriptions')}
182 ${_('Add a README file for longer descriptions')}
184 </span>
183 </span>
185 <span id="meta-tags-desc" style="display: none">
184 <span id="meta-tags-desc" style="display: none">
186 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
185 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
187 ${dt.metatags_help()}
186 ${dt.metatags_help()}
188 </span>
187 </span>
189 </div>
188 </div>
190 </div>
189 </div>
191
190
192 <div class="field">
191 <div class="field">
193 <div class="label label-checkbox">
192 <div class="label label-checkbox">
194 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
193 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
195 </div>
194 </div>
196 <div class="checkboxes">
195 <div class="checkboxes">
197 ${c.form['repo_private'].render(css_class='medium')|n}
196 ${c.form['repo_private'].render(css_class='medium')|n}
198 ${c.form.render_error(request, c.form['repo_private'])|n}
197 ${c.form.render_error(request, c.form['repo_private'])|n}
199 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
198 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
200 </div>
199 </div>
201 </div>
200 </div>
202 <div class="field">
201 <div class="field">
203 <div class="label label-checkbox">
202 <div class="label label-checkbox">
204 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
203 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
205 </div>
204 </div>
206 <div class="checkboxes">
205 <div class="checkboxes">
207 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
206 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
208 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
207 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
209 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
208 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
210 </div>
209 </div>
211 </div>
210 </div>
212 <div class="field">
211 <div class="field">
213 <div class="label label-checkbox">
212 <div class="label label-checkbox">
214 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
213 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
215 </div>
214 </div>
216 <div class="checkboxes">
215 <div class="checkboxes">
217 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
216 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
218 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
217 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
219 <span class="help-block">${_('Enable download menu on summary page.')}</span>
218 <span class="help-block">${_('Enable download menu on summary page.')}</span>
220 </div>
219 </div>
221 </div>
220 </div>
222 <div class="field">
221 <div class="field">
223 <div class="label label-checkbox">
222 <div class="label label-checkbox">
224 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
223 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
225 </div>
224 </div>
226 <div class="checkboxes">
225 <div class="checkboxes">
227 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
226 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
228 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
227 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
229 <span class="help-block">${_('Enable automatic locking on repository. Pulling from this repository creates a lock that can be released by pushing back by the same user')}</span>
228 <span class="help-block">${_('Enable automatic locking on repository. Pulling from this repository creates a lock that can be released by pushing back by the same user')}</span>
230 </div>
229 </div>
231 </div>
230 </div>
232
231
233 %if c.visual.repository_fields:
232 %if c.visual.repository_fields:
234 ## EXTRA FIELDS
233 ## EXTRA FIELDS
235 %for field in c.repo_fields:
234 %for field in c.repo_fields:
236 <div class="field">
235 <div class="field">
237 <div class="label">
236 <div class="label">
238 <label for="${field.field_key_prefixed}">${(field.field_label or field.field_key)}:</label>
237 <label for="${field.field_key_prefixed}">${(field.field_label or field.field_key)}:</label>
239 </div>
238 </div>
240 <div class="input input-medium">
239 <div class="input input-medium">
241 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
240 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
242 <span class="help-block">
241 <span class="help-block">
243 key: ${field.field_key};
242 key: ${field.field_key};
244 ${field.field_desc}
243 ${field.field_desc}
245 </span>
244 </span>
246 </div>
245 </div>
247 </div>
246 </div>
248 %endfor
247 %endfor
249 %endif
248 %endif
250 <div class="buttons">
249 <div class="buttons">
251 ${h.submit('save',_('Save'),class_="btn")}
250 ${h.submit('save',_('Save'),class_="btn")}
252 ${h.reset('reset',_('Reset'),class_="btn")}
251 ${h.reset('reset',_('Reset'),class_="btn")}
253 </div>
252 </div>
254 </div>
253 </div>
255 </div>
254 </div>
256 ${h.end_form()}
255 ${h.end_form()}
257 </div>
256 </div>
258 </div>
257 </div>
259
258
260 <script>
259 <script>
261 $(document).ready(function () {
260 $(document).ready(function () {
262 var cloneUrl = function (
261 var cloneUrl = function (
263 alterButton, editButton, cancelEditButton,
262 alterButton, editButton, cancelEditButton,
264 hiddenUrl, hiddenUrlValue, input, helpBlock, changedFlag) {
263 hiddenUrl, hiddenUrlValue, input, helpBlock, changedFlag) {
265
264
266 var originalText = helpBlock.html();
265 var originalText = helpBlock.html();
267 var obfuscatedUrl = hiddenUrlValue.html();
266 var obfuscatedUrl = hiddenUrlValue.html();
268
267
269 var edit = function(e) {
268 var edit = function(e) {
270 alterButton.show();
269 alterButton.show();
271 editButton.hide();
270 editButton.hide();
272 hiddenUrl.hide();
271 hiddenUrl.hide();
273
272
274 //add the old value next to input for verification
273 //add the old value next to input for verification
275 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
274 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
276 changedFlag.val('MOD');
275 changedFlag.val('MOD');
277 };
276 };
278
277
279 var cancelEdit = function(e) {
278 var cancelEdit = function(e) {
280 alterButton.hide();
279 alterButton.hide();
281 editButton.show();
280 editButton.show();
282 hiddenUrl.show();
281 hiddenUrl.show();
283
282
284 helpBlock.html(originalText);
283 helpBlock.html(originalText);
285 changedFlag.val('OLD');
284 changedFlag.val('OLD');
286 input.val('');
285 input.val('');
287 };
286 };
288
287
289 var initEvents = function() {
288 var initEvents = function() {
290 editButton.on('click', edit);
289 editButton.on('click', edit);
291 cancelEditButton.on('click', cancelEdit);
290 cancelEditButton.on('click', cancelEdit);
292 };
291 };
293
292
294 var setInitialState = function() {
293 var setInitialState = function() {
295 if (input.hasClass('error')) {
294 if (input.hasClass('error')) {
296 alterButton.show();
295 alterButton.show();
297 editButton.hide();
296 editButton.hide();
298 hiddenUrl.hide();
297 hiddenUrl.hide();
299 }
298 }
300 };
299 };
301
300
302 setInitialState();
301 setInitialState();
303 initEvents();
302 initEvents();
304 };
303 };
305
304
306
305
307 var alterButton = $('#alter_clone_uri');
306 var alterButton = $('#alter_clone_uri');
308 var editButton = $('#edit_clone_uri');
307 var editButton = $('#edit_clone_uri');
309 var cancelEditButton = $('#cancel_edit_clone_uri');
308 var cancelEditButton = $('#cancel_edit_clone_uri');
310 var hiddenUrl = $('#clone_uri_hidden');
309 var hiddenUrl = $('#clone_uri_hidden');
311 var hiddenUrlValue = $('#clone_uri_hidden_value');
310 var hiddenUrlValue = $('#clone_uri_hidden_value');
312 var input = $('#clone_uri');
311 var input = $('#clone_uri');
313 var helpBlock = $('#alter_clone_uri_help_block');
312 var helpBlock = $('#alter_clone_uri_help_block');
314 var changedFlag = $('#repo_clone_uri_change');
313 var changedFlag = $('#repo_clone_uri_change');
315 cloneUrl(
314 cloneUrl(
316 alterButton, editButton, cancelEditButton, hiddenUrl,
315 alterButton, editButton, cancelEditButton, hiddenUrl,
317 hiddenUrlValue, input, helpBlock, changedFlag);
316 hiddenUrlValue, input, helpBlock, changedFlag);
318
317
319 var alterButton = $('#alter_push_uri');
318 var alterButton = $('#alter_push_uri');
320 var editButton = $('#edit_push_uri');
319 var editButton = $('#edit_push_uri');
321 var cancelEditButton = $('#cancel_edit_push_uri');
320 var cancelEditButton = $('#cancel_edit_push_uri');
322 var hiddenUrl = $('#push_uri_hidden');
321 var hiddenUrl = $('#push_uri_hidden');
323 var hiddenUrlValue = $('#push_uri_hidden_value');
322 var hiddenUrlValue = $('#push_uri_hidden_value');
324 var input = $('#push_uri');
323 var input = $('#push_uri');
325 var helpBlock = $('#alter_push_uri_help_block');
324 var helpBlock = $('#alter_push_uri_help_block');
326 var changedFlag = $('#repo_push_uri_change');
325 var changedFlag = $('#repo_push_uri_change');
327 cloneUrl(
326 cloneUrl(
328 alterButton, editButton, cancelEditButton, hiddenUrl,
327 alterButton, editButton, cancelEditButton, hiddenUrl,
329 hiddenUrlValue, input, helpBlock, changedFlag);
328 hiddenUrlValue, input, helpBlock, changedFlag);
330
329
331 selectMyGroup = function(element) {
330 selectMyGroup = function(element) {
332 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
331 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
333 };
332 };
334
333
335 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
334 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
336 });
335 });
337 </script>
336 </script>
@@ -1,149 +1,148 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Repositories administration')}
4 ${_('Repositories administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='repositories')}
17 ${self.admin_menu(active='repositories')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23
22
24 <div class="title">
23 <div class="title">
25 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
24 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
26 <span id="repo_count"></span>
25 <span id="repo_count"></span>
27
26
28 <ul class="links">
27 <ul class="links">
29 %if c.can_create_repo:
28 %if c.can_create_repo:
30 <li>
29 <li>
31 <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>
32 </li>
31 </li>
33 %endif
32 %endif
34 </ul>
33 </ul>
35 </div>
34 </div>
36 <div id="repos_list_wrap">
35 <div id="repos_list_wrap">
37 <table id="repo_list_table" class="display"></table>
36 <table id="repo_list_table" class="display"></table>
38 </div>
37 </div>
39
38
40 </div>
39 </div>
41
40
42 <script>
41 <script>
43 $(document).ready(function() {
42 $(document).ready(function() {
44 var $repoListTable = $('#repo_list_table');
43 var $repoListTable = $('#repo_list_table');
45
44
46 // repo list
45 // repo list
47 $repoListTable.DataTable({
46 $repoListTable.DataTable({
48 processing: true,
47 processing: true,
49 serverSide: true,
48 serverSide: true,
50 ajax: {
49 ajax: {
51 "url": "${h.route_path('repos_data')}",
50 "url": "${h.route_path('repos_data')}",
52 "dataSrc": function (json) {
51 "dataSrc": function (json) {
53 var filteredCount = json.recordsFiltered;
52 var filteredCount = json.recordsFiltered;
54 var total = json.recordsTotal;
53 var total = json.recordsTotal;
55
54
56 var _text = _gettext(
55 var _text = _gettext(
57 "{0} of {1} repositories").format(
56 "{0} of {1} repositories").format(
58 filteredCount, total);
57 filteredCount, total);
59
58
60 if (total === filteredCount) {
59 if (total === filteredCount) {
61 _text = _gettext("{0} repositories").format(total);
60 _text = _gettext("{0} repositories").format(total);
62 }
61 }
63 $('#repo_count').text(_text);
62 $('#repo_count').text(_text);
64
63
65 return json.data;
64 return json.data;
66 },
65 },
67 },
66 },
68 dom: 'rtp',
67 dom: 'rtp',
69 pageLength: ${c.visual.admin_grid_items},
68 pageLength: ${c.visual.admin_grid_items},
70 order: [[ 0, "asc" ]],
69 order: [[ 0, "asc" ]],
71 columns: [
70 columns: [
72 {
71 {
73 data: {
72 data: {
74 "_": "name",
73 "_": "name",
75 "sort": "name"
74 "sort": "name"
76 }, title: "${_('Name')}", className: "td-componentname"
75 }, title: "${_('Name')}", className: "td-componentname"
77 },
76 },
78 {
77 {
79 data: 'menu', "bSortable": false, className: "quick_repo_menu"},
78 data: 'menu', "bSortable": false, className: "quick_repo_menu"},
80 {
79 {
81 data: {
80 data: {
82 "_": "desc",
81 "_": "desc",
83 "sort": "desc"
82 "sort": "desc"
84 }, title: "${_('Description')}", className: "td-description"
83 }, title: "${_('Description')}", className: "td-description"
85 },
84 },
86 {
85 {
87 data: {
86 data: {
88 "_": "last_change",
87 "_": "last_change",
89 "sort": "last_change",
88 "sort": "last_change",
90 "type": Number
89 "type": Number
91 }, title: "${_('Last Change')}", className: "td-time"
90 }, title: "${_('Last Change')}", className: "td-time"
92 },
91 },
93 {
92 {
94 data: {
93 data: {
95 "_": "last_changeset",
94 "_": "last_changeset",
96 "sort": "last_changeset_raw",
95 "sort": "last_changeset_raw",
97 "type": Number
96 "type": Number
98 }, title: "${_('Commit')}", className: "td-commit", orderable: false
97 }, title: "${_('Commit')}", className: "td-commit", orderable: false
99 },
98 },
100 {
99 {
101 data: {
100 data: {
102 "_": "owner",
101 "_": "owner",
103 "sort": "owner"
102 "sort": "owner"
104 }, title: "${_('Owner')}", className: "td-user"
103 }, title: "${_('Owner')}", className: "td-user"
105 },
104 },
106 {
105 {
107 data: {
106 data: {
108 "_": "state",
107 "_": "state",
109 "sort": "state"
108 "sort": "state"
110 }, title: "${_('State')}", className: "td-tags td-state"
109 }, title: "${_('State')}", className: "td-tags td-state"
111 },
110 },
112 {
111 {
113 data: {
112 data: {
114 "_": "action",
113 "_": "action",
115 "sort": "action"
114 "sort": "action"
116 }, title: "${_('Action')}", className: "td-action", orderable: false
115 }, title: "${_('Action')}", className: "td-action", orderable: false
117 }
116 }
118 ],
117 ],
119 language: {
118 language: {
120 paginate: DEFAULT_GRID_PAGINATION,
119 paginate: DEFAULT_GRID_PAGINATION,
121 sProcessing: _gettext('loading...'),
120 sProcessing: _gettext('loading...'),
122 emptyTable:_gettext("No repositories present.")
121 emptyTable:_gettext("No repositories present.")
123 },
122 },
124 "initComplete": function( settings, json ) {
123 "initComplete": function( settings, json ) {
125 quick_repo_menu();
124 quick_repo_menu();
126 }
125 }
127 });
126 });
128
127
129 $repoListTable.on('xhr.dt', function(e, settings, json, xhr){
128 $repoListTable.on('xhr.dt', function(e, settings, json, xhr){
130 $repoListTable.css('opacity', 1);
129 $repoListTable.css('opacity', 1);
131 });
130 });
132
131
133 $repoListTable.on('preXhr.dt', function(e, settings, data){
132 $repoListTable.on('preXhr.dt', function(e, settings, data){
134 $repoListTable.css('opacity', 0.3);
133 $repoListTable.css('opacity', 0.3);
135 });
134 });
136
135
137 $('#q_filter').on('keyup',
136 $('#q_filter').on('keyup',
138 $.debounce(250, function() {
137 $.debounce(250, function() {
139 $repoListTable.DataTable().search(
138 $repoListTable.DataTable().search(
140 $('#q_filter').val()
139 $('#q_filter').val()
141 ).draw();
140 ).draw();
142 })
141 })
143 );
142 );
144
143
145 });
144 });
146
145
147 </script>
146 </script>
148
147
149 </%def>
148 </%def>
@@ -1,54 +1,53 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Settings administration')}
4 ${_('Settings administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${_('Settings')}
13 ${_('Settings')}
15 </%def>
14 </%def>
16 ##
15 ##
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='admin')}
17 ${self.menu_items(active='admin')}
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_subnav()">
20 <%def name="menu_bar_subnav()">
22 ${self.admin_menu(active='settings')}
21 ${self.admin_menu(active='settings')}
23 </%def>
22 </%def>
24
23
25 <%def name="side_bar_nav()">
24 <%def name="side_bar_nav()">
26 % for navitem in c.navlist:
25 % for navitem in c.navlist:
27 <li class="${h.is_active(navitem.active_list, c.active)}">
26 <li class="${h.is_active(navitem.active_list, c.active)}">
28 <a href="${navitem.url}">${navitem.name}</a>
27 <a href="${navitem.url}">${navitem.name}</a>
29 </li>
28 </li>
30 % endfor
29 % endfor
31 </%def>
30 </%def>
32
31
33 <%def name="main_content()">
32 <%def name="main_content()">
34 <%include file="/admin/settings/settings_${c.active}.mako"/>
33 <%include file="/admin/settings/settings_${c.active}.mako"/>
35 </%def>
34 </%def>
36
35
37 <%def name="main()">
36 <%def name="main()">
38 <div class="box">
37 <div class="box">
39
38
40 ##main
39 ##main
41 <div class='sidebar-col-wrapper'>
40 <div class='sidebar-col-wrapper'>
42 <div class="sidebar">
41 <div class="sidebar">
43 <ul class="nav nav-pills nav-stacked">
42 <ul class="nav nav-pills nav-stacked">
44 ${self.side_bar_nav()}
43 ${self.side_bar_nav()}
45 </ul>
44 </ul>
46 </div>
45 </div>
47
46
48 <div class="main-content-auto-width">
47 <div class="main-content-auto-width">
49 ${self.main_content()}
48 ${self.main_content()}
50 </div>
49 </div>
51 </div>
50 </div>
52 </div>
51 </div>
53
52
54 </%def> No newline at end of file
53 </%def>
@@ -1,26 +1,25 b''
1 ## -*- coding: utf-8 -*-
2 ## upgrade block rendered afte on-click check
1 ## upgrade block rendered afte on-click check
3
2
4 <div class="alert ${'alert-warning' if c.should_upgrade else 'alert-success'}">
3 <div class="alert ${'alert-warning' if c.should_upgrade else 'alert-success'}">
5 <p>
4 <p>
6 %if c.should_upgrade:
5 %if c.should_upgrade:
7 A <b>new version</b> is available:
6 A <b>new version</b> is available:
8 %if c.latest_data.get('title'):
7 %if c.latest_data.get('title'):
9 <b>${h.literal(c.latest_data['title'])}</b>
8 <b>${h.literal(c.latest_data['title'])}</b>
10 %else:
9 %else:
11 <b>${c.latest_ver}</b>
10 <b>${c.latest_ver}</b>
12 %endif
11 %endif
13 %else:
12 %else:
14 This instance is already running the <b>latest</b> stable version ${c.latest_ver}.
13 This instance is already running the <b>latest</b> stable version ${c.latest_ver}.
15 %endif
14 %endif
16 </p>
15 </p>
17
16
18 % if c.should_upgrade and c.important_notices:
17 % if c.should_upgrade and c.important_notices:
19 <div>Important notes for this release:</div>
18 <div>Important notes for this release:</div>
20 <ul>
19 <ul>
21 % for notice in c.important_notices:
20 % for notice in c.important_notices:
22 <li>- ${notice}</li>
21 <li>- ${notice}</li>
23 % endfor
22 % endfor
24 </ul>
23 </ul>
25 % endif
24 % endif
26 </div>
25 </div>
@@ -1,71 +1,70 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Add user group')}
4 ${_('Add user group')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10 <%def name="breadcrumbs_links()">
9 <%def name="breadcrumbs_links()">
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
10 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
12 &raquo;
11 &raquo;
13 ${h.link_to(_('User groups'),h.route_path('user_groups'))}
12 ${h.link_to(_('User groups'),h.route_path('user_groups'))}
14 &raquo;
13 &raquo;
15 ${_('Add User Group')}
14 ${_('Add User Group')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_nav()">
17 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='admin')}
18 ${self.menu_items(active='admin')}
20 </%def>
19 </%def>
21
20
22 <%def name="menu_bar_subnav()">
21 <%def name="menu_bar_subnav()">
23 ${self.admin_menu(active='user_groups')}
22 ${self.admin_menu(active='user_groups')}
24 </%def>
23 </%def>
25
24
26 <%def name="main()">
25 <%def name="main()">
27 <div class="box main-content">
26 <div class="box main-content">
28 ${h.secure_form(h.route_path('user_groups_create'), request=request)}
27 ${h.secure_form(h.route_path('user_groups_create'), request=request)}
29 <div class="form">
28 <div class="form">
30 <!-- fields -->
29 <!-- fields -->
31 <div class="fields">
30 <div class="fields">
32 <div class="field">
31 <div class="field">
33 <div class="label">
32 <div class="label">
34 <label for="users_group_name">${_('Group name')}:</label>
33 <label for="users_group_name">${_('Group name')}:</label>
35 </div>
34 </div>
36 <div class="input">
35 <div class="input">
37 ${h.text('users_group_name', class_='medium')}
36 ${h.text('users_group_name', class_='medium')}
38 </div>
37 </div>
39 </div>
38 </div>
40 <div class="field">
39 <div class="field">
41 <div class="label">
40 <div class="label">
42 <label for="user_group_description">${_('Description')}:</label>
41 <label for="user_group_description">${_('Description')}:</label>
43 </div>
42 </div>
44 <div class="textarea editor">
43 <div class="textarea editor">
45 ${h.textarea('user_group_description')}
44 ${h.textarea('user_group_description')}
46 <span class="help-block">${_('Short, optional description for this user group.')}</span>
45 <span class="help-block">${_('Short, optional description for this user group.')}</span>
47 </div>
46 </div>
48 </div>
47 </div>
49 <div class="field">
48 <div class="field">
50 <div class="label">
49 <div class="label">
51 <label for="users_group_active">${_('Active')}:</label>
50 <label for="users_group_active">${_('Active')}:</label>
52 </div>
51 </div>
53 <div class="checkboxes">
52 <div class="checkboxes">
54 ${h.checkbox('users_group_active',value=True, checked='checked')}
53 ${h.checkbox('users_group_active',value=True, checked='checked')}
55 </div>
54 </div>
56 </div>
55 </div>
57
56
58 <div class="buttons">
57 <div class="buttons">
59 ${h.submit('save',_('Create User Group'),class_="btn")}
58 ${h.submit('save',_('Create User Group'),class_="btn")}
60 </div>
59 </div>
61 </div>
60 </div>
62 </div>
61 </div>
63 ${h.end_form()}
62 ${h.end_form()}
64 </div>
63 </div>
65 </%def>
64 </%def>
66
65
67 <script>
66 <script>
68 $(document).ready(function(){
67 $(document).ready(function(){
69 $('#users_group_name').focus();
68 $('#users_group_name').focus();
70 })
69 })
71 </script>
70 </script>
@@ -1,47 +1,46 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('{} user group settings').format(c.user_group.users_group_name)}
4 ${_('{} user group settings').format(c.user_group.users_group_name)}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${h.link_to(_('User Groups'),h.route_path('user_groups'))}
13 ${h.link_to(_('User Groups'),h.route_path('user_groups'))}
15 &raquo;
14 &raquo;
16 ${c.user_group.users_group_name}
15 ${c.user_group.users_group_name}
17 </%def>
16 </%def>
18
17
19 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
20 ${self.menu_items(active='admin')}
19 ${self.menu_items(active='admin')}
21 </%def>
20 </%def>
22
21
23 <%def name="menu_bar_subnav()">
22 <%def name="menu_bar_subnav()">
24 ${self.admin_menu(active='user_groups')}
23 ${self.admin_menu(active='user_groups')}
25 </%def>
24 </%def>
26
25
27 <%def name="main()">
26 <%def name="main()">
28 <div class="box">
27 <div class="box">
29
28
30 ##main
29 ##main
31 <div class="sidebar-col-wrapper">
30 <div class="sidebar-col-wrapper">
32 <div class="sidebar">
31 <div class="sidebar">
33 <ul class="nav nav-pills nav-stacked">
32 <ul class="nav nav-pills nav-stacked">
34 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_user_group', user_group_id=c.user_group.users_group_id)}">${_('Settings')}</a></li>
33 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_user_group', user_group_id=c.user_group.users_group_id)}">${_('Settings')}</a></li>
35 <li class="${h.is_active('perms', c.active)}"><a href="${h.route_path('edit_user_group_perms', user_group_id=c.user_group.users_group_id)}">${_('Permissions')}</a></li>
34 <li class="${h.is_active('perms', c.active)}"><a href="${h.route_path('edit_user_group_perms', user_group_id=c.user_group.users_group_id)}">${_('Permissions')}</a></li>
36 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_user_group_advanced', user_group_id=c.user_group.users_group_id)}">${_('Advanced')}</a></li>
35 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_user_group_advanced', user_group_id=c.user_group.users_group_id)}">${_('Advanced')}</a></li>
37 <li class="${h.is_active('global_perms', c.active)}"><a href="${h.route_path('edit_user_group_global_perms', user_group_id=c.user_group.users_group_id)}">${_('Global permissions')}</a></li>
36 <li class="${h.is_active('global_perms', c.active)}"><a href="${h.route_path('edit_user_group_global_perms', user_group_id=c.user_group.users_group_id)}">${_('Global permissions')}</a></li>
38 <li class="${h.is_active('perms_summary', c.active)}"><a href="${h.route_path('edit_user_group_perms_summary', user_group_id=c.user_group.users_group_id)}">${_('Permissions summary')}</a></li>
37 <li class="${h.is_active('perms_summary', c.active)}"><a href="${h.route_path('edit_user_group_perms_summary', user_group_id=c.user_group.users_group_id)}">${_('Permissions summary')}</a></li>
39 </ul>
38 </ul>
40 </div>
39 </div>
41
40
42 <div class="main-content-full-width">
41 <div class="main-content-full-width">
43 <%include file="/admin/user_groups/user_group_edit_${c.active}.mako"/>
42 <%include file="/admin/user_groups/user_group_edit_${c.active}.mako"/>
44 </div>
43 </div>
45 </div>
44 </div>
46 </div>
45 </div>
47 </%def>
46 </%def>
@@ -1,191 +1,190 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4 <div class="panel panel-default">
3 <div class="panel panel-default">
5 <div class="panel-heading">
4 <div class="panel-heading">
6 <h3 class="panel-title">
5 <h3 class="panel-title">
7 <i class="icon-user-group" title="${_('User group')}"></i>
6 <i class="icon-user-group" title="${_('User group')}"></i>
8 ${h.link_to_group(c.user_group.users_group_name)}
7 ${h.link_to_group(c.user_group.users_group_name)}
9 - ${_('Settings')}
8 - ${_('Settings')}
10 </h3>
9 </h3>
11 </div>
10 </div>
12 <div class="panel-body">
11 <div class="panel-body">
13 ${h.secure_form(h.route_path('user_groups_update', user_group_id=c.user_group.users_group_id), id='edit_user_group', request=request)}
12 ${h.secure_form(h.route_path('user_groups_update', user_group_id=c.user_group.users_group_id), id='edit_user_group', request=request)}
14 <div class="form">
13 <div class="form">
15 <!-- fields -->
14 <!-- fields -->
16 <div class="fields">
15 <div class="fields">
17 <div class="field">
16 <div class="field">
18 <div class="label">
17 <div class="label">
19 <label for="users_group_name">${_('Group name')}:</label>
18 <label for="users_group_name">${_('Group name')}:</label>
20 </div>
19 </div>
21 <div class="input">
20 <div class="input">
22 ${h.text('users_group_name',class_='medium')}
21 ${h.text('users_group_name',class_='medium')}
23 </div>
22 </div>
24 </div>
23 </div>
25
24
26 <div class="field badged-field">
25 <div class="field badged-field">
27 <div class="label">
26 <div class="label">
28 <label for="user">${_('Owner')}:</label>
27 <label for="user">${_('Owner')}:</label>
29 </div>
28 </div>
30 <div class="input">
29 <div class="input">
31 <div class="badge-input-container">
30 <div class="badge-input-container">
32 <div class="user-badge">
31 <div class="user-badge">
33 ${base.gravatar(c.user_group.user.email, user=c.user_group.user, tooltip=True)}
32 ${base.gravatar(c.user_group.user.email, user=c.user_group.user, tooltip=True)}
34 </div>
33 </div>
35 <div class="badge-input-wrap">
34 <div class="badge-input-wrap">
36 ${h.text('user', class_="medium", autocomplete="off")}
35 ${h.text('user', class_="medium", autocomplete="off")}
37 </div>
36 </div>
38 </div>
37 </div>
39 <form:error name="user"/>
38 <form:error name="user"/>
40 <p class="help-block">${_('Change owner of this user group.')}</p>
39 <p class="help-block">${_('Change owner of this user group.')}</p>
41 </div>
40 </div>
42 </div>
41 </div>
43
42
44 <div class="field">
43 <div class="field">
45 <div class="label label-textarea">
44 <div class="label label-textarea">
46 <label for="user_group_description">${_('Description')}:</label>
45 <label for="user_group_description">${_('Description')}:</label>
47 </div>
46 </div>
48 <div class="textarea textarea-small editor">
47 <div class="textarea textarea-small editor">
49 ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")}
48 ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")}
50 <span class="help-block">${_('Short, optional description for this user group.')}</span>
49 <span class="help-block">${_('Short, optional description for this user group.')}</span>
51 </div>
50 </div>
52 </div>
51 </div>
53 <div class="field">
52 <div class="field">
54 <div class="label label-checkbox">
53 <div class="label label-checkbox">
55 <label for="users_group_active">${_('Active')}:</label>
54 <label for="users_group_active">${_('Active')}:</label>
56 </div>
55 </div>
57 <div class="checkboxes">
56 <div class="checkboxes">
58 ${h.checkbox('users_group_active',value=True)}
57 ${h.checkbox('users_group_active',value=True)}
59 </div>
58 </div>
60 </div>
59 </div>
61
60
62 <div class="field">
61 <div class="field">
63 <div class="label label-checkbox">
62 <div class="label label-checkbox">
64 <label for="users_group_active">${_('Add members')}:</label>
63 <label for="users_group_active">${_('Add members')}:</label>
65 </div>
64 </div>
66 <div class="input">
65 <div class="input">
67 ${h.text('user_group_add_members', placeholder="user/usergroup", class_="medium")}
66 ${h.text('user_group_add_members', placeholder="user/usergroup", class_="medium")}
68 </div>
67 </div>
69 </div>
68 </div>
70
69
71 <input type="hidden" name="__start__" value="user_group_members:sequence"/>
70 <input type="hidden" name="__start__" value="user_group_members:sequence"/>
72 <table id="group_members_placeholder" class="rctable group_members">
71 <table id="group_members_placeholder" class="rctable group_members">
73 <tr>
72 <tr>
74 <th>${_('Username')}</th>
73 <th>${_('Username')}</th>
75 <th>${_('Action')}</th>
74 <th>${_('Action')}</th>
76 </tr>
75 </tr>
77
76
78 % if c.group_members_obj:
77 % if c.group_members_obj:
79 % for user in c.group_members_obj:
78 % for user in c.group_members_obj:
80 <tr>
79 <tr>
81 <td id="member_user_${user.user_id}" class="td-author">
80 <td id="member_user_${user.user_id}" class="td-author">
82 <div class="group_member">
81 <div class="group_member">
83 ${base.gravatar(user.email, 16, user=user, tooltip=True)}
82 ${base.gravatar(user.email, 16, user=user, tooltip=True)}
84 <span class="username user">${h.link_to(h.person(user), h.route_path('user_edit',user_id=user.user_id))}</span>
83 <span class="username user">${h.link_to(h.person(user), h.route_path('user_edit',user_id=user.user_id))}</span>
85 <input type="hidden" name="__start__" value="member:mapping">
84 <input type="hidden" name="__start__" value="member:mapping">
86 <input type="hidden" name="member_user_id" value="${user.user_id}">
85 <input type="hidden" name="member_user_id" value="${user.user_id}">
87 <input type="hidden" name="type" value="existing" id="member_${user.user_id}">
86 <input type="hidden" name="type" value="existing" id="member_${user.user_id}">
88 <input type="hidden" name="__end__" value="member:mapping">
87 <input type="hidden" name="__end__" value="member:mapping">
89 </div>
88 </div>
90 </td>
89 </td>
91 <td class="">
90 <td class="">
92 <div class="usergroup_member_remove action_button" onclick="removeUserGroupMember(${user.user_id}, true)" style="visibility: visible;">
91 <div class="usergroup_member_remove action_button" onclick="removeUserGroupMember(${user.user_id}, true)" style="visibility: visible;">
93 <i class="icon-remove"></i>
92 <i class="icon-remove"></i>
94 </div>
93 </div>
95 </td>
94 </td>
96 </tr>
95 </tr>
97 % endfor
96 % endfor
98
97
99 % else:
98 % else:
100 <tr><td colspan="2">${_('No members yet')}</td></tr>
99 <tr><td colspan="2">${_('No members yet')}</td></tr>
101 % endif
100 % endif
102 </table>
101 </table>
103 <input type="hidden" name="__end__" value="user_group_members:sequence"/>
102 <input type="hidden" name="__end__" value="user_group_members:sequence"/>
104
103
105 <div class="buttons">
104 <div class="buttons">
106 ${h.submit('Save',_('Save'),class_="btn")}
105 ${h.submit('Save',_('Save'),class_="btn")}
107 </div>
106 </div>
108 </div>
107 </div>
109 </div>
108 </div>
110 ${h.end_form()}
109 ${h.end_form()}
111 </div>
110 </div>
112 </div>
111 </div>
113 <script>
112 <script>
114 $(document).ready(function(){
113 $(document).ready(function(){
115 $("#group_parent_id").select2({
114 $("#group_parent_id").select2({
116 'containerCssClass': "drop-menu",
115 'containerCssClass': "drop-menu",
117 'dropdownCssClass': "drop-menu-dropdown",
116 'dropdownCssClass': "drop-menu-dropdown",
118 'dropdownAutoWidth': true
117 'dropdownAutoWidth': true
119 });
118 });
120
119
121 removeUserGroupMember = function(userId){
120 removeUserGroupMember = function(userId){
122 $('#member_'+userId).val('remove');
121 $('#member_'+userId).val('remove');
123 $('#member_user_'+userId).addClass('to-delete');
122 $('#member_user_'+userId).addClass('to-delete');
124 };
123 };
125
124
126 $('#user_group_add_members').autocomplete({
125 $('#user_group_add_members').autocomplete({
127 serviceUrl: pyroutes.url('user_autocomplete_data'),
126 serviceUrl: pyroutes.url('user_autocomplete_data'),
128 minChars:2,
127 minChars:2,
129 maxHeight:400,
128 maxHeight:400,
130 width:300,
129 width:300,
131 deferRequestBy: 300, //miliseconds
130 deferRequestBy: 300, //miliseconds
132 showNoSuggestionNotice: true,
131 showNoSuggestionNotice: true,
133 params: { user_groups:true },
132 params: { user_groups:true },
134 formatResult: autocompleteFormatResult,
133 formatResult: autocompleteFormatResult,
135 lookupFilter: autocompleteFilterResult,
134 lookupFilter: autocompleteFilterResult,
136 onSelect: function(element, suggestion){
135 onSelect: function(element, suggestion){
137
136
138 function addMember(user, fromUserGroup) {
137 function addMember(user, fromUserGroup) {
139 var gravatar = user.icon_link;
138 var gravatar = user.icon_link;
140 var username = user.value_display;
139 var username = user.value_display;
141 var userLink = pyroutes.url('user_edit', {"user_id": user.id});
140 var userLink = pyroutes.url('user_edit', {"user_id": user.id});
142 var uid = user.id;
141 var uid = user.id;
143
142
144 if (fromUserGroup) {
143 if (fromUserGroup) {
145 username = username +" "+ _gettext('(from usergroup {0})'.format(fromUserGroup))
144 username = username +" "+ _gettext('(from usergroup {0})'.format(fromUserGroup))
146 }
145 }
147
146
148 var elem = $(
147 var elem = $(
149 ('<tr>'+
148 ('<tr>'+
150 '<td id="member_user_{6}" class="td-author td-author-new-entry">'+
149 '<td id="member_user_{6}" class="td-author td-author-new-entry">'+
151 '<div class="group_member">'+
150 '<div class="group_member">'+
152 '<img class="gravatar" src="{0}" height="16" width="16">'+
151 '<img class="gravatar" src="{0}" height="16" width="16">'+
153 '<span class="username user"><a href="{1}">{2}</a></span>'+
152 '<span class="username user"><a href="{1}">{2}</a></span>'+
154 '<input type="hidden" name="__start__" value="member:mapping">'+
153 '<input type="hidden" name="__start__" value="member:mapping">'+
155 '<input type="hidden" name="member_user_id" value="{3}">'+
154 '<input type="hidden" name="member_user_id" value="{3}">'+
156 '<input type="hidden" name="type" value="new" id="member_{4}">'+
155 '<input type="hidden" name="type" value="new" id="member_{4}">'+
157 '<input type="hidden" name="__end__" value="member:mapping">'+
156 '<input type="hidden" name="__end__" value="member:mapping">'+
158 '</div>'+
157 '</div>'+
159 '</td>'+
158 '</td>'+
160 '<td class="td-author-new-entry">'+
159 '<td class="td-author-new-entry">'+
161 '<div class="usergroup_member_remove action_button" onclick="removeUserGroupMember({5}, true)" style="visibility: visible;">'+
160 '<div class="usergroup_member_remove action_button" onclick="removeUserGroupMember({5}, true)" style="visibility: visible;">'+
162 '<i class="icon-remove"></i>'+
161 '<i class="icon-remove"></i>'+
163 '</div>'+
162 '</div>'+
164 '</td>'+
163 '</td>'+
165 '</tr>').format(gravatar, userLink, username,
164 '</tr>').format(gravatar, userLink, username,
166 uid, uid, uid, uid)
165 uid, uid, uid, uid)
167 );
166 );
168 $('#group_members_placeholder').append(elem)
167 $('#group_members_placeholder').append(elem)
169 }
168 }
170
169
171 if (suggestion.value_type == 'user_group') {
170 if (suggestion.value_type == 'user_group') {
172 $.getJSON(
171 $.getJSON(
173 pyroutes.url('user_group_members_data',
172 pyroutes.url('user_group_members_data',
174 {'user_group_id': suggestion.id}),
173 {'user_group_id': suggestion.id}),
175 function(data) {
174 function(data) {
176 $.each(data.members, function(idx, user) {
175 $.each(data.members, function(idx, user) {
177 addMember(user, suggestion.value)
176 addMember(user, suggestion.value)
178 });
177 });
179 }
178 }
180 );
179 );
181 } else if (suggestion.value_type == 'user') {
180 } else if (suggestion.value_type == 'user') {
182 addMember(suggestion, null);
181 addMember(suggestion, null);
183 }
182 }
184 $('#user_group_add_members').val('')
183 $('#user_group_add_members').val('')
185 }
184 }
186 });
185 });
187
186
188
187
189 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
188 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
190 })
189 })
191 </script>
190 </script>
@@ -1,118 +1,117 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('User groups administration')}
4 ${_('User groups administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='user_groups')}
17 ${self.admin_menu(active='user_groups')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23
22
24 <div class="title">
23 <div class="title">
25 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
24 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
26 <span id="user_group_count">0</span>
25 <span id="user_group_count">0</span>
27
26
28 <ul class="links">
27 <ul class="links">
29 %if c.can_create_user_group:
28 %if c.can_create_user_group:
30 <li>
29 <li>
31 <a href="${h.route_path('user_groups_new')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a>
30 <a href="${h.route_path('user_groups_new')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a>
32 </li>
31 </li>
33 %endif
32 %endif
34 </ul>
33 </ul>
35 </div>
34 </div>
36
35
37 <div id="repos_list_wrap">
36 <div id="repos_list_wrap">
38 <table id="user_group_list_table" class="display"></table>
37 <table id="user_group_list_table" class="display"></table>
39 </div>
38 </div>
40
39
41 </div>
40 </div>
42 <script>
41 <script>
43 $(document).ready(function() {
42 $(document).ready(function() {
44 var $userGroupsListTable = $('#user_group_list_table');
43 var $userGroupsListTable = $('#user_group_list_table');
45
44
46 // user list
45 // user list
47 $userGroupsListTable.DataTable({
46 $userGroupsListTable.DataTable({
48 processing: true,
47 processing: true,
49 serverSide: true,
48 serverSide: true,
50 ajax: {
49 ajax: {
51 "url": "${h.route_path('user_groups_data')}",
50 "url": "${h.route_path('user_groups_data')}",
52 "dataSrc": function (json) {
51 "dataSrc": function (json) {
53 var filteredCount = json.recordsFiltered;
52 var filteredCount = json.recordsFiltered;
54 var filteredInactiveCount = json.recordsFilteredInactive;
53 var filteredInactiveCount = json.recordsFilteredInactive;
55 var totalInactive = json.recordsTotalInactive;
54 var totalInactive = json.recordsTotalInactive;
56 var total = json.recordsTotal;
55 var total = json.recordsTotal;
57
56
58 var _text = _gettext(
57 var _text = _gettext(
59 "{0} ({1} inactive) of {2} user groups ({3} inactive)").format(
58 "{0} ({1} inactive) of {2} user groups ({3} inactive)").format(
60 filteredCount, filteredInactiveCount, total, totalInactive);
59 filteredCount, filteredInactiveCount, total, totalInactive);
61
60
62 if (total === filteredCount) {
61 if (total === filteredCount) {
63 _text = _gettext(
62 _text = _gettext(
64 "{0} user groups ({1} inactive)").format(total, totalInactive);
63 "{0} user groups ({1} inactive)").format(total, totalInactive);
65 }
64 }
66 $('#user_group_count').text(_text);
65 $('#user_group_count').text(_text);
67 return json.data;
66 return json.data;
68 },
67 },
69 },
68 },
70
69
71 dom: 'rtp',
70 dom: 'rtp',
72 pageLength: ${c.visual.admin_grid_items},
71 pageLength: ${c.visual.admin_grid_items},
73 order: [[ 0, "asc" ]],
72 order: [[ 0, "asc" ]],
74 columns: [
73 columns: [
75 { data: {"_": "users_group_name",
74 { data: {"_": "users_group_name",
76 "sort": "users_group_name"}, title: "${_('Name')}", className: "td-componentname" },
75 "sort": "users_group_name"}, title: "${_('Name')}", className: "td-componentname" },
77 { data: {"_": "description",
76 { data: {"_": "description",
78 "sort": "description"}, title: "${_('Description')}", className: "td-description" },
77 "sort": "description"}, title: "${_('Description')}", className: "td-description" },
79 { data: {"_": "members",
78 { data: {"_": "members",
80 "sort": "members"}, title: "${_('Members')}", className: "td-number" },
79 "sort": "members"}, title: "${_('Members')}", className: "td-number" },
81 { data: {"_": "sync",
80 { data: {"_": "sync",
82 "sort": "sync"}, title: "${_('Sync')}", className: "td-sync" },
81 "sort": "sync"}, title: "${_('Sync')}", className: "td-sync" },
83 { data: {"_": "active",
82 { data: {"_": "active",
84 "sort": "active"}, title: "${_('Active')}", className: "td-active" },
83 "sort": "active"}, title: "${_('Active')}", className: "td-active" },
85 { data: {"_": "owner",
84 { data: {"_": "owner",
86 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
85 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
87 { data: {"_": "action",
86 { data: {"_": "action",
88 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false}
87 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false}
89 ],
88 ],
90 language: {
89 language: {
91 paginate: DEFAULT_GRID_PAGINATION,
90 paginate: DEFAULT_GRID_PAGINATION,
92 sProcessing: _gettext('loading...'),
91 sProcessing: _gettext('loading...'),
93 emptyTable: _gettext("No user groups available yet.")
92 emptyTable: _gettext("No user groups available yet.")
94 }
93 }
95 });
94 });
96
95
97 $userGroupsListTable.on('xhr.dt', function(e, settings, json, xhr){
96 $userGroupsListTable.on('xhr.dt', function(e, settings, json, xhr){
98 $userGroupsListTable.css('opacity', 1);
97 $userGroupsListTable.css('opacity', 1);
99 });
98 });
100
99
101 $userGroupsListTable.on('preXhr.dt', function(e, settings, data){
100 $userGroupsListTable.on('preXhr.dt', function(e, settings, data){
102 $userGroupsListTable.css('opacity', 0.3);
101 $userGroupsListTable.css('opacity', 0.3);
103 });
102 });
104
103
105 // filter
104 // filter
106 $('#q_filter').on('keyup',
105 $('#q_filter').on('keyup',
107 $.debounce(250, function() {
106 $.debounce(250, function() {
108 $userGroupsListTable.DataTable().search(
107 $userGroupsListTable.DataTable().search(
109 $('#q_filter').val()
108 $('#q_filter').val()
110 ).draw();
109 ).draw();
111 })
110 })
112 );
111 );
113
112
114 });
113 });
115
114
116 </script>
115 </script>
117
116
118 </%def>
117 </%def>
@@ -1,147 +1,146 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Add user')}
4 ${_('Add user')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10 <%def name="breadcrumbs_links()">
9 <%def name="breadcrumbs_links()">
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
10 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
12 &raquo;
11 &raquo;
13 ${h.link_to(_('Users'),h.route_path('users'))}
12 ${h.link_to(_('Users'),h.route_path('users'))}
14 &raquo;
13 &raquo;
15 ${_('Add User')}
14 ${_('Add User')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_nav()">
17 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='admin')}
18 ${self.menu_items(active='admin')}
20 </%def>
19 </%def>
21
20
22 <%def name="main()">
21 <%def name="main()">
23 <div class="box">
22 <div class="box">
24 <!-- box / title -->
23 <!-- box / title -->
25 <div class="title">
24 <div class="title">
26 ${self.breadcrumbs()}
25 ${self.breadcrumbs()}
27 </div>
26 </div>
28 <!-- end box / title -->
27 <!-- end box / title -->
29 ${h.secure_form(h.route_path('users_create'), request=request)}
28 ${h.secure_form(h.route_path('users_create'), request=request)}
30 <div class="form">
29 <div class="form">
31 <!-- fields -->
30 <!-- fields -->
32 <div class="fields">
31 <div class="fields">
33 <div class="field">
32 <div class="field">
34 <div class="label">
33 <div class="label">
35 <label for="username">${_('Username')}:</label>
34 <label for="username">${_('Username')}:</label>
36 </div>
35 </div>
37 <div class="input">
36 <div class="input">
38 ${h.text('username', class_='medium')}
37 ${h.text('username', class_='medium')}
39 </div>
38 </div>
40 </div>
39 </div>
41
40
42 <div class="field">
41 <div class="field">
43 <div class="label">
42 <div class="label">
44 <label for="password">${_('Password')}:</label>
43 <label for="password">${_('Password')}:</label>
45 </div>
44 </div>
46 <div class="input">
45 <div class="input">
47 ${h.password('password', class_='medium')}
46 ${h.password('password', class_='medium')}
48 </div>
47 </div>
49 </div>
48 </div>
50
49
51 <div class="field">
50 <div class="field">
52 <div class="label">
51 <div class="label">
53 <label for="password_confirmation">${_('Password confirmation')}:</label>
52 <label for="password_confirmation">${_('Password confirmation')}:</label>
54 </div>
53 </div>
55 <div class="input">
54 <div class="input">
56 ${h.password('password_confirmation',autocomplete="off", class_='medium')}
55 ${h.password('password_confirmation',autocomplete="off", class_='medium')}
57 <div class="info-block">
56 <div class="info-block">
58 <a id="generate_password" href="#">
57 <a id="generate_password" href="#">
59 <i class="icon-lock"></i> ${_('Generate password')}
58 <i class="icon-lock"></i> ${_('Generate password')}
60 </a>
59 </a>
61 <span id="generate_password_preview"></span>
60 <span id="generate_password_preview"></span>
62 </div>
61 </div>
63 </div>
62 </div>
64 </div>
63 </div>
65
64
66 <div class="field">
65 <div class="field">
67 <div class="label">
66 <div class="label">
68 <label for="firstname">${_('First Name')}:</label>
67 <label for="firstname">${_('First Name')}:</label>
69 </div>
68 </div>
70 <div class="input">
69 <div class="input">
71 ${h.text('firstname', class_='medium')}
70 ${h.text('firstname', class_='medium')}
72 </div>
71 </div>
73 </div>
72 </div>
74
73
75 <div class="field">
74 <div class="field">
76 <div class="label">
75 <div class="label">
77 <label for="lastname">${_('Last Name')}:</label>
76 <label for="lastname">${_('Last Name')}:</label>
78 </div>
77 </div>
79 <div class="input">
78 <div class="input">
80 ${h.text('lastname', class_='medium')}
79 ${h.text('lastname', class_='medium')}
81 </div>
80 </div>
82 </div>
81 </div>
83
82
84 <div class="field">
83 <div class="field">
85 <div class="label">
84 <div class="label">
86 <label for="email">${_('Email')}:</label>
85 <label for="email">${_('Email')}:</label>
87 </div>
86 </div>
88 <div class="input">
87 <div class="input">
89 ${h.text('email', class_='medium')}
88 ${h.text('email', class_='medium')}
90 ${h.hidden('extern_name', c.default_extern_type)}
89 ${h.hidden('extern_name', c.default_extern_type)}
91 ${h.hidden('extern_type', c.default_extern_type)}
90 ${h.hidden('extern_type', c.default_extern_type)}
92 </div>
91 </div>
93 </div>
92 </div>
94
93
95 <div class="field">
94 <div class="field">
96 <div class="label label-checkbox">
95 <div class="label label-checkbox">
97 <label for="active">${_('Active')}:</label>
96 <label for="active">${_('Active')}:</label>
98 </div>
97 </div>
99 <div class="checkboxes">
98 <div class="checkboxes">
100 ${h.checkbox('active',value=True,checked='checked')}
99 ${h.checkbox('active',value=True,checked='checked')}
101 </div>
100 </div>
102 </div>
101 </div>
103
102
104 <div class="field">
103 <div class="field">
105 <div class="label label-checkbox">
104 <div class="label label-checkbox">
106 <label for="password_change">${_('Password change')}:</label>
105 <label for="password_change">${_('Password change')}:</label>
107 </div>
106 </div>
108 <div class="checkboxes">
107 <div class="checkboxes">
109 ${h.checkbox('password_change',value=True)}
108 ${h.checkbox('password_change',value=True)}
110 <span class="help-block">${_('Force user to change his password on the next login')}</span>
109 <span class="help-block">${_('Force user to change his password on the next login')}</span>
111 </div>
110 </div>
112 </div>
111 </div>
113
112
114 <div class="field">
113 <div class="field">
115 <div class="label label-checkbox">
114 <div class="label label-checkbox">
116 <label for="create_repo_group">${_('Add personal repository group')}:</label>
115 <label for="create_repo_group">${_('Add personal repository group')}:</label>
117 </div>
116 </div>
118 <div class="checkboxes">
117 <div class="checkboxes">
119 ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)}
118 ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)}
120 <span class="help-block">
119 <span class="help-block">
121 ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/>
120 ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/>
122 ${_('User will be automatically set as this group owner.')}
121 ${_('User will be automatically set as this group owner.')}
123 </span>
122 </span>
124 </div>
123 </div>
125 </div>
124 </div>
126
125
127 <div class="buttons">
126 <div class="buttons">
128 ${h.submit('save',_('Create User'),class_="btn")}
127 ${h.submit('save',_('Create User'),class_="btn")}
129 </div>
128 </div>
130 </div>
129 </div>
131 </div>
130 </div>
132 ${h.end_form()}
131 ${h.end_form()}
133 </div>
132 </div>
134 <script>
133 <script>
135 $(document).ready(function(){
134 $(document).ready(function(){
136 $('#username').focus();
135 $('#username').focus();
137
136
138 $('#generate_password').on('click', function(e){
137 $('#generate_password').on('click', function(e){
139 var tmpl = "(${_('generated password:')} {0})";
138 var tmpl = "(${_('generated password:')} {0})";
140 var new_passwd = generatePassword(12);
139 var new_passwd = generatePassword(12);
141 $('#generate_password_preview').html(tmpl.format(new_passwd));
140 $('#generate_password_preview').html(tmpl.format(new_passwd));
142 $('#password').val(new_passwd);
141 $('#password').val(new_passwd);
143 $('#password_confirmation').val(new_passwd);
142 $('#password_confirmation').val(new_passwd);
144 })
143 })
145 })
144 })
146 </script>
145 </script>
147 </%def>
146 </%def>
@@ -1,59 +1,58 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('{} user settings').format(c.user.username)}
4 ${_('{} user settings').format(c.user.username)}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
12 &raquo;
14 ${h.link_to(_('Users'),h.route_path('users'))}
13 ${h.link_to(_('Users'),h.route_path('users'))}
15 &raquo;
14 &raquo;
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_nav()">
17 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='admin')}
18 ${self.menu_items(active='admin')}
20 </%def>
19 </%def>
21
20
22 <%def name="menu_bar_subnav()">
21 <%def name="menu_bar_subnav()">
23 ${self.admin_menu(active='users')}
22 ${self.admin_menu(active='users')}
24 </%def>
23 </%def>
25
24
26
25
27 <%def name="main()">
26 <%def name="main()">
28 <div class="box user_settings">
27 <div class="box user_settings">
29 % if not c.user.active:
28 % if not c.user.active:
30 <div class="alert alert-warning text-center" style="margin: 0 0 15px 0">
29 <div class="alert alert-warning text-center" style="margin: 0 0 15px 0">
31 <strong>${_('This user is set as non-active and disabled.')}</strong>
30 <strong>${_('This user is set as non-active and disabled.')}</strong>
32 </div>
31 </div>
33 % endif
32 % endif
34
33
35 ##main
34 ##main
36 <div class="sidebar-col-wrapper">
35 <div class="sidebar-col-wrapper">
37 <div class="sidebar">
36 <div class="sidebar">
38 <ul class="nav nav-pills nav-stacked">
37 <ul class="nav nav-pills nav-stacked">
39 <li class="${h.is_active('profile', c.active)}"><a href="${h.route_path('user_edit', user_id=c.user.user_id)}">${_('User Profile')}</a></li>
38 <li class="${h.is_active('profile', c.active)}"><a href="${h.route_path('user_edit', user_id=c.user.user_id)}">${_('User Profile')}</a></li>
40 <li class="${h.is_active('auth_tokens', c.active)}"><a href="${h.route_path('edit_user_auth_tokens', user_id=c.user.user_id)}">${_('Auth tokens')}</a></li>
39 <li class="${h.is_active('auth_tokens', c.active)}"><a href="${h.route_path('edit_user_auth_tokens', user_id=c.user.user_id)}">${_('Auth tokens')}</a></li>
41 <li class="${h.is_active(['ssh_keys','ssh_keys_generate'], c.active)}"><a href="${h.route_path('edit_user_ssh_keys', user_id=c.user.user_id)}">${_('SSH Keys')}</a></li>
40 <li class="${h.is_active(['ssh_keys','ssh_keys_generate'], c.active)}"><a href="${h.route_path('edit_user_ssh_keys', user_id=c.user.user_id)}">${_('SSH Keys')}</a></li>
42 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('user_edit_advanced', user_id=c.user.user_id)}">${_('Advanced')}</a></li>
41 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('user_edit_advanced', user_id=c.user.user_id)}">${_('Advanced')}</a></li>
43 <li class="${h.is_active('global_perms', c.active)}"><a href="${h.route_path('user_edit_global_perms', user_id=c.user.user_id)}">${_('Global permissions')}</a></li>
42 <li class="${h.is_active('global_perms', c.active)}"><a href="${h.route_path('user_edit_global_perms', user_id=c.user.user_id)}">${_('Global permissions')}</a></li>
44 <li class="${h.is_active('perms_summary', c.active)}"><a href="${h.route_path('edit_user_perms_summary', user_id=c.user.user_id)}">${_('Permissions summary')}</a></li>
43 <li class="${h.is_active('perms_summary', c.active)}"><a href="${h.route_path('edit_user_perms_summary', user_id=c.user.user_id)}">${_('Permissions summary')}</a></li>
45 <li class="${h.is_active('emails', c.active)}"><a href="${h.route_path('edit_user_emails', user_id=c.user.user_id)}">${_('Emails')}</a></li>
44 <li class="${h.is_active('emails', c.active)}"><a href="${h.route_path('edit_user_emails', user_id=c.user.user_id)}">${_('Emails')}</a></li>
46 <li class="${h.is_active('ips', c.active)}"><a href="${h.route_path('edit_user_ips', user_id=c.user.user_id)}">${_('Ip Whitelist')}</a></li>
45 <li class="${h.is_active('ips', c.active)}"><a href="${h.route_path('edit_user_ips', user_id=c.user.user_id)}">${_('Ip Whitelist')}</a></li>
47 <li class="${h.is_active('groups', c.active)}"><a href="${h.route_path('edit_user_groups_management', user_id=c.user.user_id)}">${_('User Groups Management')}</a></li>
46 <li class="${h.is_active('groups', c.active)}"><a href="${h.route_path('edit_user_groups_management', user_id=c.user.user_id)}">${_('User Groups Management')}</a></li>
48 <li class="${h.is_active('audit', c.active)}"><a href="${h.route_path('edit_user_audit_logs', user_id=c.user.user_id)}">${_('Audit logs')}</a></li>
47 <li class="${h.is_active('audit', c.active)}"><a href="${h.route_path('edit_user_audit_logs', user_id=c.user.user_id)}">${_('Audit logs')}</a></li>
49 <li class="${h.is_active('caches', c.active)}"><a href="${h.route_path('edit_user_caches', user_id=c.user.user_id)}">${_('Caches')}</a></li>
48 <li class="${h.is_active('caches', c.active)}"><a href="${h.route_path('edit_user_caches', user_id=c.user.user_id)}">${_('Caches')}</a></li>
50 </ul>
49 </ul>
51 </div>
50 </div>
52
51
53 <div class="main-content-full-width">
52 <div class="main-content-full-width">
54 <%include file="/admin/users/user_edit_${c.active}.mako"/>
53 <%include file="/admin/users/user_edit_${c.active}.mako"/>
55 </div>
54 </div>
56 </div>
55 </div>
57 </div>
56 </div>
58
57
59 </%def>
58 </%def>
@@ -1,27 +1,26 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4
3
5 <div class="panel panel-default">
4 <div class="panel panel-default">
6 <div class="panel-heading">
5 <div class="panel-heading">
7 <h3 class="panel-title">
6 <h3 class="panel-title">
8 ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')}
7 ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')}
9 &nbsp;- ${_('Audit Logs')}
8 &nbsp;- ${_('Audit Logs')}
10 (${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)})
9 (${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)})
11 </h3>
10 </h3>
12 <a href="${h.route_path('edit_user_audit_logs_download', user_id=c.user.user_id)}" class="panel-edit">${_('Download as JSON')}</a>
11 <a href="${h.route_path('edit_user_audit_logs_download', user_id=c.user.user_id)}" class="panel-edit">${_('Download as JSON')}</a>
13 </div>
12 </div>
14 <div class="panel-body">
13 <div class="panel-body">
15
14
16 ${h.form(None, id_="filter_form", method="get")}
15 ${h.form(None, id_="filter_form", method="get")}
17 <input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
16 <input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
18 <input type='submit' value="${_('filter')}" class="btn" />
17 <input type='submit' value="${_('filter')}" class="btn" />
19 ${h.end_form()}
18 ${h.end_form()}
20
19
21 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
20 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
22 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
21 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
23
22
24 <%include file="/admin/admin_log_base.mako" />
23 <%include file="/admin/admin_log_base.mako" />
25
24
26 </div>
25 </div>
27 </div>
26 </div>
@@ -1,150 +1,149 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4 <div class="panel panel-default">
3 <div class="panel panel-default">
5 <div class="panel-heading">
4 <div class="panel-heading">
6 <h3 class="panel-title">
5 <h3 class="panel-title">
7 ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')}
6 ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')}
8 &nbsp;- ${_('User groups administration')}
7 &nbsp;- ${_('User groups administration')}
9 </h3>
8 </h3>
10 </div>
9 </div>
11 <div class="panel-body">
10 <div class="panel-body">
12 <div class="fields">
11 <div class="fields">
13 <div class="field">
12 <div class="field">
14 <div class="label label-checkbox">
13 <div class="label label-checkbox">
15 <label for="users_group_active">${_('Add user to user group')}:</label>
14 <label for="users_group_active">${_('Add user to user group')}:</label>
16 </div>
15 </div>
17 <div class="input">
16 <div class="input">
18 ${h.text('add_user_to_group', placeholder="user group name", class_="medium")}
17 ${h.text('add_user_to_group', placeholder="user group name", class_="medium")}
19 </div>
18 </div>
20
19
21 </div>
20 </div>
22 </div>
21 </div>
23
22
24 <div class="groups_management">
23 <div class="groups_management">
25 ${h.secure_form(h.route_path('edit_user_groups_management_updates', user_id=c.user.user_id), request=request)}
24 ${h.secure_form(h.route_path('edit_user_groups_management_updates', user_id=c.user.user_id), request=request)}
26 <div id="repos_list_wrap">
25 <div id="repos_list_wrap">
27 <table id="user_group_list_table" class="display"></table>
26 <table id="user_group_list_table" class="display"></table>
28 </div>
27 </div>
29 <div class="buttons">
28 <div class="buttons">
30 ${h.submit('save',_('Save'),class_="btn")}
29 ${h.submit('save',_('Save'),class_="btn")}
31 </div>
30 </div>
32 ${h.end_form()}
31 ${h.end_form()}
33 </div>
32 </div>
34 </div>
33 </div>
35 </div>
34 </div>
36 <script>
35 <script>
37 var api;
36 var api;
38 $(document).ready(function() {
37 $(document).ready(function() {
39
38
40 var get_datatable_count = function(){
39 var get_datatable_count = function(){
41 $('#user_group_count').text(api.page.info().recordsDisplay);
40 $('#user_group_count').text(api.page.info().recordsDisplay);
42 };
41 };
43
42
44 $('#user_group_list_table').on('click', 'a.editor_remove', function (e) {
43 $('#user_group_list_table').on('click', 'a.editor_remove', function (e) {
45 e.preventDefault();
44 e.preventDefault();
46 var row = api.row($(this).closest('tr'));
45 var row = api.row($(this).closest('tr'));
47 row.remove().draw();
46 row.remove().draw();
48 } );
47 } );
49
48
50 $('#user_group_list_table').DataTable({
49 $('#user_group_list_table').DataTable({
51 data: ${c.groups|n},
50 data: ${c.groups|n},
52 dom: 'rtp',
51 dom: 'rtp',
53 pageLength: ${c.visual.admin_grid_items},
52 pageLength: ${c.visual.admin_grid_items},
54 order: [[ 0, "asc" ]],
53 order: [[ 0, "asc" ]],
55 columns: [
54 columns: [
56 { data: {"_": "group_name",
55 { data: {"_": "group_name",
57 "sort": "group_name"}, title: "${_('Name')}", className: "td-componentname," ,
56 "sort": "group_name"}, title: "${_('Name')}", className: "td-componentname," ,
58 render: function (data,type,full,meta)
57 render: function (data,type,full,meta)
59 {return '<div><i class="icon-user-group" title="User group">'+data+'</i></div>'}},
58 {return '<div><i class="icon-user-group" title="User group">'+data+'</i></div>'}},
60
59
61 { data: {"_": "group_description",
60 { data: {"_": "group_description",
62 "sort": "group_description"}, title: "${_('Description')}", className: "td-description" },
61 "sort": "group_description"}, title: "${_('Description')}", className: "td-description" },
63 { data: {"_": "users_group_id"}, className: "td-user",
62 { data: {"_": "users_group_id"}, className: "td-user",
64 render: function (data,type,full,meta)
63 render: function (data,type,full,meta)
65 {return '<input type="hidden" name="users_group_id" value="'+data+'">'}},
64 {return '<input type="hidden" name="users_group_id" value="'+data+'">'}},
66 { data: {"_": "active",
65 { data: {"_": "active",
67 "sort": "active"}, title: "${_('Active')}", className: "td-active"},
66 "sort": "active"}, title: "${_('Active')}", className: "td-active"},
68 { data: {"_": "owner_data"}, title: "${_('Owner')}", className: "td-user",
67 { data: {"_": "owner_data"}, title: "${_('Owner')}", className: "td-user",
69 render: function (data,type,full,meta)
68 render: function (data,type,full,meta)
70 {return '<div class="rc-user tooltip">'+
69 {return '<div class="rc-user tooltip">'+
71 '<img class="gravatar" src="'+ data.owner_icon +'" height="16" width="16">'+
70 '<img class="gravatar" src="'+ data.owner_icon +'" height="16" width="16">'+
72 data.owner +'</div>'
71 data.owner +'</div>'
73 }
72 }
74 },
73 },
75 { data: null,
74 { data: null,
76 title: "${_('Action')}",
75 title: "${_('Action')}",
77 className: "td-action",
76 className: "td-action",
78 defaultContent: '-'
77 defaultContent: '-'
79 }
78 }
80 ],
79 ],
81 language: {
80 language: {
82 paginate: DEFAULT_GRID_PAGINATION,
81 paginate: DEFAULT_GRID_PAGINATION,
83 emptyTable: _gettext("No user groups available yet.")
82 emptyTable: _gettext("No user groups available yet.")
84 },
83 },
85 "initComplete": function( settings, json ) {
84 "initComplete": function( settings, json ) {
86 var data_grid = $('#user_group_list_table').dataTable();
85 var data_grid = $('#user_group_list_table').dataTable();
87 api = data_grid.api();
86 api = data_grid.api();
88 get_datatable_count();
87 get_datatable_count();
89 }
88 }
90 });
89 });
91
90
92 // update the counter when doing search
91 // update the counter when doing search
93 $('#user_group_list_table').on( 'search.dt', function (e,settings) {
92 $('#user_group_list_table').on( 'search.dt', function (e,settings) {
94 get_datatable_count();
93 get_datatable_count();
95 });
94 });
96
95
97 // filter, filter both grids
96 // filter, filter both grids
98 $('#q_filter').on( 'keyup', function () {
97 $('#q_filter').on( 'keyup', function () {
99 var user_api = $('#user_group_list_table').dataTable().api();
98 var user_api = $('#user_group_list_table').dataTable().api();
100 user_api
99 user_api
101 .columns(0)
100 .columns(0)
102 .search(this.value)
101 .search(this.value)
103 .draw();
102 .draw();
104 });
103 });
105
104
106 // refilter table if page load via back button
105 // refilter table if page load via back button
107 $("#q_filter").trigger('keyup');
106 $("#q_filter").trigger('keyup');
108
107
109 });
108 });
110
109
111 $('#language').select2({
110 $('#language').select2({
112 'containerCssClass': "drop-menu",
111 'containerCssClass': "drop-menu",
113 'dropdownCssClass': "drop-menu-dropdown",
112 'dropdownCssClass': "drop-menu-dropdown",
114 'dropdownAutoWidth': true
113 'dropdownAutoWidth': true
115 });
114 });
116
115
117
116
118
117
119 $(document).ready(function(){
118 $(document).ready(function(){
120 $("#group_parent_id").select2({
119 $("#group_parent_id").select2({
121 'containerCssClass': "drop-menu",
120 'containerCssClass': "drop-menu",
122 'dropdownCssClass': "drop-menu-dropdown",
121 'dropdownCssClass': "drop-menu-dropdown",
123 'dropdownAutoWidth': true
122 'dropdownAutoWidth': true
124 });
123 });
125
124
126 $('#add_user_to_group').autocomplete({
125 $('#add_user_to_group').autocomplete({
127 serviceUrl: pyroutes.url('user_group_autocomplete_data'),
126 serviceUrl: pyroutes.url('user_group_autocomplete_data'),
128 minChars:2,
127 minChars:2,
129 maxHeight:400,
128 maxHeight:400,
130 width:300,
129 width:300,
131 deferRequestBy: 300, //miliseconds
130 deferRequestBy: 300, //miliseconds
132 showNoSuggestionNotice: true,
131 showNoSuggestionNotice: true,
133 params: { user_groups:true },
132 params: { user_groups:true },
134 formatResult: autocompleteFormatResult,
133 formatResult: autocompleteFormatResult,
135 lookupFilter: autocompleteFilterResult,
134 lookupFilter: autocompleteFilterResult,
136 onSelect: function(element, suggestion){
135 onSelect: function(element, suggestion){
137 var owner = {owner_icon: suggestion.owner_icon, owner:suggestion.owner};
136 var owner = {owner_icon: suggestion.owner_icon, owner:suggestion.owner};
138 api.row.add(
137 api.row.add(
139 {"active": suggestion.active,
138 {"active": suggestion.active,
140 "owner_data": owner,
139 "owner_data": owner,
141 "users_group_id": suggestion.id,
140 "users_group_id": suggestion.id,
142 "group_description": suggestion.description,
141 "group_description": suggestion.description,
143 "group_name": suggestion.value}).draw();
142 "group_name": suggestion.value}).draw();
144 }
143 }
145 });
144 });
146 })
145 })
147
146
148 </script>
147 </script>
149
148
150
149
@@ -1,126 +1,125 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Users administration')}
4 ${_('Users administration')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
13 ${self.menu_items(active='admin')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='users')}
17 ${self.admin_menu(active='users')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22
21
23 <div class="box">
22 <div class="box">
24
23
25 <div class="title">
24 <div class="title">
26 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
25 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
27 <span id="user_count">0</span>
26 <span id="user_count">0</span>
28
27
29 <ul class="links">
28 <ul class="links">
30 <li>
29 <li>
31 <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a>
30 <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a>
32 </li>
31 </li>
33 </ul>
32 </ul>
34 </div>
33 </div>
35
34
36 <div id="repos_list_wrap">
35 <div id="repos_list_wrap">
37 <table id="user_list_table" class="display"></table>
36 <table id="user_list_table" class="display"></table>
38 </div>
37 </div>
39 </div>
38 </div>
40
39
41 <script type="text/javascript">
40 <script type="text/javascript">
42
41
43 $(document).ready(function() {
42 $(document).ready(function() {
44 var $userListTable = $('#user_list_table');
43 var $userListTable = $('#user_list_table');
45 // user list
44 // user list
46 $userListTable.DataTable({
45 $userListTable.DataTable({
47 processing: true,
46 processing: true,
48 serverSide: true,
47 serverSide: true,
49 ajax: {
48 ajax: {
50 "url": "${h.route_path('users_data')}",
49 "url": "${h.route_path('users_data')}",
51 "dataSrc": function ( json ) {
50 "dataSrc": function ( json ) {
52 var filteredCount = json.recordsFiltered;
51 var filteredCount = json.recordsFiltered;
53 var filteredInactiveCount = json.recordsFilteredInactive;
52 var filteredInactiveCount = json.recordsFilteredInactive;
54 var totalInactive = json.recordsTotalInactive;
53 var totalInactive = json.recordsTotalInactive;
55 var total = json.recordsTotal;
54 var total = json.recordsTotal;
56
55
57 var _text = _gettext(
56 var _text = _gettext(
58 "{0} ({1} inactive) of {2} users ({3} inactive)").format(
57 "{0} ({1} inactive) of {2} users ({3} inactive)").format(
59 filteredCount, filteredInactiveCount, total, totalInactive);
58 filteredCount, filteredInactiveCount, total, totalInactive);
60
59
61 if(total === filteredCount){
60 if(total === filteredCount){
62 _text = _gettext(
61 _text = _gettext(
63 "{0} users ({1} inactive)").format(total, totalInactive);
62 "{0} users ({1} inactive)").format(total, totalInactive);
64 }
63 }
65 $('#user_count').text(_text);
64 $('#user_count').text(_text);
66 return json.data;
65 return json.data;
67 }
66 }
68 },
67 },
69 dom: 'rtp',
68 dom: 'rtp',
70 pageLength: ${c.visual.admin_grid_items},
69 pageLength: ${c.visual.admin_grid_items},
71 order: [[ 0, "asc" ]],
70 order: [[ 0, "asc" ]],
72 columns: [
71 columns: [
73 { data: {"_": "username",
72 { data: {"_": "username",
74 "sort": "username"}, title: "${_('Username')}", className: "td-user" },
73 "sort": "username"}, title: "${_('Username')}", className: "td-user" },
75 { data: {"_": "email",
74 { data: {"_": "email",
76 "sort": "email"}, title: "${_('Email')}", className: "td-email" },
75 "sort": "email"}, title: "${_('Email')}", className: "td-email" },
77 { data: {"_": "first_name",
76 { data: {"_": "first_name",
78 "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" },
77 "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" },
79 { data: {"_": "last_name",
78 { data: {"_": "last_name",
80 "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" },
79 "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" },
81 { data: {"_": "last_activity",
80 { data: {"_": "last_activity",
82 "sort": "last_activity",
81 "sort": "last_activity",
83 "type": Number}, title: "${_('Last activity')}", className: "td-time" },
82 "type": Number}, title: "${_('Last activity')}", className: "td-time" },
84 { data: {"_": "active",
83 { data: {"_": "active",
85 "sort": "active"}, title: "${_('Active')}", className: "td-active" },
84 "sort": "active"}, title: "${_('Active')}", className: "td-active" },
86 { data: {"_": "admin",
85 { data: {"_": "admin",
87 "sort": "admin"}, title: "${_('Super-admin')}", className: "td-admin" },
86 "sort": "admin"}, title: "${_('Super-admin')}", className: "td-admin" },
88 { data: {"_": "extern_type",
87 { data: {"_": "extern_type",
89 "sort": "extern_type"}, title: "${_('Auth type')}", className: "td-type" },
88 "sort": "extern_type"}, title: "${_('Auth type')}", className: "td-type" },
90 { data: {"_": "action",
89 { data: {"_": "action",
91 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
90 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
92 ],
91 ],
93 language: {
92 language: {
94 paginate: DEFAULT_GRID_PAGINATION,
93 paginate: DEFAULT_GRID_PAGINATION,
95 sProcessing: _gettext('loading...'),
94 sProcessing: _gettext('loading...'),
96 emptyTable: _gettext("No users available yet.")
95 emptyTable: _gettext("No users available yet.")
97 },
96 },
98
97
99 "createdRow": function ( row, data, index ) {
98 "createdRow": function ( row, data, index ) {
100 if (!data['active_raw']){
99 if (!data['active_raw']){
101 $(row).addClass('closed')
100 $(row).addClass('closed')
102 }
101 }
103 }
102 }
104 });
103 });
105
104
106 $userListTable.on('xhr.dt', function(e, settings, json, xhr){
105 $userListTable.on('xhr.dt', function(e, settings, json, xhr){
107 $userListTable.css('opacity', 1);
106 $userListTable.css('opacity', 1);
108 });
107 });
109
108
110 $userListTable.on('preXhr.dt', function(e, settings, data){
109 $userListTable.on('preXhr.dt', function(e, settings, data){
111 $userListTable.css('opacity', 0.3);
110 $userListTable.css('opacity', 0.3);
112 });
111 });
113
112
114 // filter
113 // filter
115 $('#q_filter').on('keyup',
114 $('#q_filter').on('keyup',
116 $.debounce(250, function() {
115 $.debounce(250, function() {
117 $userListTable.DataTable().search(
116 $userListTable.DataTable().search(
118 $('#q_filter').val()
117 $('#q_filter').val()
119 ).draw();
118 ).draw();
120 })
119 })
121 );
120 );
122
121
123 });
122 });
124 </script>
123 </script>
125
124
126 </%def>
125 </%def>
@@ -1,28 +1,27 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('{} Artifacts').format(c.repo_name)}
4 ${_('{} Artifacts').format(c.repo_name)}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='repositories')}
13 ${self.menu_items(active='repositories')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.repo_menu(active='artifacts')}
17 ${self.repo_menu(active='artifacts')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23
22
24 <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4>
23 <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4>
25 ##<img style="width: 100%; height: 100%" src="${h.asset('images/ee_features/repo_artifacts.png')}"/>
24 ##<img style="width: 100%; height: 100%" src="${h.asset('images/ee_features/repo_artifacts.png')}"/>
26 </div>
25 </div>
27
26
28 </%def>
27 </%def>
@@ -1,1263 +1,1262 b''
1 ## -*- coding: utf-8 -*-
2
1
3 <%!
2 <%!
4 from rhodecode.lib import html_filters
3 from rhodecode.lib import html_filters
5 %>
4 %>
6
5
7 <%inherit file="root.mako"/>
6 <%inherit file="root.mako"/>
8
7
9 <%include file="/ejs_templates/templates.html"/>
8 <%include file="/ejs_templates/templates.html"/>
10
9
11 <div class="outerwrapper">
10 <div class="outerwrapper">
12 <!-- HEADER -->
11 <!-- HEADER -->
13 <div class="header">
12 <div class="header">
14 <div id="header-inner" class="wrapper">
13 <div id="header-inner" class="wrapper">
15 <div id="logo">
14 <div id="logo">
16 <div class="logo-wrapper">
15 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
16 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
18 </div>
17 </div>
19 % if c.rhodecode_name:
18 % if c.rhodecode_name:
20 <div class="branding">
19 <div class="branding">
21 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
20 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
22 </div>
21 </div>
23 % endif
22 % endif
24 </div>
23 </div>
25 <!-- MENU BAR NAV -->
24 <!-- MENU BAR NAV -->
26 ${self.menu_bar_nav()}
25 ${self.menu_bar_nav()}
27 <!-- END MENU BAR NAV -->
26 <!-- END MENU BAR NAV -->
28 </div>
27 </div>
29 </div>
28 </div>
30 ${self.menu_bar_subnav()}
29 ${self.menu_bar_subnav()}
31 <!-- END HEADER -->
30 <!-- END HEADER -->
32
31
33 <!-- CONTENT -->
32 <!-- CONTENT -->
34 <div id="content" class="wrapper">
33 <div id="content" class="wrapper">
35
34
36 <rhodecode-toast id="notifications"></rhodecode-toast>
35 <rhodecode-toast id="notifications"></rhodecode-toast>
37
36
38 <div class="main">
37 <div class="main">
39 ${next.main()}
38 ${next.main()}
40 </div>
39 </div>
41
40
42 </div>
41 </div>
43 <!-- END CONTENT -->
42 <!-- END CONTENT -->
44
43
45 </div>
44 </div>
46
45
47 <!-- FOOTER -->
46 <!-- FOOTER -->
48 <div id="footer">
47 <div id="footer">
49 <div id="footer-inner" class="title wrapper">
48 <div id="footer-inner" class="title wrapper">
50 <div>
49 <div>
51 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
50 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
52
51
53 <p class="footer-link-right">
52 <p class="footer-link-right">
54 <a class="grey-link-action" href="${h.route_path('home', _query={'showrcid': 1})}">
53 <a class="grey-link-action" href="${h.route_path('home', _query={'showrcid': 1})}">
55 RhodeCode
54 RhodeCode
56 % if c.visual.show_version:
55 % if c.visual.show_version:
57 ${c.rhodecode_version}
56 ${c.rhodecode_version}
58 % endif
57 % endif
59 ${c.rhodecode_edition}
58 ${c.rhodecode_edition}
60 </a> |
59 </a> |
61
60
62 % if c.visual.rhodecode_support_url:
61 % if c.visual.rhodecode_support_url:
63 <a class="grey-link-action" href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
62 <a class="grey-link-action" href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
64 <a class="grey-link-action" href="https://docs.rhodecode.com" target="_blank">${_('Documentation')}</a>
63 <a class="grey-link-action" href="https://docs.rhodecode.com" target="_blank">${_('Documentation')}</a>
65 % endif
64 % endif
66
65
67 </p>
66 </p>
68
67
69 <p class="server-instance" style="display:${sid}">
68 <p class="server-instance" style="display:${sid}">
70 ## display hidden instance ID if specially defined
69 ## display hidden instance ID if specially defined
71 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
70 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
72 % if c.rhodecode_instanceid:
71 % if c.rhodecode_instanceid:
73 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
72 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
74 % endif
73 % endif
75 </p>
74 </p>
76 </div>
75 </div>
77 </div>
76 </div>
78 </div>
77 </div>
79
78
80 <!-- END FOOTER -->
79 <!-- END FOOTER -->
81
80
82 ### MAKO DEFS ###
81 ### MAKO DEFS ###
83
82
84 <%def name="menu_bar_subnav()">
83 <%def name="menu_bar_subnav()">
85 </%def>
84 </%def>
86
85
87 <%def name="breadcrumbs(class_='breadcrumbs')">
86 <%def name="breadcrumbs(class_='breadcrumbs')">
88 <div class="${class_}">
87 <div class="${class_}">
89 ${self.breadcrumbs_links()}
88 ${self.breadcrumbs_links()}
90 </div>
89 </div>
91 </%def>
90 </%def>
92
91
93 <%def name="admin_menu(active=None)">
92 <%def name="admin_menu(active=None)">
94
93
95 <div id="context-bar">
94 <div id="context-bar">
96 <div class="wrapper">
95 <div class="wrapper">
97 <div class="title">
96 <div class="title">
98 <div class="title-content">
97 <div class="title-content">
99 <div class="title-main">
98 <div class="title-main">
100 % if c.is_super_admin:
99 % if c.is_super_admin:
101 ${_('Super-admin Panel')}
100 ${_('Super-admin Panel')}
102 % else:
101 % else:
103 ${_('Delegated Admin Panel')}
102 ${_('Delegated Admin Panel')}
104 % endif
103 % endif
105 </div>
104 </div>
106 </div>
105 </div>
107 </div>
106 </div>
108
107
109 <ul id="context-pages" class="navigation horizontal-list">
108 <ul id="context-pages" class="navigation horizontal-list">
110
109
111 ## super-admin case
110 ## super-admin case
112 % if c.is_super_admin:
111 % if c.is_super_admin:
113 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
112 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
114 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
113 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
115 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
114 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
116 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
115 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
117 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
116 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
118 <li class="${h.is_active('artifacts', active)}"><a href="${h.route_path('admin_artifacts')}">${_('Artifacts')}</a></li>
117 <li class="${h.is_active('artifacts', active)}"><a href="${h.route_path('admin_artifacts')}">${_('Artifacts')}</a></li>
119 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
118 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
120 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
119 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
121 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
120 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
122 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
121 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
123 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
122 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
124
123
125 ## delegated admin
124 ## delegated admin
126 % elif c.is_delegated_admin:
125 % elif c.is_delegated_admin:
127 <%
126 <%
128 repositories=c.auth_user.repositories_admin or c.can_create_repo
127 repositories=c.auth_user.repositories_admin or c.can_create_repo
129 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
128 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
130 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
129 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
131 %>
130 %>
132
131
133 %if repositories:
132 %if repositories:
134 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
133 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
135 %endif
134 %endif
136 %if repository_groups:
135 %if repository_groups:
137 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
136 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
138 %endif
137 %endif
139 %if user_groups:
138 %if user_groups:
140 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
139 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
141 %endif
140 %endif
142 % endif
141 % endif
143 </ul>
142 </ul>
144
143
145 </div>
144 </div>
146 <div class="clear"></div>
145 <div class="clear"></div>
147 </div>
146 </div>
148 </%def>
147 </%def>
149
148
150 <%def name="dt_info_panel(elements)">
149 <%def name="dt_info_panel(elements)">
151 <dl class="dl-horizontal">
150 <dl class="dl-horizontal">
152 %for dt, dd, title, show_items in elements:
151 %for dt, dd, title, show_items in elements:
153 <dt>${dt}:</dt>
152 <dt>${dt}:</dt>
154 <dd title="${h.tooltip(title)}">
153 <dd title="${h.tooltip(title)}">
155 %if callable(dd):
154 %if callable(dd):
156 ## allow lazy evaluation of elements
155 ## allow lazy evaluation of elements
157 ${dd()}
156 ${dd()}
158 %else:
157 %else:
159 ${dd}
158 ${dd}
160 %endif
159 %endif
161 %if show_items:
160 %if show_items:
162 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
161 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
163 %endif
162 %endif
164 </dd>
163 </dd>
165
164
166 %if show_items:
165 %if show_items:
167 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
166 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
168 %for item in show_items:
167 %for item in show_items:
169 <dt></dt>
168 <dt></dt>
170 <dd>${item}</dd>
169 <dd>${item}</dd>
171 %endfor
170 %endfor
172 </div>
171 </div>
173 %endif
172 %endif
174
173
175 %endfor
174 %endfor
176 </dl>
175 </dl>
177 </%def>
176 </%def>
178
177
179 <%def name="tr_info_entry(element)">
178 <%def name="tr_info_entry(element)">
180 <% key, val, title, show_items = element %>
179 <% key, val, title, show_items = element %>
181
180
182 <tr>
181 <tr>
183 <td style="vertical-align: top">${key}</td>
182 <td style="vertical-align: top">${key}</td>
184 <td title="${h.tooltip(title)}">
183 <td title="${h.tooltip(title)}">
185 %if callable(val):
184 %if callable(val):
186 ## allow lazy evaluation of elements
185 ## allow lazy evaluation of elements
187 ${val()}
186 ${val()}
188 %else:
187 %else:
189 ${val}
188 ${val}
190 %endif
189 %endif
191 %if show_items:
190 %if show_items:
192 <div class="collapsable-content" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details" style="display: none">
191 <div class="collapsable-content" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details" style="display: none">
193 % for item in show_items:
192 % for item in show_items:
194 <dt></dt>
193 <dt></dt>
195 <dd>${item}</dd>
194 <dd>${item}</dd>
196 % endfor
195 % endfor
197 </div>
196 </div>
198 %endif
197 %endif
199 </td>
198 </td>
200 <td style="vertical-align: top">
199 <td style="vertical-align: top">
201 %if show_items:
200 %if show_items:
202 <span class="btn-collapse" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details">${_('Show More')} </span>
201 <span class="btn-collapse" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details">${_('Show More')} </span>
203 %endif
202 %endif
204 </td>
203 </td>
205 </tr>
204 </tr>
206
205
207 </%def>
206 </%def>
208
207
209 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None, extra_class=None)">
208 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None, extra_class=None)">
210 <%
209 <%
211 if size > 16:
210 if size > 16:
212 gravatar_class = ['gravatar','gravatar-large']
211 gravatar_class = ['gravatar','gravatar-large']
213 else:
212 else:
214 gravatar_class = ['gravatar']
213 gravatar_class = ['gravatar']
215
214
216 data_hovercard_url = ''
215 data_hovercard_url = ''
217 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
216 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
218
217
219 if tooltip:
218 if tooltip:
220 gravatar_class += ['tooltip-hovercard']
219 gravatar_class += ['tooltip-hovercard']
221 if extra_class:
220 if extra_class:
222 gravatar_class += extra_class
221 gravatar_class += extra_class
223 if tooltip and user:
222 if tooltip and user:
224 if user.username == h.DEFAULT_USER:
223 if user.username == h.DEFAULT_USER:
225 gravatar_class.pop(-1)
224 gravatar_class.pop(-1)
226 else:
225 else:
227 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
226 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
228 gravatar_class = ' '.join(gravatar_class)
227 gravatar_class = ' '.join(gravatar_class)
229
228
230 %>
229 %>
231 <%doc>
230 <%doc>
232 TODO: johbo: For now we serve double size images to make it smooth
231 TODO: johbo: For now we serve double size images to make it smooth
233 for retina. This is how it worked until now. Should be replaced
232 for retina. This is how it worked until now. Should be replaced
234 with a better solution at some point.
233 with a better solution at some point.
235 </%doc>
234 </%doc>
236
235
237 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2)}" />
236 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2)}" />
238 </%def>
237 </%def>
239
238
240
239
241 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False, _class='rc-user')">
240 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False, _class='rc-user')">
242 <%
241 <%
243 email = h.email_or_none(contact)
242 email = h.email_or_none(contact)
244 rc_user = h.discover_user(contact)
243 rc_user = h.discover_user(contact)
245 %>
244 %>
246
245
247 <div class="${_class}">
246 <div class="${_class}">
248 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
247 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
249 <span class="${('user user-disabled' if show_disabled else 'user')}">
248 <span class="${('user user-disabled' if show_disabled else 'user')}">
250 ${h.link_to_user(rc_user or contact)}
249 ${h.link_to_user(rc_user or contact)}
251 </span>
250 </span>
252 </div>
251 </div>
253 </%def>
252 </%def>
254
253
255
254
256 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
255 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
257 <%
256 <%
258 if (size > 16):
257 if (size > 16):
259 gravatar_class = 'icon-user-group-alt'
258 gravatar_class = 'icon-user-group-alt'
260 else:
259 else:
261 gravatar_class = 'icon-user-group-alt'
260 gravatar_class = 'icon-user-group-alt'
262
261
263 if tooltip:
262 if tooltip:
264 gravatar_class += ' tooltip-hovercard'
263 gravatar_class += ' tooltip-hovercard'
265
264
266 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
265 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
267 %>
266 %>
268 <%doc>
267 <%doc>
269 TODO: johbo: For now we serve double size images to make it smooth
268 TODO: johbo: For now we serve double size images to make it smooth
270 for retina. This is how it worked until now. Should be replaced
269 for retina. This is how it worked until now. Should be replaced
271 with a better solution at some point.
270 with a better solution at some point.
272 </%doc>
271 </%doc>
273
272
274 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
273 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
275 </%def>
274 </%def>
276
275
277 <%def name="repo_page_title(repo_instance)">
276 <%def name="repo_page_title(repo_instance)">
278 <div class="title-content repo-title">
277 <div class="title-content repo-title">
279
278
280 <div class="title-main">
279 <div class="title-main">
281 ## SVN/HG/GIT icons
280 ## SVN/HG/GIT icons
282 %if h.is_hg(repo_instance):
281 %if h.is_hg(repo_instance):
283 <i class="icon-hg"></i>
282 <i class="icon-hg"></i>
284 %endif
283 %endif
285 %if h.is_git(repo_instance):
284 %if h.is_git(repo_instance):
286 <i class="icon-git"></i>
285 <i class="icon-git"></i>
287 %endif
286 %endif
288 %if h.is_svn(repo_instance):
287 %if h.is_svn(repo_instance):
289 <i class="icon-svn"></i>
288 <i class="icon-svn"></i>
290 %endif
289 %endif
291
290
292 ## public/private
291 ## public/private
293 %if repo_instance.private:
292 %if repo_instance.private:
294 <i class="icon-repo-private"></i>
293 <i class="icon-repo-private"></i>
295 %else:
294 %else:
296 <i class="icon-repo-public"></i>
295 <i class="icon-repo-public"></i>
297 %endif
296 %endif
298
297
299 ## repo name with group name
298 ## repo name with group name
300 ${h.breadcrumb_repo_link(repo_instance)}
299 ${h.breadcrumb_repo_link(repo_instance)}
301
300
302 ## Context Actions
301 ## Context Actions
303 <div class="pull-right">
302 <div class="pull-right">
304 %if c.rhodecode_user.username != h.DEFAULT_USER:
303 %if c.rhodecode_user.username != h.DEFAULT_USER:
305 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
304 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
306
305
307 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
306 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
308 % if c.repository_is_user_following:
307 % if c.repository_is_user_following:
309 <i class="icon-eye-off"></i>${_('Unwatch')}
308 <i class="icon-eye-off"></i>${_('Unwatch')}
310 % else:
309 % else:
311 <i class="icon-eye"></i>${_('Watch')}
310 <i class="icon-eye"></i>${_('Watch')}
312 % endif
311 % endif
313
312
314 </a>
313 </a>
315 %else:
314 %else:
316 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
315 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
317 %endif
316 %endif
318 </div>
317 </div>
319
318
320 </div>
319 </div>
321
320
322 ## FORKED
321 ## FORKED
323 %if repo_instance.fork:
322 %if repo_instance.fork:
324 <p class="discreet">
323 <p class="discreet">
325 <i class="icon-code-fork"></i> ${_('Fork of')}
324 <i class="icon-code-fork"></i> ${_('Fork of')}
326 ${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))}
325 ${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))}
327 </p>
326 </p>
328 %endif
327 %endif
329
328
330 ## IMPORTED FROM REMOTE
329 ## IMPORTED FROM REMOTE
331 %if repo_instance.clone_uri:
330 %if repo_instance.clone_uri:
332 <p class="discreet">
331 <p class="discreet">
333 <i class="icon-code-fork"></i> ${_('Clone from')}
332 <i class="icon-code-fork"></i> ${_('Clone from')}
334 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
333 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
335 </p>
334 </p>
336 %endif
335 %endif
337
336
338 ## LOCKING STATUS
337 ## LOCKING STATUS
339 %if repo_instance.locked[0]:
338 %if repo_instance.locked[0]:
340 <p class="locking_locked discreet">
339 <p class="locking_locked discreet">
341 <i class="icon-repo-lock"></i>
340 <i class="icon-repo-lock"></i>
342 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
341 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
343 </p>
342 </p>
344 %elif repo_instance.enable_locking:
343 %elif repo_instance.enable_locking:
345 <p class="locking_unlocked discreet">
344 <p class="locking_unlocked discreet">
346 <i class="icon-repo-unlock"></i>
345 <i class="icon-repo-unlock"></i>
347 ${_('Repository not locked. Pull repository to lock it.')}
346 ${_('Repository not locked. Pull repository to lock it.')}
348 </p>
347 </p>
349 %endif
348 %endif
350
349
351 </div>
350 </div>
352 </%def>
351 </%def>
353
352
354 <%def name="repo_menu(active=None)">
353 <%def name="repo_menu(active=None)">
355 <%
354 <%
356 ## determine if we have "any" option available
355 ## determine if we have "any" option available
357 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
356 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
358 has_actions = can_lock
357 has_actions = can_lock
359
358
360 %>
359 %>
361 % if c.rhodecode_db_repo.archived:
360 % if c.rhodecode_db_repo.archived:
362 <div class="alert alert-warning text-center">
361 <div class="alert alert-warning text-center">
363 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
362 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
364 </div>
363 </div>
365 % endif
364 % endif
366
365
367 <!--- REPO CONTEXT BAR -->
366 <!--- REPO CONTEXT BAR -->
368 <div id="context-bar">
367 <div id="context-bar">
369 <div class="wrapper">
368 <div class="wrapper">
370
369
371 <div class="title">
370 <div class="title">
372 ${self.repo_page_title(c.rhodecode_db_repo)}
371 ${self.repo_page_title(c.rhodecode_db_repo)}
373 </div>
372 </div>
374
373
375 <ul id="context-pages" class="navigation horizontal-list">
374 <ul id="context-pages" class="navigation horizontal-list">
376 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary_explicit', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
375 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary_explicit', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
377 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
376 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
378 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.repo_files_by_ref_url(c.repo_name, c.rhodecode_db_repo.repo_type, f_path='', ref_name=c.rhodecode_db_repo.landing_ref_name, commit_id='tip', query={'at':c.rhodecode_db_repo.landing_ref_name})}"><div class="menulabel">${_('Files')}</div></a></li>
377 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.repo_files_by_ref_url(c.repo_name, c.rhodecode_db_repo.repo_type, f_path='', ref_name=c.rhodecode_db_repo.landing_ref_name, commit_id='tip', query={'at':c.rhodecode_db_repo.landing_ref_name})}"><div class="menulabel">${_('Files')}</div></a></li>
379 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
378 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
380
379
381 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
380 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
382 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
381 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
383 <li class="${h.is_active('showpullrequest', active)}">
382 <li class="${h.is_active('showpullrequest', active)}">
384 <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)}">
383 <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)}">
385 <div class="menulabel">
384 <div class="menulabel">
386 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
385 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
387 </div>
386 </div>
388 </a>
387 </a>
389 </li>
388 </li>
390 %endif
389 %endif
391
390
392 <li class="${h.is_active('artifacts', active)}">
391 <li class="${h.is_active('artifacts', active)}">
393 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
392 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
394 <div class="menulabel">
393 <div class="menulabel">
395 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
394 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
396 </div>
395 </div>
397 </a>
396 </a>
398 </li>
397 </li>
399
398
400 %if not c.rhodecode_db_repo.archived and h.HasRepoPermissionAll('repository.admin')(c.repo_name):
399 %if not c.rhodecode_db_repo.archived and h.HasRepoPermissionAll('repository.admin')(c.repo_name):
401 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
400 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
402 %endif
401 %endif
403
402
404 <li class="${h.is_active('options', active)}">
403 <li class="${h.is_active('options', active)}">
405 % if has_actions:
404 % if has_actions:
406 <a class="menulink dropdown">
405 <a class="menulink dropdown">
407 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
406 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
408 </a>
407 </a>
409 <ul class="submenu">
408 <ul class="submenu">
410 %if can_lock:
409 %if can_lock:
411 %if c.rhodecode_db_repo.locked[0]:
410 %if c.rhodecode_db_repo.locked[0]:
412 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
411 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
413 %else:
412 %else:
414 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
413 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
415 %endif
414 %endif
416 %endif
415 %endif
417 </ul>
416 </ul>
418 % endif
417 % endif
419 </li>
418 </li>
420
419
421 </ul>
420 </ul>
422 </div>
421 </div>
423 <div class="clear"></div>
422 <div class="clear"></div>
424 </div>
423 </div>
425
424
426 <!--- REPO END CONTEXT BAR -->
425 <!--- REPO END CONTEXT BAR -->
427
426
428 </%def>
427 </%def>
429
428
430 <%def name="repo_group_page_title(repo_group_instance)">
429 <%def name="repo_group_page_title(repo_group_instance)">
431 <div class="title-content">
430 <div class="title-content">
432 <div class="title-main">
431 <div class="title-main">
433 ## Repository Group icon
432 ## Repository Group icon
434 <i class="icon-repo-group"></i>
433 <i class="icon-repo-group"></i>
435
434
436 ## repo name with group name
435 ## repo name with group name
437 ${h.breadcrumb_repo_group_link(repo_group_instance)}
436 ${h.breadcrumb_repo_group_link(repo_group_instance)}
438 </div>
437 </div>
439
438
440 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
439 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
441 <div class="repo-group-desc discreet">
440 <div class="repo-group-desc discreet">
442 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
441 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
443 </div>
442 </div>
444
443
445 </div>
444 </div>
446 </%def>
445 </%def>
447
446
448
447
449 <%def name="repo_group_menu(active=None)">
448 <%def name="repo_group_menu(active=None)">
450 <%
449 <%
451 gr_name = c.repo_group.group_name if c.repo_group else None
450 gr_name = c.repo_group.group_name if c.repo_group else None
452 # create repositories with write permission on group is set to true
451 # create repositories with write permission on group is set to true
453 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
452 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
454
453
455 %>
454 %>
456
455
457
456
458 <!--- REPO GROUP CONTEXT BAR -->
457 <!--- REPO GROUP CONTEXT BAR -->
459 <div id="context-bar">
458 <div id="context-bar">
460 <div class="wrapper">
459 <div class="wrapper">
461 <div class="title">
460 <div class="title">
462 ${self.repo_group_page_title(c.repo_group)}
461 ${self.repo_group_page_title(c.repo_group)}
463 </div>
462 </div>
464
463
465 <ul id="context-pages" class="navigation horizontal-list">
464 <ul id="context-pages" class="navigation horizontal-list">
466 <li class="${h.is_active('home', active)}">
465 <li class="${h.is_active('home', active)}">
467 <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>
466 <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>
468 </li>
467 </li>
469 % if c.is_super_admin or group_admin:
468 % if c.is_super_admin or group_admin:
470 <li class="${h.is_active('settings', active)}">
469 <li class="${h.is_active('settings', active)}">
471 <a class="menulink" 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')}"><div class="menulabel">${_('Group Settings')}</div></a>
470 <a class="menulink" 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')}"><div class="menulabel">${_('Group Settings')}</div></a>
472 </li>
471 </li>
473 % endif
472 % endif
474
473
475 </ul>
474 </ul>
476 </div>
475 </div>
477 <div class="clear"></div>
476 <div class="clear"></div>
478 </div>
477 </div>
479
478
480 <!--- REPO GROUP CONTEXT BAR -->
479 <!--- REPO GROUP CONTEXT BAR -->
481
480
482 </%def>
481 </%def>
483
482
484
483
485 <%def name="usermenu(active=False)">
484 <%def name="usermenu(active=False)">
486 <%
485 <%
487 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
486 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
488
487
489 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
488 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
490 # create repositories with write permission on group is set to true
489 # create repositories with write permission on group is set to true
491
490
492 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
491 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
493 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
492 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
494 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
493 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
495 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
494 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
496
495
497 can_create_repos = c.is_super_admin or c.can_create_repo
496 can_create_repos = c.is_super_admin or c.can_create_repo
498 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
497 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
499
498
500 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
499 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
501 can_create_repo_groups_in_group = c.is_super_admin or group_admin
500 can_create_repo_groups_in_group = c.is_super_admin or group_admin
502 %>
501 %>
503
502
504 % if not_anonymous:
503 % if not_anonymous:
505 <%
504 <%
506 default_target_group = dict()
505 default_target_group = dict()
507 if c.rhodecode_user.personal_repo_group:
506 if c.rhodecode_user.personal_repo_group:
508 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
507 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
509 %>
508 %>
510
509
511 ## create action
510 ## create action
512 <li>
511 <li>
513 <a href="#create-actions" onclick="return false;" class="menulink childs">
512 <a href="#create-actions" onclick="return false;" class="menulink childs">
514 <i class="icon-plus-circled"></i>
513 <i class="icon-plus-circled"></i>
515 </a>
514 </a>
516
515
517 <div class="action-menu submenu">
516 <div class="action-menu submenu">
518
517
519 <ol>
518 <ol>
520 ## scope of within a repository
519 ## scope of within a repository
521 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
520 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
522 <li class="submenu-title">${_('This Repository')}</li>
521 <li class="submenu-title">${_('This Repository')}</li>
523 <li>
522 <li>
524 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
523 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
525 </li>
524 </li>
526 % if can_fork:
525 % if can_fork:
527 <li>
526 <li>
528 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
527 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
529 </li>
528 </li>
530 % endif
529 % endif
531 % endif
530 % endif
532
531
533 ## scope of within repository groups
532 ## scope of within repository groups
534 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
533 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
535 <li class="submenu-title">${_('This Repository Group')}</li>
534 <li class="submenu-title">${_('This Repository Group')}</li>
536
535
537 % if can_create_repos_in_group:
536 % if can_create_repos_in_group:
538 <li>
537 <li>
539 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
538 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
540 </li>
539 </li>
541 % endif
540 % endif
542
541
543 % if can_create_repo_groups_in_group:
542 % if can_create_repo_groups_in_group:
544 <li>
543 <li>
545 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'New Repository Group')}</a>
544 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'New Repository Group')}</a>
546 </li>
545 </li>
547 % endif
546 % endif
548 % endif
547 % endif
549
548
550 ## personal group
549 ## personal group
551 % if c.rhodecode_user.personal_repo_group:
550 % if c.rhodecode_user.personal_repo_group:
552 <li class="submenu-title">Personal Group</li>
551 <li class="submenu-title">Personal Group</li>
553
552
554 <li>
553 <li>
555 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
554 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
556 </li>
555 </li>
557
556
558 <li>
557 <li>
559 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
558 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
560 </li>
559 </li>
561 % endif
560 % endif
562
561
563 ## Global actions
562 ## Global actions
564 <li class="submenu-title">RhodeCode</li>
563 <li class="submenu-title">RhodeCode</li>
565 % if can_create_repos:
564 % if can_create_repos:
566 <li>
565 <li>
567 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
566 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
568 </li>
567 </li>
569 % endif
568 % endif
570
569
571 % if can_create_repo_groups:
570 % if can_create_repo_groups:
572 <li>
571 <li>
573 <a href="${h.route_path('repo_group_new')}" >${_(u'New Repository Group')}</a>
572 <a href="${h.route_path('repo_group_new')}" >${_(u'New Repository Group')}</a>
574 </li>
573 </li>
575 % endif
574 % endif
576
575
577 <li>
576 <li>
578 <a href="${h.route_path('gists_new')}">${_(u'New Gist')}</a>
577 <a href="${h.route_path('gists_new')}">${_(u'New Gist')}</a>
579 </li>
578 </li>
580
579
581 </ol>
580 </ol>
582
581
583 </div>
582 </div>
584 </li>
583 </li>
585
584
586 ## notifications
585 ## notifications
587 <li>
586 <li>
588 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
587 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
589 ${c.unread_notifications}
588 ${c.unread_notifications}
590 </a>
589 </a>
591 </li>
590 </li>
592 % endif
591 % endif
593
592
594 ## USER MENU
593 ## USER MENU
595 <li id="quick_login_li" class="${'active' if active else ''}">
594 <li id="quick_login_li" class="${'active' if active else ''}">
596 % if c.rhodecode_user.username == h.DEFAULT_USER:
595 % if c.rhodecode_user.username == h.DEFAULT_USER:
597 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
596 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
598 ${gravatar(c.rhodecode_user.email, 20)}
597 ${gravatar(c.rhodecode_user.email, 20)}
599 <span class="user">
598 <span class="user">
600 <span>${_('Sign in')}</span>
599 <span>${_('Sign in')}</span>
601 </span>
600 </span>
602 </a>
601 </a>
603 % else:
602 % else:
604 ## logged in user
603 ## logged in user
605 <a id="quick_login_link" class="menulink childs">
604 <a id="quick_login_link" class="menulink childs">
606 ${gravatar(c.rhodecode_user.email, 20)}
605 ${gravatar(c.rhodecode_user.email, 20)}
607 <span class="user">
606 <span class="user">
608 <span class="menu_link_user">${c.rhodecode_user.username}</span>
607 <span class="menu_link_user">${c.rhodecode_user.username}</span>
609 <div class="show_more"></div>
608 <div class="show_more"></div>
610 </span>
609 </span>
611 </a>
610 </a>
612 ## subnav with menu for logged in user
611 ## subnav with menu for logged in user
613 <div class="user-menu submenu">
612 <div class="user-menu submenu">
614 <div id="quick_login">
613 <div id="quick_login">
615 %if c.rhodecode_user.username != h.DEFAULT_USER:
614 %if c.rhodecode_user.username != h.DEFAULT_USER:
616 <div class="">
615 <div class="">
617 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
616 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
618 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
617 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
619 <div class="email">${c.rhodecode_user.email}</div>
618 <div class="email">${c.rhodecode_user.email}</div>
620 </div>
619 </div>
621 <div class="">
620 <div class="">
622 <ol class="links">
621 <ol class="links">
623 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
622 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
624 % if c.rhodecode_user.personal_repo_group:
623 % if c.rhodecode_user.personal_repo_group:
625 <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>
624 <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>
626 % endif
625 % endif
627 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
626 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
628
627
629 % if c.debug_style:
628 % if c.debug_style:
630 <li>
629 <li>
631 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
630 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
632 <div class="menulabel">${_('[Style]')}</div>
631 <div class="menulabel">${_('[Style]')}</div>
633 </a>
632 </a>
634 </li>
633 </li>
635 % endif
634 % endif
636
635
637 ## bookmark-items
636 ## bookmark-items
638 <li class="bookmark-items">
637 <li class="bookmark-items">
639 ${_('Bookmarks')}
638 ${_('Bookmarks')}
640 <div class="pull-right">
639 <div class="pull-right">
641 <a href="${h.route_path('my_account_bookmarks')}">
640 <a href="${h.route_path('my_account_bookmarks')}">
642
641
643 <i class="icon-cog"></i>
642 <i class="icon-cog"></i>
644 </a>
643 </a>
645 </div>
644 </div>
646 </li>
645 </li>
647 % if not c.bookmark_items:
646 % if not c.bookmark_items:
648 <li>
647 <li>
649 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
648 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
650 </li>
649 </li>
651 % endif
650 % endif
652 % for item in c.bookmark_items:
651 % for item in c.bookmark_items:
653 <li>
652 <li>
654 % if item.repository:
653 % if item.repository:
655 <div>
654 <div>
656 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
655 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
657 <code>${item.position}</code>
656 <code>${item.position}</code>
658 % if item.repository.repo_type == 'hg':
657 % if item.repository.repo_type == 'hg':
659 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
658 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
660 % elif item.repository.repo_type == 'git':
659 % elif item.repository.repo_type == 'git':
661 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
660 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
662 % elif item.repository.repo_type == 'svn':
661 % elif item.repository.repo_type == 'svn':
663 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
662 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
664 % endif
663 % endif
665 ${(item.title or h.shorter(item.repository.repo_name, 30))}
664 ${(item.title or h.shorter(item.repository.repo_name, 30))}
666 </a>
665 </a>
667 </div>
666 </div>
668 % elif item.repository_group:
667 % elif item.repository_group:
669 <div>
668 <div>
670 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
669 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
671 <code>${item.position}</code>
670 <code>${item.position}</code>
672 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
671 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
673 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
672 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
674 </a>
673 </a>
675 </div>
674 </div>
676 % else:
675 % else:
677 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
676 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
678 <code>${item.position}</code>
677 <code>${item.position}</code>
679 ${item.title}
678 ${item.title}
680 </a>
679 </a>
681 % endif
680 % endif
682 </li>
681 </li>
683 % endfor
682 % endfor
684
683
685 <li class="logout">
684 <li class="logout">
686 ${h.secure_form(h.route_path('logout'), request=request)}
685 ${h.secure_form(h.route_path('logout'), request=request)}
687 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
686 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
688 ${h.end_form()}
687 ${h.end_form()}
689 </li>
688 </li>
690 </ol>
689 </ol>
691 </div>
690 </div>
692 %endif
691 %endif
693 </div>
692 </div>
694 </div>
693 </div>
695
694
696 % endif
695 % endif
697 </li>
696 </li>
698 </%def>
697 </%def>
699
698
700 <%def name="menu_items(active=None)">
699 <%def name="menu_items(active=None)">
701 <%
700 <%
702 notice_messages, notice_level = c.rhodecode_user.get_notice_messages()
701 notice_messages, notice_level = c.rhodecode_user.get_notice_messages()
703 notice_display = 'none' if len(notice_messages) == 0 else ''
702 notice_display = 'none' if len(notice_messages) == 0 else ''
704 %>
703 %>
705
704
706 <ul id="quick" class="main_nav navigation horizontal-list">
705 <ul id="quick" class="main_nav navigation horizontal-list">
707 ## notice box for important system messages
706 ## notice box for important system messages
708 <li style="display: ${notice_display}">
707 <li style="display: ${notice_display}">
709 <a class="notice-box" href="#openNotice" onclick="$('.notice-messages-container').toggle(); return false">
708 <a class="notice-box" href="#openNotice" onclick="$('.notice-messages-container').toggle(); return false">
710 <div class="menulabel-notice ${notice_level}" >
709 <div class="menulabel-notice ${notice_level}" >
711 ${len(notice_messages)}
710 ${len(notice_messages)}
712 </div>
711 </div>
713 </a>
712 </a>
714 </li>
713 </li>
715 <div class="notice-messages-container" style="display: none">
714 <div class="notice-messages-container" style="display: none">
716 <div class="notice-messages">
715 <div class="notice-messages">
717 <table class="rctable">
716 <table class="rctable">
718 % for notice in notice_messages:
717 % for notice in notice_messages:
719 <tr id="notice-message-${notice['msg_id']}" class="notice-message-${notice['level']}">
718 <tr id="notice-message-${notice['msg_id']}" class="notice-message-${notice['level']}">
720 <td style="vertical-align: text-top; width: 20px">
719 <td style="vertical-align: text-top; width: 20px">
721 <i class="tooltip icon-info notice-color-${notice['level']}" title="${notice['level']}"></i>
720 <i class="tooltip icon-info notice-color-${notice['level']}" title="${notice['level']}"></i>
722 </td>
721 </td>
723 <td>
722 <td>
724 <span><i class="icon-plus-squared cursor-pointer" onclick="$('#notice-${notice['msg_id']}').toggle()"></i> </span>
723 <span><i class="icon-plus-squared cursor-pointer" onclick="$('#notice-${notice['msg_id']}').toggle()"></i> </span>
725 ${notice['subject']}
724 ${notice['subject']}
726
725
727 <div id="notice-${notice['msg_id']}" style="display: none">
726 <div id="notice-${notice['msg_id']}" style="display: none">
728 ${h.render(notice['body'], renderer='markdown')}
727 ${h.render(notice['body'], renderer='markdown')}
729 </div>
728 </div>
730 </td>
729 </td>
731 <td style="vertical-align: text-top; width: 35px;">
730 <td style="vertical-align: text-top; width: 35px;">
732 <a class="tooltip" title="${_('dismiss')}" href="#dismiss" onclick="dismissNotice(${notice['msg_id']});return false">
731 <a class="tooltip" title="${_('dismiss')}" href="#dismiss" onclick="dismissNotice(${notice['msg_id']});return false">
733 <i class="icon-remove icon-filled-red"></i>
732 <i class="icon-remove icon-filled-red"></i>
734 </a>
733 </a>
735 </td>
734 </td>
736 </tr>
735 </tr>
737
736
738 % endfor
737 % endfor
739 </table>
738 </table>
740 </div>
739 </div>
741 </div>
740 </div>
742 ## Main filter
741 ## Main filter
743 <li>
742 <li>
744 <div class="menulabel main_filter_box">
743 <div class="menulabel main_filter_box">
745 <div class="main_filter_input_box">
744 <div class="main_filter_input_box">
746 <ul class="searchItems">
745 <ul class="searchItems">
747
746
748 <li class="searchTag searchTagIcon">
747 <li class="searchTag searchTagIcon">
749 <i class="icon-search"></i>
748 <i class="icon-search"></i>
750 </li>
749 </li>
751
750
752 % if c.template_context['search_context']['repo_id']:
751 % if c.template_context['search_context']['repo_id']:
753 <li class="searchTag searchTagFilter searchTagHidable" >
752 <li class="searchTag searchTagFilter searchTagHidable" >
754 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
753 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
755 <span class="tag">
754 <span class="tag">
756 This repo
755 This repo
757 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
756 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
758 </span>
757 </span>
759 ##</a>
758 ##</a>
760 </li>
759 </li>
761 % elif c.template_context['search_context']['repo_group_id']:
760 % elif c.template_context['search_context']['repo_group_id']:
762 <li class="searchTag searchTagFilter searchTagHidable">
761 <li class="searchTag searchTagFilter searchTagHidable">
763 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
762 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
764 <span class="tag">
763 <span class="tag">
765 This group
764 This group
766 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
765 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
767 </span>
766 </span>
768 ##</a>
767 ##</a>
769 </li>
768 </li>
770 % endif
769 % endif
771
770
772 <li class="searchTagInput">
771 <li class="searchTagInput">
773 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
772 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
774 </li>
773 </li>
775 <li class="searchTag searchTagHelp">
774 <li class="searchTag searchTagHelp">
776 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
775 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
777 </li>
776 </li>
778 </ul>
777 </ul>
779 </div>
778 </div>
780 </div>
779 </div>
781
780
782 <div id="main_filter_help" style="display: none">
781 <div id="main_filter_help" style="display: none">
783 - Use '/' key to quickly access this field.
782 - Use '/' key to quickly access this field.
784
783
785 - Enter a name of repository, or repository group for quick search.
784 - Enter a name of repository, or repository group for quick search.
786
785
787 - Prefix query to allow special search:
786 - Prefix query to allow special search:
788
787
789 <strong>user:</strong>admin, to search for usernames, always global
788 <strong>user:</strong>admin, to search for usernames, always global
790
789
791 <strong>user_group:</strong>devops, to search for user groups, always global
790 <strong>user_group:</strong>devops, to search for user groups, always global
792
791
793 <strong>pr:</strong>303, to search for pull request number, title, or description, always global
792 <strong>pr:</strong>303, to search for pull request number, title, or description, always global
794
793
795 <strong>commit:</strong>efced4, to search for commits, scoped to repositories or groups
794 <strong>commit:</strong>efced4, to search for commits, scoped to repositories or groups
796
795
797 <strong>file:</strong>models.py, to search for file paths, scoped to repositories or groups
796 <strong>file:</strong>models.py, to search for file paths, scoped to repositories or groups
798
797
799 % if c.template_context['search_context']['repo_id']:
798 % if c.template_context['search_context']['repo_id']:
800 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>
799 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>
801 % elif c.template_context['search_context']['repo_group_id']:
800 % elif c.template_context['search_context']['repo_group_id']:
802 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>
801 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>
803 % else:
802 % else:
804 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
803 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
805 % endif
804 % endif
806 </div>
805 </div>
807 </li>
806 </li>
808
807
809 ## ROOT MENU
808 ## ROOT MENU
810 <li class="${h.is_active('home', active)}">
809 <li class="${h.is_active('home', active)}">
811 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
810 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
812 <div class="menulabel">${_('Home')}</div>
811 <div class="menulabel">${_('Home')}</div>
813 </a>
812 </a>
814 </li>
813 </li>
815
814
816 %if c.rhodecode_user.username != h.DEFAULT_USER:
815 %if c.rhodecode_user.username != h.DEFAULT_USER:
817 <li class="${h.is_active('journal', active)}">
816 <li class="${h.is_active('journal', active)}">
818 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
817 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
819 <div class="menulabel">${_('Journal')}</div>
818 <div class="menulabel">${_('Journal')}</div>
820 </a>
819 </a>
821 </li>
820 </li>
822 %else:
821 %else:
823 <li class="${h.is_active('journal', active)}">
822 <li class="${h.is_active('journal', active)}">
824 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
823 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
825 <div class="menulabel">${_('Public journal')}</div>
824 <div class="menulabel">${_('Public journal')}</div>
826 </a>
825 </a>
827 </li>
826 </li>
828 %endif
827 %endif
829
828
830 <li class="${h.is_active('gists', active)}">
829 <li class="${h.is_active('gists', active)}">
831 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
830 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
832 <div class="menulabel">${_('Gists')}</div>
831 <div class="menulabel">${_('Gists')}</div>
833 </a>
832 </a>
834 </li>
833 </li>
835
834
836 % if c.is_super_admin or c.is_delegated_admin:
835 % if c.is_super_admin or c.is_delegated_admin:
837 <li class="${h.is_active('admin', active)}">
836 <li class="${h.is_active('admin', active)}">
838 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
837 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
839 <div class="menulabel">${_('Admin')} </div>
838 <div class="menulabel">${_('Admin')} </div>
840 </a>
839 </a>
841 </li>
840 </li>
842 % endif
841 % endif
843
842
844 ## render extra user menu
843 ## render extra user menu
845 ${usermenu(active=(active=='my_account'))}
844 ${usermenu(active=(active=='my_account'))}
846
845
847 </ul>
846 </ul>
848
847
849 <script type="text/javascript">
848 <script type="text/javascript">
850 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
849 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
851
850
852 var formatRepoResult = function(result, container, query, escapeMarkup) {
851 var formatRepoResult = function(result, container, query, escapeMarkup) {
853 return function(data, escapeMarkup) {
852 return function(data, escapeMarkup) {
854 if (!data.repo_id){
853 if (!data.repo_id){
855 return data.text; // optgroup text Repositories
854 return data.text; // optgroup text Repositories
856 }
855 }
857
856
858 var tmpl = '';
857 var tmpl = '';
859 var repoType = data['repo_type'];
858 var repoType = data['repo_type'];
860 var repoName = data['text'];
859 var repoName = data['text'];
861
860
862 if(data && data.type == 'repo'){
861 if(data && data.type == 'repo'){
863 if(repoType === 'hg'){
862 if(repoType === 'hg'){
864 tmpl += '<i class="icon-hg"></i> ';
863 tmpl += '<i class="icon-hg"></i> ';
865 }
864 }
866 else if(repoType === 'git'){
865 else if(repoType === 'git'){
867 tmpl += '<i class="icon-git"></i> ';
866 tmpl += '<i class="icon-git"></i> ';
868 }
867 }
869 else if(repoType === 'svn'){
868 else if(repoType === 'svn'){
870 tmpl += '<i class="icon-svn"></i> ';
869 tmpl += '<i class="icon-svn"></i> ';
871 }
870 }
872 if(data['private']){
871 if(data['private']){
873 tmpl += '<i class="icon-lock" ></i> ';
872 tmpl += '<i class="icon-lock" ></i> ';
874 }
873 }
875 else if(visualShowPublicIcon){
874 else if(visualShowPublicIcon){
876 tmpl += '<i class="icon-unlock-alt"></i> ';
875 tmpl += '<i class="icon-unlock-alt"></i> ';
877 }
876 }
878 }
877 }
879 tmpl += escapeMarkup(repoName);
878 tmpl += escapeMarkup(repoName);
880 return tmpl;
879 return tmpl;
881
880
882 }(result, escapeMarkup);
881 }(result, escapeMarkup);
883 };
882 };
884
883
885 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
884 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
886 return function(data, escapeMarkup) {
885 return function(data, escapeMarkup) {
887 if (!data.repo_group_id){
886 if (!data.repo_group_id){
888 return data.text; // optgroup text Repositories
887 return data.text; // optgroup text Repositories
889 }
888 }
890
889
891 var tmpl = '';
890 var tmpl = '';
892 var repoGroupName = data['text'];
891 var repoGroupName = data['text'];
893
892
894 if(data){
893 if(data){
895
894
896 tmpl += '<i class="icon-repo-group"></i> ';
895 tmpl += '<i class="icon-repo-group"></i> ';
897
896
898 }
897 }
899 tmpl += escapeMarkup(repoGroupName);
898 tmpl += escapeMarkup(repoGroupName);
900 return tmpl;
899 return tmpl;
901
900
902 }(result, escapeMarkup);
901 }(result, escapeMarkup);
903 };
902 };
904
903
905 var escapeRegExChars = function (value) {
904 var escapeRegExChars = function (value) {
906 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
905 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
907 };
906 };
908
907
909 var getRepoIcon = function(repo_type) {
908 var getRepoIcon = function(repo_type) {
910 if (repo_type === 'hg') {
909 if (repo_type === 'hg') {
911 return '<i class="icon-hg"></i> ';
910 return '<i class="icon-hg"></i> ';
912 }
911 }
913 else if (repo_type === 'git') {
912 else if (repo_type === 'git') {
914 return '<i class="icon-git"></i> ';
913 return '<i class="icon-git"></i> ';
915 }
914 }
916 else if (repo_type === 'svn') {
915 else if (repo_type === 'svn') {
917 return '<i class="icon-svn"></i> ';
916 return '<i class="icon-svn"></i> ';
918 }
917 }
919 return ''
918 return ''
920 };
919 };
921
920
922 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
921 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
923
922
924 if (value.split(':').length === 2) {
923 if (value.split(':').length === 2) {
925 value = value.split(':')[1]
924 value = value.split(':')[1]
926 }
925 }
927
926
928 var searchType = data['type'];
927 var searchType = data['type'];
929 var searchSubType = data['subtype'];
928 var searchSubType = data['subtype'];
930 var valueDisplay = data['value_display'];
929 var valueDisplay = data['value_display'];
931 var valueIcon = data['value_icon'];
930 var valueIcon = data['value_icon'];
932
931
933 var pattern = '(' + escapeRegExChars(value) + ')';
932 var pattern = '(' + escapeRegExChars(value) + ')';
934
933
935 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
934 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
936
935
937 // highlight match
936 // highlight match
938 if (searchType != 'text') {
937 if (searchType != 'text') {
939 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
938 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
940 }
939 }
941
940
942 var icon = '';
941 var icon = '';
943
942
944 if (searchType === 'hint') {
943 if (searchType === 'hint') {
945 icon += '<i class="icon-repo-group"></i> ';
944 icon += '<i class="icon-repo-group"></i> ';
946 }
945 }
947 // full text search/hints
946 // full text search/hints
948 else if (searchType === 'search') {
947 else if (searchType === 'search') {
949 if (valueIcon === undefined) {
948 if (valueIcon === undefined) {
950 icon += '<i class="icon-more"></i> ';
949 icon += '<i class="icon-more"></i> ';
951 } else {
950 } else {
952 icon += valueIcon + ' ';
951 icon += valueIcon + ' ';
953 }
952 }
954
953
955 if (searchSubType !== undefined && searchSubType == 'repo') {
954 if (searchSubType !== undefined && searchSubType == 'repo') {
956 valueDisplay += '<div class="pull-right tag">repository</div>';
955 valueDisplay += '<div class="pull-right tag">repository</div>';
957 }
956 }
958 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
957 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
959 valueDisplay += '<div class="pull-right tag">repo group</div>';
958 valueDisplay += '<div class="pull-right tag">repo group</div>';
960 }
959 }
961 }
960 }
962 // repository
961 // repository
963 else if (searchType === 'repo') {
962 else if (searchType === 'repo') {
964
963
965 var repoIcon = getRepoIcon(data['repo_type']);
964 var repoIcon = getRepoIcon(data['repo_type']);
966 icon += repoIcon;
965 icon += repoIcon;
967
966
968 if (data['private']) {
967 if (data['private']) {
969 icon += '<i class="icon-lock" ></i> ';
968 icon += '<i class="icon-lock" ></i> ';
970 }
969 }
971 else if (visualShowPublicIcon) {
970 else if (visualShowPublicIcon) {
972 icon += '<i class="icon-unlock-alt"></i> ';
971 icon += '<i class="icon-unlock-alt"></i> ';
973 }
972 }
974 }
973 }
975 // repository groups
974 // repository groups
976 else if (searchType === 'repo_group') {
975 else if (searchType === 'repo_group') {
977 icon += '<i class="icon-repo-group"></i> ';
976 icon += '<i class="icon-repo-group"></i> ';
978 }
977 }
979 // user group
978 // user group
980 else if (searchType === 'user_group') {
979 else if (searchType === 'user_group') {
981 icon += '<i class="icon-group"></i> ';
980 icon += '<i class="icon-group"></i> ';
982 }
981 }
983 // user
982 // user
984 else if (searchType === 'user') {
983 else if (searchType === 'user') {
985 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
984 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
986 }
985 }
987 // pull request
986 // pull request
988 else if (searchType === 'pull_request') {
987 else if (searchType === 'pull_request') {
989 icon += '<i class="icon-merge"></i> ';
988 icon += '<i class="icon-merge"></i> ';
990 }
989 }
991 // commit
990 // commit
992 else if (searchType === 'commit') {
991 else if (searchType === 'commit') {
993 var repo_data = data['repo_data'];
992 var repo_data = data['repo_data'];
994 var repoIcon = getRepoIcon(repo_data['repository_type']);
993 var repoIcon = getRepoIcon(repo_data['repository_type']);
995 if (repoIcon) {
994 if (repoIcon) {
996 icon += repoIcon;
995 icon += repoIcon;
997 } else {
996 } else {
998 icon += '<i class="icon-tag"></i>';
997 icon += '<i class="icon-tag"></i>';
999 }
998 }
1000 }
999 }
1001 // file
1000 // file
1002 else if (searchType === 'file') {
1001 else if (searchType === 'file') {
1003 var repo_data = data['repo_data'];
1002 var repo_data = data['repo_data'];
1004 var repoIcon = getRepoIcon(repo_data['repository_type']);
1003 var repoIcon = getRepoIcon(repo_data['repository_type']);
1005 if (repoIcon) {
1004 if (repoIcon) {
1006 icon += repoIcon;
1005 icon += repoIcon;
1007 } else {
1006 } else {
1008 icon += '<i class="icon-tag"></i>';
1007 icon += '<i class="icon-tag"></i>';
1009 }
1008 }
1010 }
1009 }
1011 // generic text
1010 // generic text
1012 else if (searchType === 'text') {
1011 else if (searchType === 'text') {
1013 icon = '';
1012 icon = '';
1014 }
1013 }
1015
1014
1016 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
1015 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
1017 return tmpl.format(icon, valueDisplay);
1016 return tmpl.format(icon, valueDisplay);
1018 };
1017 };
1019
1018
1020 var handleSelect = function(element, suggestion) {
1019 var handleSelect = function(element, suggestion) {
1021 if (suggestion.type === "hint") {
1020 if (suggestion.type === "hint") {
1022 // we skip action
1021 // we skip action
1023 $('#main_filter').focus();
1022 $('#main_filter').focus();
1024 }
1023 }
1025 else if (suggestion.type === "text") {
1024 else if (suggestion.type === "text") {
1026 // we skip action
1025 // we skip action
1027 $('#main_filter').focus();
1026 $('#main_filter').focus();
1028
1027
1029 } else {
1028 } else {
1030 window.location = suggestion['url'];
1029 window.location = suggestion['url'];
1031 }
1030 }
1032 };
1031 };
1033
1032
1034 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
1033 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
1035 if (queryLowerCase.split(':').length === 2) {
1034 if (queryLowerCase.split(':').length === 2) {
1036 queryLowerCase = queryLowerCase.split(':')[1]
1035 queryLowerCase = queryLowerCase.split(':')[1]
1037 }
1036 }
1038 if (suggestion.type === "text") {
1037 if (suggestion.type === "text") {
1039 // special case we don't want to "skip" display for
1038 // special case we don't want to "skip" display for
1040 return true
1039 return true
1041 }
1040 }
1042 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
1041 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
1043 };
1042 };
1044
1043
1045 var cleanContext = {
1044 var cleanContext = {
1046 repo_view_type: null,
1045 repo_view_type: null,
1047
1046
1048 repo_id: null,
1047 repo_id: null,
1049 repo_name: "",
1048 repo_name: "",
1050
1049
1051 repo_group_id: null,
1050 repo_group_id: null,
1052 repo_group_name: null
1051 repo_group_name: null
1053 };
1052 };
1054 var removeGoToFilter = function () {
1053 var removeGoToFilter = function () {
1055 $('.searchTagHidable').hide();
1054 $('.searchTagHidable').hide();
1056 $('#main_filter').autocomplete(
1055 $('#main_filter').autocomplete(
1057 'setOptions', {params:{search_context: cleanContext}});
1056 'setOptions', {params:{search_context: cleanContext}});
1058 };
1057 };
1059
1058
1060 $('#main_filter').autocomplete({
1059 $('#main_filter').autocomplete({
1061 serviceUrl: pyroutes.url('goto_switcher_data'),
1060 serviceUrl: pyroutes.url('goto_switcher_data'),
1062 params: {
1061 params: {
1063 "search_context": templateContext.search_context
1062 "search_context": templateContext.search_context
1064 },
1063 },
1065 minChars:2,
1064 minChars:2,
1066 maxHeight:400,
1065 maxHeight:400,
1067 deferRequestBy: 300, //miliseconds
1066 deferRequestBy: 300, //miliseconds
1068 tabDisabled: true,
1067 tabDisabled: true,
1069 autoSelectFirst: false,
1068 autoSelectFirst: false,
1070 containerClass: 'autocomplete-qfilter-suggestions',
1069 containerClass: 'autocomplete-qfilter-suggestions',
1071 formatResult: autocompleteMainFilterFormatResult,
1070 formatResult: autocompleteMainFilterFormatResult,
1072 lookupFilter: autocompleteMainFilterResult,
1071 lookupFilter: autocompleteMainFilterResult,
1073 onSelect: function (element, suggestion) {
1072 onSelect: function (element, suggestion) {
1074 handleSelect(element, suggestion);
1073 handleSelect(element, suggestion);
1075 return false;
1074 return false;
1076 },
1075 },
1077 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1076 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1078 if (jqXHR !== 'abort') {
1077 if (jqXHR !== 'abort') {
1079 var message = formatErrorMessage(jqXHR, textStatus, errorThrown);
1078 var message = formatErrorMessage(jqXHR, textStatus, errorThrown);
1080 SwalNoAnimation.fire({
1079 SwalNoAnimation.fire({
1081 icon: 'error',
1080 icon: 'error',
1082 title: _gettext('Error during search operation'),
1081 title: _gettext('Error during search operation'),
1083 html: '<span style="white-space: pre-line">{0}</span>'.format(message),
1082 html: '<span style="white-space: pre-line">{0}</span>'.format(message),
1084 }).then(function(result) {
1083 }).then(function(result) {
1085 window.location.reload();
1084 window.location.reload();
1086 })
1085 })
1087 }
1086 }
1088 },
1087 },
1089 onSearchStart: function (params) {
1088 onSearchStart: function (params) {
1090 $('.searchTag.searchTagIcon').html('<i class="icon-spin animate-spin"></i>')
1089 $('.searchTag.searchTagIcon').html('<i class="icon-spin animate-spin"></i>')
1091 },
1090 },
1092 onSearchComplete: function (query, suggestions) {
1091 onSearchComplete: function (query, suggestions) {
1093 $('.searchTag.searchTagIcon').html('<i class="icon-search"></i>')
1092 $('.searchTag.searchTagIcon').html('<i class="icon-search"></i>')
1094 },
1093 },
1095 });
1094 });
1096
1095
1097 showMainFilterBox = function () {
1096 showMainFilterBox = function () {
1098 $('#main_filter_help').toggle();
1097 $('#main_filter_help').toggle();
1099 };
1098 };
1100
1099
1101 $('#main_filter').on('keydown.autocomplete', function (e) {
1100 $('#main_filter').on('keydown.autocomplete', function (e) {
1102
1101
1103 var BACKSPACE = 8;
1102 var BACKSPACE = 8;
1104 var el = $(e.currentTarget);
1103 var el = $(e.currentTarget);
1105 if(e.which === BACKSPACE){
1104 if(e.which === BACKSPACE){
1106 var inputVal = el.val();
1105 var inputVal = el.val();
1107 if (inputVal === ""){
1106 if (inputVal === ""){
1108 removeGoToFilter()
1107 removeGoToFilter()
1109 }
1108 }
1110 }
1109 }
1111 });
1110 });
1112
1111
1113 var dismissNotice = function(noticeId) {
1112 var dismissNotice = function(noticeId) {
1114
1113
1115 var url = pyroutes.url('user_notice_dismiss',
1114 var url = pyroutes.url('user_notice_dismiss',
1116 {"user_id": templateContext.rhodecode_user.user_id});
1115 {"user_id": templateContext.rhodecode_user.user_id});
1117
1116
1118 var postData = {
1117 var postData = {
1119 'csrf_token': CSRF_TOKEN,
1118 'csrf_token': CSRF_TOKEN,
1120 'notice_id': noticeId,
1119 'notice_id': noticeId,
1121 };
1120 };
1122
1121
1123 var success = function(response) {
1122 var success = function(response) {
1124 $('#notice-message-' + noticeId).remove();
1123 $('#notice-message-' + noticeId).remove();
1125 return false;
1124 return false;
1126 };
1125 };
1127 var failure = function(data, textStatus, xhr) {
1126 var failure = function(data, textStatus, xhr) {
1128 alert("error processing request: " + textStatus);
1127 alert("error processing request: " + textStatus);
1129 return false;
1128 return false;
1130 };
1129 };
1131 ajaxPOST(url, postData, success, failure);
1130 ajaxPOST(url, postData, success, failure);
1132 }
1131 }
1133
1132
1134 var hideLicenseWarning = function () {
1133 var hideLicenseWarning = function () {
1135 var fingerprint = templateContext.session_attrs.license_fingerprint;
1134 var fingerprint = templateContext.session_attrs.license_fingerprint;
1136 storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint);
1135 storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint);
1137 $('#notifications').hide();
1136 $('#notifications').hide();
1138 }
1137 }
1139
1138
1140 var hideLicenseError = function () {
1139 var hideLicenseError = function () {
1141 var fingerprint = templateContext.session_attrs.license_fingerprint;
1140 var fingerprint = templateContext.session_attrs.license_fingerprint;
1142 storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint);
1141 storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint);
1143 $('#notifications').hide();
1142 $('#notifications').hide();
1144 }
1143 }
1145
1144
1146 </script>
1145 </script>
1147 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1146 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1148 </%def>
1147 </%def>
1149
1148
1150 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1149 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1151 <div class="modal-dialog">
1150 <div class="modal-dialog">
1152 <div class="modal-content">
1151 <div class="modal-content">
1153 <div class="modal-header">
1152 <div class="modal-header">
1154 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1153 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1155 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1154 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1156 </div>
1155 </div>
1157 <div class="modal-body">
1156 <div class="modal-body">
1158 <div class="block-left">
1157 <div class="block-left">
1159 <table class="keyboard-mappings">
1158 <table class="keyboard-mappings">
1160 <tbody>
1159 <tbody>
1161 <tr>
1160 <tr>
1162 <th></th>
1161 <th></th>
1163 <th>${_('Site-wide shortcuts')}</th>
1162 <th>${_('Site-wide shortcuts')}</th>
1164 </tr>
1163 </tr>
1165 <%
1164 <%
1166 elems = [
1165 elems = [
1167 ('/', 'Use quick search box'),
1166 ('/', 'Use quick search box'),
1168 ('g h', 'Goto home page'),
1167 ('g h', 'Goto home page'),
1169 ('g g', 'Goto my private gists page'),
1168 ('g g', 'Goto my private gists page'),
1170 ('g G', 'Goto my public gists page'),
1169 ('g G', 'Goto my public gists page'),
1171 ('g 0-9', 'Goto bookmarked items from 0-9'),
1170 ('g 0-9', 'Goto bookmarked items from 0-9'),
1172 ('n r', 'New repository page'),
1171 ('n r', 'New repository page'),
1173 ('n g', 'New gist page'),
1172 ('n g', 'New gist page'),
1174 ]
1173 ]
1175 %>
1174 %>
1176 %for key, desc in elems:
1175 %for key, desc in elems:
1177 <tr>
1176 <tr>
1178 <td class="keys">
1177 <td class="keys">
1179 <span class="key tag">${key}</span>
1178 <span class="key tag">${key}</span>
1180 </td>
1179 </td>
1181 <td>${desc}</td>
1180 <td>${desc}</td>
1182 </tr>
1181 </tr>
1183 %endfor
1182 %endfor
1184 </tbody>
1183 </tbody>
1185 </table>
1184 </table>
1186 </div>
1185 </div>
1187 <div class="block-left">
1186 <div class="block-left">
1188 <table class="keyboard-mappings">
1187 <table class="keyboard-mappings">
1189 <tbody>
1188 <tbody>
1190 <tr>
1189 <tr>
1191 <th></th>
1190 <th></th>
1192 <th>${_('Repositories')}</th>
1191 <th>${_('Repositories')}</th>
1193 </tr>
1192 </tr>
1194 <%
1193 <%
1195 elems = [
1194 elems = [
1196 ('g s', 'Goto summary page'),
1195 ('g s', 'Goto summary page'),
1197 ('g c', 'Goto changelog page'),
1196 ('g c', 'Goto changelog page'),
1198 ('g f', 'Goto files page'),
1197 ('g f', 'Goto files page'),
1199 ('g F', 'Goto files page with file search activated'),
1198 ('g F', 'Goto files page with file search activated'),
1200 ('g p', 'Goto pull requests page'),
1199 ('g p', 'Goto pull requests page'),
1201 ('g o', 'Goto repository settings'),
1200 ('g o', 'Goto repository settings'),
1202 ('g O', 'Goto repository access permissions settings'),
1201 ('g O', 'Goto repository access permissions settings'),
1203 ('t s', 'Toggle sidebar on some pages'),
1202 ('t s', 'Toggle sidebar on some pages'),
1204 ]
1203 ]
1205 %>
1204 %>
1206 %for key, desc in elems:
1205 %for key, desc in elems:
1207 <tr>
1206 <tr>
1208 <td class="keys">
1207 <td class="keys">
1209 <span class="key tag">${key}</span>
1208 <span class="key tag">${key}</span>
1210 </td>
1209 </td>
1211 <td>${desc}</td>
1210 <td>${desc}</td>
1212 </tr>
1211 </tr>
1213 %endfor
1212 %endfor
1214 </tbody>
1213 </tbody>
1215 </table>
1214 </table>
1216 </div>
1215 </div>
1217 </div>
1216 </div>
1218 <div class="modal-footer">
1217 <div class="modal-footer">
1219 </div>
1218 </div>
1220 </div><!-- /.modal-content -->
1219 </div><!-- /.modal-content -->
1221 </div><!-- /.modal-dialog -->
1220 </div><!-- /.modal-dialog -->
1222 </div><!-- /.modal -->
1221 </div><!-- /.modal -->
1223
1222
1224
1223
1225 <script type="text/javascript">
1224 <script type="text/javascript">
1226 (function () {
1225 (function () {
1227 "use sctrict";
1226 "use sctrict";
1228
1227
1229 // details block auto-hide menu
1228 // details block auto-hide menu
1230 $(document).mouseup(function(e) {
1229 $(document).mouseup(function(e) {
1231 var container = $('.details-inline-block');
1230 var container = $('.details-inline-block');
1232 if (!container.is(e.target) && container.has(e.target).length === 0) {
1231 if (!container.is(e.target) && container.has(e.target).length === 0) {
1233 $('.details-inline-block[open]').removeAttr('open')
1232 $('.details-inline-block[open]').removeAttr('open')
1234 }
1233 }
1235 });
1234 });
1236
1235
1237 var $sideBar = $('.right-sidebar');
1236 var $sideBar = $('.right-sidebar');
1238 var expanded = $sideBar.hasClass('right-sidebar-expanded');
1237 var expanded = $sideBar.hasClass('right-sidebar-expanded');
1239 var sidebarState = templateContext.session_attrs.sidebarState;
1238 var sidebarState = templateContext.session_attrs.sidebarState;
1240 var sidebarEnabled = $('aside.right-sidebar').get(0);
1239 var sidebarEnabled = $('aside.right-sidebar').get(0);
1241
1240
1242 if (sidebarState === 'expanded') {
1241 if (sidebarState === 'expanded') {
1243 expanded = true
1242 expanded = true
1244 } else if (sidebarState === 'collapsed') {
1243 } else if (sidebarState === 'collapsed') {
1245 expanded = false
1244 expanded = false
1246 }
1245 }
1247 if (sidebarEnabled) {
1246 if (sidebarEnabled) {
1248 // show sidebar since it's hidden on load
1247 // show sidebar since it's hidden on load
1249 $('.right-sidebar').show();
1248 $('.right-sidebar').show();
1250
1249
1251 // init based on set initial class, or if defined user session attrs
1250 // init based on set initial class, or if defined user session attrs
1252 if (expanded) {
1251 if (expanded) {
1253 window.expandSidebar();
1252 window.expandSidebar();
1254 window.updateStickyHeader();
1253 window.updateStickyHeader();
1255
1254
1256 } else {
1255 } else {
1257 window.collapseSidebar();
1256 window.collapseSidebar();
1258 window.updateStickyHeader();
1257 window.updateStickyHeader();
1259 }
1258 }
1260 }
1259 }
1261 })()
1260 })()
1262
1261
1263 </script>
1262 </script>
@@ -1,166 +1,165 b''
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html>
1 <!DOCTYPE html>
3
2
4 <%
3 <%
5 c.template_context['repo_name'] = getattr(c, 'repo_name', '')
4 c.template_context['repo_name'] = getattr(c, 'repo_name', '')
6 go_import_header = ''
5 go_import_header = ''
7 if hasattr(c, 'rhodecode_db_repo'):
6 if hasattr(c, 'rhodecode_db_repo'):
8 c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type
7 c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type
9 c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_ref_name
8 c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_ref_name
10 c.template_context['repo_id'] = c.rhodecode_db_repo.repo_id
9 c.template_context['repo_id'] = c.rhodecode_db_repo.repo_id
11 c.template_context['repo_view_type'] = h.get_repo_view_type(request)
10 c.template_context['repo_view_type'] = h.get_repo_view_type(request)
12
11
13 if getattr(c, 'repo_group', None):
12 if getattr(c, 'repo_group', None):
14 c.template_context['repo_group_id'] = c.repo_group.group_id
13 c.template_context['repo_group_id'] = c.repo_group.group_id
15 c.template_context['repo_group_name'] = c.repo_group.group_name
14 c.template_context['repo_group_name'] = c.repo_group.group_name
16
15
17 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
16 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
18 c.template_context['rhodecode_user']['user_id'] = c.rhodecode_user.user_id
17 c.template_context['rhodecode_user']['user_id'] = c.rhodecode_user.user_id
19 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
18 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
20 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
19 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
21 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
20 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
22 c.template_context['rhodecode_user']['first_name'] = c.rhodecode_user.first_name
21 c.template_context['rhodecode_user']['first_name'] = c.rhodecode_user.first_name
23 c.template_context['rhodecode_user']['last_name'] = c.rhodecode_user.last_name
22 c.template_context['rhodecode_user']['last_name'] = c.rhodecode_user.last_name
24
23
25 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
24 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
26 c.template_context['default_user'] = {
25 c.template_context['default_user'] = {
27 'username': h.DEFAULT_USER,
26 'username': h.DEFAULT_USER,
28 'user_id': 1
27 'user_id': 1
29 }
28 }
30 c.template_context['search_context'] = {
29 c.template_context['search_context'] = {
31 'repo_group_id': c.template_context.get('repo_group_id'),
30 'repo_group_id': c.template_context.get('repo_group_id'),
32 'repo_group_name': c.template_context.get('repo_group_name'),
31 'repo_group_name': c.template_context.get('repo_group_name'),
33 'repo_id': c.template_context.get('repo_id'),
32 'repo_id': c.template_context.get('repo_id'),
34 'repo_name': c.template_context.get('repo_name'),
33 'repo_name': c.template_context.get('repo_name'),
35 'repo_view_type': c.template_context.get('repo_view_type'),
34 'repo_view_type': c.template_context.get('repo_view_type'),
36 }
35 }
37
36
38 c.template_context['attachment_store'] = {
37 c.template_context['attachment_store'] = {
39 'max_file_size_mb': 10,
38 'max_file_size_mb': 10,
40 'image_ext': ["png", "jpg", "gif", "jpeg"]
39 'image_ext': ["png", "jpg", "gif", "jpeg"]
41 }
40 }
42
41
43 %>
42 %>
44 <html xmlns="http://www.w3.org/1999/xhtml">
43 <html xmlns="http://www.w3.org/1999/xhtml">
45 <head>
44 <head>
46 <title>${self.title()}</title>
45 <title>${self.title()}</title>
47 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
46 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
48
47
49 ${h.go_import_header(request, getattr(c, 'rhodecode_db_repo', None))}
48 ${h.go_import_header(request, getattr(c, 'rhodecode_db_repo', None))}
50
49
51 % if 'safari' in (request.user_agent or '').lower():
50 % if 'safari' in (request.user_agent or '').lower():
52 <meta name="referrer" content="origin">
51 <meta name="referrer" content="origin">
53 % else:
52 % else:
54 <meta name="referrer" content="origin-when-cross-origin">
53 <meta name="referrer" content="origin-when-cross-origin">
55 % endif
54 % endif
56
55
57 <%def name="robots()">
56 <%def name="robots()">
58 <meta name="robots" content="index, nofollow"/>
57 <meta name="robots" content="index, nofollow"/>
59 </%def>
58 </%def>
60 ${self.robots()}
59 ${self.robots()}
61 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
60 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
62 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
61 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
63 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
62 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
64
63
65 ## CSS definitions
64 ## CSS definitions
66 <%def name="css()">
65 <%def name="css()">
67 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
66 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
68 ## EXTRA FOR CSS
67 ## EXTRA FOR CSS
69 ${self.css_extra()}
68 ${self.css_extra()}
70 </%def>
69 </%def>
71 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
70 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
72 <%def name="css_extra()">
71 <%def name="css_extra()">
73 </%def>
72 </%def>
74
73
75 ${self.css()}
74 ${self.css()}
76
75
77 ## JAVASCRIPT
76 ## JAVASCRIPT
78 <%def name="js()">
77 <%def name="js()">
79
78
80 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
79 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
81 <script type="text/javascript">
80 <script type="text/javascript">
82 // register templateContext to pass template variables to JS
81 // register templateContext to pass template variables to JS
83 var templateContext = ${h.str_json(c.template_context)|n};
82 var templateContext = ${h.str_json(c.template_context)|n};
84
83
85 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
84 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
86 var APPLICATION_PLUGINS = [];
85 var APPLICATION_PLUGINS = [];
87 var ASSET_URL = "${h.asset('')}";
86 var ASSET_URL = "${h.asset('')}";
88 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
87 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
89 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
88 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
90
89
91 var APPENLIGHT = {
90 var APPENLIGHT = {
92 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
91 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
93 key: '${getattr(c, "appenlight_api_public_key", "")}',
92 key: '${getattr(c, "appenlight_api_public_key", "")}',
94 % if getattr(c, 'appenlight_server_url', None):
93 % if getattr(c, 'appenlight_server_url', None):
95 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
94 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
96 % endif
95 % endif
97 requestInfo: {
96 requestInfo: {
98 % if getattr(c, 'rhodecode_user', None):
97 % if getattr(c, 'rhodecode_user', None):
99 ip: '${c.rhodecode_user.ip_addr}',
98 ip: '${c.rhodecode_user.ip_addr}',
100 username: '${c.rhodecode_user.username}'
99 username: '${c.rhodecode_user.username}'
101 % endif
100 % endif
102 },
101 },
103 tags: {
102 tags: {
104 rhodecode_version: '${c.rhodecode_version}',
103 rhodecode_version: '${c.rhodecode_version}',
105 rhodecode_edition: '${c.rhodecode_edition}'
104 rhodecode_edition: '${c.rhodecode_edition}'
106 }
105 }
107 };
106 };
108
107
109 </script>
108 </script>
110 <%include file="/base/plugins_base.mako"/>
109 <%include file="/base/plugins_base.mako"/>
111 <!--[if lt IE 9]>
110 <!--[if lt IE 9]>
112 <script language="javascript" type="text/javascript" src="${h.asset('js/src/excanvas.min.js')}"></script>
111 <script language="javascript" type="text/javascript" src="${h.asset('js/src/excanvas.min.js')}"></script>
113 <![endif]-->
112 <![endif]-->
114 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
113 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
115 <script> var alertMessagePayloads = ${h.flash.json_alerts(request=request)|n}; </script>
114 <script> var alertMessagePayloads = ${h.flash.json_alerts(request=request)|n}; </script>
116 ## avoide escaping the %N
115 ## avoide escaping the %N
117 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.min.js', ver=c.rhodecode_version_hash)}"></script>
116 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.min.js', ver=c.rhodecode_version_hash)}"></script>
118 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
117 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
119
118
120
119
121 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
120 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
122 ${self.js_extra()}
121 ${self.js_extra()}
123
122
124 <script type="text/javascript">
123 <script type="text/javascript">
125 Rhodecode = (function() {
124 Rhodecode = (function() {
126 function _Rhodecode() {
125 function _Rhodecode() {
127 this.comments = new CommentsController();
126 this.comments = new CommentsController();
128 }
127 }
129 return new _Rhodecode();
128 return new _Rhodecode();
130 })();
129 })();
131
130
132 $(document).ready(function(){
131 $(document).ready(function(){
133 show_more_event();
132 show_more_event();
134 timeagoActivate();
133 timeagoActivate();
135 tooltipActivate();
134 tooltipActivate();
136 clipboardActivate();
135 clipboardActivate();
137 })
136 })
138 </script>
137 </script>
139
138
140 </%def>
139 </%def>
141
140
142 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
141 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
143 <%def name="js_extra()"></%def>
142 <%def name="js_extra()"></%def>
144 ${self.js()}
143 ${self.js()}
145
144
146 <%def name="head_extra()"></%def>
145 <%def name="head_extra()"></%def>
147 ${self.head_extra()}
146 ${self.head_extra()}
148 ## extra stuff
147 ## extra stuff
149 %if c.pre_code:
148 %if c.pre_code:
150 ${c.pre_code|n}
149 ${c.pre_code|n}
151 %endif
150 %endif
152 </head>
151 </head>
153 <body id="body">
152 <body id="body">
154 <noscript>
153 <noscript>
155 <div class="noscript-error">
154 <div class="noscript-error">
156 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
155 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
157 </div>
156 </div>
158 </noscript>
157 </noscript>
159
158
160 ${next.body()}
159 ${next.body()}
161 %if c.post_code:
160 %if c.post_code:
162 ${c.post_code|n}
161 ${c.post_code|n}
163 %endif
162 %endif
164 <rhodecode-app></rhodecode-app>
163 <rhodecode-app></rhodecode-app>
165 </body>
164 </body>
166 </html>
165 </html>
@@ -1,119 +1,118 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%namespace name="components" file="/summary/components.mako"/>
2 <%namespace name="components" file="/summary/components.mako"/>
4
3
5 <%def name="title()">
4 <%def name="title()">
6 ${_('{} Bookmarks').format(c.repo_name)}
5 ${_('{} Bookmarks').format(c.repo_name)}
7 %if c.rhodecode_name:
6 %if c.rhodecode_name:
8 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
9 %endif
8 %endif
10 </%def>
9 </%def>
11
10
12 <%def name="breadcrumbs_links()"></%def>
11 <%def name="breadcrumbs_links()"></%def>
13
12
14 <%def name="menu_bar_nav()">
13 <%def name="menu_bar_nav()">
15 ${self.menu_items(active='repositories')}
14 ${self.menu_items(active='repositories')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_subnav()">
17 <%def name="menu_bar_subnav()">
19 ${self.repo_menu(active='summary')}
18 ${self.repo_menu(active='summary')}
20 </%def>
19 </%def>
21
20
22 <%def name="main()">
21 <%def name="main()">
23 <div id="repo-summary" class="summary">
22 <div id="repo-summary" class="summary">
24 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False, simplified=True)}
23 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False, simplified=True)}
25 </div>
24 </div>
26
25
27 <div class="box">
26 <div class="box">
28 <div class="title">
27 <div class="title">
29
28
30 %if c.has_references:
29 %if c.has_references:
31 <ul class="links">
30 <ul class="links">
32 <li>
31 <li>
33 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Bookmarks')}">
32 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Bookmarks')}">
34 </li>
33 </li>
35 </ul>
34 </ul>
36 %endif
35 %endif
37 %if c.has_references:
36 %if c.has_references:
38 <div class="grid-quick-filter">
37 <div class="grid-quick-filter">
39 <ul class="grid-filter-box">
38 <ul class="grid-filter-box">
40 <li class="grid-filter-box-icon">
39 <li class="grid-filter-box-icon">
41 <i class="icon-search"></i>
40 <i class="icon-search"></i>
42 </li>
41 </li>
43 <li class="grid-filter-box-input">
42 <li class="grid-filter-box-input">
44 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
43 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
45 </li>
44 </li>
46 </ul>
45 </ul>
47 </div>
46 </div>
48 <div id="obj_count">0</div>
47 <div id="obj_count">0</div>
49 %endif
48 %endif
50 </div>
49 </div>
51
50
52 <table id="obj_list_table" class="rctable table-bordered"></table>
51 <table id="obj_list_table" class="rctable table-bordered"></table>
53 </div>
52 </div>
54
53
55
54
56 <script type="text/javascript">
55 <script type="text/javascript">
57 $(document).ready(function() {
56 $(document).ready(function() {
58
57
59 var get_datatable_count = function(){
58 var get_datatable_count = function(){
60 var api = $('#obj_list_table').dataTable().api();
59 var api = $('#obj_list_table').dataTable().api();
61 var total = api.page.info().recordsDisplay
60 var total = api.page.info().recordsDisplay
62 var _text = _ngettext('{0} bookmark', '{0} bookmarks', total).format(total);
61 var _text = _ngettext('{0} bookmark', '{0} bookmarks', total).format(total);
63 $('#obj_count').text(_text);
62 $('#obj_count').text(_text);
64 };
63 };
65
64
66 // object list
65 // object list
67 $('#obj_list_table').DataTable({
66 $('#obj_list_table').DataTable({
68 data: ${c.data | n},
67 data: ${c.data | n},
69 dom: 'rtp',
68 dom: 'rtp',
70 pageLength: ${c.visual.dashboard_items},
69 pageLength: ${c.visual.dashboard_items},
71 order: [[ 0, "asc" ]],
70 order: [[ 0, "asc" ]],
72 columns: [
71 columns: [
73 { data: {"_": "name",
72 { data: {"_": "name",
74 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
73 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
75 { data: {"_": "date",
74 { data: {"_": "date",
76 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
75 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
77 { data: {"_": "author",
76 { data: {"_": "author",
78 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
77 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
79 { data: {"_": "commit",
78 { data: {"_": "commit",
80 "sort": "commit_raw",
79 "sort": "commit_raw",
81 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
80 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
82 { data: {"_": "compare",
81 { data: {"_": "compare",
83 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
82 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
84 ],
83 ],
85 language: {
84 language: {
86 paginate: DEFAULT_GRID_PAGINATION,
85 paginate: DEFAULT_GRID_PAGINATION,
87 emptyTable: _gettext("No bookmarks available yet.")
86 emptyTable: _gettext("No bookmarks available yet.")
88 },
87 },
89 "initComplete": function(settings, json) {
88 "initComplete": function(settings, json) {
90 get_datatable_count();
89 get_datatable_count();
91 timeagoActivate();
90 timeagoActivate();
92 tooltipActivate();
91 tooltipActivate();
93 compare_radio_buttons("${c.repo_name}", 'book');
92 compare_radio_buttons("${c.repo_name}", 'book');
94 }
93 }
95 });
94 });
96
95
97 // update when things change
96 // update when things change
98 $('#obj_list_table').on('draw.dt', function() {
97 $('#obj_list_table').on('draw.dt', function() {
99 get_datatable_count();
98 get_datatable_count();
100 timeagoActivate();
99 timeagoActivate();
101 tooltipActivate();
100 tooltipActivate();
102 });
101 });
103
102
104 // filter, filter both grids
103 // filter, filter both grids
105 $('#q_filter').on('keyup', function() {
104 $('#q_filter').on('keyup', function() {
106 var obj_api = $('#obj_list_table').dataTable().api();
105 var obj_api = $('#obj_list_table').dataTable().api();
107 obj_api
106 obj_api
108 .columns(0)
107 .columns(0)
109 .search(this.value)
108 .search(this.value)
110 .draw();
109 .draw();
111 });
110 });
112
111
113 // refilter table if page load via back button
112 // refilter table if page load via back button
114 $("#q_filter").trigger('keyup');
113 $("#q_filter").trigger('keyup');
115
114
116 });
115 });
117
116
118 </script>
117 </script>
119 </%def>
118 </%def>
@@ -1,118 +1,117 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%namespace name="components" file="/summary/components.mako"/>
2 <%namespace name="components" file="/summary/components.mako"/>
4
3
5 <%def name="title()">
4 <%def name="title()">
6 ${_('{} Branches').format(c.repo_name)}
5 ${_('{} Branches').format(c.repo_name)}
7 %if c.rhodecode_name:
6 %if c.rhodecode_name:
8 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
9 %endif
8 %endif
10 </%def>
9 </%def>
11
10
12 <%def name="breadcrumbs_links()"></%def>
11 <%def name="breadcrumbs_links()"></%def>
13
12
14 <%def name="menu_bar_nav()">
13 <%def name="menu_bar_nav()">
15 ${self.menu_items(active='repositories')}
14 ${self.menu_items(active='repositories')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_subnav()">
17 <%def name="menu_bar_subnav()">
19 ${self.repo_menu(active='summary')}
18 ${self.repo_menu(active='summary')}
20 </%def>
19 </%def>
21
20
22 <%def name="main()">
21 <%def name="main()">
23 <div id="repo-summary" class="summary">
22 <div id="repo-summary" class="summary">
24 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False, simplified=True)}
23 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False, simplified=True)}
25 </div>
24 </div>
26
25
27 <div class="box">
26 <div class="box">
28 <div class="title">
27 <div class="title">
29
28
30 %if c.has_references:
29 %if c.has_references:
31 <ul class="links">
30 <ul class="links">
32 <li>
31 <li>
33 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Branches')}"/>
32 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Branches')}"/>
34 </li>
33 </li>
35 </ul>
34 </ul>
36 %endif
35 %endif
37 %if c.has_references:
36 %if c.has_references:
38 <div class="grid-quick-filter">
37 <div class="grid-quick-filter">
39 <ul class="grid-filter-box">
38 <ul class="grid-filter-box">
40 <li class="grid-filter-box-icon">
39 <li class="grid-filter-box-icon">
41 <i class="icon-search"></i>
40 <i class="icon-search"></i>
42 </li>
41 </li>
43 <li class="grid-filter-box-input">
42 <li class="grid-filter-box-input">
44 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
43 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
45 </li>
44 </li>
46 </ul>
45 </ul>
47 </div>
46 </div>
48 <div id="obj_count">0</div>
47 <div id="obj_count">0</div>
49 %endif
48 %endif
50 </div>
49 </div>
51 <table id="obj_list_table" class="rctable table-bordered"></table>
50 <table id="obj_list_table" class="rctable table-bordered"></table>
52 </div>
51 </div>
53
52
54 <script type="text/javascript">
53 <script type="text/javascript">
55 $(document).ready(function() {
54 $(document).ready(function() {
56
55
57 var get_datatable_count = function(){
56 var get_datatable_count = function(){
58 var api = $('#obj_list_table').dataTable().api();
57 var api = $('#obj_list_table').dataTable().api();
59 var total = api.page.info().recordsDisplay
58 var total = api.page.info().recordsDisplay
60 var _text = _ngettext('{0} branch', '{0} branches', total).format(total);
59 var _text = _ngettext('{0} branch', '{0} branches', total).format(total);
61
60
62 $('#obj_count').text(_text);
61 $('#obj_count').text(_text);
63 };
62 };
64
63
65 // object list
64 // object list
66 $('#obj_list_table').DataTable({
65 $('#obj_list_table').DataTable({
67 data: ${c.data|n},
66 data: ${c.data|n},
68 dom: 'rtp',
67 dom: 'rtp',
69 pageLength: ${c.visual.dashboard_items},
68 pageLength: ${c.visual.dashboard_items},
70 order: [[ 0, "asc" ]],
69 order: [[ 0, "asc" ]],
71 columns: [
70 columns: [
72 { data: {"_": "name",
71 { data: {"_": "name",
73 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
72 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
74 { data: {"_": "date",
73 { data: {"_": "date",
75 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
74 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
76 { data: {"_": "author",
75 { data: {"_": "author",
77 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
76 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
78 { data: {"_": "commit",
77 { data: {"_": "commit",
79 "sort": "commit_raw",
78 "sort": "commit_raw",
80 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
79 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
81 { data: {"_": "compare",
80 { data: {"_": "compare",
82 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
81 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
83 ],
82 ],
84 language: {
83 language: {
85 paginate: DEFAULT_GRID_PAGINATION,
84 paginate: DEFAULT_GRID_PAGINATION,
86 emptyTable: _gettext("No branches available yet.")
85 emptyTable: _gettext("No branches available yet.")
87 },
86 },
88 "initComplete": function( settings, json ) {
87 "initComplete": function( settings, json ) {
89 get_datatable_count();
88 get_datatable_count();
90 timeagoActivate();
89 timeagoActivate();
91 tooltipActivate();
90 tooltipActivate();
92 compare_radio_buttons("${c.repo_name}", 'branch');
91 compare_radio_buttons("${c.repo_name}", 'branch');
93 }
92 }
94 });
93 });
95
94
96 // update when things change
95 // update when things change
97 $('#obj_list_table').on('draw.dt', function() {
96 $('#obj_list_table').on('draw.dt', function() {
98 get_datatable_count();
97 get_datatable_count();
99 timeagoActivate();
98 timeagoActivate();
100 tooltipActivate();
99 tooltipActivate();
101 });
100 });
102
101
103 // filter, filter both grids
102 // filter, filter both grids
104 $('#q_filter').on( 'keyup', function () {
103 $('#q_filter').on( 'keyup', function () {
105 var obj_api = $('#obj_list_table').dataTable().api();
104 var obj_api = $('#obj_list_table').dataTable().api();
106 obj_api
105 obj_api
107 .columns(0)
106 .columns(0)
108 .search(this.value)
107 .search(this.value)
109 .draw();
108 .draw();
110 });
109 });
111
110
112 // refilter table if page load via back button
111 // refilter table if page load via back button
113 $("#q_filter").trigger('keyup');
112 $("#q_filter").trigger('keyup');
114
113
115 });
114 });
116
115
117 </script>
116 </script>
118 </%def>
117 </%def>
@@ -1,435 +1,434 b''
1 ## -*- coding: utf-8 -*-
2
1
3 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
4 <%namespace name="base" file="/base/base.mako"/>
3 <%namespace name="base" file="/base/base.mako"/>
5 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
6 <%namespace name="file_base" file="/files/base.mako"/>
5 <%namespace name="file_base" file="/files/base.mako"/>
7 <%namespace name="sidebar" file="/base/sidebar.mako"/>
6 <%namespace name="sidebar" file="/base/sidebar.mako"/>
8
7
9
8
10 <%def name="title()">
9 <%def name="title()">
11 ${_('{} Commit').format(c.repo_name)} - ${h.show_id(c.commit)}
10 ${_('{} Commit').format(c.repo_name)} - ${h.show_id(c.commit)}
12 %if c.rhodecode_name:
11 %if c.rhodecode_name:
13 &middot; ${h.branding(c.rhodecode_name)}
12 &middot; ${h.branding(c.rhodecode_name)}
14 %endif
13 %endif
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='repositories')}
17 ${self.menu_items(active='repositories')}
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_subnav()">
20 <%def name="menu_bar_subnav()">
22 ${self.repo_menu(active='commits')}
21 ${self.repo_menu(active='commits')}
23 </%def>
22 </%def>
24
23
25 <%def name="main()">
24 <%def name="main()">
26 <script type="text/javascript">
25 <script type="text/javascript">
27 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
26 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
28 </script>
27 </script>
29
28
30 <div class="box">
29 <div class="box">
31
30
32 <div class="summary">
31 <div class="summary">
33
32
34 <div class="fieldset">
33 <div class="fieldset">
35 <div class="left-content">
34 <div class="left-content">
36 <%
35 <%
37 rc_user = h.discover_user(c.commit.author_email)
36 rc_user = h.discover_user(c.commit.author_email)
38 %>
37 %>
39 <div class="left-content-avatar">
38 <div class="left-content-avatar">
40 ${base.gravatar(c.commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)}
39 ${base.gravatar(c.commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)}
41 </div>
40 </div>
42
41
43 <div class="left-content-message">
42 <div class="left-content-message">
44 <div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
43 <div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
45 <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div>
44 <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div>
46 </div>
45 </div>
47
46
48 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none">
47 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none">
49 <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
48 <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
50 </div>
49 </div>
51
50
52 <div class="fieldset" data-toggle="summary-details">
51 <div class="fieldset" data-toggle="summary-details">
53 <div class="">
52 <div class="">
54 <table>
53 <table>
55 <tr class="file_author">
54 <tr class="file_author">
56
55
57 <td>
56 <td>
58 <span class="user commit-author">${h.link_to_user(rc_user or c.commit.author)}</span>
57 <span class="user commit-author">${h.link_to_user(rc_user or c.commit.author)}</span>
59 <span class="commit-date">- ${h.age_component(c.commit.date)}</span>
58 <span class="commit-date">- ${h.age_component(c.commit.date)}</span>
60 </td>
59 </td>
61
60
62 <td>
61 <td>
63 ## second cell for consistency with files
62 ## second cell for consistency with files
64 </td>
63 </td>
65 </tr>
64 </tr>
66 </table>
65 </table>
67 </div>
66 </div>
68 </div>
67 </div>
69
68
70 </div>
69 </div>
71 </div>
70 </div>
72
71
73 <div class="right-content">
72 <div class="right-content">
74
73
75 <div data-toggle="summary-details">
74 <div data-toggle="summary-details">
76 <div class="tags tags-main">
75 <div class="tags tags-main">
77 <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a></code>
76 <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a></code>
78 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
77 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
79 ${file_base.refs(c.commit)}
78 ${file_base.refs(c.commit)}
80
79
81
80
82 ## phase
81 ## phase
83 % if hasattr(c.commit, 'phase') and getattr(c.commit, 'phase') != 'public':
82 % if hasattr(c.commit, 'phase') and getattr(c.commit, 'phase') != 'public':
84 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">
83 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">
85 <i class="icon-info"></i>${c.commit.phase}
84 <i class="icon-info"></i>${c.commit.phase}
86 </span>
85 </span>
87 % endif
86 % endif
88
87
89 ## obsolete commits
88 ## obsolete commits
90 % if getattr(c.commit, 'obsolete', False):
89 % if getattr(c.commit, 'obsolete', False):
91 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">
90 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">
92 ${_('obsolete')}
91 ${_('obsolete')}
93 </span>
92 </span>
94 % endif
93 % endif
95
94
96 ## hidden commits
95 ## hidden commits
97 % if getattr(c.commit, 'hidden', False):
96 % if getattr(c.commit, 'hidden', False):
98 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">
97 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">
99 ${_('hidden')}
98 ${_('hidden')}
100 </span>
99 </span>
101 % endif
100 % endif
102 </div>
101 </div>
103
102
104 <span id="parent_link" class="tag tagtag">
103 <span id="parent_link" class="tag tagtag">
105 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
104 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
106 </span>
105 </span>
107
106
108 <span id="child_link" class="tag tagtag">
107 <span id="child_link" class="tag tagtag">
109 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
108 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
110 </span>
109 </span>
111 <span class="tag tooltip" title="${_('Browse files at this commit')}">
110 <span class="tag tooltip" title="${_('Browse files at this commit')}">
112 <i class="icon-code"></i>
111 <i class="icon-code"></i>
113 <a href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path='')}">${_('Browse files')}</a>
112 <a href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path='')}">${_('Browse files')}</a>
114 </span>
113 </span>
115
114
116 </div>
115 </div>
117
116
118 </div>
117 </div>
119 </div>
118 </div>
120
119
121 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
120 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
122 <div class="left-label-summary">
121 <div class="left-label-summary">
123 <p>${_('Diff options')}:</p>
122 <p>${_('Diff options')}:</p>
124 <div class="right-label-summary">
123 <div class="right-label-summary">
125 <div class="diff-actions">
124 <div class="diff-actions">
126 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">
125 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">
127 ${_('Raw Diff')}
126 ${_('Raw Diff')}
128 </a>
127 </a>
129 |
128 |
130 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">
129 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">
131 ${_('Patch Diff')}
130 ${_('Patch Diff')}
132 </a>
131 </a>
133 |
132 |
134 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}">
133 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}">
135 ${_('Download Diff')}
134 ${_('Download Diff')}
136 </a>
135 </a>
137 </div>
136 </div>
138 </div>
137 </div>
139 </div>
138 </div>
140 </div>
139 </div>
141
140
142 <div class="clear-fix"></div>
141 <div class="clear-fix"></div>
143
142
144 <div class="btn-collapse" data-toggle="summary-details">
143 <div class="btn-collapse" data-toggle="summary-details">
145 ${_('Show More')}
144 ${_('Show More')}
146 </div>
145 </div>
147
146
148 </div>
147 </div>
149
148
150 <div class="cs_files">
149 <div class="cs_files">
151 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
150 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
152 ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id], commit=c.commit)}
151 ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id], commit=c.commit)}
153 ${cbdiffs.render_diffset(
152 ${cbdiffs.render_diffset(
154 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,
153 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,
155 inline_comments=c.inline_comments,
154 inline_comments=c.inline_comments,
156 show_todos=False)}
155 show_todos=False)}
157 </div>
156 </div>
158
157
159 ## template for inline comment form
158 ## template for inline comment form
160 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
159 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
161
160
162 ## comments heading with count
161 ## comments heading with count
163 <div class="comments-heading">
162 <div class="comments-heading">
164 <i class="icon-comment"></i>
163 <i class="icon-comment"></i>
165 ${_('General Comments')} ${len(c.comments)}
164 ${_('General Comments')} ${len(c.comments)}
166 </div>
165 </div>
167
166
168 ## render comments
167 ## render comments
169 ${comment.generate_comments(c.comments)}
168 ${comment.generate_comments(c.comments)}
170
169
171 ## main comment form and it status
170 ## main comment form and it status
172 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
171 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
173 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
172 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
174 </div>
173 </div>
175
174
176 ### NAV SIDEBAR
175 ### NAV SIDEBAR
177 <aside class="right-sidebar right-sidebar-expanded" id="commit-nav-sticky" style="display: none">
176 <aside class="right-sidebar right-sidebar-expanded" id="commit-nav-sticky" style="display: none">
178 <div class="sidenav navbar__inner" >
177 <div class="sidenav navbar__inner" >
179 ## TOGGLE
178 ## TOGGLE
180 <div class="sidebar-toggle" onclick="toggleSidebar(); return false">
179 <div class="sidebar-toggle" onclick="toggleSidebar(); return false">
181 <a href="#toggleSidebar" class="grey-link-action">
180 <a href="#toggleSidebar" class="grey-link-action">
182
181
183 </a>
182 </a>
184 </div>
183 </div>
185
184
186 ## CONTENT
185 ## CONTENT
187 <div class="sidebar-content">
186 <div class="sidebar-content">
188
187
189 ## RULES SUMMARY/RULES
188 ## RULES SUMMARY/RULES
190 <div class="sidebar-element clear-both">
189 <div class="sidebar-element clear-both">
191 <% vote_title = _ungettext(
190 <% vote_title = _ungettext(
192 'Status calculated based on votes from {} reviewer',
191 'Status calculated based on votes from {} reviewer',
193 'Status calculated based on votes from {} reviewers', c.reviewers_count).format(c.reviewers_count)
192 'Status calculated based on votes from {} reviewers', c.reviewers_count).format(c.reviewers_count)
194 %>
193 %>
195
194
196 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${vote_title}">
195 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${vote_title}">
197 <i class="icon-circle review-status-${c.commit_review_status}"></i>
196 <i class="icon-circle review-status-${c.commit_review_status}"></i>
198 ${c.reviewers_count}
197 ${c.reviewers_count}
199 </div>
198 </div>
200 </div>
199 </div>
201
200
202 ## REVIEWERS
201 ## REVIEWERS
203 <div class="right-sidebar-expanded-state pr-details-title">
202 <div class="right-sidebar-expanded-state pr-details-title">
204 <span class="tooltip sidebar-heading" title="${vote_title}">
203 <span class="tooltip sidebar-heading" title="${vote_title}">
205 <i class="icon-circle review-status-${c.commit_review_status}"></i>
204 <i class="icon-circle review-status-${c.commit_review_status}"></i>
206 ${_('Reviewers')}
205 ${_('Reviewers')}
207 </span>
206 </span>
208 </div>
207 </div>
209
208
210 <div id="reviewers" class="right-sidebar-expanded-state pr-details-content reviewers">
209 <div id="reviewers" class="right-sidebar-expanded-state pr-details-content reviewers">
211
210
212 <table id="review_members" class="group_members">
211 <table id="review_members" class="group_members">
213 ## This content is loaded via JS and ReviewersPanel
212 ## This content is loaded via JS and ReviewersPanel
214 </table>
213 </table>
215
214
216 </div>
215 </div>
217
216
218 ## TODOs
217 ## TODOs
219 <div class="sidebar-element clear-both">
218 <div class="sidebar-element clear-both">
220 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="TODOs">
219 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="TODOs">
221 <i class="icon-flag-filled"></i>
220 <i class="icon-flag-filled"></i>
222 <span id="todos-count">${len(c.unresolved_comments)}</span>
221 <span id="todos-count">${len(c.unresolved_comments)}</span>
223 </div>
222 </div>
224
223
225 <div class="right-sidebar-expanded-state pr-details-title">
224 <div class="right-sidebar-expanded-state pr-details-title">
226 ## Only show unresolved, that is only what matters
225 ## Only show unresolved, that is only what matters
227 <span class="sidebar-heading noselect" onclick="refreshTODOs(); return false">
226 <span class="sidebar-heading noselect" onclick="refreshTODOs(); return false">
228 <i class="icon-flag-filled"></i>
227 <i class="icon-flag-filled"></i>
229 TODOs
228 TODOs
230 </span>
229 </span>
231
230
232 % if c.resolved_comments:
231 % if c.resolved_comments:
233 <span class="block-right action_button last-item noselect" onclick="$('.unresolved-todo-text').toggle(); return toggleElement(this, '.resolved-todo');" data-toggle-on="Show resolved" data-toggle-off="Hide resolved">Show resolved</span>
232 <span class="block-right action_button last-item noselect" onclick="$('.unresolved-todo-text').toggle(); return toggleElement(this, '.resolved-todo');" data-toggle-on="Show resolved" data-toggle-off="Hide resolved">Show resolved</span>
234 % else:
233 % else:
235 <span class="block-right last-item noselect">Show resolved</span>
234 <span class="block-right last-item noselect">Show resolved</span>
236 % endif
235 % endif
237
236
238 </div>
237 </div>
239
238
240 <div class="right-sidebar-expanded-state pr-details-content">
239 <div class="right-sidebar-expanded-state pr-details-content">
241 % if c.unresolved_comments + c.resolved_comments:
240 % if c.unresolved_comments + c.resolved_comments:
242 ${sidebar.comments_table(c.unresolved_comments + c.resolved_comments, len(c.unresolved_comments), todo_comments=True, is_pr=False)}
241 ${sidebar.comments_table(c.unresolved_comments + c.resolved_comments, len(c.unresolved_comments), todo_comments=True, is_pr=False)}
243 % else:
242 % else:
244 <table>
243 <table>
245 <tr>
244 <tr>
246 <td>
245 <td>
247 ${_('No TODOs yet')}
246 ${_('No TODOs yet')}
248 </td>
247 </td>
249 </tr>
248 </tr>
250 </table>
249 </table>
251 % endif
250 % endif
252 </div>
251 </div>
253 </div>
252 </div>
254
253
255 ## COMMENTS
254 ## COMMENTS
256 <div class="sidebar-element clear-both">
255 <div class="sidebar-element clear-both">
257 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Comments')}">
256 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Comments')}">
258 <i class="icon-comment" style="color: #949494"></i>
257 <i class="icon-comment" style="color: #949494"></i>
259 <span id="comments-count">${len(c.inline_comments_flat+c.comments)}</span>
258 <span id="comments-count">${len(c.inline_comments_flat+c.comments)}</span>
260 <span class="display-none" id="general-comments-count">${len(c.comments)}</span>
259 <span class="display-none" id="general-comments-count">${len(c.comments)}</span>
261 <span class="display-none" id="inline-comments-count">${len(c.inline_comments_flat)}</span>
260 <span class="display-none" id="inline-comments-count">${len(c.inline_comments_flat)}</span>
262 </div>
261 </div>
263
262
264 <div class="right-sidebar-expanded-state pr-details-title">
263 <div class="right-sidebar-expanded-state pr-details-title">
265 <span class="sidebar-heading noselect" onclick="refreshComments(); return false">
264 <span class="sidebar-heading noselect" onclick="refreshComments(); return false">
266 <i class="icon-comment" style="color: #949494"></i>
265 <i class="icon-comment" style="color: #949494"></i>
267 ${_('Comments')}
266 ${_('Comments')}
268 </span>
267 </span>
269
268
270 </div>
269 </div>
271
270
272 <div class="right-sidebar-expanded-state pr-details-content">
271 <div class="right-sidebar-expanded-state pr-details-content">
273 % if c.inline_comments_flat + c.comments:
272 % if c.inline_comments_flat + c.comments:
274 ${sidebar.comments_table(c.inline_comments_flat + c.comments, len(c.inline_comments_flat+c.comments), is_pr=False)}
273 ${sidebar.comments_table(c.inline_comments_flat + c.comments, len(c.inline_comments_flat+c.comments), is_pr=False)}
275 % else:
274 % else:
276 <table>
275 <table>
277 <tr>
276 <tr>
278 <td>
277 <td>
279 ${_('No Comments yet')}
278 ${_('No Comments yet')}
280 </td>
279 </td>
281 </tr>
280 </tr>
282 </table>
281 </table>
283 % endif
282 % endif
284 </div>
283 </div>
285
284
286 </div>
285 </div>
287
286
288 </div>
287 </div>
289
288
290 </div>
289 </div>
291 </aside>
290 </aside>
292
291
293 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
292 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
294 <script type="text/javascript">
293 <script type="text/javascript">
295 window.setReviewersData = ${c.commit_set_reviewers_data_json | n};
294 window.setReviewersData = ${c.commit_set_reviewers_data_json | n};
296
295
297 $(document).ready(function () {
296 $(document).ready(function () {
298 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
297 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
299
298
300 if ($('#trimmed_message_box').height() === boxmax) {
299 if ($('#trimmed_message_box').height() === boxmax) {
301 $('#message_expand').show();
300 $('#message_expand').show();
302 }
301 }
303
302
304 $('#message_expand').on('click', function (e) {
303 $('#message_expand').on('click', function (e) {
305 $('#trimmed_message_box').css('max-height', 'none');
304 $('#trimmed_message_box').css('max-height', 'none');
306 $(this).hide();
305 $(this).hide();
307 });
306 });
308
307
309 $('.show-inline-comments').on('click', function (e) {
308 $('.show-inline-comments').on('click', function (e) {
310 var boxid = $(this).attr('data-comment-id');
309 var boxid = $(this).attr('data-comment-id');
311 var button = $(this);
310 var button = $(this);
312
311
313 if (button.hasClass("comments-visible")) {
312 if (button.hasClass("comments-visible")) {
314 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
313 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
315 $(this).hide();
314 $(this).hide();
316 });
315 });
317 button.removeClass("comments-visible");
316 button.removeClass("comments-visible");
318 } else {
317 } else {
319 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
318 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
320 $(this).show();
319 $(this).show();
321 });
320 });
322 button.addClass("comments-visible");
321 button.addClass("comments-visible");
323 }
322 }
324 });
323 });
325
324
326 // next links
325 // next links
327 $('#child_link').on('click', function (e) {
326 $('#child_link').on('click', function (e) {
328 // fetch via ajax what is going to be the next link, if we have
327 // fetch via ajax what is going to be the next link, if we have
329 // >1 links show them to user to choose
328 // >1 links show them to user to choose
330 if (!$('#child_link').hasClass('disabled')) {
329 if (!$('#child_link').hasClass('disabled')) {
331 $.ajax({
330 $.ajax({
332 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
331 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
333 success: function (data) {
332 success: function (data) {
334 if (data.results.length === 0) {
333 if (data.results.length === 0) {
335 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
334 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
336 }
335 }
337 if (data.results.length === 1) {
336 if (data.results.length === 1) {
338 var commit = data.results[0];
337 var commit = data.results[0];
339 window.location = pyroutes.url('repo_commit', {
338 window.location = pyroutes.url('repo_commit', {
340 'repo_name': '${c.repo_name}',
339 'repo_name': '${c.repo_name}',
341 'commit_id': commit.raw_id
340 'commit_id': commit.raw_id
342 });
341 });
343 } else if (data.results.length === 2) {
342 } else if (data.results.length === 2) {
344 $('#child_link').addClass('disabled');
343 $('#child_link').addClass('disabled');
345 $('#child_link').addClass('double');
344 $('#child_link').addClass('double');
346
345
347 var _html = '';
346 var _html = '';
348 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
347 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
349 .replace('__branch__', data.results[0].branch)
348 .replace('__branch__', data.results[0].branch)
350 .replace('__rev__', 'r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0, 6)))
349 .replace('__rev__', 'r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0, 6)))
351 .replace('__title__', data.results[0].message)
350 .replace('__title__', data.results[0].message)
352 .replace('__url__', pyroutes.url('repo_commit', {
351 .replace('__url__', pyroutes.url('repo_commit', {
353 'repo_name': '${c.repo_name}',
352 'repo_name': '${c.repo_name}',
354 'commit_id': data.results[0].raw_id
353 'commit_id': data.results[0].raw_id
355 }));
354 }));
356 _html += ' | ';
355 _html += ' | ';
357 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
356 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
358 .replace('__branch__', data.results[1].branch)
357 .replace('__branch__', data.results[1].branch)
359 .replace('__rev__', 'r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0, 6)))
358 .replace('__rev__', 'r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0, 6)))
360 .replace('__title__', data.results[1].message)
359 .replace('__title__', data.results[1].message)
361 .replace('__url__', pyroutes.url('repo_commit', {
360 .replace('__url__', pyroutes.url('repo_commit', {
362 'repo_name': '${c.repo_name}',
361 'repo_name': '${c.repo_name}',
363 'commit_id': data.results[1].raw_id
362 'commit_id': data.results[1].raw_id
364 }));
363 }));
365 $('#child_link').html(_html);
364 $('#child_link').html(_html);
366 }
365 }
367 }
366 }
368 });
367 });
369 e.preventDefault();
368 e.preventDefault();
370 }
369 }
371 });
370 });
372
371
373 // prev links
372 // prev links
374 $('#parent_link').on('click', function (e) {
373 $('#parent_link').on('click', function (e) {
375 // fetch via ajax what is going to be the next link, if we have
374 // fetch via ajax what is going to be the next link, if we have
376 // >1 links show them to user to choose
375 // >1 links show them to user to choose
377 if (!$('#parent_link').hasClass('disabled')) {
376 if (!$('#parent_link').hasClass('disabled')) {
378 $.ajax({
377 $.ajax({
379 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
378 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
380 success: function (data) {
379 success: function (data) {
381 if (data.results.length === 0) {
380 if (data.results.length === 0) {
382 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
381 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
383 }
382 }
384 if (data.results.length === 1) {
383 if (data.results.length === 1) {
385 var commit = data.results[0];
384 var commit = data.results[0];
386 window.location = pyroutes.url('repo_commit', {
385 window.location = pyroutes.url('repo_commit', {
387 'repo_name': '${c.repo_name}',
386 'repo_name': '${c.repo_name}',
388 'commit_id': commit.raw_id
387 'commit_id': commit.raw_id
389 });
388 });
390 } else if (data.results.length === 2) {
389 } else if (data.results.length === 2) {
391 $('#parent_link').addClass('disabled');
390 $('#parent_link').addClass('disabled');
392 $('#parent_link').addClass('double');
391 $('#parent_link').addClass('double');
393
392
394 var _html = '';
393 var _html = '';
395 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
394 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
396 .replace('__branch__', data.results[0].branch)
395 .replace('__branch__', data.results[0].branch)
397 .replace('__rev__', 'r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0, 6)))
396 .replace('__rev__', 'r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0, 6)))
398 .replace('__title__', data.results[0].message)
397 .replace('__title__', data.results[0].message)
399 .replace('__url__', pyroutes.url('repo_commit', {
398 .replace('__url__', pyroutes.url('repo_commit', {
400 'repo_name': '${c.repo_name}',
399 'repo_name': '${c.repo_name}',
401 'commit_id': data.results[0].raw_id
400 'commit_id': data.results[0].raw_id
402 }));
401 }));
403 _html += ' | ';
402 _html += ' | ';
404 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
403 _html += '<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
405 .replace('__branch__', data.results[1].branch)
404 .replace('__branch__', data.results[1].branch)
406 .replace('__rev__', 'r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0, 6)))
405 .replace('__rev__', 'r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0, 6)))
407 .replace('__title__', data.results[1].message)
406 .replace('__title__', data.results[1].message)
408 .replace('__url__', pyroutes.url('repo_commit', {
407 .replace('__url__', pyroutes.url('repo_commit', {
409 'repo_name': '${c.repo_name}',
408 'repo_name': '${c.repo_name}',
410 'commit_id': data.results[1].raw_id
409 'commit_id': data.results[1].raw_id
411 }));
410 }));
412 $('#parent_link').html(_html);
411 $('#parent_link').html(_html);
413 }
412 }
414 }
413 }
415 });
414 });
416 e.preventDefault();
415 e.preventDefault();
417 }
416 }
418 });
417 });
419
418
420 // browse tree @ revision
419 // browse tree @ revision
421 $('#files_link').on('click', function (e) {
420 $('#files_link').on('click', function (e) {
422 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
421 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
423 e.preventDefault();
422 e.preventDefault();
424 });
423 });
425
424
426 reviewersController = new ReviewersController();
425 reviewersController = new ReviewersController();
427 ReviewersPanel.init(reviewersController, null, setReviewersData);
426 ReviewersPanel.init(reviewersController, null, setReviewersData);
428
427
429 var channel = '${c.commit_broadcast_channel}';
428 var channel = '${c.commit_broadcast_channel}';
430 new ReviewerPresenceController(channel)
429 new ReviewerPresenceController(channel)
431
430
432 })
431 })
433 </script>
432 </script>
434
433
435 </%def>
434 </%def>
@@ -1,557 +1,556 b''
1 ## -*- coding: utf-8 -*-
2 ## usage:
1 ## usage:
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
2 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
4 ## ${comment.comment_block(comment)}
3 ## ${comment.comment_block(comment)}
5 ##
4 ##
6 <%namespace name="base" file="/base/base.mako"/>
5 <%namespace name="base" file="/base/base.mako"/>
7
6
8 <%!
7 <%!
9 from rhodecode.lib import html_filters
8 from rhodecode.lib import html_filters
10 %>
9 %>
11
10
12
11
13 <%def name="comment_block(comment, inline=False, active_pattern_entries=None, is_new=False)">
12 <%def name="comment_block(comment, inline=False, active_pattern_entries=None, is_new=False)">
14
13
15 <%
14 <%
16 from rhodecode.model.comment import CommentsModel
15 from rhodecode.model.comment import CommentsModel
17 comment_model = CommentsModel()
16 comment_model = CommentsModel()
18
17
19 comment_ver = comment.get_index_version(getattr(c, 'versions', []))
18 comment_ver = comment.get_index_version(getattr(c, 'versions', []))
20 latest_ver = len(getattr(c, 'versions', []))
19 latest_ver = len(getattr(c, 'versions', []))
21 visible_for_user = True
20 visible_for_user = True
22 if comment.draft:
21 if comment.draft:
23 visible_for_user = comment.user_id == c.rhodecode_user.user_id
22 visible_for_user = comment.user_id == c.rhodecode_user.user_id
24 %>
23 %>
25
24
26 % if inline:
25 % if inline:
27 <% outdated_at_ver = comment.outdated_at_version(c.at_version_num) %>
26 <% outdated_at_ver = comment.outdated_at_version(c.at_version_num) %>
28 % else:
27 % else:
29 <% outdated_at_ver = comment.older_than_version(c.at_version_num) %>
28 <% outdated_at_ver = comment.older_than_version(c.at_version_num) %>
30 % endif
29 % endif
31
30
32 % if visible_for_user:
31 % if visible_for_user:
33 <div class="comment
32 <div class="comment
34 ${'comment-inline' if inline else 'comment-general'}
33 ${'comment-inline' if inline else 'comment-general'}
35 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
34 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
36 id="comment-${comment.comment_id}"
35 id="comment-${comment.comment_id}"
37 line="${comment.line_no}"
36 line="${comment.line_no}"
38 data-comment-id="${comment.comment_id}"
37 data-comment-id="${comment.comment_id}"
39 data-comment-type="${comment.comment_type}"
38 data-comment-type="${comment.comment_type}"
40 data-comment-draft=${h.str_json(comment.draft)}
39 data-comment-draft=${h.str_json(comment.draft)}
41 data-comment-renderer="${comment.renderer}"
40 data-comment-renderer="${comment.renderer}"
42 data-comment-text="${comment.text | html_filters.base64,n}"
41 data-comment-text="${comment.text | html_filters.base64,n}"
43 data-comment-f-path="${comment.f_path}"
42 data-comment-f-path="${comment.f_path}"
44 data-comment-line-no="${comment.line_no}"
43 data-comment-line-no="${comment.line_no}"
45 data-comment-inline=${h.str_json(inline)}
44 data-comment-inline=${h.str_json(inline)}
46 style="${'display: none;' if outdated_at_ver else ''}">
45 style="${'display: none;' if outdated_at_ver else ''}">
47
46
48 <div class="meta">
47 <div class="meta">
49 <div class="comment-type-label">
48 <div class="comment-type-label">
50 % if comment.draft:
49 % if comment.draft:
51 <div class="tooltip comment-draft" title="${_('Draft comments are only visible to the author until submitted')}.">
50 <div class="tooltip comment-draft" title="${_('Draft comments are only visible to the author until submitted')}.">
52 DRAFT
51 DRAFT
53 </div>
52 </div>
54 % elif is_new:
53 % elif is_new:
55 <div class="tooltip comment-new" title="${_('This comment was added while you browsed this page')}.">
54 <div class="tooltip comment-new" title="${_('This comment was added while you browsed this page')}.">
56 NEW
55 NEW
57 </div>
56 </div>
58 % endif
57 % endif
59
58
60 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}">
59 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}">
61
60
62 ## TODO COMMENT
61 ## TODO COMMENT
63 % if comment.comment_type == 'todo':
62 % if comment.comment_type == 'todo':
64 % if comment.resolved:
63 % if comment.resolved:
65 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
64 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
66 <i class="icon-flag-filled"></i>
65 <i class="icon-flag-filled"></i>
67 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
66 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
68 </div>
67 </div>
69 % else:
68 % else:
70 <div class="resolved tooltip" style="display: none">
69 <div class="resolved tooltip" style="display: none">
71 <span>${comment.comment_type}</span>
70 <span>${comment.comment_type}</span>
72 </div>
71 </div>
73 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to create resolution comment.')}">
72 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to create resolution comment.')}">
74 <i class="icon-flag-filled"></i>
73 <i class="icon-flag-filled"></i>
75 ${comment.comment_type}
74 ${comment.comment_type}
76 </div>
75 </div>
77 % endif
76 % endif
78 ## NOTE COMMENT
77 ## NOTE COMMENT
79 % else:
78 % else:
80 ## RESOLVED NOTE
79 ## RESOLVED NOTE
81 % if comment.resolved_comment:
80 % if comment.resolved_comment:
82 <div class="tooltip" title="${_('This comment resolves TODO #{}').format(comment.resolved_comment.comment_id)}">
81 <div class="tooltip" title="${_('This comment resolves TODO #{}').format(comment.resolved_comment.comment_id)}">
83 fix
82 fix
84 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.str_json(comment.resolved_comment.outdated)})">
83 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.str_json(comment.resolved_comment.outdated)})">
85 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
84 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
86 </a>
85 </a>
87 </div>
86 </div>
88 ## STATUS CHANGE NOTE
87 ## STATUS CHANGE NOTE
89 % elif not comment.is_inline and comment.status_change:
88 % elif not comment.is_inline and comment.status_change:
90 <%
89 <%
91 if comment.pull_request:
90 if comment.pull_request:
92 status_change_title = 'Status of review for pull request !{}'.format(comment.pull_request.pull_request_id)
91 status_change_title = 'Status of review for pull request !{}'.format(comment.pull_request.pull_request_id)
93 else:
92 else:
94 status_change_title = 'Status of review for commit {}'.format(h.short_id(comment.commit_id))
93 status_change_title = 'Status of review for commit {}'.format(h.short_id(comment.commit_id))
95 %>
94 %>
96
95
97 <i class="icon-circle review-status-${comment.review_status}"></i>
96 <i class="icon-circle review-status-${comment.review_status}"></i>
98 <div class="changeset-status-lbl tooltip" title="${status_change_title}">
97 <div class="changeset-status-lbl tooltip" title="${status_change_title}">
99 ${comment.review_status_lbl}
98 ${comment.review_status_lbl}
100 </div>
99 </div>
101 % else:
100 % else:
102 <div>
101 <div>
103 <i class="icon-comment"></i>
102 <i class="icon-comment"></i>
104 ${(comment.comment_type or 'note')}
103 ${(comment.comment_type or 'note')}
105 </div>
104 </div>
106 % endif
105 % endif
107 % endif
106 % endif
108
107
109 </div>
108 </div>
110 </div>
109 </div>
111 ## NOTE 0 and .. => because we disable it for now until UI ready
110 ## NOTE 0 and .. => because we disable it for now until UI ready
112 % if 0 and comment.status_change:
111 % if 0 and comment.status_change:
113 <div class="pull-left">
112 <div class="pull-left">
114 <span class="tag authortag tooltip" title="${_('Status from pull request.')}">
113 <span class="tag authortag tooltip" title="${_('Status from pull request.')}">
115 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
114 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
116 ${'!{}'.format(comment.pull_request.pull_request_id)}
115 ${'!{}'.format(comment.pull_request.pull_request_id)}
117 </a>
116 </a>
118 </span>
117 </span>
119 </div>
118 </div>
120 % endif
119 % endif
121 ## Since only author can see drafts, we don't show it
120 ## Since only author can see drafts, we don't show it
122 % if not comment.draft:
121 % if not comment.draft:
123 <div class="author ${'author-inline' if inline else 'author-general'}">
122 <div class="author ${'author-inline' if inline else 'author-general'}">
124 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
123 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
125 </div>
124 </div>
126 % endif
125 % endif
127
126
128 <div class="date">
127 <div class="date">
129 ${h.age_component(comment.modified_at, time_is_local=True)}
128 ${h.age_component(comment.modified_at, time_is_local=True)}
130 </div>
129 </div>
131
130
132 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
131 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
133 <span class="tag authortag tooltip" title="${_('Pull request author')}">
132 <span class="tag authortag tooltip" title="${_('Pull request author')}">
134 ${_('author')}
133 ${_('author')}
135 </span>
134 </span>
136 % endif
135 % endif
137
136
138 <%
137 <%
139 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
138 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
140 %>
139 %>
141
140
142 % if comment.history:
141 % if comment.history:
143 <div class="date">
142 <div class="date">
144
143
145 <input id="${comment_version_selector}" name="${comment_version_selector}"
144 <input id="${comment_version_selector}" name="${comment_version_selector}"
146 type="hidden"
145 type="hidden"
147 data-last-version="${comment.history[-1].version}">
146 data-last-version="${comment.history[-1].version}">
148
147
149 <script type="text/javascript">
148 <script type="text/javascript">
150
149
151 var preLoadVersionData = [
150 var preLoadVersionData = [
152 % for comment_history in comment.history:
151 % for comment_history in comment.history:
153 {
152 {
154 id: ${comment_history.comment_history_id},
153 id: ${comment_history.comment_history_id},
155 text: 'v${comment_history.version}',
154 text: 'v${comment_history.version}',
156 action: function () {
155 action: function () {
157 Rhodecode.comments.showVersion(
156 Rhodecode.comments.showVersion(
158 "${comment.comment_id}",
157 "${comment.comment_id}",
159 "${comment_history.comment_history_id}"
158 "${comment_history.comment_history_id}"
160 )
159 )
161 },
160 },
162 comment_version: "${comment_history.version}",
161 comment_version: "${comment_history.version}",
163 comment_author_username: "${comment_history.author.username}",
162 comment_author_username: "${comment_history.author.username}",
164 comment_author_gravatar: "${h.gravatar_url(comment_history.author.email, 16)}",
163 comment_author_gravatar: "${h.gravatar_url(comment_history.author.email, 16)}",
165 comment_created_on: '${h.age_component(comment_history.created_on, time_is_local=True)}',
164 comment_created_on: '${h.age_component(comment_history.created_on, time_is_local=True)}',
166 },
165 },
167 % endfor
166 % endfor
168 ]
167 ]
169 initVersionSelector("#${comment_version_selector}", {results: preLoadVersionData});
168 initVersionSelector("#${comment_version_selector}", {results: preLoadVersionData});
170
169
171 </script>
170 </script>
172
171
173 </div>
172 </div>
174 % else:
173 % else:
175 <div class="date" style="display: none">
174 <div class="date" style="display: none">
176 <input id="${comment_version_selector}" name="${comment_version_selector}"
175 <input id="${comment_version_selector}" name="${comment_version_selector}"
177 type="hidden"
176 type="hidden"
178 data-last-version="0">
177 data-last-version="0">
179 </div>
178 </div>
180 %endif
179 %endif
181
180
182 <div class="comment-links-block">
181 <div class="comment-links-block">
183
182
184 % if inline:
183 % if inline:
185 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
184 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
186 % if outdated_at_ver:
185 % if outdated_at_ver:
187 <strong class="comment-outdated-label">outdated</strong> <code class="tooltip pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}">${'v{}'.format(comment_ver)}</code>
186 <strong class="comment-outdated-label">outdated</strong> <code class="tooltip pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}">${'v{}'.format(comment_ver)}</code>
188 <code class="action-divider">|</code>
187 <code class="action-divider">|</code>
189 % elif comment_ver:
188 % elif comment_ver:
190 <code class="tooltip pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}">${'v{}'.format(comment_ver)}</code>
189 <code class="tooltip pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}">${'v{}'.format(comment_ver)}</code>
191 <code class="action-divider">|</code>
190 <code class="action-divider">|</code>
192 % endif
191 % endif
193 </a>
192 </a>
194 % else:
193 % else:
195 % if comment_ver:
194 % if comment_ver:
196
195
197 % if comment.outdated:
196 % if comment.outdated:
198 <a class="pr-version"
197 <a class="pr-version"
199 href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"
198 href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"
200 >
199 >
201 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}
200 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}
202 </a>
201 </a>
203 <code class="action-divider">|</code>
202 <code class="action-divider">|</code>
204 % else:
203 % else:
205 <a class="tooltip pr-version"
204 <a class="tooltip pr-version"
206 title="${_('Comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}"
205 title="${_('Comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}"
207 href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}"
206 href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}"
208 >
207 >
209 <code class="pr-version-num">${'v{}'.format(comment_ver)}</code>
208 <code class="pr-version-num">${'v{}'.format(comment_ver)}</code>
210 </a>
209 </a>
211 <code class="action-divider">|</code>
210 <code class="action-divider">|</code>
212 % endif
211 % endif
213
212
214 % endif
213 % endif
215 % endif
214 % endif
216
215
217 <details class="details-reset details-inline-block">
216 <details class="details-reset details-inline-block">
218 <summary class="noselect"><i class="icon-options cursor-pointer"></i></summary>
217 <summary class="noselect"><i class="icon-options cursor-pointer"></i></summary>
219 <details-menu class="details-dropdown">
218 <details-menu class="details-dropdown">
220
219
221 <div class="dropdown-item">
220 <div class="dropdown-item">
222 ${_('Comment')} #${comment.comment_id}
221 ${_('Comment')} #${comment.comment_id}
223 <span class="pull-right icon-clipboard clipboard-action" data-clipboard-text="${comment_model.get_url(comment,request, permalink=True, anchor='comment-{}'.format(comment.comment_id))}" title="${_('Copy permalink')}"></span>
222 <span class="pull-right icon-clipboard clipboard-action" data-clipboard-text="${comment_model.get_url(comment,request, permalink=True, anchor='comment-{}'.format(comment.comment_id))}" title="${_('Copy permalink')}"></span>
224 </div>
223 </div>
225
224
226 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
225 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
227 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
226 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
228 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
227 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
229 ## permissions to delete
228 ## permissions to delete
230 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
229 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
231 <div class="dropdown-divider"></div>
230 <div class="dropdown-divider"></div>
232 <div class="dropdown-item">
231 <div class="dropdown-item">
233 <a onclick="return Rhodecode.comments.editComment(this, '${comment.line_no}', '${comment.f_path}');" class="btn btn-link btn-sm edit-comment">${_('Edit')}</a>
232 <a onclick="return Rhodecode.comments.editComment(this, '${comment.line_no}', '${comment.f_path}');" class="btn btn-link btn-sm edit-comment">${_('Edit')}</a>
234 </div>
233 </div>
235 <div class="dropdown-item">
234 <div class="dropdown-item">
236 <a onclick="return Rhodecode.comments.deleteComment(this);" class="btn btn-link btn-sm btn-danger delete-comment">${_('Delete')}</a>
235 <a onclick="return Rhodecode.comments.deleteComment(this);" class="btn btn-link btn-sm btn-danger delete-comment">${_('Delete')}</a>
237 </div>
236 </div>
238 ## Only available in EE edition
237 ## Only available in EE edition
239 % if comment.draft and c.rhodecode_edition_id == 'EE':
238 % if comment.draft and c.rhodecode_edition_id == 'EE':
240 <div class="dropdown-item">
239 <div class="dropdown-item">
241 <a onclick="return Rhodecode.comments.finalizeDrafts([${comment.comment_id}]);" class="btn btn-link btn-sm finalize-draft-comment">${_('Submit draft')}</a>
240 <a onclick="return Rhodecode.comments.finalizeDrafts([${comment.comment_id}]);" class="btn btn-link btn-sm finalize-draft-comment">${_('Submit draft')}</a>
242 </div>
241 </div>
243 % endif
242 % endif
244 %else:
243 %else:
245 <div class="dropdown-divider"></div>
244 <div class="dropdown-divider"></div>
246 <div class="dropdown-item">
245 <div class="dropdown-item">
247 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
246 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
248 </div>
247 </div>
249 <div class="dropdown-item">
248 <div class="dropdown-item">
250 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
249 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
251 </div>
250 </div>
252 %endif
251 %endif
253 %else:
252 %else:
254 <div class="dropdown-divider"></div>
253 <div class="dropdown-divider"></div>
255 <div class="dropdown-item">
254 <div class="dropdown-item">
256 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
255 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
257 </div>
256 </div>
258 <div class="dropdown-item">
257 <div class="dropdown-item">
259 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
258 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
260 </div>
259 </div>
261 %endif
260 %endif
262 </details-menu>
261 </details-menu>
263 </details>
262 </details>
264
263
265 <code class="action-divider">|</code>
264 <code class="action-divider">|</code>
266 % if outdated_at_ver:
265 % if outdated_at_ver:
267 <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous outdated comment')}"> <i class="icon-angle-left"></i> </a>
266 <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous outdated comment')}"> <i class="icon-angle-left"></i> </a>
268 <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="tooltip next-comment" title="${_('Jump to the next outdated comment')}"> <i class="icon-angle-right"></i></a>
267 <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="tooltip next-comment" title="${_('Jump to the next outdated comment')}"> <i class="icon-angle-right"></i></a>
269 % else:
268 % else:
270 <a onclick="return Rhodecode.comments.prevComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous comment')}"> <i class="icon-angle-left"></i></a>
269 <a onclick="return Rhodecode.comments.prevComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous comment')}"> <i class="icon-angle-left"></i></a>
271 <a onclick="return Rhodecode.comments.nextComment(this);" class="tooltip next-comment" title="${_('Jump to the next comment')}"> <i class="icon-angle-right"></i></a>
270 <a onclick="return Rhodecode.comments.nextComment(this);" class="tooltip next-comment" title="${_('Jump to the next comment')}"> <i class="icon-angle-right"></i></a>
272 % endif
271 % endif
273
272
274 </div>
273 </div>
275 </div>
274 </div>
276 <div class="text">
275 <div class="text">
277 ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
276 ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
278 </div>
277 </div>
279
278
280 </div>
279 </div>
281 % endif
280 % endif
282 </%def>
281 </%def>
283
282
284 ## generate main comments
283 ## generate main comments
285 <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
284 <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
286 <%
285 <%
287 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
286 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
288 %>
287 %>
289
288
290 <div class="general-comments" id="comments">
289 <div class="general-comments" id="comments">
291 %for comment in comments:
290 %for comment in comments:
292 <div id="comment-tr-${comment.comment_id}">
291 <div id="comment-tr-${comment.comment_id}">
293 ## only render comments that are not from pull request, or from
292 ## only render comments that are not from pull request, or from
294 ## pull request and a status change
293 ## pull request and a status change
295 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
294 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
296 ${comment_block(comment, active_pattern_entries=active_pattern_entries)}
295 ${comment_block(comment, active_pattern_entries=active_pattern_entries)}
297 %endif
296 %endif
298 </div>
297 </div>
299 %endfor
298 %endfor
300 ## to anchor ajax comments
299 ## to anchor ajax comments
301 <div id="injected_page_comments"></div>
300 <div id="injected_page_comments"></div>
302 </div>
301 </div>
303 </%def>
302 </%def>
304
303
305
304
306 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
305 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
307
306
308 <div class="comments">
307 <div class="comments">
309 <%
308 <%
310 if is_pull_request:
309 if is_pull_request:
311 placeholder = _('Leave a comment on this Pull Request.')
310 placeholder = _('Leave a comment on this Pull Request.')
312 elif is_compare:
311 elif is_compare:
313 placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras))
312 placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras))
314 else:
313 else:
315 placeholder = _('Leave a comment on this Commit.')
314 placeholder = _('Leave a comment on this Commit.')
316 %>
315 %>
317
316
318 % if c.rhodecode_user.username != h.DEFAULT_USER:
317 % if c.rhodecode_user.username != h.DEFAULT_USER:
319 <div class="js-template" id="cb-comment-general-form-template">
318 <div class="js-template" id="cb-comment-general-form-template">
320 ## template generated for injection
319 ## template generated for injection
321 ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)}
320 ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)}
322 </div>
321 </div>
323
322
324 <div id="cb-comment-general-form-placeholder" class="comment-form ac">
323 <div id="cb-comment-general-form-placeholder" class="comment-form ac">
325 ## inject form here
324 ## inject form here
326 </div>
325 </div>
327 <script type="text/javascript">
326 <script type="text/javascript">
328 var resolvesCommentId = null;
327 var resolvesCommentId = null;
329 var generalCommentForm = Rhodecode.comments.createGeneralComment(
328 var generalCommentForm = Rhodecode.comments.createGeneralComment(
330 'general', "${placeholder}", resolvesCommentId);
329 'general', "${placeholder}", resolvesCommentId);
331
330
332 // set custom success callback on rangeCommit
331 // set custom success callback on rangeCommit
333 % if is_compare:
332 % if is_compare:
334 generalCommentForm.setHandleFormSubmit(function(o) {
333 generalCommentForm.setHandleFormSubmit(function(o) {
335 var self = generalCommentForm;
334 var self = generalCommentForm;
336
335
337 var text = self.cm.getValue();
336 var text = self.cm.getValue();
338 var status = self.getCommentStatus();
337 var status = self.getCommentStatus();
339 var commentType = self.getCommentType();
338 var commentType = self.getCommentType();
340 var isDraft = self.getDraftState();
339 var isDraft = self.getDraftState();
341
340
342 if (text === "" && !status) {
341 if (text === "" && !status) {
343 return;
342 return;
344 }
343 }
345
344
346 // we can pick which commits we want to make the comment by
345 // we can pick which commits we want to make the comment by
347 // selecting them via click on preview pane, this will alter the hidden inputs
346 // selecting them via click on preview pane, this will alter the hidden inputs
348 var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0;
347 var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0;
349
348
350 var commitIds = [];
349 var commitIds = [];
351 $('#changeset_compare_view_content .compare_select').each(function(el) {
350 $('#changeset_compare_view_content .compare_select').each(function(el) {
352 var commitId = this.id.replace('row-', '');
351 var commitId = this.id.replace('row-', '');
353 if ($(this).hasClass('hl') || !cherryPicked) {
352 if ($(this).hasClass('hl') || !cherryPicked) {
354 $("input[data-commit-id='{0}']".format(commitId)).val(commitId);
353 $("input[data-commit-id='{0}']".format(commitId)).val(commitId);
355 commitIds.push(commitId);
354 commitIds.push(commitId);
356 } else {
355 } else {
357 $("input[data-commit-id='{0}']".format(commitId)).val('')
356 $("input[data-commit-id='{0}']".format(commitId)).val('')
358 }
357 }
359 });
358 });
360
359
361 self.setActionButtonsDisabled(true);
360 self.setActionButtonsDisabled(true);
362 self.cm.setOption("readOnly", true);
361 self.cm.setOption("readOnly", true);
363 var postData = {
362 var postData = {
364 'text': text,
363 'text': text,
365 'changeset_status': status,
364 'changeset_status': status,
366 'comment_type': commentType,
365 'comment_type': commentType,
367 'draft': isDraft,
366 'draft': isDraft,
368 'commit_ids': commitIds,
367 'commit_ids': commitIds,
369 'csrf_token': CSRF_TOKEN
368 'csrf_token': CSRF_TOKEN
370 };
369 };
371
370
372 var submitSuccessCallback = function(o) {
371 var submitSuccessCallback = function(o) {
373 location.reload(true);
372 location.reload(true);
374 };
373 };
375 var submitFailCallback = function(){
374 var submitFailCallback = function(){
376 self.resetCommentFormState(text)
375 self.resetCommentFormState(text)
377 };
376 };
378 self.submitAjaxPOST(
377 self.submitAjaxPOST(
379 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
378 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
380 });
379 });
381 % endif
380 % endif
382
381
383 </script>
382 </script>
384 % else:
383 % else:
385 ## form state when not logged in
384 ## form state when not logged in
386 <div class="comment-form ac">
385 <div class="comment-form ac">
387
386
388 <div class="comment-area">
387 <div class="comment-area">
389 <div class="comment-area-header">
388 <div class="comment-area-header">
390 <ul class="nav-links clearfix">
389 <ul class="nav-links clearfix">
391 <li class="active">
390 <li class="active">
392 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
391 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
393 </li>
392 </li>
394 <li class="">
393 <li class="">
395 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
394 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
396 </li>
395 </li>
397 </ul>
396 </ul>
398 </div>
397 </div>
399
398
400 <div class="comment-area-write" style="display: block;">
399 <div class="comment-area-write" style="display: block;">
401 <div id="edit-container">
400 <div id="edit-container">
402 <div style="padding: 20px 0px 0px 0;">
401 <div style="padding: 20px 0px 0px 0;">
403 ${_('You need to be logged in to leave comments.')}
402 ${_('You need to be logged in to leave comments.')}
404 <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
403 <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
405 </div>
404 </div>
406 </div>
405 </div>
407 <div id="preview-container" class="clearfix" style="display: none;">
406 <div id="preview-container" class="clearfix" style="display: none;">
408 <div id="preview-box" class="preview-box"></div>
407 <div id="preview-box" class="preview-box"></div>
409 </div>
408 </div>
410 </div>
409 </div>
411
410
412 <div class="comment-area-footer">
411 <div class="comment-area-footer">
413 <div class="toolbar">
412 <div class="toolbar">
414 <div class="toolbar-text">
413 <div class="toolbar-text">
415 </div>
414 </div>
416 </div>
415 </div>
417 </div>
416 </div>
418 </div>
417 </div>
419
418
420 <div class="comment-footer">
419 <div class="comment-footer">
421 </div>
420 </div>
422
421
423 </div>
422 </div>
424 % endif
423 % endif
425
424
426 <script type="text/javascript">
425 <script type="text/javascript">
427 bindToggleButtons();
426 bindToggleButtons();
428 </script>
427 </script>
429 </div>
428 </div>
430 </%def>
429 </%def>
431
430
432
431
433 <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)">
432 <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)">
434
433
435 ## comment injected based on assumption that user is logged in
434 ## comment injected based on assumption that user is logged in
436 <form ${('id="{}"'.format(form_id) if form_id else '') |n} action="#" method="GET">
435 <form ${('id="{}"'.format(form_id) if form_id else '') |n} action="#" method="GET">
437
436
438 <div class="comment-area">
437 <div class="comment-area">
439 <div class="comment-area-header">
438 <div class="comment-area-header">
440 <div class="pull-left">
439 <div class="pull-left">
441 <ul class="nav-links clearfix">
440 <ul class="nav-links clearfix">
442 <li class="active">
441 <li class="active">
443 <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a>
442 <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a>
444 </li>
443 </li>
445 <li class="">
444 <li class="">
446 <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a>
445 <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a>
447 </li>
446 </li>
448 </ul>
447 </ul>
449 </div>
448 </div>
450 <div class="pull-right">
449 <div class="pull-right">
451 <span class="comment-area-text">${_('Mark as')}:</span>
450 <span class="comment-area-text">${_('Mark as')}:</span>
452 <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type">
451 <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type">
453 % for val in c.visual.comment_types:
452 % for val in c.visual.comment_types:
454 <option value="${val}">${val.upper()}</option>
453 <option value="${val}">${val.upper()}</option>
455 % endfor
454 % endfor
456 </select>
455 </select>
457 </div>
456 </div>
458 </div>
457 </div>
459
458
460 <div class="comment-area-write" style="display: block;">
459 <div class="comment-area-write" style="display: block;">
461 <div id="edit-container_${lineno_id}" style="margin-top: -1px">
460 <div id="edit-container_${lineno_id}" style="margin-top: -1px">
462 <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea>
461 <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea>
463 </div>
462 </div>
464 <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;">
463 <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;">
465 <div id="preview-box_${lineno_id}" class="preview-box"></div>
464 <div id="preview-box_${lineno_id}" class="preview-box"></div>
466 </div>
465 </div>
467 </div>
466 </div>
468
467
469 <div class="comment-area-footer comment-attachment-uploader">
468 <div class="comment-area-footer comment-attachment-uploader">
470 <div class="toolbar">
469 <div class="toolbar">
471
470
472 <div class="comment-attachment-text">
471 <div class="comment-attachment-text">
473 <div class="dropzone-text">
472 <div class="dropzone-text">
474 ${_("Drag'n Drop files here or")} <span class="link pick-attachment">${_('Choose your files')}</span>.<br>
473 ${_("Drag'n Drop files here or")} <span class="link pick-attachment">${_('Choose your files')}</span>.<br>
475 </div>
474 </div>
476 <div class="dropzone-upload" style="display:none">
475 <div class="dropzone-upload" style="display:none">
477 <i class="icon-spin animate-spin"></i> ${_('uploading...')}
476 <i class="icon-spin animate-spin"></i> ${_('uploading...')}
478 </div>
477 </div>
479 </div>
478 </div>
480
479
481 ## comments dropzone template, empty on purpose
480 ## comments dropzone template, empty on purpose
482 <div style="display: none" class="comment-attachment-uploader-template">
481 <div style="display: none" class="comment-attachment-uploader-template">
483 <div class="dz-file-preview" style="margin: 0">
482 <div class="dz-file-preview" style="margin: 0">
484 <div class="dz-error-message"></div>
483 <div class="dz-error-message"></div>
485 </div>
484 </div>
486 </div>
485 </div>
487
486
488 </div>
487 </div>
489 </div>
488 </div>
490 </div>
489 </div>
491
490
492 <div class="comment-footer">
491 <div class="comment-footer">
493
492
494 ## inject extra inputs into the form
493 ## inject extra inputs into the form
495 % if form_extras and isinstance(form_extras, (list, tuple)):
494 % if form_extras and isinstance(form_extras, (list, tuple)):
496 <div id="comment_form_extras">
495 <div id="comment_form_extras">
497 % for form_ex_el in form_extras:
496 % for form_ex_el in form_extras:
498 ${form_ex_el|n}
497 ${form_ex_el|n}
499 % endfor
498 % endfor
500 </div>
499 </div>
501 % endif
500 % endif
502
501
503 <div class="action-buttons">
502 <div class="action-buttons">
504 % if form_type != 'inline':
503 % if form_type != 'inline':
505 <div class="action-buttons-extra"></div>
504 <div class="action-buttons-extra"></div>
506 % endif
505 % endif
507
506
508 <input class="btn btn-success comment-button-input submit-comment-action" id="save_${lineno_id}" name="save" type="submit" value="${_('Add comment')}" data-is-draft=false onclick="$(this).addClass('submitter')">
507 <input class="btn btn-success comment-button-input submit-comment-action" id="save_${lineno_id}" name="save" type="submit" value="${_('Add comment')}" data-is-draft=false onclick="$(this).addClass('submitter')">
509
508
510 % if form_type == 'inline':
509 % if form_type == 'inline':
511 % if c.rhodecode_edition_id == 'EE':
510 % if c.rhodecode_edition_id == 'EE':
512 ## Disable the button for CE, the "real" validation is in the backend code anyway
511 ## Disable the button for CE, the "real" validation is in the backend code anyway
513 <input class="btn btn-draft comment-button-input submit-draft-action" id="save_draft_${lineno_id}" name="save_draft" type="submit" value="${_('Add draft')}" data-is-draft=true onclick="$(this).addClass('submitter')">
512 <input class="btn btn-draft comment-button-input submit-draft-action" id="save_draft_${lineno_id}" name="save_draft" type="submit" value="${_('Add draft')}" data-is-draft=true onclick="$(this).addClass('submitter')">
514 % else:
513 % else:
515 <input class="btn btn-draft comment-button-input submit-draft-action disabled" disabled="disabled" type="submit" value="${_('Add draft')}" onclick="return false;" title="Draft comments only available in EE edition of RhodeCode">
514 <input class="btn btn-draft comment-button-input submit-draft-action disabled" disabled="disabled" type="submit" value="${_('Add draft')}" onclick="return false;" title="Draft comments only available in EE edition of RhodeCode">
516 % endif
515 % endif
517 % endif
516 % endif
518
517
519 % if review_statuses:
518 % if review_statuses:
520 <div class="comment-status-box">
519 <div class="comment-status-box">
521 <select id="change_status_${lineno_id}" name="changeset_status">
520 <select id="change_status_${lineno_id}" name="changeset_status">
522 <option></option> ## Placeholder
521 <option></option> ## Placeholder
523 % for status, lbl in review_statuses:
522 % for status, lbl in review_statuses:
524 <option value="${status}" data-status="${status}">${lbl}</option>
523 <option value="${status}" data-status="${status}">${lbl}</option>
525 %if is_pull_request and change_status and status in ('approved', 'rejected'):
524 %if is_pull_request and change_status and status in ('approved', 'rejected'):
526 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
525 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
527 %endif
526 %endif
528 % endfor
527 % endfor
529 </select>
528 </select>
530 </div>
529 </div>
531 % endif
530 % endif
532
531
533 ## inline for has a file, and line-number together with cancel hide button.
532 ## inline for has a file, and line-number together with cancel hide button.
534 % if form_type == 'inline':
533 % if form_type == 'inline':
535 <input type="hidden" name="f_path" value="{0}">
534 <input type="hidden" name="f_path" value="{0}">
536 <input type="hidden" name="line" value="${lineno_id}">
535 <input type="hidden" name="line" value="${lineno_id}">
537 <span style="opacity: 0.7" class="cursor-pointer cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
536 <span style="opacity: 0.7" class="cursor-pointer cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
538 ${_('dismiss')}
537 ${_('dismiss')}
539 </span>
538 </span>
540 % endif
539 % endif
541 </div>
540 </div>
542
541
543 <div class="toolbar-text">
542 <div class="toolbar-text">
544 <% renderer_url = '<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper()) %>
543 <% renderer_url = '<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper()) %>
545 <span>${_('{} is supported.').format(renderer_url)|n}
544 <span>${_('{} is supported.').format(renderer_url)|n}
546
545
547 <i class="icon-info-circled tooltip-hovercard"
546 <i class="icon-info-circled tooltip-hovercard"
548 data-hovercard-alt="ALT"
547 data-hovercard-alt="ALT"
549 data-hovercard-url="javascript:commentHelp('${c.visual.default_renderer.upper()}')"
548 data-hovercard-url="javascript:commentHelp('${c.visual.default_renderer.upper()}')"
550 data-comment-json-b64='${h.b64(h.str_json({}))}'></i>
549 data-comment-json-b64='${h.b64(h.str_json({}))}'></i>
551 </span>
550 </span>
552 </div>
551 </div>
553 </div>
552 </div>
554
553
555 </form>
554 </form>
556
555
557 </%def> No newline at end of file
556 </%def>
@@ -1,123 +1,122 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('%s Commits') % c.repo_name} -
4 ${_('%s Commits') % c.repo_name} -
6 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}
5 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}
7 ...
6 ...
8 r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
7 r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
9 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
8 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
10 %if c.rhodecode_name:
9 %if c.rhodecode_name:
11 &middot; ${h.branding(c.rhodecode_name)}
10 &middot; ${h.branding(c.rhodecode_name)}
12 %endif
11 %endif
13 </%def>
12 </%def>
14
13
15 <%def name="breadcrumbs_links()"></%def>
14 <%def name="breadcrumbs_links()"></%def>
16
15
17 <%def name="menu_bar_nav()">
16 <%def name="menu_bar_nav()">
18 ${self.menu_items(active='repositories')}
17 ${self.menu_items(active='repositories')}
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_subnav()">
20 <%def name="menu_bar_subnav()">
22 ${self.repo_menu(active='commits')}
21 ${self.repo_menu(active='commits')}
23 </%def>
22 </%def>
24
23
25 <%def name="main()">
24 <%def name="main()">
26
25
27 <div class="box">
26 <div class="box">
28 <div class="summary changeset">
27 <div class="summary changeset">
29 <div class="summary-detail">
28 <div class="summary-detail">
30 <div class="summary-detail-header">
29 <div class="summary-detail-header">
31 <span class="breadcrumbs files_location">
30 <span class="breadcrumbs files_location">
32 <h4>
31 <h4>
33 ${_('Commit Range')}
32 ${_('Commit Range')}
34 </h4>
33 </h4>
35 </span>
34 </span>
36
35
37 <div class="clear-fix"></div>
36 <div class="clear-fix"></div>
38 </div>
37 </div>
39
38
40 <div class="fieldset">
39 <div class="fieldset">
41 <div class="left-label-summary">
40 <div class="left-label-summary">
42 <p class="spacing">${_('Range')}:</p>
41 <p class="spacing">${_('Range')}:</p>
43 <div class="right-label-summary">
42 <div class="right-label-summary">
44 <div class="code-header" >
43 <div class="code-header" >
45 <div class="compare_header">
44 <div class="compare_header">
46 <code class="fieldset-text-line">
45 <code class="fieldset-text-line">
47 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}
46 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}
48 ...
47 ...
49 r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
48 r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
50 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
49 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
51 </code>
50 </code>
52 </div>
51 </div>
53 </div>
52 </div>
54 </div>
53 </div>
55 </div>
54 </div>
56 </div>
55 </div>
57
56
58 <div class="fieldset">
57 <div class="fieldset">
59 <div class="left-label-summary">
58 <div class="left-label-summary">
60 <p class="spacing">${_('Diff Option')}:</p>
59 <p class="spacing">${_('Diff Option')}:</p>
61 <div class="right-label-summary">
60 <div class="right-label-summary">
62 <div class="code-header" >
61 <div class="code-header" >
63 <div class="compare_header">
62 <div class="compare_header">
64 <a class="btn btn-primary" href="${h.route_path('repo_compare',
63 <a class="btn btn-primary" href="${h.route_path('repo_compare',
65 repo_name=c.repo_name,
64 repo_name=c.repo_name,
66 source_ref_type='rev',
65 source_ref_type='rev',
67 source_ref=getattr(c.commit_ranges[0].parents[0] if c.commit_ranges[0].parents else h.EmptyCommit(), 'raw_id'),
66 source_ref=getattr(c.commit_ranges[0].parents[0] if c.commit_ranges[0].parents else h.EmptyCommit(), 'raw_id'),
68 target_ref_type='rev',
67 target_ref_type='rev',
69 target_ref=c.commit_ranges[-1].raw_id)}"
68 target_ref=c.commit_ranges[-1].raw_id)}"
70 >
69 >
71 ${_('Show combined diff')}
70 ${_('Show combined diff')}
72 </a>
71 </a>
73 </div>
72 </div>
74 </div>
73 </div>
75 </div>
74 </div>
76 </div>
75 </div>
77 </div>
76 </div>
78
77
79 <div class="clear-fix"></div>
78 <div class="clear-fix"></div>
80 </div> <!-- end summary-detail -->
79 </div> <!-- end summary-detail -->
81 </div> <!-- end summary -->
80 </div> <!-- end summary -->
82
81
83 <div id="changeset_compare_view_content">
82 <div id="changeset_compare_view_content">
84 <div class="pull-left">
83 <div class="pull-left">
85 <div class="btn-group">
84 <div class="btn-group">
86 <a class="${('collapsed' if c.collapse_all_commits else '')}" href="#expand-commits" onclick="toggleCommitExpand(this); return false" data-toggle-commits-cnt=${len(c.commit_ranges)} >
85 <a class="${('collapsed' if c.collapse_all_commits else '')}" href="#expand-commits" onclick="toggleCommitExpand(this); return false" data-toggle-commits-cnt=${len(c.commit_ranges)} >
87 % if c.collapse_all_commits:
86 % if c.collapse_all_commits:
88 <i class="icon-plus-squared-alt icon-no-margin"></i>
87 <i class="icon-plus-squared-alt icon-no-margin"></i>
89 ${_ungettext('Expand {} commit', 'Expand {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
88 ${_ungettext('Expand {} commit', 'Expand {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
90 % else:
89 % else:
91 <i class="icon-minus-squared-alt icon-no-margin"></i>
90 <i class="icon-minus-squared-alt icon-no-margin"></i>
92 ${_ungettext('Collapse {} commit', 'Collapse {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
91 ${_ungettext('Collapse {} commit', 'Collapse {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
93 % endif
92 % endif
94 </a>
93 </a>
95 </div>
94 </div>
96 </div>
95 </div>
97 ## Commit range generated below
96 ## Commit range generated below
98 <%include file="../compare/compare_commits.mako"/>
97 <%include file="../compare/compare_commits.mako"/>
99 <div class="cs_files">
98 <div class="cs_files">
100 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
99 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
101 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
100 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
102 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
101 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
103
102
104 %for commit in c.commit_ranges:
103 %for commit in c.commit_ranges:
105 ## commit range header for each individual diff
104 ## commit range header for each individual diff
106 <h3>
105 <h3>
107 <a class="tooltip-hovercard revision" data-hovercard-alt="Commit: ${commit.short_id}" data-hovercard-url="${h.route_path('hovercard_repo_commit', repo_name=c.repo_name, commit_id=commit.raw_id)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">
106 <a class="tooltip-hovercard revision" data-hovercard-alt="Commit: ${commit.short_id}" data-hovercard-url="${h.route_path('hovercard_repo_commit', repo_name=c.repo_name, commit_id=commit.raw_id)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">
108 ${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}
107 ${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}
109 </a>
108 </a>
110 </h3>
109 </h3>
111
110
112 ${cbdiffs.render_diffset_menu(c.changes[commit.raw_id])}
111 ${cbdiffs.render_diffset_menu(c.changes[commit.raw_id])}
113 ${cbdiffs.render_diffset(
112 ${cbdiffs.render_diffset(
114 diffset=c.changes[commit.raw_id],
113 diffset=c.changes[commit.raw_id],
115 collapse_when_files_over=5,
114 collapse_when_files_over=5,
116 commit=commit,
115 commit=commit,
117 )}
116 )}
118 %endfor
117 %endfor
119 </div>
118 </div>
120 </div>
119 </div>
121 </div>
120 </div>
122
121
123 </%def>
122 </%def>
@@ -1,353 +1,352 b''
1 ## -*- coding: utf-8 -*-
2
1
3 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
4
3
5 <%def name="title()">
4 <%def name="title()">
6 ${_('%s Changelog') % c.repo_name}
5 ${_('%s Changelog') % c.repo_name}
7 %if c.changelog_for_path:
6 %if c.changelog_for_path:
8 /${c.changelog_for_path}
7 /${c.changelog_for_path}
9 %endif
8 %endif
10 %if c.rhodecode_name:
9 %if c.rhodecode_name:
11 &middot; ${h.branding(c.rhodecode_name)}
10 &middot; ${h.branding(c.rhodecode_name)}
12 %endif
11 %endif
13 </%def>
12 </%def>
14
13
15 <%def name="breadcrumbs_links()">
14 <%def name="breadcrumbs_links()">
16 %if c.changelog_for_path:
15 %if c.changelog_for_path:
17 /${c.changelog_for_path}
16 /${c.changelog_for_path}
18 %endif
17 %endif
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_nav()">
20 <%def name="menu_bar_nav()">
22 ${self.menu_items(active='repositories')}
21 ${self.menu_items(active='repositories')}
23 </%def>
22 </%def>
24
23
25 <%def name="menu_bar_subnav()">
24 <%def name="menu_bar_subnav()">
26 ${self.repo_menu(active='commits')}
25 ${self.repo_menu(active='commits')}
27 </%def>
26 </%def>
28
27
29 <%def name="main()">
28 <%def name="main()">
30
29
31 <div class="box">
30 <div class="box">
32
31
33 <div class="title">
32 <div class="title">
34 <div id="filter_changelog">
33 <div id="filter_changelog">
35 ${h.hidden('branch_filter')}
34 ${h.hidden('branch_filter')}
36 %if c.selected_name:
35 %if c.selected_name:
37 <div class="btn btn-default" id="clear_filter" >
36 <div class="btn btn-default" id="clear_filter" >
38 ${_('Clear filter')}
37 ${_('Clear filter')}
39 </div>
38 </div>
40 %endif
39 %endif
41 </div>
40 </div>
42 <div class="pull-left obsolete-toggle">
41 <div class="pull-left obsolete-toggle">
43 % if h.is_hg(c.rhodecode_repo):
42 % if h.is_hg(c.rhodecode_repo):
44 % if c.show_hidden:
43 % if c.show_hidden:
45 <a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a>
44 <a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a>
46 % else:
45 % else:
47 <a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a>
46 <a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a>
48 % endif
47 % endif
49 % else:
48 % else:
50 <span class="action-link disabled">${_('Show hidden')}</span>
49 <span class="action-link disabled">${_('Show hidden')}</span>
51 % endif
50 % endif
52 </div>
51 </div>
53 <ul class="links">
52 <ul class="links">
54 <li>
53 <li>
55
54
56 %if c.rhodecode_db_repo.fork:
55 %if c.rhodecode_db_repo.fork:
57 <span>
56 <span>
58 <a id="compare_fork_button"
57 <a id="compare_fork_button"
59 title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
58 title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
60 class="btn btn-small"
59 class="btn btn-small"
61 href="${h.route_path('repo_compare',
60 href="${h.route_path('repo_compare',
62 repo_name=c.rhodecode_db_repo.fork.repo_name,
61 repo_name=c.rhodecode_db_repo.fork.repo_name,
63 source_ref_type=c.rhodecode_db_repo.landing_ref_type,
62 source_ref_type=c.rhodecode_db_repo.landing_ref_type,
64 source_ref=c.rhodecode_db_repo.landing_ref_name,
63 source_ref=c.rhodecode_db_repo.landing_ref_name,
65 target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_ref_type,
64 target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_ref_type,
66 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_ref_name,
65 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_ref_name,
67 _query=dict(merge=1, target_repo=c.repo_name))}"
66 _query=dict(merge=1, target_repo=c.repo_name))}"
68 >
67 >
69 ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)}
68 ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)}
70 </a>
69 </a>
71 </span>
70 </span>
72 %endif
71 %endif
73
72
74 ## pr open link
73 ## pr open link
75 %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo):
74 %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo):
76 <span>
75 <span>
77 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">
76 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">
78 ${_('Open new pull request')}
77 ${_('Open new pull request')}
79 </a>
78 </a>
80 </span>
79 </span>
81 %endif
80 %endif
82
81
83 </li>
82 </li>
84 </ul>
83 </ul>
85 </div>
84 </div>
86
85
87 % if c.pagination:
86 % if c.pagination:
88 <script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script>
87 <script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script>
89
88
90 <div class="graph-header">
89 <div class="graph-header">
91 ${self.breadcrumbs('breadcrumbs_light')}
90 ${self.breadcrumbs('breadcrumbs_light')}
92 </div>
91 </div>
93
92
94 <div id="graph">
93 <div id="graph">
95 <div class="graph-col-wrapper">
94 <div class="graph-col-wrapper">
96 <div id="graph_nodes">
95 <div id="graph_nodes">
97 <div id="graph_canvas"></div>
96 <div id="graph_canvas"></div>
98 </div>
97 </div>
99 <div id="graph_content" class="graph_full_width">
98 <div id="graph_content" class="graph_full_width">
100
99
101 <div class="table">
100 <div class="table">
102 <table id="changesets" class="rctable table-bordered">
101 <table id="changesets" class="rctable table-bordered">
103 <tr>
102 <tr>
104 ## checkbox
103 ## checkbox
105 <th colspan="4">
104 <th colspan="4">
106 ## clear selection
105 ## clear selection
107 <div title="${_('Clear selection')}" class="btn btn-sm" id="rev_range_clear" style="display:none">
106 <div title="${_('Clear selection')}" class="btn btn-sm" id="rev_range_clear" style="display:none">
108 <i class="icon-cancel-circled2"></i>
107 <i class="icon-cancel-circled2"></i>
109 </div>
108 </div>
110 <div class="btn btn-sm disabled" disabled="disabled" id="rev_range_more" style="display:none;">${_('Select second commit')}</div>
109 <div class="btn btn-sm disabled" disabled="disabled" id="rev_range_more" style="display:none;">${_('Select second commit')}</div>
111
110
112 <div id="rev_range_action" class="btn-group btn-group-actions" style="display:none;">
111 <div id="rev_range_action" class="btn-group btn-group-actions" style="display:none;">
113 <a href="#" class="btn btn-success btn-sm" id="rev_range_container" style="display:none;"></a>
112 <a href="#" class="btn btn-success btn-sm" id="rev_range_container" style="display:none;"></a>
114
113
115 <a class="btn btn-success btn-sm btn-more-option" data-toggle="dropdown" aria-pressed="false" role="button">
114 <a class="btn btn-success btn-sm btn-more-option" data-toggle="dropdown" aria-pressed="false" role="button">
116 <i class="icon-down"></i>
115 <i class="icon-down"></i>
117 </a>
116 </a>
118
117
119 <div class="btn-action-switcher-container right-align">
118 <div class="btn-action-switcher-container right-align">
120 <ul class="btn-action-switcher" role="menu" style="min-width: 220px; width: max-content">
119 <ul class="btn-action-switcher" role="menu" style="min-width: 220px; width: max-content">
121 <li>
120 <li>
122 ## JS fills the URL
121 ## JS fills the URL
123 <a id="rev_range_combined_url" class="btn btn-primary btn-sm" href="">
122 <a id="rev_range_combined_url" class="btn btn-primary btn-sm" href="">
124 ${_('Show combined diff')}
123 ${_('Show combined diff')}
125 </a>
124 </a>
126 </li>
125 </li>
127 </ul>
126 </ul>
128 </div>
127 </div>
129 </div>
128 </div>
130
129
131 </th>
130 </th>
132
131
133 ## commit message expand arrow
132 ## commit message expand arrow
134 <th></th>
133 <th></th>
135 <th>${_('Commit Message')}</th>
134 <th>${_('Commit Message')}</th>
136
135
137 <th>${_('Age')}</th>
136 <th>${_('Age')}</th>
138 <th>${_('Author')}</th>
137 <th>${_('Author')}</th>
139
138
140 <th>${_('Refs')}</th>
139 <th>${_('Refs')}</th>
141 ## comments
140 ## comments
142 <th></th>
141 <th></th>
143 </tr>
142 </tr>
144
143
145 <tbody class="commits-range">
144 <tbody class="commits-range">
146 <%include file='changelog_elements.mako'/>
145 <%include file='changelog_elements.mako'/>
147 </tbody>
146 </tbody>
148 </table>
147 </table>
149 </div>
148 </div>
150 </div>
149 </div>
151 <div class="pagination-wh pagination-left">
150 <div class="pagination-wh pagination-left">
152 ${c.pagination.render()}
151 ${c.pagination.render()}
153 </div>
152 </div>
154 <div id="commit-counter" data-total=${c.total_cs} class="pull-right">
153 <div id="commit-counter" data-total=${c.total_cs} class="pull-right">
155 ${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)}
154 ${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)}
156 </div>
155 </div>
157 </div>
156 </div>
158
157
159 <script type="text/javascript">
158 <script type="text/javascript">
160 var cache = {};
159 var cache = {};
161 $(function(){
160 $(function(){
162
161
163 // Create links to commit ranges when range checkboxes are selected
162 // Create links to commit ranges when range checkboxes are selected
164 var $commitCheckboxes = $('.commit-range');
163 var $commitCheckboxes = $('.commit-range');
165 // cache elements
164 // cache elements
166 var $commitRangeMore = $('#rev_range_more');
165 var $commitRangeMore = $('#rev_range_more');
167 var $commitRangeContainer = $('#rev_range_container');
166 var $commitRangeContainer = $('#rev_range_container');
168 var $commitRangeClear = $('#rev_range_clear');
167 var $commitRangeClear = $('#rev_range_clear');
169 var $commitRangeAction = $('#rev_range_action');
168 var $commitRangeAction = $('#rev_range_action');
170 var $commitRangeCombinedUrl = $('#rev_range_combined_url');
169 var $commitRangeCombinedUrl = $('#rev_range_combined_url');
171 var $compareFork = $('#compare_fork_button');
170 var $compareFork = $('#compare_fork_button');
172
171
173 var checkboxRangeSelector = function(e){
172 var checkboxRangeSelector = function(e){
174 var selectedCheckboxes = [];
173 var selectedCheckboxes = [];
175 for (pos in $commitCheckboxes){
174 for (pos in $commitCheckboxes){
176 if($commitCheckboxes[pos].checked){
175 if($commitCheckboxes[pos].checked){
177 selectedCheckboxes.push($commitCheckboxes[pos]);
176 selectedCheckboxes.push($commitCheckboxes[pos]);
178 }
177 }
179 }
178 }
180 var open_new_pull_request = $('#open_new_pull_request');
179 var open_new_pull_request = $('#open_new_pull_request');
181
180
182 if (open_new_pull_request) {
181 if (open_new_pull_request) {
183 var selected_changes = selectedCheckboxes.length;
182 var selected_changes = selectedCheckboxes.length;
184 open_new_pull_request.hide();
183 open_new_pull_request.hide();
185 if (selected_changes == 1) {
184 if (selected_changes == 1) {
186 open_new_pull_request.html(_gettext('Open new pull request for selected commit'));
185 open_new_pull_request.html(_gettext('Open new pull request for selected commit'));
187 } else {
186 } else {
188 open_new_pull_request.html(_gettext('Open new pull request'));
187 open_new_pull_request.html(_gettext('Open new pull request'));
189 }
188 }
190 open_new_pull_request.show();
189 open_new_pull_request.show();
191 }
190 }
192
191
193 if (selectedCheckboxes.length > 0) {
192 if (selectedCheckboxes.length > 0) {
194 $compareFork.hide();
193 $compareFork.hide();
195 var commitStart = $(selectedCheckboxes[selectedCheckboxes.length-1]).data();
194 var commitStart = $(selectedCheckboxes[selectedCheckboxes.length-1]).data();
196 var revStart = commitStart.commitId;
195 var revStart = commitStart.commitId;
197
196
198 var commitEnd = $(selectedCheckboxes[0]).data();
197 var commitEnd = $(selectedCheckboxes[0]).data();
199 var revEnd = commitEnd.commitId;
198 var revEnd = commitEnd.commitId;
200
199
201 var lbl_start = '{0}'.format(commitStart.commitIdx, commitStart.shortId);
200 var lbl_start = '{0}'.format(commitStart.commitIdx, commitStart.shortId);
202 var lbl_end = '{0}'.format(commitEnd.commitIdx, commitEnd.shortId);
201 var lbl_end = '{0}'.format(commitEnd.commitIdx, commitEnd.shortId);
203
202
204 var url = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}', 'commit_id': revStart+'...'+revEnd});
203 var url = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}', 'commit_id': revStart+'...'+revEnd});
205 var urlCombined = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}', 'commit_id': revStart+'...'+revEnd, 'redirect_combined': '1'});
204 var urlCombined = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}', 'commit_id': revStart+'...'+revEnd, 'redirect_combined': '1'});
206
205
207 var link = _gettext('Show commit range {0}<i class="icon-angle-right"></i>{1}').format(lbl_start, lbl_end);
206 var link = _gettext('Show commit range {0}<i class="icon-angle-right"></i>{1}').format(lbl_start, lbl_end);
208
207
209 if (selectedCheckboxes.length > 1) {
208 if (selectedCheckboxes.length > 1) {
210 $commitRangeClear.show();
209 $commitRangeClear.show();
211 $commitRangeMore.hide();
210 $commitRangeMore.hide();
212
211
213 $commitRangeContainer
212 $commitRangeContainer
214 .attr('href',url)
213 .attr('href',url)
215 .html(link)
214 .html(link)
216 .show();
215 .show();
217
216
218 $commitRangeCombinedUrl.attr('href', urlCombined);
217 $commitRangeCombinedUrl.attr('href', urlCombined);
219 $commitRangeAction.show();
218 $commitRangeAction.show();
220
219
221 } else {
220 } else {
222 $commitRangeContainer.hide();
221 $commitRangeContainer.hide();
223 $commitRangeAction.hide();
222 $commitRangeAction.hide();
224 $commitRangeClear.show();
223 $commitRangeClear.show();
225 $commitRangeMore.show();
224 $commitRangeMore.show();
226 }
225 }
227
226
228 // pull-request link
227 // pull-request link
229 if (selectedCheckboxes.length == 1){
228 if (selectedCheckboxes.length == 1){
230 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}', 'commit': revEnd});
229 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}', 'commit': revEnd});
231 open_new_pull_request.attr('href', _url);
230 open_new_pull_request.attr('href', _url);
232 } else {
231 } else {
233 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}'});
232 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}'});
234 open_new_pull_request.attr('href', _url);
233 open_new_pull_request.attr('href', _url);
235 }
234 }
236
235
237 } else {
236 } else {
238 $commitRangeContainer.hide();
237 $commitRangeContainer.hide();
239 $commitRangeClear.hide();
238 $commitRangeClear.hide();
240 $commitRangeMore.hide();
239 $commitRangeMore.hide();
241 $commitRangeAction.hide();
240 $commitRangeAction.hide();
242
241
243 %if c.branch_name:
242 %if c.branch_name:
244 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}', 'branch':'${c.branch_name}'});
243 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}', 'branch':'${c.branch_name}'});
245 open_new_pull_request.attr('href', _url);
244 open_new_pull_request.attr('href', _url);
246 %else:
245 %else:
247 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}'});
246 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}'});
248 open_new_pull_request.attr('href', _url);
247 open_new_pull_request.attr('href', _url);
249 %endif
248 %endif
250 $compareFork.show();
249 $compareFork.show();
251 }
250 }
252 };
251 };
253
252
254 $commitCheckboxes.on('click', checkboxRangeSelector);
253 $commitCheckboxes.on('click', checkboxRangeSelector);
255
254
256 $commitRangeClear.on('click',function(e) {
255 $commitRangeClear.on('click',function(e) {
257 $commitCheckboxes.attr('checked', false);
256 $commitCheckboxes.attr('checked', false);
258 checkboxRangeSelector();
257 checkboxRangeSelector();
259 e.preventDefault();
258 e.preventDefault();
260 });
259 });
261
260
262 // make sure the buttons are consistent when navigate back and forth
261 // make sure the buttons are consistent when navigate back and forth
263 checkboxRangeSelector();
262 checkboxRangeSelector();
264
263
265 var msgs = $('.message');
264 var msgs = $('.message');
266 // get first element height
265 // get first element height
267 var el = $('#graph_content .container')[0];
266 var el = $('#graph_content .container')[0];
268 var row_h = el.clientHeight;
267 var row_h = el.clientHeight;
269 for (var i=0; i < msgs.length; i++) {
268 for (var i=0; i < msgs.length; i++) {
270 var m = msgs[i];
269 var m = msgs[i];
271
270
272 var h = m.clientHeight;
271 var h = m.clientHeight;
273 var pad = $(m).css('padding');
272 var pad = $(m).css('padding');
274 if (h > row_h) {
273 if (h > row_h) {
275 var offset = row_h - (h+12);
274 var offset = row_h - (h+12);
276 $(m.nextElementSibling).css('display','block');
275 $(m.nextElementSibling).css('display','block');
277 $(m.nextElementSibling).css('margin-top',offset+'px');
276 $(m.nextElementSibling).css('margin-top',offset+'px');
278 }
277 }
279 }
278 }
280
279
281 $("#clear_filter").on("click", function() {
280 $("#clear_filter").on("click", function() {
282 var filter = {'repo_name': '${c.repo_name}'};
281 var filter = {'repo_name': '${c.repo_name}'};
283 window.location = pyroutes.url('repo_commits', filter);
282 window.location = pyroutes.url('repo_commits', filter);
284 });
283 });
285
284
286 $("#branch_filter").select2({
285 $("#branch_filter").select2({
287 'dropdownAutoWidth': true,
286 'dropdownAutoWidth': true,
288 'width': 'resolve',
287 'width': 'resolve',
289 'placeholder': "${c.selected_name or _('Branch filter')}",
288 'placeholder': "${c.selected_name or _('Branch filter')}",
290 containerCssClass: "drop-menu",
289 containerCssClass: "drop-menu",
291 dropdownCssClass: "drop-menu-dropdown",
290 dropdownCssClass: "drop-menu-dropdown",
292 query: function(query){
291 query: function(query){
293 var key = 'cache';
292 var key = 'cache';
294 var cached = cache[key] ;
293 var cached = cache[key] ;
295 if(cached) {
294 if(cached) {
296 var data = {results: []};
295 var data = {results: []};
297 //filter results
296 //filter results
298 $.each(cached.results, function(){
297 $.each(cached.results, function(){
299 var section = this.text;
298 var section = this.text;
300 var children = [];
299 var children = [];
301 $.each(this.children, function(){
300 $.each(this.children, function(){
302 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
301 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
303 children.push({'id': this.id, 'text': this.text, 'type': this.type})
302 children.push({'id': this.id, 'text': this.text, 'type': this.type})
304 }
303 }
305 });
304 });
306 data.results.push({'text': section, 'children': children});
305 data.results.push({'text': section, 'children': children});
307 query.callback({results: data.results});
306 query.callback({results: data.results});
308 });
307 });
309 }else{
308 }else{
310 $.ajax({
309 $.ajax({
311 url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}),
310 url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}),
312 data: {},
311 data: {},
313 dataType: 'json',
312 dataType: 'json',
314 type: 'GET',
313 type: 'GET',
315 success: function(data) {
314 success: function(data) {
316 cache[key] = data;
315 cache[key] = data;
317 query.callback({results: data.results});
316 query.callback({results: data.results});
318 }
317 }
319 })
318 })
320 }
319 }
321 }
320 }
322 });
321 });
323 $('#branch_filter').on('change', function(e){
322 $('#branch_filter').on('change', function(e){
324 var data = $('#branch_filter').select2('data');
323 var data = $('#branch_filter').select2('data');
325 //type: branch_closed
324 //type: branch_closed
326 var selected = data.text;
325 var selected = data.text;
327 var filter = {'repo_name': '${c.repo_name}'};
326 var filter = {'repo_name': '${c.repo_name}'};
328 if(data.type == 'branch' || data.type == 'branch_closed'){
327 if(data.type == 'branch' || data.type == 'branch_closed'){
329 filter["branch"] = selected;
328 filter["branch"] = selected;
330 if (data.type == 'branch_closed') {
329 if (data.type == 'branch_closed') {
331 filter["evolve"] = '1';
330 filter["evolve"] = '1';
332 }
331 }
333 }
332 }
334 else if (data.type == 'book'){
333 else if (data.type == 'book'){
335 filter["bookmark"] = selected;
334 filter["bookmark"] = selected;
336 }
335 }
337 window.location = pyroutes.url('repo_commits', filter);
336 window.location = pyroutes.url('repo_commits', filter);
338 });
337 });
339
338
340 commitsController = new CommitsController();
339 commitsController = new CommitsController();
341 % if not c.changelog_for_path:
340 % if not c.changelog_for_path:
342 commitsController.reloadGraph();
341 commitsController.reloadGraph();
343 % endif
342 % endif
344
343
345 });
344 });
346
345
347 </script>
346 </script>
348 </div>
347 </div>
349 % else:
348 % else:
350 ${_('There are no changes yet')}
349 ${_('There are no changes yet')}
351 % endif
350 % endif
352 </div>
351 </div>
353 </%def>
352 </%def>
@@ -1,308 +1,307 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
2 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
4
3
5 <%def name="title()">
4 <%def name="title()">
6 %if c.compare_home:
5 %if c.compare_home:
7 ${_('%s Compare') % c.repo_name}
6 ${_('%s Compare') % c.repo_name}
8 %else:
7 %else:
9 ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} &gt; ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}
8 ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} &gt; ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}
10 %endif
9 %endif
11 %if c.rhodecode_name:
10 %if c.rhodecode_name:
12 &middot; ${h.branding(c.rhodecode_name)}
11 &middot; ${h.branding(c.rhodecode_name)}
13 %endif
12 %endif
14 </%def>
13 </%def>
15
14
16 <%def name="breadcrumbs_links()"></%def>
15 <%def name="breadcrumbs_links()"></%def>
17
16
18 <%def name="menu_bar_nav()">
17 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='repositories')}
18 ${self.menu_items(active='repositories')}
20 </%def>
19 </%def>
21
20
22 <%def name="menu_bar_subnav()">
21 <%def name="menu_bar_subnav()">
23 ${self.repo_menu(active='compare')}
22 ${self.repo_menu(active='compare')}
24 </%def>
23 </%def>
25
24
26 <%def name="main()">
25 <%def name="main()">
27 <script type="text/javascript">
26 <script type="text/javascript">
28 // set fake commitId on this commit-range page
27 // set fake commitId on this commit-range page
29 templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}";
28 templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}";
30 </script>
29 </script>
31
30
32 <div class="box">
31 <div class="box">
33 <div class="summary changeset">
32 <div class="summary changeset">
34 <div class="summary-detail">
33 <div class="summary-detail">
35 <div class="summary-detail-header">
34 <div class="summary-detail-header">
36 <span class="breadcrumbs files_location">
35 <span class="breadcrumbs files_location">
37 <h4>
36 <h4>
38 ${_('Compare Commits')}
37 ${_('Compare Commits')}
39 % if c.file_path:
38 % if c.file_path:
40 ${_('for file')} <a href="#${('a_' + h.FID('',c.file_path))}">${c.file_path}</a>
39 ${_('for file')} <a href="#${('a_' + h.FID('',c.file_path))}">${c.file_path}</a>
41 % endif
40 % endif
42
41
43 % if c.commit_ranges:
42 % if c.commit_ranges:
44 <code>
43 <code>
45 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}...r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
44 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}...r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
46 </code>
45 </code>
47 % endif
46 % endif
48 </h4>
47 </h4>
49 </span>
48 </span>
50
49
51 <div class="clear-fix"></div>
50 <div class="clear-fix"></div>
52 </div>
51 </div>
53
52
54 <div class="fieldset">
53 <div class="fieldset">
55 <div class="left-label-summary">
54 <div class="left-label-summary">
56 <p class="spacing">${_('Target')}:</p>
55 <p class="spacing">${_('Target')}:</p>
57 <div class="right-label-summary">
56 <div class="right-label-summary">
58 <div class="code-header" >
57 <div class="code-header" >
59 <div class="compare_header">
58 <div class="compare_header">
60 ## The hidden elements are replaced with a select2 widget
59 ## The hidden elements are replaced with a select2 widget
61 ${h.hidden('compare_source')}
60 ${h.hidden('compare_source')}
62 </div>
61 </div>
63 </div>
62 </div>
64 </div>
63 </div>
65 </div>
64 </div>
66 </div>
65 </div>
67
66
68 <div class="fieldset">
67 <div class="fieldset">
69 <div class="left-label-summary">
68 <div class="left-label-summary">
70 <p class="spacing">${_('Source')}:</p>
69 <p class="spacing">${_('Source')}:</p>
71 <div class="right-label-summary">
70 <div class="right-label-summary">
72 <div class="code-header" >
71 <div class="code-header" >
73 <div class="compare_header">
72 <div class="compare_header">
74 ## The hidden elements are replaced with a select2 widget
73 ## The hidden elements are replaced with a select2 widget
75 ${h.hidden('compare_target')}
74 ${h.hidden('compare_target')}
76 </div>
75 </div>
77 </div>
76 </div>
78 </div>
77 </div>
79 </div>
78 </div>
80 </div>
79 </div>
81
80
82 <div class="fieldset">
81 <div class="fieldset">
83 <div class="left-label-summary">
82 <div class="left-label-summary">
84 <p class="spacing">${_('Actions')}:</p>
83 <p class="spacing">${_('Actions')}:</p>
85 <div class="right-label-summary">
84 <div class="right-label-summary">
86 <div class="code-header" >
85 <div class="code-header" >
87 <div class="compare_header">
86 <div class="compare_header">
88 <div class="compare-buttons">
87 <div class="compare-buttons">
89 % if c.compare_home:
88 % if c.compare_home:
90 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
89 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
91 %if c.rhodecode_db_repo.fork:
90 %if c.rhodecode_db_repo.fork:
92
91
93 <a class="btn btn-default" title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
92 <a class="btn btn-default" title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
94 href="${h.route_path('repo_compare',
93 href="${h.route_path('repo_compare',
95 repo_name=c.rhodecode_db_repo.fork.repo_name,
94 repo_name=c.rhodecode_db_repo.fork.repo_name,
96 source_ref_type=c.rhodecode_db_repo.landing_ref_type,
95 source_ref_type=c.rhodecode_db_repo.landing_ref_type,
97 source_ref=c.rhodecode_db_repo.landing_ref_name,
96 source_ref=c.rhodecode_db_repo.landing_ref_name,
98 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_ref_type,
97 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_ref_type,
99 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_ref_name,
98 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_ref_name,
100 _query=dict(merge=1))}"
99 _query=dict(merge=1))}"
101 >
100 >
102 ${_('Compare with origin')}
101 ${_('Compare with origin')}
103 </a>
102 </a>
104
103
105 %endif
104 %endif
106
105
107 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
106 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
108 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
107 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
109 <div id="changeset_compare_view_content">
108 <div id="changeset_compare_view_content">
110 <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div>
109 <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div>
111 </div>
110 </div>
112
111
113 % elif c.preview_mode:
112 % elif c.preview_mode:
114 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a>
113 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a>
115 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
114 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
116 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
115 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
117
116
118 % else:
117 % else:
119 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
118 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
120 <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a>
119 <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a>
121
120
122 ## allow comment only if there are commits to comment on
121 ## allow comment only if there are commits to comment on
123 % if c.diffset and c.diffset.files and c.commit_ranges:
122 % if c.diffset and c.diffset.files and c.commit_ranges:
124 <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a>
123 <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a>
125 % else:
124 % else:
126 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
125 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
127 % endif
126 % endif
128 % endif
127 % endif
129 </div>
128 </div>
130 </div>
129 </div>
131 </div>
130 </div>
132 </div>
131 </div>
133 </div>
132 </div>
134 </div>
133 </div>
135
134
136 ## commit status form
135 ## commit status form
137 <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;">
136 <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;">
138 <div class="left-label-summary">
137 <div class="left-label-summary">
139 <p class="spacing">${_('Commit status')}:</p>
138 <p class="spacing">${_('Commit status')}:</p>
140 <div class="right-label-summary">
139 <div class="right-label-summary">
141 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
140 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
142 ## main comment form and it status
141 ## main comment form and it status
143 <%
142 <%
144 def revs(_revs):
143 def revs(_revs):
145 form_inputs = []
144 form_inputs = []
146 for cs in _revs:
145 for cs in _revs:
147 tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id}
146 tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id}
148 form_inputs.append(tmpl)
147 form_inputs.append(tmpl)
149 return form_inputs
148 return form_inputs
150 %>
149 %>
151 <div>
150 <div>
152 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))}
151 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))}
153 </div>
152 </div>
154 </div>
153 </div>
155 </div>
154 </div>
156 </div>
155 </div>
157 <div class="clear-fix"></div>
156 <div class="clear-fix"></div>
158 </div> <!-- end summary-detail -->
157 </div> <!-- end summary-detail -->
159 </div> <!-- end summary -->
158 </div> <!-- end summary -->
160
159
161 ## use JS script to load it quickly before potentially large diffs render long time
160 ## use JS script to load it quickly before potentially large diffs render long time
162 ## this prevents from situation when large diffs block rendering of select2 fields
161 ## this prevents from situation when large diffs block rendering of select2 fields
163 <script type="text/javascript">
162 <script type="text/javascript">
164
163
165 var cache = {};
164 var cache = {};
166
165
167 var formatSelection = function(repoName){
166 var formatSelection = function(repoName){
168 return function(data, container, escapeMarkup) {
167 return function(data, container, escapeMarkup) {
169 var selection = data ? this.text(data) : "";
168 var selection = data ? this.text(data) : "";
170 return escapeMarkup('{0}@{1}'.format(repoName, selection));
169 return escapeMarkup('{0}@{1}'.format(repoName, selection));
171 }
170 }
172 };
171 };
173
172
174 var feedCompareData = function(query, cachedValue){
173 var feedCompareData = function(query, cachedValue){
175 var data = {results: []};
174 var data = {results: []};
176 //filter results
175 //filter results
177 $.each(cachedValue.results, function() {
176 $.each(cachedValue.results, function() {
178 var section = this.text;
177 var section = this.text;
179 var children = [];
178 var children = [];
180 $.each(this.children, function() {
179 $.each(this.children, function() {
181 if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
180 if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
182 children.push({
181 children.push({
183 'id': this.id,
182 'id': this.id,
184 'text': this.text,
183 'text': this.text,
185 'type': this.type
184 'type': this.type
186 })
185 })
187 }
186 }
188 });
187 });
189 data.results.push({
188 data.results.push({
190 'text': section,
189 'text': section,
191 'children': children
190 'children': children
192 })
191 })
193 });
192 });
194 //push the typed in changeset
193 //push the typed in changeset
195 data.results.push({
194 data.results.push({
196 'text': _gettext('specify commit'),
195 'text': _gettext('specify commit'),
197 'children': [{
196 'children': [{
198 'id': query.term,
197 'id': query.term,
199 'text': query.term,
198 'text': query.term,
200 'type': 'rev'
199 'type': 'rev'
201 }]
200 }]
202 });
201 });
203 query.callback(data);
202 query.callback(data);
204 };
203 };
205
204
206 var loadCompareData = function(repoName, query, cache){
205 var loadCompareData = function(repoName, query, cache){
207 $.ajax({
206 $.ajax({
208 url: pyroutes.url('repo_refs_data', {'repo_name': repoName}),
207 url: pyroutes.url('repo_refs_data', {'repo_name': repoName}),
209 data: {},
208 data: {},
210 dataType: 'json',
209 dataType: 'json',
211 type: 'GET',
210 type: 'GET',
212 success: function(data) {
211 success: function(data) {
213 cache[repoName] = data;
212 cache[repoName] = data;
214 query.callback({results: data.results});
213 query.callback({results: data.results});
215 }
214 }
216 })
215 })
217 };
216 };
218
217
219 var enable_fields = ${"false" if c.preview_mode else "true"};
218 var enable_fields = ${"false" if c.preview_mode else "true"};
220 $("#compare_source").select2({
219 $("#compare_source").select2({
221 placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}",
220 placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}",
222 containerCssClass: "drop-menu",
221 containerCssClass: "drop-menu",
223 dropdownCssClass: "drop-menu-dropdown",
222 dropdownCssClass: "drop-menu-dropdown",
224 formatSelection: formatSelection("${c.source_repo.repo_name}"),
223 formatSelection: formatSelection("${c.source_repo.repo_name}"),
225 dropdownAutoWidth: true,
224 dropdownAutoWidth: true,
226 query: function(query) {
225 query: function(query) {
227 var repoName = '${c.source_repo.repo_name}';
226 var repoName = '${c.source_repo.repo_name}';
228 var cachedValue = cache[repoName];
227 var cachedValue = cache[repoName];
229
228
230 if (cachedValue){
229 if (cachedValue){
231 feedCompareData(query, cachedValue);
230 feedCompareData(query, cachedValue);
232 }
231 }
233 else {
232 else {
234 loadCompareData(repoName, query, cache);
233 loadCompareData(repoName, query, cache);
235 }
234 }
236 }
235 }
237 }).select2("enable", enable_fields);
236 }).select2("enable", enable_fields);
238
237
239 $("#compare_target").select2({
238 $("#compare_target").select2({
240 placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}",
239 placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}",
241 dropdownAutoWidth: true,
240 dropdownAutoWidth: true,
242 containerCssClass: "drop-menu",
241 containerCssClass: "drop-menu",
243 dropdownCssClass: "drop-menu-dropdown",
242 dropdownCssClass: "drop-menu-dropdown",
244 formatSelection: formatSelection("${c.target_repo.repo_name}"),
243 formatSelection: formatSelection("${c.target_repo.repo_name}"),
245 query: function(query) {
244 query: function(query) {
246 var repoName = '${c.target_repo.repo_name}';
245 var repoName = '${c.target_repo.repo_name}';
247 var cachedValue = cache[repoName];
246 var cachedValue = cache[repoName];
248
247
249 if (cachedValue){
248 if (cachedValue){
250 feedCompareData(query, cachedValue);
249 feedCompareData(query, cachedValue);
251 }
250 }
252 else {
251 else {
253 loadCompareData(repoName, query, cache);
252 loadCompareData(repoName, query, cache);
254 }
253 }
255 }
254 }
256 }).select2("enable", enable_fields);
255 }).select2("enable", enable_fields);
257 var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"};
256 var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"};
258 var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"};
257 var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"};
259
258
260 $('#compare_revs').on('click', function(e) {
259 $('#compare_revs').on('click', function(e) {
261 var source = $('#compare_source').select2('data') || initial_compare_source;
260 var source = $('#compare_source').select2('data') || initial_compare_source;
262 var target = $('#compare_target').select2('data') || initial_compare_target;
261 var target = $('#compare_target').select2('data') || initial_compare_target;
263 if (source && target) {
262 if (source && target) {
264 var url_data = {
263 var url_data = {
265 repo_name: "${c.repo_name}",
264 repo_name: "${c.repo_name}",
266 source_ref: source.id,
265 source_ref: source.id,
267 source_ref_type: source.type,
266 source_ref_type: source.type,
268 target_ref: target.id,
267 target_ref: target.id,
269 target_ref_type: target.type
268 target_ref_type: target.type
270 };
269 };
271 window.location = pyroutes.url('repo_compare', url_data);
270 window.location = pyroutes.url('repo_compare', url_data);
272 }
271 }
273 });
272 });
274 $('#compare_changeset_status_toggle').on('click', function(e) {
273 $('#compare_changeset_status_toggle').on('click', function(e) {
275 $('#compare_changeset_status').toggle();
274 $('#compare_changeset_status').toggle();
276 });
275 });
277
276
278 </script>
277 </script>
279
278
280 ## table diff data
279 ## table diff data
281 <div class="table">
280 <div class="table">
282 % if not c.compare_home:
281 % if not c.compare_home:
283 <div id="changeset_compare_view_content">
282 <div id="changeset_compare_view_content">
284 <div class="pull-left">
283 <div class="pull-left">
285 <div class="btn-group">
284 <div class="btn-group">
286 <a class="${('collapsed' if c.collapse_all_commits else '')}" href="#expand-commits" onclick="toggleCommitExpand(this); return false" data-toggle-commits-cnt=${len(c.commit_ranges)} >
285 <a class="${('collapsed' if c.collapse_all_commits else '')}" href="#expand-commits" onclick="toggleCommitExpand(this); return false" data-toggle-commits-cnt=${len(c.commit_ranges)} >
287 % if c.collapse_all_commits:
286 % if c.collapse_all_commits:
288 <i class="icon-plus-squared-alt icon-no-margin"></i>
287 <i class="icon-plus-squared-alt icon-no-margin"></i>
289 ${_ungettext('Expand {} commit', 'Expand {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
288 ${_ungettext('Expand {} commit', 'Expand {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
290 % else:
289 % else:
291 <i class="icon-minus-squared-alt icon-no-margin"></i>
290 <i class="icon-minus-squared-alt icon-no-margin"></i>
292 ${_ungettext('Collapse {} commit', 'Collapse {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
291 ${_ungettext('Collapse {} commit', 'Collapse {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
293 % endif
292 % endif
294 </a>
293 </a>
295 </div>
294 </div>
296 </div>
295 </div>
297 <div style="padding:0 10px 10px 0px" class="pull-left"></div>
296 <div style="padding:0 10px 10px 0px" class="pull-left"></div>
298 ## commit compare generated below
297 ## commit compare generated below
299 <%include file="compare_commits.mako"/>
298 <%include file="compare_commits.mako"/>
300 ${cbdiffs.render_diffset_menu(c.diffset)}
299 ${cbdiffs.render_diffset_menu(c.diffset)}
301 ${cbdiffs.render_diffset(c.diffset)}
300 ${cbdiffs.render_diffset(c.diffset)}
302 </div>
301 </div>
303 % endif
302 % endif
304
303
305 </div>
304 </div>
306 </div>
305 </div>
307
306
308 </%def>
307 </%def>
@@ -1,645 +1,644 b''
1 ## -*- coding: utf-8 -*-
2
1
3 ## helpers
2 ## helpers
4 <%def name="tag_button(text, tag_type=None)">
3 <%def name="tag_button(text, tag_type=None)">
5 <%
4 <%
6 color_scheme = {
5 color_scheme = {
7 'default': 'border:1px solid #979797;color:#666666;background-color:#f9f9f9',
6 'default': 'border:1px solid #979797;color:#666666;background-color:#f9f9f9',
8 'approved': 'border:1px solid #0ac878;color:#0ac878;background-color:#f9f9f9',
7 'approved': 'border:1px solid #0ac878;color:#0ac878;background-color:#f9f9f9',
9 'rejected': 'border:1px solid #e85e4d;color:#e85e4d;background-color:#f9f9f9',
8 'rejected': 'border:1px solid #e85e4d;color:#e85e4d;background-color:#f9f9f9',
10 'under_review': 'border:1px solid #ffc854;color:#ffc854;background-color:#f9f9f9',
9 'under_review': 'border:1px solid #ffc854;color:#ffc854;background-color:#f9f9f9',
11 }
10 }
12
11
13 css_style = ';'.join([
12 css_style = ';'.join([
14 'display:inline',
13 'display:inline',
15 'border-radius:2px',
14 'border-radius:2px',
16 'font-size:12px',
15 'font-size:12px',
17 'padding:.2em',
16 'padding:.2em',
18 ])
17 ])
19
18
20 %>
19 %>
21 <pre style="${css_style}; ${color_scheme.get(tag_type, color_scheme['default'])}">${text}</pre>
20 <pre style="${css_style}; ${color_scheme.get(tag_type, color_scheme['default'])}">${text}</pre>
22 </%def>
21 </%def>
23
22
24 <%def name="status_text(text, tag_type=None)">
23 <%def name="status_text(text, tag_type=None)">
25 <%
24 <%
26 color_scheme = {
25 color_scheme = {
27 'default': 'color:#666666',
26 'default': 'color:#666666',
28 'approved': 'color:#0ac878',
27 'approved': 'color:#0ac878',
29 'rejected': 'color:#e85e4d',
28 'rejected': 'color:#e85e4d',
30 'under_review': 'color:#ffc854',
29 'under_review': 'color:#ffc854',
31 }
30 }
32 %>
31 %>
33 <span style="font-weight:bold;font-size:12px;padding:.2em;${color_scheme.get(tag_type, color_scheme['default'])}">${text}</span>
32 <span style="font-weight:bold;font-size:12px;padding:.2em;${color_scheme.get(tag_type, color_scheme['default'])}">${text}</span>
34 </%def>
33 </%def>
35
34
36 <%def name="gravatar_img(email, size=16)">
35 <%def name="gravatar_img(email, size=16)">
37 <%
36 <%
38 css_style = ';'.join([
37 css_style = ';'.join([
39 'padding: 0',
38 'padding: 0',
40 'margin: -4px 0',
39 'margin: -4px 0',
41 'border-radius: 50%',
40 'border-radius: 50%',
42 'box-sizing: content-box',
41 'box-sizing: content-box',
43 'display: inline',
42 'display: inline',
44 'line-height: 1em',
43 'line-height: 1em',
45 'min-width: 16px',
44 'min-width: 16px',
46 'min-height: 16px',
45 'min-height: 16px',
47 ])
46 ])
48 %>
47 %>
49
48
50 <img alt="gravatar" style="${css_style}" src="${h.gravatar_url(email, size)}" height="${size}" width="${size}">
49 <img alt="gravatar" style="${css_style}" src="${h.gravatar_url(email, size)}" height="${size}" width="${size}">
51 </%def>
50 </%def>
52
51
53 <%def name="link_css()">\
52 <%def name="link_css()">\
54 <%
53 <%
55 css_style = ';'.join([
54 css_style = ';'.join([
56 'color:#427cc9',
55 'color:#427cc9',
57 'text-decoration:none',
56 'text-decoration:none',
58 'cursor:pointer'
57 'cursor:pointer'
59 ])
58 ])
60 %>\
59 %>\
61 ${css_style}\
60 ${css_style}\
62 </%def>
61 </%def>
63
62
64 ## Constants
63 ## Constants
65 <%
64 <%
66 text_regular = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, sans-serif"
65 text_regular = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, sans-serif"
67 text_monospace = "'Menlo', 'Liberation Mono', 'Consolas', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace"
66 text_monospace = "'Menlo', 'Liberation Mono', 'Consolas', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace"
68
67
69 %>
68 %>
70
69
71 <%def name="plaintext_footer()" filter="trim">
70 <%def name="plaintext_footer()" filter="trim">
72 ${_('This is a notification from RhodeCode.')} ${instance_url}
71 ${_('This is a notification from RhodeCode.')} ${instance_url}
73 </%def>
72 </%def>
74
73
75 <%def name="body_plaintext()" filter="n,trim">
74 <%def name="body_plaintext()" filter="n,trim">
76 ## this example is not called itself but overridden in each template
75 ## this example is not called itself but overridden in each template
77 ## the plaintext_footer should be at the bottom of both html and text emails
76 ## the plaintext_footer should be at the bottom of both html and text emails
78 ${self.plaintext_footer()}
77 ${self.plaintext_footer()}
79 </%def>
78 </%def>
80
79
81 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
80 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
82 <html xmlns="http://www.w3.org/1999/xhtml">
81 <html xmlns="http://www.w3.org/1999/xhtml">
83 <head>
82 <head>
84 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
83 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
85 <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
84 <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
86 <title>${self.subject()}</title>
85 <title>${self.subject()}</title>
87 <style type="text/css">
86 <style type="text/css">
88 /* Based on The MailChimp Reset INLINE: Yes. */
87 /* Based on The MailChimp Reset INLINE: Yes. */
89 #outlook a {
88 #outlook a {
90 padding: 0;
89 padding: 0;
91 }
90 }
92
91
93 /* Force Outlook to provide a "view in browser" menu link. */
92 /* Force Outlook to provide a "view in browser" menu link. */
94 body {
93 body {
95 width: 100% !important;
94 width: 100% !important;
96 -webkit-text-size-adjust: 100%;
95 -webkit-text-size-adjust: 100%;
97 -ms-text-size-adjust: 100%;
96 -ms-text-size-adjust: 100%;
98 margin: 0;
97 margin: 0;
99 padding: 0;
98 padding: 0;
100 font-family: ${text_regular|n};
99 font-family: ${text_regular|n};
101 color: #000000;
100 color: #000000;
102 }
101 }
103
102
104 /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
103 /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
105 .ExternalClass {
104 .ExternalClass {
106 width: 100%;
105 width: 100%;
107 }
106 }
108
107
109 /* Force Hotmail to display emails at full width */
108 /* Force Hotmail to display emails at full width */
110 .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
109 .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
111 line-height: 100%;
110 line-height: 100%;
112 }
111 }
113
112
114 /* Forces Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */
113 /* Forces Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */
115 #backgroundTable {
114 #backgroundTable {
116 margin: 0;
115 margin: 0;
117 padding: 0;
116 padding: 0;
118 line-height: 100% !important;
117 line-height: 100% !important;
119 }
118 }
120
119
121 /* End reset */
120 /* End reset */
122
121
123 /* defaults for images*/
122 /* defaults for images*/
124 img {
123 img {
125 outline: none;
124 outline: none;
126 text-decoration: none;
125 text-decoration: none;
127 -ms-interpolation-mode: bicubic;
126 -ms-interpolation-mode: bicubic;
128 }
127 }
129
128
130 a img {
129 a img {
131 border: none;
130 border: none;
132 }
131 }
133
132
134 .image_fix {
133 .image_fix {
135 display: block;
134 display: block;
136 }
135 }
137
136
138 body {
137 body {
139 line-height: 1.2em;
138 line-height: 1.2em;
140 }
139 }
141
140
142 p {
141 p {
143 margin: 0 0 20px;
142 margin: 0 0 20px;
144 }
143 }
145
144
146 h1, h2, h3, h4, h5, h6 {
145 h1, h2, h3, h4, h5, h6 {
147 color: #323232 !important;
146 color: #323232 !important;
148 }
147 }
149
148
150 a {
149 a {
151 color: #427cc9;
150 color: #427cc9;
152 text-decoration: none;
151 text-decoration: none;
153 outline: none;
152 outline: none;
154 cursor: pointer;
153 cursor: pointer;
155 }
154 }
156
155
157 a:focus {
156 a:focus {
158 outline: none;
157 outline: none;
159 }
158 }
160
159
161 a:hover {
160 a:hover {
162 color: #305b91;
161 color: #305b91;
163 }
162 }
164
163
165 h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
164 h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
166 color: #427cc9 !important;
165 color: #427cc9 !important;
167 text-decoration: none !important;
166 text-decoration: none !important;
168 }
167 }
169
168
170 h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
169 h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
171 color: #305b91 !important;
170 color: #305b91 !important;
172 }
171 }
173
172
174 h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
173 h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
175 color: #305b91 !important;
174 color: #305b91 !important;
176 }
175 }
177
176
178 table {
177 table {
179 font-size: 13px;
178 font-size: 13px;
180 border-collapse: collapse;
179 border-collapse: collapse;
181 mso-table-lspace: 0pt;
180 mso-table-lspace: 0pt;
182 mso-table-rspace: 0pt;
181 mso-table-rspace: 0pt;
183 }
182 }
184
183
185 table tr {
184 table tr {
186 display: table-row;
185 display: table-row;
187 vertical-align: inherit;
186 vertical-align: inherit;
188 border-color: inherit;
187 border-color: inherit;
189 border-spacing: 0 3px;
188 border-spacing: 0 3px;
190 }
189 }
191
190
192 table td {
191 table td {
193 padding: .65em 1em .65em 0;
192 padding: .65em 1em .65em 0;
194 border-collapse: collapse;
193 border-collapse: collapse;
195 vertical-align: top;
194 vertical-align: top;
196 text-align: left;
195 text-align: left;
197 }
196 }
198
197
199 input {
198 input {
200 display: inline;
199 display: inline;
201 border-radius: 2px;
200 border-radius: 2px;
202 border: 1px solid #dbd9da;
201 border: 1px solid #dbd9da;
203 padding: .5em;
202 padding: .5em;
204 }
203 }
205
204
206 input:focus {
205 input:focus {
207 outline: 1px solid #979797
206 outline: 1px solid #979797
208 }
207 }
209
208
210 code {
209 code {
211 font-family: ${text_monospace|n};
210 font-family: ${text_monospace|n};
212 white-space: pre-line !important;
211 white-space: pre-line !important;
213 color: #000000;
212 color: #000000;
214 }
213 }
215
214
216 ul.changes-ul {
215 ul.changes-ul {
217 list-style: none;
216 list-style: none;
218 list-style-type: none;
217 list-style-type: none;
219 padding: 0;
218 padding: 0;
220 margin: 10px 0;
219 margin: 10px 0;
221 }
220 }
222 ul.changes-ul li {
221 ul.changes-ul li {
223 list-style: none;
222 list-style: none;
224 list-style-type: none;
223 list-style-type: none;
225 margin: 2px 0;
224 margin: 2px 0;
226 }
225 }
227
226
228 @media only screen and (-webkit-min-device-pixel-ratio: 2) {
227 @media only screen and (-webkit-min-device-pixel-ratio: 2) {
229 /* Put your iPhone 4g styles in here */
228 /* Put your iPhone 4g styles in here */
230 }
229 }
231
230
232 /* Android targeting */
231 /* Android targeting */
233 @media only screen and (-webkit-device-pixel-ratio:.75){
232 @media only screen and (-webkit-device-pixel-ratio:.75){
234 /* Put CSS for low density (ldpi) Android layouts in here */
233 /* Put CSS for low density (ldpi) Android layouts in here */
235 }
234 }
236 @media only screen and (-webkit-device-pixel-ratio:1){
235 @media only screen and (-webkit-device-pixel-ratio:1){
237 /* Put CSS for medium density (mdpi) Android layouts in here */
236 /* Put CSS for medium density (mdpi) Android layouts in here */
238 }
237 }
239 @media only screen and (-webkit-device-pixel-ratio:1.5){
238 @media only screen and (-webkit-device-pixel-ratio:1.5){
240 /* Put CSS for high density (hdpi) Android layouts in here */
239 /* Put CSS for high density (hdpi) Android layouts in here */
241 }
240 }
242 /* end Android targeting */
241 /* end Android targeting */
243
242
244 /** MARKDOWN styling **/
243 /** MARKDOWN styling **/
245 div.markdown-block {
244 div.markdown-block {
246 clear: both;
245 clear: both;
247 overflow: hidden;
246 overflow: hidden;
248 margin: 0;
247 margin: 0;
249 padding: 3px 5px 3px
248 padding: 3px 5px 3px
250 }
249 }
251
250
252 div.markdown-block h1,
251 div.markdown-block h1,
253 div.markdown-block h2,
252 div.markdown-block h2,
254 div.markdown-block h3,
253 div.markdown-block h3,
255 div.markdown-block h4,
254 div.markdown-block h4,
256 div.markdown-block h5,
255 div.markdown-block h5,
257 div.markdown-block h6 {
256 div.markdown-block h6 {
258 border-bottom: none !important;
257 border-bottom: none !important;
259 padding: 0 !important;
258 padding: 0 !important;
260 overflow: visible !important
259 overflow: visible !important
261 }
260 }
262
261
263 div.markdown-block h1,
262 div.markdown-block h1,
264 div.markdown-block h2 {
263 div.markdown-block h2 {
265 border-bottom: 1px #e6e5e5 solid !important
264 border-bottom: 1px #e6e5e5 solid !important
266 }
265 }
267
266
268 div.markdown-block h1 {
267 div.markdown-block h1 {
269 font-size: 32px;
268 font-size: 32px;
270 margin: 15px 0 15px 0 !important;
269 margin: 15px 0 15px 0 !important;
271 padding-bottom: 5px !important
270 padding-bottom: 5px !important
272 }
271 }
273
272
274 div.markdown-block h2 {
273 div.markdown-block h2 {
275 font-size: 24px !important;
274 font-size: 24px !important;
276 margin: 34px 0 10px 0 !important;
275 margin: 34px 0 10px 0 !important;
277 padding-top: 15px !important;
276 padding-top: 15px !important;
278 padding-bottom: 8px !important
277 padding-bottom: 8px !important
279 }
278 }
280
279
281 div.markdown-block h3 {
280 div.markdown-block h3 {
282 font-size: 18px !important;
281 font-size: 18px !important;
283 margin: 30px 0 8px 0 !important;
282 margin: 30px 0 8px 0 !important;
284 padding-bottom: 2px !important
283 padding-bottom: 2px !important
285 }
284 }
286
285
287 div.markdown-block h4 {
286 div.markdown-block h4 {
288 font-size: 13px !important;
287 font-size: 13px !important;
289 margin: 18px 0 3px 0 !important
288 margin: 18px 0 3px 0 !important
290 }
289 }
291
290
292 div.markdown-block h5 {
291 div.markdown-block h5 {
293 font-size: 12px !important;
292 font-size: 12px !important;
294 margin: 15px 0 3px 0 !important
293 margin: 15px 0 3px 0 !important
295 }
294 }
296
295
297 div.markdown-block h6 {
296 div.markdown-block h6 {
298 font-size: 12px;
297 font-size: 12px;
299 color: #777777;
298 color: #777777;
300 margin: 15px 0 3px 0 !important
299 margin: 15px 0 3px 0 !important
301 }
300 }
302
301
303 div.markdown-block hr {
302 div.markdown-block hr {
304 border: 0;
303 border: 0;
305 color: #e6e5e5;
304 color: #e6e5e5;
306 background-color: #e6e5e5;
305 background-color: #e6e5e5;
307 height: 3px;
306 height: 3px;
308 margin-bottom: 13px
307 margin-bottom: 13px
309 }
308 }
310
309
311 div.markdown-block ol,
310 div.markdown-block ol,
312 div.markdown-block ul,
311 div.markdown-block ul,
313 div.markdown-block p,
312 div.markdown-block p,
314 div.markdown-block blockquote,
313 div.markdown-block blockquote,
315 div.markdown-block dl,
314 div.markdown-block dl,
316 div.markdown-block li,
315 div.markdown-block li,
317 div.markdown-block table {
316 div.markdown-block table {
318 margin: 3px 0 13px 0 !important;
317 margin: 3px 0 13px 0 !important;
319 color: #424242 !important;
318 color: #424242 !important;
320 font-size: 13px !important;
319 font-size: 13px !important;
321 font-family: ${text_regular|n};
320 font-family: ${text_regular|n};
322 font-weight: normal !important;
321 font-weight: normal !important;
323 overflow: visible !important;
322 overflow: visible !important;
324 line-height: 140% !important
323 line-height: 140% !important
325 }
324 }
326
325
327 div.markdown-block pre {
326 div.markdown-block pre {
328 margin: 3px 0 13px 0 !important;
327 margin: 3px 0 13px 0 !important;
329 padding: .5em;
328 padding: .5em;
330 color: #424242 !important;
329 color: #424242 !important;
331 font-size: 13px !important;
330 font-size: 13px !important;
332 overflow: visible !important;
331 overflow: visible !important;
333 line-height: 140% !important;
332 line-height: 140% !important;
334 background-color: #F5F5F5
333 background-color: #F5F5F5
335 }
334 }
336
335
337 div.markdown-block img {
336 div.markdown-block img {
338 border-style: none;
337 border-style: none;
339 background-color: #fff;
338 background-color: #fff;
340 max-width: 100%
339 max-width: 100%
341 }
340 }
342
341
343 div.markdown-block strong {
342 div.markdown-block strong {
344 font-weight: 600;
343 font-weight: 600;
345 margin: 0
344 margin: 0
346 }
345 }
347
346
348 div.markdown-block ul.checkbox, div.markdown-block ol.checkbox {
347 div.markdown-block ul.checkbox, div.markdown-block ol.checkbox {
349 padding-left: 20px !important;
348 padding-left: 20px !important;
350 margin-top: 0 !important;
349 margin-top: 0 !important;
351 margin-bottom: 18px !important
350 margin-bottom: 18px !important
352 }
351 }
353
352
354 div.markdown-block ul, div.markdown-block ol {
353 div.markdown-block ul, div.markdown-block ol {
355 padding-left: 30px !important;
354 padding-left: 30px !important;
356 margin-top: 0 !important;
355 margin-top: 0 !important;
357 margin-bottom: 18px !important
356 margin-bottom: 18px !important
358 }
357 }
359
358
360 div.markdown-block ul.checkbox li, div.markdown-block ol.checkbox li {
359 div.markdown-block ul.checkbox li, div.markdown-block ol.checkbox li {
361 list-style: none !important;
360 list-style: none !important;
362 margin: 0px !important;
361 margin: 0px !important;
363 padding: 0 !important
362 padding: 0 !important
364 }
363 }
365
364
366 div.markdown-block ul li, div.markdown-block ol li {
365 div.markdown-block ul li, div.markdown-block ol li {
367 list-style: disc !important;
366 list-style: disc !important;
368 margin: 0px !important;
367 margin: 0px !important;
369 padding: 0 !important
368 padding: 0 !important
370 }
369 }
371
370
372 div.markdown-block ol li {
371 div.markdown-block ol li {
373 list-style: decimal !important
372 list-style: decimal !important
374 }
373 }
375
374
376 div.markdown-block #message {
375 div.markdown-block #message {
377 -webkit-border-radius: 2px;
376 -webkit-border-radius: 2px;
378 -moz-border-radius: 2px;
377 -moz-border-radius: 2px;
379 border-radius: 2px;
378 border-radius: 2px;
380 border: 1px solid #dbd9da;
379 border: 1px solid #dbd9da;
381 display: block;
380 display: block;
382 width: 100%;
381 width: 100%;
383 height: 60px;
382 height: 60px;
384 margin: 6px 0
383 margin: 6px 0
385 }
384 }
386
385
387 div.markdown-block button, div.markdown-block #ws {
386 div.markdown-block button, div.markdown-block #ws {
388 font-size: 13px;
387 font-size: 13px;
389 padding: 4px 6px;
388 padding: 4px 6px;
390 -webkit-border-radius: 2px;
389 -webkit-border-radius: 2px;
391 -moz-border-radius: 2px;
390 -moz-border-radius: 2px;
392 border-radius: 2px;
391 border-radius: 2px;
393 border: 1px solid #dbd9da;
392 border: 1px solid #dbd9da;
394 background-color: #eeeeee
393 background-color: #eeeeee
395 }
394 }
396
395
397 div.markdown-block p {
396 div.markdown-block p {
398 margin-top: 0;
397 margin-top: 0;
399 margin-bottom: 16px;
398 margin-bottom: 16px;
400 padding: 0;
399 padding: 0;
401 line-height: unset;
400 line-height: unset;
402 }
401 }
403
402
404 div.markdown-block code,
403 div.markdown-block code,
405 div.markdown-block pre,
404 div.markdown-block pre,
406 div.markdown-block #ws,
405 div.markdown-block #ws,
407 div.markdown-block #message {
406 div.markdown-block #message {
408 font-family: ${text_monospace|n};
407 font-family: ${text_monospace|n};
409 font-size: 11px;
408 font-size: 11px;
410 -webkit-border-radius: 2px;
409 -webkit-border-radius: 2px;
411 -moz-border-radius: 2px;
410 -moz-border-radius: 2px;
412 border-radius: 2px;
411 border-radius: 2px;
413 background-color: #FFFFFF;
412 background-color: #FFFFFF;
414 color: #7E7F7F
413 color: #7E7F7F
415 }
414 }
416
415
417 div.markdown-block code {
416 div.markdown-block code {
418 border: 1px solid #7E7F7F;
417 border: 1px solid #7E7F7F;
419 margin: 0 2px;
418 margin: 0 2px;
420 padding: 0 5px
419 padding: 0 5px
421 }
420 }
422
421
423 div.markdown-block pre {
422 div.markdown-block pre {
424 border: 1px solid #7E7F7F;
423 border: 1px solid #7E7F7F;
425 overflow: auto;
424 overflow: auto;
426 padding: .5em;
425 padding: .5em;
427 background-color: #FFFFFF;
426 background-color: #FFFFFF;
428 }
427 }
429
428
430 div.markdown-block pre > code {
429 div.markdown-block pre > code {
431 border: 0;
430 border: 0;
432 margin: 0;
431 margin: 0;
433 padding: 0
432 padding: 0
434 }
433 }
435
434
436 div.rst-block {
435 div.rst-block {
437 clear: both;
436 clear: both;
438 overflow: hidden;
437 overflow: hidden;
439 margin: 0;
438 margin: 0;
440 padding: 3px 5px 3px
439 padding: 3px 5px 3px
441 }
440 }
442
441
443 div.rst-block h2 {
442 div.rst-block h2 {
444 font-weight: normal
443 font-weight: normal
445 }
444 }
446
445
447 div.rst-block h1,
446 div.rst-block h1,
448 div.rst-block h2,
447 div.rst-block h2,
449 div.rst-block h3,
448 div.rst-block h3,
450 div.rst-block h4,
449 div.rst-block h4,
451 div.rst-block h5,
450 div.rst-block h5,
452 div.rst-block h6 {
451 div.rst-block h6 {
453 border-bottom: 0 !important;
452 border-bottom: 0 !important;
454 margin: 0 !important;
453 margin: 0 !important;
455 padding: 0 !important;
454 padding: 0 !important;
456 line-height: 1.5em !important
455 line-height: 1.5em !important
457 }
456 }
458
457
459 div.rst-block h1:first-child {
458 div.rst-block h1:first-child {
460 padding-top: .25em !important
459 padding-top: .25em !important
461 }
460 }
462
461
463 div.rst-block h2, div.rst-block h3 {
462 div.rst-block h2, div.rst-block h3 {
464 margin: 1em 0 !important
463 margin: 1em 0 !important
465 }
464 }
466
465
467 div.rst-block h1, div.rst-block h2 {
466 div.rst-block h1, div.rst-block h2 {
468 border-bottom: 1px #e6e5e5 solid !important
467 border-bottom: 1px #e6e5e5 solid !important
469 }
468 }
470
469
471 div.rst-block h2 {
470 div.rst-block h2 {
472 margin-top: 1.5em !important;
471 margin-top: 1.5em !important;
473 padding-top: .5em !important
472 padding-top: .5em !important
474 }
473 }
475
474
476 div.rst-block p {
475 div.rst-block p {
477 color: black !important;
476 color: black !important;
478 margin: 1em 0 !important;
477 margin: 1em 0 !important;
479 line-height: 1.5em !important
478 line-height: 1.5em !important
480 }
479 }
481
480
482 div.rst-block ul {
481 div.rst-block ul {
483 list-style: disc !important;
482 list-style: disc !important;
484 margin: 1em 0 1em 2em !important;
483 margin: 1em 0 1em 2em !important;
485 clear: both
484 clear: both
486 }
485 }
487
486
488 div.rst-block ol {
487 div.rst-block ol {
489 list-style: decimal;
488 list-style: decimal;
490 margin: 1em 0 1em 2em !important
489 margin: 1em 0 1em 2em !important
491 }
490 }
492
491
493 div.rst-block pre, div.rst-block code {
492 div.rst-block pre, div.rst-block code {
494 font: 12px "Bitstream Vera Sans Mono", "Courier", monospace
493 font: 12px "Bitstream Vera Sans Mono", "Courier", monospace
495 }
494 }
496
495
497 div.rst-block code {
496 div.rst-block code {
498 font-size: 12px !important;
497 font-size: 12px !important;
499 background-color: ghostWhite !important;
498 background-color: ghostWhite !important;
500 color: #444 !important;
499 color: #444 !important;
501 padding: 0 .2em !important;
500 padding: 0 .2em !important;
502 border: 1px solid #7E7F7F !important
501 border: 1px solid #7E7F7F !important
503 }
502 }
504
503
505 div.rst-block pre code {
504 div.rst-block pre code {
506 padding: 0 !important;
505 padding: 0 !important;
507 font-size: 12px !important;
506 font-size: 12px !important;
508 background-color: #eee !important;
507 background-color: #eee !important;
509 border: none !important
508 border: none !important
510 }
509 }
511
510
512 div.rst-block pre {
511 div.rst-block pre {
513 margin: 1em 0;
512 margin: 1em 0;
514 padding: 15px;
513 padding: 15px;
515 border: 1px solid #7E7F7F;
514 border: 1px solid #7E7F7F;
516 -webkit-border-radius: 2px;
515 -webkit-border-radius: 2px;
517 -moz-border-radius: 2px;
516 -moz-border-radius: 2px;
518 border-radius: 2px;
517 border-radius: 2px;
519 overflow: auto;
518 overflow: auto;
520 font-size: 12px;
519 font-size: 12px;
521 color: #444;
520 color: #444;
522 background-color: #FFFFFF;
521 background-color: #FFFFFF;
523 }
522 }
524
523
525 .clear-both {
524 .clear-both {
526 clear:both;
525 clear:both;
527 }
526 }
528
527
529 /*elasticmatch is custom rhodecode tag*/
528 /*elasticmatch is custom rhodecode tag*/
530 .codehilite .c-ElasticMatch {
529 .codehilite .c-ElasticMatch {
531 background-color: #faffa6;
530 background-color: #faffa6;
532 padding: 0.2em;
531 padding: 0.2em;
533 }
532 }
534
533
535 .codehilite .c-ElasticMatch { background-color: #faffa6; padding: 0.2em;}
534 .codehilite .c-ElasticMatch { background-color: #faffa6; padding: 0.2em;}
536 .codehilite .hll { background-color: #ffffcc }
535 .codehilite .hll { background-color: #ffffcc }
537 .codehilite .c { color: #408080; font-style: italic } /* Comment */
536 .codehilite .c { color: #408080; font-style: italic } /* Comment */
538 .codehilite .err { border: none } /* Error */
537 .codehilite .err { border: none } /* Error */
539 .codehilite .k { color: #008000; font-weight: bold } /* Keyword */
538 .codehilite .k { color: #008000; font-weight: bold } /* Keyword */
540 .codehilite .o { color: #666666 } /* Operator */
539 .codehilite .o { color: #666666 } /* Operator */
541 .codehilite .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
540 .codehilite .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
542 .codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
541 .codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
543 .codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
542 .codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
544 .codehilite .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
543 .codehilite .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
545 .codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
544 .codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
546 .codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
545 .codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
547 .codehilite .gd { color: #A00000 } /* Generic.Deleted */
546 .codehilite .gd { color: #A00000 } /* Generic.Deleted */
548 .codehilite .ge { font-style: italic } /* Generic.Emph */
547 .codehilite .ge { font-style: italic } /* Generic.Emph */
549 .codehilite .gr { color: #FF0000 } /* Generic.Error */
548 .codehilite .gr { color: #FF0000 } /* Generic.Error */
550 .codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
549 .codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
551 .codehilite .gi { color: #00A000 } /* Generic.Inserted */
550 .codehilite .gi { color: #00A000 } /* Generic.Inserted */
552 .codehilite .go { color: #888888 } /* Generic.Output */
551 .codehilite .go { color: #888888 } /* Generic.Output */
553 .codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
552 .codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
554 .codehilite .gs { font-weight: bold } /* Generic.Strong */
553 .codehilite .gs { font-weight: bold } /* Generic.Strong */
555 .codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
554 .codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
556 .codehilite .gt { color: #0044DD } /* Generic.Traceback */
555 .codehilite .gt { color: #0044DD } /* Generic.Traceback */
557 .codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
556 .codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
558 .codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
557 .codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
559 .codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
558 .codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
560 .codehilite .kp { color: #008000 } /* Keyword.Pseudo */
559 .codehilite .kp { color: #008000 } /* Keyword.Pseudo */
561 .codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
560 .codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
562 .codehilite .kt { color: #B00040 } /* Keyword.Type */
561 .codehilite .kt { color: #B00040 } /* Keyword.Type */
563 .codehilite .m { color: #666666 } /* Literal.Number */
562 .codehilite .m { color: #666666 } /* Literal.Number */
564 .codehilite .s { color: #BA2121 } /* Literal.String */
563 .codehilite .s { color: #BA2121 } /* Literal.String */
565 .codehilite .na { color: #7D9029 } /* Name.Attribute */
564 .codehilite .na { color: #7D9029 } /* Name.Attribute */
566 .codehilite .nb { color: #008000 } /* Name.Builtin */
565 .codehilite .nb { color: #008000 } /* Name.Builtin */
567 .codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
566 .codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
568 .codehilite .no { color: #880000 } /* Name.Constant */
567 .codehilite .no { color: #880000 } /* Name.Constant */
569 .codehilite .nd { color: #AA22FF } /* Name.Decorator */
568 .codehilite .nd { color: #AA22FF } /* Name.Decorator */
570 .codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
569 .codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
571 .codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
570 .codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
572 .codehilite .nf { color: #0000FF } /* Name.Function */
571 .codehilite .nf { color: #0000FF } /* Name.Function */
573 .codehilite .nl { color: #A0A000 } /* Name.Label */
572 .codehilite .nl { color: #A0A000 } /* Name.Label */
574 .codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
573 .codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
575 .codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
574 .codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
576 .codehilite .nv { color: #19177C } /* Name.Variable */
575 .codehilite .nv { color: #19177C } /* Name.Variable */
577 .codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
576 .codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
578 .codehilite .w { color: #bbbbbb } /* Text.Whitespace */
577 .codehilite .w { color: #bbbbbb } /* Text.Whitespace */
579 .codehilite .mb { color: #666666 } /* Literal.Number.Bin */
578 .codehilite .mb { color: #666666 } /* Literal.Number.Bin */
580 .codehilite .mf { color: #666666 } /* Literal.Number.Float */
579 .codehilite .mf { color: #666666 } /* Literal.Number.Float */
581 .codehilite .mh { color: #666666 } /* Literal.Number.Hex */
580 .codehilite .mh { color: #666666 } /* Literal.Number.Hex */
582 .codehilite .mi { color: #666666 } /* Literal.Number.Integer */
581 .codehilite .mi { color: #666666 } /* Literal.Number.Integer */
583 .codehilite .mo { color: #666666 } /* Literal.Number.Oct */
582 .codehilite .mo { color: #666666 } /* Literal.Number.Oct */
584 .codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
583 .codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
585 .codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
584 .codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
586 .codehilite .sc { color: #BA2121 } /* Literal.String.Char */
585 .codehilite .sc { color: #BA2121 } /* Literal.String.Char */
587 .codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
586 .codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
588 .codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
587 .codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
589 .codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
588 .codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
590 .codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
589 .codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
591 .codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
590 .codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
592 .codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
591 .codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
593 .codehilite .sx { color: #008000 } /* Literal.String.Other */
592 .codehilite .sx { color: #008000 } /* Literal.String.Other */
594 .codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
593 .codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
595 .codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
594 .codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
596 .codehilite .ss { color: #19177C } /* Literal.String.Symbol */
595 .codehilite .ss { color: #19177C } /* Literal.String.Symbol */
597 .codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
596 .codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
598 .codehilite .fm { color: #0000FF } /* Name.Function.Magic */
597 .codehilite .fm { color: #0000FF } /* Name.Function.Magic */
599 .codehilite .vc { color: #19177C } /* Name.Variable.Class */
598 .codehilite .vc { color: #19177C } /* Name.Variable.Class */
600 .codehilite .vg { color: #19177C } /* Name.Variable.Global */
599 .codehilite .vg { color: #19177C } /* Name.Variable.Global */
601 .codehilite .vi { color: #19177C } /* Name.Variable.Instance */
600 .codehilite .vi { color: #19177C } /* Name.Variable.Instance */
602 .codehilite .vm { color: #19177C } /* Name.Variable.Magic */
601 .codehilite .vm { color: #19177C } /* Name.Variable.Magic */
603 .codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
602 .codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
604
603
605 </style>
604 </style>
606
605
607 </head>
606 </head>
608 <body>
607 <body>
609
608
610 <div>
609 <div>
611 <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
610 <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
612 <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" align="left" style="margin:1%;width:97%;padding:0;font-family:${text_regular|n};font-weight:100;border:1px solid #dbd9da">
611 <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" align="left" style="margin:1%;width:97%;padding:0;font-family:${text_regular|n};font-weight:100;border:1px solid #dbd9da">
613 <tr>
612 <tr>
614 <td valign="top" style="padding:0;">
613 <td valign="top" style="padding:0;">
615 <table cellpadding="0" cellspacing="0" border="0" align="left" width="100%">
614 <table cellpadding="0" cellspacing="0" border="0" align="left" width="100%">
616 <tr>
615 <tr>
617 <td style="width:100%;padding:10px 15px;background-color:#202020" valign="top">
616 <td style="width:100%;padding:10px 15px;background-color:#202020" valign="top">
618 <a style="color:#eeeeee;text-decoration:none;" href="${instance_url}">
617 <a style="color:#eeeeee;text-decoration:none;" href="${instance_url}">
619 ${_('RhodeCode')}
618 ${_('RhodeCode')}
620 % if rhodecode_instance_name:
619 % if rhodecode_instance_name:
621 - ${rhodecode_instance_name}
620 - ${rhodecode_instance_name}
622 % endif
621 % endif
623 </a>
622 </a>
624 </td>
623 </td>
625 </tr>
624 </tr>
626 <tr style="background-color: #fff">
625 <tr style="background-color: #fff">
627 <td style="padding:15px;" valign="top">${self.body()}</td>
626 <td style="padding:15px;" valign="top">${self.body()}</td>
628 </tr>
627 </tr>
629 </table>
628 </table>
630 </td>
629 </td>
631 </tr>
630 </tr>
632 </table>
631 </table>
633 <!-- End of wrapper table -->
632 <!-- End of wrapper table -->
634 </div>
633 </div>
635
634
636 <div style="width:100%; clear: both; height: 1px">&nbsp;</div>
635 <div style="width:100%; clear: both; height: 1px">&nbsp;</div>
637
636
638 <div style="margin-left:1%;font-weight:100;font-size:11px;color:#666666;text-decoration:none;font-family:${text_monospace};">
637 <div style="margin-left:1%;font-weight:100;font-size:11px;color:#666666;text-decoration:none;font-family:${text_monospace};">
639 ${_('This is a notification from RhodeCode.')}
638 ${_('This is a notification from RhodeCode.')}
640 <a style="font-weight:100;font-size:11px;color:#666666;text-decoration:none;font-family:${text_monospace};" href="${instance_url}">
639 <a style="font-weight:100;font-size:11px;color:#666666;text-decoration:none;font-family:${text_monospace};" href="${instance_url}">
641 ${instance_url}
640 ${instance_url}
642 </a>
641 </a>
643 </div>
642 </div>
644 </body>
643 </body>
645 </html>
644 </html>
@@ -1,176 +1,175 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 ## EMAIL SUBJECT
4 ## EMAIL SUBJECT
6 <%def name="subject()" filter="n,trim,whitespace_filter">
5 <%def name="subject()" filter="n,trim,whitespace_filter">
7 <%
6 <%
8 data = {
7 data = {
9 'user': '@'+h.person(user),
8 'user': '@'+h.person(user),
10 'repo_name': repo_name,
9 'repo_name': repo_name,
11 'status': status_change,
10 'status': status_change,
12 'comment_file': comment_file,
11 'comment_file': comment_file,
13 'comment_line': comment_line,
12 'comment_line': comment_line,
14 'comment_type': comment_type,
13 'comment_type': comment_type,
15 'comment_id': comment_id,
14 'comment_id': comment_id,
16
15
17 'commit_id': h.show_id(commit),
16 'commit_id': h.show_id(commit),
18 'mention_prefix': '[mention] ' if mention else '',
17 'mention_prefix': '[mention] ' if mention else '',
19 }
18 }
20
19
21
20
22 if comment_file:
21 if comment_file:
23 subject_template = email_comment_file_subject_template or \
22 subject_template = email_comment_file_subject_template or \
24 _('{mention_prefix}{user} left a {comment_type} on file `{comment_file}` in commit `{commit_id}` in the `{repo_name}` repository').format(**data)
23 _('{mention_prefix}{user} left a {comment_type} on file `{comment_file}` in commit `{commit_id}` in the `{repo_name}` repository').format(**data)
25 else:
24 else:
26 if status_change:
25 if status_change:
27 subject_template = email_comment_status_change_subject_template or \
26 subject_template = email_comment_status_change_subject_template or \
28 _('{mention_prefix}[status: {status}] {user} left a {comment_type} on commit `{commit_id}` in the `{repo_name}` repository').format(**data)
27 _('{mention_prefix}[status: {status}] {user} left a {comment_type} on commit `{commit_id}` in the `{repo_name}` repository').format(**data)
29 else:
28 else:
30 subject_template = email_comment_subject_template or \
29 subject_template = email_comment_subject_template or \
31 _('{mention_prefix}{user} left a {comment_type} on commit `{commit_id}` in the `{repo_name}` repository').format(**data)
30 _('{mention_prefix}{user} left a {comment_type} on commit `{commit_id}` in the `{repo_name}` repository').format(**data)
32 %>
31 %>
33
32
34
33
35 ${subject_template.format(**data) |n}
34 ${subject_template.format(**data) |n}
36 </%def>
35 </%def>
37
36
38 ## PLAINTEXT VERSION OF BODY
37 ## PLAINTEXT VERSION OF BODY
39 <%def name="body_plaintext()" filter="n,trim">
38 <%def name="body_plaintext()" filter="n,trim">
40 <%
39 <%
41 data = {
40 data = {
42 'user': h.person(user),
41 'user': h.person(user),
43 'repo_name': repo_name,
42 'repo_name': repo_name,
44 'status': status_change,
43 'status': status_change,
45 'comment_file': comment_file,
44 'comment_file': comment_file,
46 'comment_line': comment_line,
45 'comment_line': comment_line,
47 'comment_type': comment_type,
46 'comment_type': comment_type,
48 'comment_id': comment_id,
47 'comment_id': comment_id,
49
48
50 'commit_id': h.show_id(commit),
49 'commit_id': h.show_id(commit),
51 }
50 }
52 %>
51 %>
53
52
54 * ${_('Comment link')}: ${commit_comment_url}
53 * ${_('Comment link')}: ${commit_comment_url}
55
54
56 %if status_change:
55 %if status_change:
57 * ${_('Commit status')}: ${_('Status was changed to')}: *${status_change}*
56 * ${_('Commit status')}: ${_('Status was changed to')}: *${status_change}*
58
57
59 %endif
58 %endif
60 * ${_('Commit')}: ${h.show_id(commit)}
59 * ${_('Commit')}: ${h.show_id(commit)}
61
60
62 * ${_('Commit message')}: ${commit.message}
61 * ${_('Commit message')}: ${commit.message}
63
62
64 %if comment_file:
63 %if comment_file:
65 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
64 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
66
65
67 %endif
66 %endif
68 % if comment_type == 'todo':
67 % if comment_type == 'todo':
69 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
68 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
70 % else:
69 % else:
71 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
70 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
72 % endif
71 % endif
73
72
74 ${comment_body |n, trim}
73 ${comment_body |n, trim}
75
74
76 ---
75 ---
77 ${self.plaintext_footer()}
76 ${self.plaintext_footer()}
78 </%def>
77 </%def>
79
78
80
79
81 <%
80 <%
82 data = {
81 data = {
83 'user': h.person(user),
82 'user': h.person(user),
84 'comment_file': comment_file,
83 'comment_file': comment_file,
85 'comment_line': comment_line,
84 'comment_line': comment_line,
86 'comment_type': comment_type,
85 'comment_type': comment_type,
87 'comment_id': comment_id,
86 'comment_id': comment_id,
88 'renderer_type': renderer_type or 'plain',
87 'renderer_type': renderer_type or 'plain',
89
88
90 'repo': commit_target_repo_url,
89 'repo': commit_target_repo_url,
91 'repo_name': repo_name,
90 'repo_name': repo_name,
92 'commit_id': h.show_id(commit),
91 'commit_id': h.show_id(commit),
93 }
92 }
94 %>
93 %>
95
94
96 ## header
95 ## header
97 <table style="text-align:left;vertical-align:middle;width: 100%">
96 <table style="text-align:left;vertical-align:middle;width: 100%">
98 <tr>
97 <tr>
99 <td style="width:100%;border-bottom:1px solid #dbd9da;">
98 <td style="width:100%;border-bottom:1px solid #dbd9da;">
100
99
101 <div style="margin: 0; font-weight: bold">
100 <div style="margin: 0; font-weight: bold">
102 <div class="clear-both" style="margin-bottom: 4px">
101 <div class="clear-both" style="margin-bottom: 4px">
103 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
102 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
104 ${_('left a')}
103 ${_('left a')}
105 <a href="${commit_comment_url}" style="${base.link_css()}">
104 <a href="${commit_comment_url}" style="${base.link_css()}">
106 % if comment_file:
105 % if comment_file:
107 ${_('{comment_type} on file `{comment_file}` in commit.').format(**data)}
106 ${_('{comment_type} on file `{comment_file}` in commit.').format(**data)}
108 % else:
107 % else:
109 ${_('{comment_type} on commit.').format(**data) |n}
108 ${_('{comment_type} on commit.').format(**data) |n}
110 % endif
109 % endif
111 </a>
110 </a>
112 </div>
111 </div>
113 <div style="margin-top: 10px"></div>
112 <div style="margin-top: 10px"></div>
114 ${_('Commit')} <code>${data['commit_id']}</code> ${_('of repository')}: ${data['repo_name']}
113 ${_('Commit')} <code>${data['commit_id']}</code> ${_('of repository')}: ${data['repo_name']}
115 </div>
114 </div>
116
115
117 </td>
116 </td>
118 </tr>
117 </tr>
119
118
120 </table>
119 </table>
121 <div class="clear-both"></div>
120 <div class="clear-both"></div>
122 ## main body
121 ## main body
123 <table style="text-align:left;vertical-align:middle;width: 100%">
122 <table style="text-align:left;vertical-align:middle;width: 100%">
124
123
125 ## spacing def
124 ## spacing def
126 <tr>
125 <tr>
127 <td style="width: 130px"></td>
126 <td style="width: 130px"></td>
128 <td></td>
127 <td></td>
129 </tr>
128 </tr>
130
129
131 % if status_change:
130 % if status_change:
132 <tr>
131 <tr>
133 <td style="padding-right:20px;">${_('Commit Status')}:</td>
132 <td style="padding-right:20px;">${_('Commit Status')}:</td>
134 <td>
133 <td>
135 ${_('Status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)}
134 ${_('Status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)}
136 </td>
135 </td>
137 </tr>
136 </tr>
138 % endif
137 % endif
139
138
140 <tr>
139 <tr>
141 <td style="padding-right:20px;">${_('Commit')}:</td>
140 <td style="padding-right:20px;">${_('Commit')}:</td>
142 <td>
141 <td>
143 <a href="${commit_comment_url}" style="${base.link_css()}">${h.show_id(commit)}</a>
142 <a href="${commit_comment_url}" style="${base.link_css()}">${h.show_id(commit)}</a>
144 </td>
143 </td>
145 </tr>
144 </tr>
146 <tr>
145 <tr>
147 <td style="padding-right:20px;">${_('Commit message')}:</td>
146 <td style="padding-right:20px;">${_('Commit message')}:</td>
148 <td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td>
147 <td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td>
149 </tr>
148 </tr>
150
149
151 % if comment_file:
150 % if comment_file:
152 <tr>
151 <tr>
153 <td style="padding-right:20px;">${_('File')}:</td>
152 <td style="padding-right:20px;">${_('File')}:</td>
154 <td><a href="${commit_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td>
153 <td><a href="${commit_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td>
155 </tr>
154 </tr>
156 % endif
155 % endif
157
156
158 <tr style="border-bottom:1px solid #dbd9da;">
157 <tr style="border-bottom:1px solid #dbd9da;">
159 <td colspan="2" style="padding-right:20px;">
158 <td colspan="2" style="padding-right:20px;">
160 % if comment_type == 'todo':
159 % if comment_type == 'todo':
161 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
160 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
162 % else:
161 % else:
163 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
162 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
164 % endif
163 % endif
165 </td>
164 </td>
166 </tr>
165 </tr>
167
166
168 <tr>
167 <tr>
169 <td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td>
168 <td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td>
170 </tr>
169 </tr>
171
170
172 <tr>
171 <tr>
173 <td><a href="${commit_comment_reply_url}">${_('Reply')}</a></td>
172 <td><a href="${commit_comment_reply_url}">${_('Reply')}</a></td>
174 <td></td>
173 <td></td>
175 </tr>
174 </tr>
176 </table>
175 </table>
@@ -1,20 +1,19 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 <%def name="subject()" filter="n,trim,whitespace_filter">
4 <%def name="subject()" filter="n,trim,whitespace_filter">
6 RhodeCode test email: ${h.format_date(date)}
5 RhodeCode test email: ${h.format_date(date)}
7 </%def>
6 </%def>
8
7
9 ## plain text version of the email. Empty by default
8 ## plain text version of the email. Empty by default
10 <%def name="body_plaintext()" filter="n,trim">
9 <%def name="body_plaintext()" filter="n,trim">
11 Test Email from RhodeCode version: ${rhodecode_version}
10 Test Email from RhodeCode version: ${rhodecode_version}
12 Email sent by: ${h.person(user)}
11 Email sent by: ${h.person(user)}
13
12
14 ---
13 ---
15 ${self.plaintext_footer()}
14 ${self.plaintext_footer()}
16 </%def>
15 </%def>
17
16
18 Test Email from RhodeCode version: ${rhodecode_version}
17 Test Email from RhodeCode version: ${rhodecode_version}
19 <br/><br/>
18 <br/><br/>
20 Email sent by: <strong>${h.person(user)}</strong>
19 Email sent by: <strong>${h.person(user)}</strong>
@@ -1,18 +1,17 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 <%def name="subject()" filter="n,trim,whitespace_filter">
4 <%def name="subject()" filter="n,trim,whitespace_filter">
6 ${email_prefix} ${exc_type_name} (${exc_id})
5 ${email_prefix} ${exc_type_name} (${exc_id})
7 </%def>
6 </%def>
8
7
9 ## plain text version of the email. Empty by default
8 ## plain text version of the email. Empty by default
10 <%def name="body_plaintext()" filter="n,trim">
9 <%def name="body_plaintext()" filter="n,trim">
11 NO PLAINTEXT VERSION
10 NO PLAINTEXT VERSION
12 </%def>
11 </%def>
13
12
14 <h4>${_('Exception `{}` generated on UTC date: {}').format(exc_traceback.get('exc_type', 'NO_TYPE'), exc_traceback.get('exc_utc_date', 'NO_DATE'))}</h4>
13 <h4>${_('Exception `{}` generated on UTC date: {}').format(exc_traceback.get('exc_type', 'NO_TYPE'), exc_traceback.get('exc_utc_date', 'NO_DATE'))}</h4>
15 <p>
14 <p>
16 View exception <a href="${exc_url}">${exc_id}</a>
15 View exception <a href="${exc_url}">${exc_id}</a>
17 </p>
16 </p>
18 <pre>${exc_traceback.get('exc_message', 'NO_MESSAGE')}</pre>
17 <pre>${exc_traceback.get('exc_message', 'NO_MESSAGE')}</pre>
@@ -1,21 +1,20 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3
2
4 <%def name="subject()" filter="n,trim,whitespace_filter">
3 <%def name="subject()" filter="n,trim,whitespace_filter">
5 </%def>
4 </%def>
6
5
7
6
8 ## plain text version of the email. Empty by default
7 ## plain text version of the email. Empty by default
9 <%def name="body_plaintext()" filter="n,trim">
8 <%def name="body_plaintext()" filter="n,trim">
10 ${body}
9 ${body}
11
10
12 ---
11 ---
13 ${self.plaintext_footer()}
12 ${self.plaintext_footer()}
14 </%def>
13 </%def>
15
14
16 ## BODY GOES BELOW
15 ## BODY GOES BELOW
17 <table style="text-align:left;vertical-align:top;">
16 <table style="text-align:left;vertical-align:top;">
18 <tr>
17 <tr>
19 <td style="padding-right:20px;padding-top:15px;white-space:pre-wrap">${body}</td>
18 <td style="padding-right:20px;padding-top:15px;white-space:pre-wrap">${body}</td>
20 </tr>
19 </tr>
21 </table>
20 </table>
@@ -1,37 +1,36 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 <%def name="subject()" filter="n,trim,whitespace_filter">
4 <%def name="subject()" filter="n,trim,whitespace_filter">
6 RhodeCode Password reset
5 RhodeCode Password reset
7 </%def>
6 </%def>
8
7
9 ## plain text version of the email. Empty by default
8 ## plain text version of the email. Empty by default
10 <%def name="body_plaintext()" filter="n,trim">
9 <%def name="body_plaintext()" filter="n,trim">
11 Hello ${user.username},
10 Hello ${user.username},
12
11
13 On ${h.format_date(date)} there was a request to reset your password using the email address `${email}`
12 On ${h.format_date(date)} there was a request to reset your password using the email address `${email}`
14
13
15 *If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}*
14 *If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}*
16
15
17 You can continue, and generate new password by clicking following URL:
16 You can continue, and generate new password by clicking following URL:
18 ${password_reset_url}
17 ${password_reset_url}
19
18
20 This link will be active for 10 minutes.
19 This link will be active for 10 minutes.
21
20
22 ---
21 ---
23 ${self.plaintext_footer()}
22 ${self.plaintext_footer()}
24 </%def>
23 </%def>
25
24
26 ## BODY GOES BELOW
25 ## BODY GOES BELOW
27 <p>
26 <p>
28 Hello ${user.username},
27 Hello ${user.username},
29 </p><p>
28 </p><p>
30 On ${h.format_date(date)} there was a request to reset your password using the email address `${email}`
29 On ${h.format_date(date)} there was a request to reset your password using the email address `${email}`
31 <br/><br/>
30 <br/><br/>
32 <strong>If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}.</strong>
31 <strong>If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}.</strong>
33 </p><p>
32 </p><p>
34 You can continue, and generate new password by clicking following URL:<br/><br/>
33 You can continue, and generate new password by clicking following URL:<br/><br/>
35 <a href="${password_reset_url}" style="${base.link_css()}">${password_reset_url}</a>
34 <a href="${password_reset_url}" style="${base.link_css()}">${password_reset_url}</a>
36 <br/><br/>This link will be active for 10 minutes.
35 <br/><br/>This link will be active for 10 minutes.
37 </p>
36 </p>
@@ -1,31 +1,30 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 <%def name="subject()" filter="n,trim,whitespace_filter">
4 <%def name="subject()" filter="n,trim,whitespace_filter">
6 Your new RhodeCode password
5 Your new RhodeCode password
7 </%def>
6 </%def>
8
7
9 ## plain text version of the email. Empty by default
8 ## plain text version of the email. Empty by default
10 <%def name="body_plaintext()" filter="n,trim">
9 <%def name="body_plaintext()" filter="n,trim">
11 Hello ${user.username},
10 Hello ${user.username},
12
11
13 Below is your new access password for RhodeCode requested via password reset link.
12 Below is your new access password for RhodeCode requested via password reset link.
14
13
15 *If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}.*
14 *If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}.*
16
15
17 new password: ${new_password}
16 new password: ${new_password}
18
17
19 ---
18 ---
20 ${self.plaintext_footer()}
19 ${self.plaintext_footer()}
21 </%def>
20 </%def>
22
21
23 ## BODY GOES BELOW
22 ## BODY GOES BELOW
24 <p>
23 <p>
25 Hello ${user.username},
24 Hello ${user.username},
26 </p><p>
25 </p><p>
27 Below is your new access password for RhodeCode requested via password reset link.
26 Below is your new access password for RhodeCode requested via password reset link.
28 <br/><br/>
27 <br/><br/>
29 <strong>If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}.</strong>
28 <strong>If you did not request a password reset, please contact your RhodeCode administrator at: ${first_admin_email}.</strong>
30 </p>
29 </p>
31 <p>new password: <code>${new_password}</code>
30 <p>new password: <code>${new_password}</code>
@@ -1,205 +1,204 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 ## EMAIL SUBJECT
4 ## EMAIL SUBJECT
6 <%def name="subject()" filter="n,trim,whitespace_filter">
5 <%def name="subject()" filter="n,trim,whitespace_filter">
7 <%
6 <%
8 data = {
7 data = {
9 'user': '@'+h.person(user),
8 'user': '@'+h.person(user),
10 'repo_name': repo_name,
9 'repo_name': repo_name,
11 'status': status_change,
10 'status': status_change,
12 'comment_file': comment_file,
11 'comment_file': comment_file,
13 'comment_line': comment_line,
12 'comment_line': comment_line,
14 'comment_type': comment_type,
13 'comment_type': comment_type,
15 'comment_id': comment_id,
14 'comment_id': comment_id,
16
15
17 'pr_title': pull_request.title_safe,
16 'pr_title': pull_request.title_safe,
18 'pr_id': pull_request.pull_request_id,
17 'pr_id': pull_request.pull_request_id,
19 'mention_prefix': '[mention] ' if mention else '',
18 'mention_prefix': '[mention] ' if mention else '',
20 }
19 }
21
20
22 if comment_file:
21 if comment_file:
23 subject_template = email_pr_comment_file_subject_template or \
22 subject_template = email_pr_comment_file_subject_template or \
24 _('{mention_prefix}{user} left a {comment_type} on file `{comment_file}` in pull request !{pr_id}: "{pr_title}"').format(**data)
23 _('{mention_prefix}{user} left a {comment_type} on file `{comment_file}` in pull request !{pr_id}: "{pr_title}"').format(**data)
25 else:
24 else:
26 if status_change:
25 if status_change:
27 subject_template = email_pr_comment_status_change_subject_template or \
26 subject_template = email_pr_comment_status_change_subject_template or \
28 _('{mention_prefix}[status: {status}] {user} left a {comment_type} on pull request !{pr_id}: "{pr_title}"').format(**data)
27 _('{mention_prefix}[status: {status}] {user} left a {comment_type} on pull request !{pr_id}: "{pr_title}"').format(**data)
29 else:
28 else:
30 subject_template = email_pr_comment_subject_template or \
29 subject_template = email_pr_comment_subject_template or \
31 _('{mention_prefix}{user} left a {comment_type} on pull request !{pr_id}: "{pr_title}"').format(**data)
30 _('{mention_prefix}{user} left a {comment_type} on pull request !{pr_id}: "{pr_title}"').format(**data)
32 %>
31 %>
33
32
34 ${subject_template.format(**data) |n}
33 ${subject_template.format(**data) |n}
35 </%def>
34 </%def>
36
35
37 ## PLAINTEXT VERSION OF BODY
36 ## PLAINTEXT VERSION OF BODY
38 <%def name="body_plaintext()" filter="n,trim">
37 <%def name="body_plaintext()" filter="n,trim">
39 <%
38 <%
40 data = {
39 data = {
41 'user': h.person(user),
40 'user': h.person(user),
42 'repo_name': repo_name,
41 'repo_name': repo_name,
43 'status': status_change,
42 'status': status_change,
44 'comment_file': comment_file,
43 'comment_file': comment_file,
45 'comment_line': comment_line,
44 'comment_line': comment_line,
46 'comment_type': comment_type,
45 'comment_type': comment_type,
47 'comment_id': comment_id,
46 'comment_id': comment_id,
48
47
49 'pr_title': pull_request.title_safe,
48 'pr_title': pull_request.title_safe,
50 'pr_id': pull_request.pull_request_id,
49 'pr_id': pull_request.pull_request_id,
51 'source_ref_type': pull_request.source_ref_parts.type,
50 'source_ref_type': pull_request.source_ref_parts.type,
52 'source_ref_name': pull_request.source_ref_parts.name,
51 'source_ref_name': pull_request.source_ref_parts.name,
53 'target_ref_type': pull_request.target_ref_parts.type,
52 'target_ref_type': pull_request.target_ref_parts.type,
54 'target_ref_name': pull_request.target_ref_parts.name,
53 'target_ref_name': pull_request.target_ref_parts.name,
55 'source_repo': pull_request_source_repo.repo_name,
54 'source_repo': pull_request_source_repo.repo_name,
56 'target_repo': pull_request_target_repo.repo_name,
55 'target_repo': pull_request_target_repo.repo_name,
57 'source_repo_url': pull_request_source_repo_url,
56 'source_repo_url': pull_request_source_repo_url,
58 'target_repo_url': pull_request_target_repo_url,
57 'target_repo_url': pull_request_target_repo_url,
59 }
58 }
60 %>
59 %>
61
60
62 * ${_('Comment link')}: ${pr_comment_url}
61 * ${_('Comment link')}: ${pr_comment_url}
63
62
64 * ${_('Pull Request')}: !${pull_request.pull_request_id}
63 * ${_('Pull Request')}: !${pull_request.pull_request_id}
65
64
66 * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))}
65 * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))}
67
66
68 %if status_change and not closing_pr:
67 %if status_change and not closing_pr:
69 * ${_('{user} submitted pull request !{pr_id} status: *{status}*').format(**data)}
68 * ${_('{user} submitted pull request !{pr_id} status: *{status}*').format(**data)}
70
69
71 %elif status_change and closing_pr:
70 %elif status_change and closing_pr:
72 * ${_('{user} submitted pull request !{pr_id} status: *{status} and closed*').format(**data)}
71 * ${_('{user} submitted pull request !{pr_id} status: *{status} and closed*').format(**data)}
73
72
74 %endif
73 %endif
75 %if comment_file:
74 %if comment_file:
76 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
75 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
77
76
78 %endif
77 %endif
79 % if comment_type == 'todo':
78 % if comment_type == 'todo':
80 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
79 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
81 % else:
80 % else:
82 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
81 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
83 % endif
82 % endif
84
83
85 ${comment_body |n, trim}
84 ${comment_body |n, trim}
86
85
87 ---
86 ---
88 ${self.plaintext_footer()}
87 ${self.plaintext_footer()}
89 </%def>
88 </%def>
90
89
91
90
92 <%
91 <%
93 data = {
92 data = {
94 'user': h.person(user),
93 'user': h.person(user),
95 'comment_file': comment_file,
94 'comment_file': comment_file,
96 'comment_line': comment_line,
95 'comment_line': comment_line,
97 'comment_type': comment_type,
96 'comment_type': comment_type,
98 'comment_id': comment_id,
97 'comment_id': comment_id,
99 'renderer_type': renderer_type or 'plain',
98 'renderer_type': renderer_type or 'plain',
100
99
101 'pr_title': pull_request.title_safe,
100 'pr_title': pull_request.title_safe,
102 'pr_id': pull_request.pull_request_id,
101 'pr_id': pull_request.pull_request_id,
103 'status': status_change,
102 'status': status_change,
104 'source_ref_type': pull_request.source_ref_parts.type,
103 'source_ref_type': pull_request.source_ref_parts.type,
105 'source_ref_name': pull_request.source_ref_parts.name,
104 'source_ref_name': pull_request.source_ref_parts.name,
106 'target_ref_type': pull_request.target_ref_parts.type,
105 'target_ref_type': pull_request.target_ref_parts.type,
107 'target_ref_name': pull_request.target_ref_parts.name,
106 'target_ref_name': pull_request.target_ref_parts.name,
108 'source_repo': pull_request_source_repo.repo_name,
107 'source_repo': pull_request_source_repo.repo_name,
109 'target_repo': pull_request_target_repo.repo_name,
108 'target_repo': pull_request_target_repo.repo_name,
110 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
109 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
111 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
110 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
112 }
111 }
113 %>
112 %>
114
113
115 ## header
114 ## header
116 <table style="text-align:left;vertical-align:middle;width: 100%">
115 <table style="text-align:left;vertical-align:middle;width: 100%">
117 <tr>
116 <tr>
118 <td style="width:100%;border-bottom:1px solid #dbd9da;">
117 <td style="width:100%;border-bottom:1px solid #dbd9da;">
119
118
120 <div style="margin: 0; font-weight: bold">
119 <div style="margin: 0; font-weight: bold">
121 <div class="clear-both" style="margin-bottom: 4px">
120 <div class="clear-both" style="margin-bottom: 4px">
122 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
121 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
123 ${_('left a')}
122 ${_('left a')}
124 <a href="${pr_comment_url}" style="${base.link_css()}">
123 <a href="${pr_comment_url}" style="${base.link_css()}">
125 % if comment_file:
124 % if comment_file:
126 ${_('{comment_type} on file `{comment_file}` in pull request.').format(**data)}
125 ${_('{comment_type} on file `{comment_file}` in pull request.').format(**data)}
127 % else:
126 % else:
128 ${_('{comment_type} on pull request.').format(**data) |n}
127 ${_('{comment_type} on pull request.').format(**data) |n}
129 % endif
128 % endif
130 </a>
129 </a>
131 </div>
130 </div>
132 <div style="margin-top: 10px"></div>
131 <div style="margin-top: 10px"></div>
133 ${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
132 ${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
134 </div>
133 </div>
135
134
136 </td>
135 </td>
137 </tr>
136 </tr>
138
137
139 </table>
138 </table>
140 <div class="clear-both"></div>
139 <div class="clear-both"></div>
141 ## main body
140 ## main body
142 <table style="text-align:left;vertical-align:middle;width: 100%">
141 <table style="text-align:left;vertical-align:middle;width: 100%">
143
142
144 ## spacing def
143 ## spacing def
145 <tr>
144 <tr>
146 <td style="width: 130px"></td>
145 <td style="width: 130px"></td>
147 <td></td>
146 <td></td>
148 </tr>
147 </tr>
149
148
150 % if status_change:
149 % if status_change:
151 <tr>
150 <tr>
152 <td style="padding-right:20px;">${_('Review Status')}:</td>
151 <td style="padding-right:20px;">${_('Review Status')}:</td>
153 <td>
152 <td>
154 % if closing_pr:
153 % if closing_pr:
155 ${_('Closed pull request with status')}: ${base.status_text(status_change, tag_type=status_change_type)}
154 ${_('Closed pull request with status')}: ${base.status_text(status_change, tag_type=status_change_type)}
156 % else:
155 % else:
157 ${_('Submitted review status')}: ${base.status_text(status_change, tag_type=status_change_type)}
156 ${_('Submitted review status')}: ${base.status_text(status_change, tag_type=status_change_type)}
158 % endif
157 % endif
159 </td>
158 </td>
160 </tr>
159 </tr>
161 % endif
160 % endif
162 <tr>
161 <tr>
163 <td style="padding-right:20px;">${_('Pull request')}:</td>
162 <td style="padding-right:20px;">${_('Pull request')}:</td>
164 <td>
163 <td>
165 <a href="${pull_request_url}" style="${base.link_css()}">
164 <a href="${pull_request_url}" style="${base.link_css()}">
166 !${pull_request.pull_request_id}
165 !${pull_request.pull_request_id}
167 </a>
166 </a>
168 </td>
167 </td>
169 </tr>
168 </tr>
170
169
171 <tr>
170 <tr>
172 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
171 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
173 <td style="line-height:20px;">
172 <td style="line-height:20px;">
174 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
173 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
175 &rarr;
174 &rarr;
176 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
175 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
177 </td>
176 </td>
178 </tr>
177 </tr>
179
178
180 % if comment_file:
179 % if comment_file:
181 <tr>
180 <tr>
182 <td style="padding-right:20px;">${_('File')}:</td>
181 <td style="padding-right:20px;">${_('File')}:</td>
183 <td><a href="${pr_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td>
182 <td><a href="${pr_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td>
184 </tr>
183 </tr>
185 % endif
184 % endif
186
185
187 <tr style="border-bottom:1px solid #dbd9da;">
186 <tr style="border-bottom:1px solid #dbd9da;">
188 <td colspan="2" style="padding-right:20px;">
187 <td colspan="2" style="padding-right:20px;">
189 % if comment_type == 'todo':
188 % if comment_type == 'todo':
190 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
189 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
191 % else:
190 % else:
192 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
191 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
193 % endif
192 % endif
194 </td>
193 </td>
195 </tr>
194 </tr>
196
195
197 <tr>
196 <tr>
198 <td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td>
197 <td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td>
199 </tr>
198 </tr>
200
199
201 <tr>
200 <tr>
202 <td><a href="${pr_comment_reply_url}">${_('Reply')}</a></td>
201 <td><a href="${pr_comment_reply_url}">${_('Reply')}</a></td>
203 <td></td>
202 <td></td>
204 </tr>
203 </tr>
205 </table>
204 </table>
@@ -1,154 +1,153 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 ## EMAIL SUBJECT
4 ## EMAIL SUBJECT
6 <%def name="subject()" filter="n,trim,whitespace_filter">
5 <%def name="subject()" filter="n,trim,whitespace_filter">
7 <%
6 <%
8 data = {
7 data = {
9 'user': '@'+h.person(user),
8 'user': '@'+h.person(user),
10 'pr_id': pull_request.pull_request_id,
9 'pr_id': pull_request.pull_request_id,
11 'pr_title': pull_request.title_safe,
10 'pr_title': pull_request.title_safe,
12 }
11 }
13
12
14 if user_role == 'observer':
13 if user_role == 'observer':
15 subject_template = email_pr_review_subject_template or _('{user} added you as observer to pull request. !{pr_id}: "{pr_title}"')
14 subject_template = email_pr_review_subject_template or _('{user} added you as observer to pull request. !{pr_id}: "{pr_title}"')
16 else:
15 else:
17 subject_template = email_pr_review_subject_template or _('{user} requested a pull request review. !{pr_id}: "{pr_title}"')
16 subject_template = email_pr_review_subject_template or _('{user} requested a pull request review. !{pr_id}: "{pr_title}"')
18 %>
17 %>
19
18
20 ${subject_template.format(**data) |n}
19 ${subject_template.format(**data) |n}
21 </%def>
20 </%def>
22
21
23 ## PLAINTEXT VERSION OF BODY
22 ## PLAINTEXT VERSION OF BODY
24 <%def name="body_plaintext()" filter="n,trim">
23 <%def name="body_plaintext()" filter="n,trim">
25 <%
24 <%
26 data = {
25 data = {
27 'user': h.person(user),
26 'user': h.person(user),
28 'pr_id': pull_request.pull_request_id,
27 'pr_id': pull_request.pull_request_id,
29 'pr_title': pull_request.title_safe,
28 'pr_title': pull_request.title_safe,
30 'source_ref_type': pull_request.source_ref_parts.type,
29 'source_ref_type': pull_request.source_ref_parts.type,
31 'source_ref_name': pull_request.source_ref_parts.name,
30 'source_ref_name': pull_request.source_ref_parts.name,
32 'target_ref_type': pull_request.target_ref_parts.type,
31 'target_ref_type': pull_request.target_ref_parts.type,
33 'target_ref_name': pull_request.target_ref_parts.name,
32 'target_ref_name': pull_request.target_ref_parts.name,
34 'repo_url': pull_request_source_repo_url,
33 'repo_url': pull_request_source_repo_url,
35 'source_repo': pull_request_source_repo.repo_name,
34 'source_repo': pull_request_source_repo.repo_name,
36 'target_repo': pull_request_target_repo.repo_name,
35 'target_repo': pull_request_target_repo.repo_name,
37 'source_repo_url': pull_request_source_repo_url,
36 'source_repo_url': pull_request_source_repo_url,
38 'target_repo_url': pull_request_target_repo_url,
37 'target_repo_url': pull_request_target_repo_url,
39 }
38 }
40
39
41 %>
40 %>
42
41
43 * ${_('Pull Request link')}: ${pull_request_url}
42 * ${_('Pull Request link')}: ${pull_request_url}
44
43
45 * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))}
44 * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))}
46
45
47 * ${_('Title')}: ${pull_request.title}
46 * ${_('Title')}: ${pull_request.title}
48
47
49 * ${_('Description')}:
48 * ${_('Description')}:
50
49
51 ${pull_request.description | trim}
50 ${pull_request.description | trim}
52
51
53
52
54 * ${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits) ) % {'num': len(pull_request_commits)}}:
53 * ${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits) ) % {'num': len(pull_request_commits)}}:
55
54
56 % for commit_id, message in pull_request_commits:
55 % for commit_id, message in pull_request_commits:
57 - ${h.short_id(commit_id)}
56 - ${h.short_id(commit_id)}
58 ${h.chop_at_smart(message.lstrip(), '\n', suffix_if_chopped='...')}
57 ${h.chop_at_smart(message.lstrip(), '\n', suffix_if_chopped='...')}
59
58
60 % endfor
59 % endfor
61
60
62 ---
61 ---
63 ${self.plaintext_footer()}
62 ${self.plaintext_footer()}
64 </%def>
63 </%def>
65 <%
64 <%
66 data = {
65 data = {
67 'user': h.person(user),
66 'user': h.person(user),
68 'pr_id': pull_request.pull_request_id,
67 'pr_id': pull_request.pull_request_id,
69 'pr_title': pull_request.title_safe,
68 'pr_title': pull_request.title_safe,
70 'source_ref_type': pull_request.source_ref_parts.type,
69 'source_ref_type': pull_request.source_ref_parts.type,
71 'source_ref_name': pull_request.source_ref_parts.name,
70 'source_ref_name': pull_request.source_ref_parts.name,
72 'target_ref_type': pull_request.target_ref_parts.type,
71 'target_ref_type': pull_request.target_ref_parts.type,
73 'target_ref_name': pull_request.target_ref_parts.name,
72 'target_ref_name': pull_request.target_ref_parts.name,
74 'repo_url': pull_request_source_repo_url,
73 'repo_url': pull_request_source_repo_url,
75 'source_repo': pull_request_source_repo.repo_name,
74 'source_repo': pull_request_source_repo.repo_name,
76 'target_repo': pull_request_target_repo.repo_name,
75 'target_repo': pull_request_target_repo.repo_name,
77 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
76 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
78 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
77 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
79 }
78 }
80 %>
79 %>
81 ## header
80 ## header
82 <table style="text-align:left;vertical-align:middle;width: 100%">
81 <table style="text-align:left;vertical-align:middle;width: 100%">
83 <tr>
82 <tr>
84 <td style="width:100%;border-bottom:1px solid #dbd9da;">
83 <td style="width:100%;border-bottom:1px solid #dbd9da;">
85 <div style="margin: 0; font-weight: bold">
84 <div style="margin: 0; font-weight: bold">
86 % if user_role == 'observer':
85 % if user_role == 'observer':
87 <div class="clear-both" class="clear-both" style="margin-bottom: 4px">
86 <div class="clear-both" class="clear-both" style="margin-bottom: 4px">
88 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
87 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
89 ${_('added you as observer to')}
88 ${_('added you as observer to')}
90 <a href="${pull_request_url}" style="${base.link_css()}">pull request</a>.
89 <a href="${pull_request_url}" style="${base.link_css()}">pull request</a>.
91 </div>
90 </div>
92 % else:
91 % else:
93 <div class="clear-both" class="clear-both" style="margin-bottom: 4px">
92 <div class="clear-both" class="clear-both" style="margin-bottom: 4px">
94 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
93 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
95 ${_('requested a')}
94 ${_('requested a')}
96 <a href="${pull_request_url}" style="${base.link_css()}">pull request</a> review.
95 <a href="${pull_request_url}" style="${base.link_css()}">pull request</a> review.
97 </div>
96 </div>
98 % endif
97 % endif
99 <div style="margin-top: 10px"></div>
98 <div style="margin-top: 10px"></div>
100 ${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
99 ${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
101 </div>
100 </div>
102 </td>
101 </td>
103 </tr>
102 </tr>
104
103
105 </table>
104 </table>
106 <div class="clear-both"></div>
105 <div class="clear-both"></div>
107 ## main body
106 ## main body
108 <table style="text-align:left;vertical-align:middle;width: 100%">
107 <table style="text-align:left;vertical-align:middle;width: 100%">
109 ## spacing def
108 ## spacing def
110 <tr>
109 <tr>
111 <td style="width: 130px"></td>
110 <td style="width: 130px"></td>
112 <td></td>
111 <td></td>
113 </tr>
112 </tr>
114
113
115 <tr>
114 <tr>
116 <td style="padding-right:20px;">${_('Pull request')}:</td>
115 <td style="padding-right:20px;">${_('Pull request')}:</td>
117 <td>
116 <td>
118 <a href="${pull_request_url}" style="${base.link_css()}">
117 <a href="${pull_request_url}" style="${base.link_css()}">
119 !${pull_request.pull_request_id}
118 !${pull_request.pull_request_id}
120 </a>
119 </a>
121 </td>
120 </td>
122 </tr>
121 </tr>
123
122
124 <tr>
123 <tr>
125 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
124 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
126 <td style="line-height:20px;">
125 <td style="line-height:20px;">
127 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
126 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
128 &rarr;
127 &rarr;
129 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
128 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
130 </td>
129 </td>
131 </tr>
130 </tr>
132
131
133 <tr>
132 <tr>
134 <td style="padding-right:20px;">${_('Description')}:</td>
133 <td style="padding-right:20px;">${_('Description')}:</td>
135 <td style="white-space:pre-wrap"><code>${pull_request.description | trim}</code></td>
134 <td style="white-space:pre-wrap"><code>${pull_request.description | trim}</code></td>
136 </tr>
135 </tr>
137 <tr>
136 <tr>
138 <td style="padding-right:20px;">${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits)) % {'num': len(pull_request_commits)}}:</td>
137 <td style="padding-right:20px;">${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits)) % {'num': len(pull_request_commits)}}:</td>
139 <td></td>
138 <td></td>
140 </tr>
139 </tr>
141
140
142 <tr>
141 <tr>
143 <td colspan="2">
142 <td colspan="2">
144 <ol style="margin:0 0 0 1em;padding:0;text-align:left;">
143 <ol style="margin:0 0 0 1em;padding:0;text-align:left;">
145 % for commit_id, message in pull_request_commits:
144 % for commit_id, message in pull_request_commits:
146 <li style="margin:0 0 1em;">
145 <li style="margin:0 0 1em;">
147 <pre style="margin:0 0 .5em"><a href="${h.route_path('repo_commit', repo_name=pull_request_source_repo.repo_name, commit_id=commit_id)}" style="${base.link_css()}">${h.short_id(commit_id)}</a></pre>
146 <pre style="margin:0 0 .5em"><a href="${h.route_path('repo_commit', repo_name=pull_request_source_repo.repo_name, commit_id=commit_id)}" style="${base.link_css()}">${h.short_id(commit_id)}</a></pre>
148 ${h.chop_at_smart(message, '\n', suffix_if_chopped='...')}
147 ${h.chop_at_smart(message, '\n', suffix_if_chopped='...')}
149 </li>
148 </li>
150 % endfor
149 % endfor
151 </ol>
150 </ol>
152 </td>
151 </td>
153 </tr>
152 </tr>
154 </table>
153 </table>
@@ -1,172 +1,171 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 ## EMAIL SUBJECT
4 ## EMAIL SUBJECT
6 <%def name="subject()" filter="n,trim,whitespace_filter">
5 <%def name="subject()" filter="n,trim,whitespace_filter">
7 <%
6 <%
8 data = {
7 data = {
9 'updating_user': '@'+h.person(updating_user),
8 'updating_user': '@'+h.person(updating_user),
10 'pr_id': pull_request.pull_request_id,
9 'pr_id': pull_request.pull_request_id,
11 'pr_title': pull_request.title_safe,
10 'pr_title': pull_request.title_safe,
12 }
11 }
13
12
14 subject_template = email_pr_update_subject_template or _('{updating_user} updated pull request. !{pr_id}: "{pr_title}"')
13 subject_template = email_pr_update_subject_template or _('{updating_user} updated pull request. !{pr_id}: "{pr_title}"')
15 %>
14 %>
16
15
17 ${subject_template.format(**data) |n}
16 ${subject_template.format(**data) |n}
18 </%def>
17 </%def>
19
18
20 ## PLAINTEXT VERSION OF BODY
19 ## PLAINTEXT VERSION OF BODY
21 <%def name="body_plaintext()" filter="n,trim">
20 <%def name="body_plaintext()" filter="n,trim">
22 <%
21 <%
23 data = {
22 data = {
24 'updating_user': h.person(updating_user),
23 'updating_user': h.person(updating_user),
25 'pr_id': pull_request.pull_request_id,
24 'pr_id': pull_request.pull_request_id,
26 'pr_title': pull_request.title_safe,
25 'pr_title': pull_request.title_safe,
27 'source_ref_type': pull_request.source_ref_parts.type,
26 'source_ref_type': pull_request.source_ref_parts.type,
28 'source_ref_name': pull_request.source_ref_parts.name,
27 'source_ref_name': pull_request.source_ref_parts.name,
29 'target_ref_type': pull_request.target_ref_parts.type,
28 'target_ref_type': pull_request.target_ref_parts.type,
30 'target_ref_name': pull_request.target_ref_parts.name,
29 'target_ref_name': pull_request.target_ref_parts.name,
31 'repo_url': pull_request_source_repo_url,
30 'repo_url': pull_request_source_repo_url,
32 'source_repo': pull_request_source_repo.repo_name,
31 'source_repo': pull_request_source_repo.repo_name,
33 'target_repo': pull_request_target_repo.repo_name,
32 'target_repo': pull_request_target_repo.repo_name,
34 'source_repo_url': pull_request_source_repo_url,
33 'source_repo_url': pull_request_source_repo_url,
35 'target_repo_url': pull_request_target_repo_url,
34 'target_repo_url': pull_request_target_repo_url,
36 }
35 }
37 %>
36 %>
38
37
39 * ${_('Pull Request link')}: ${pull_request_url}
38 * ${_('Pull Request link')}: ${pull_request_url}
40
39
41 * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))}
40 * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))}
42
41
43 * ${_('Title')}: ${pull_request.title}
42 * ${_('Title')}: ${pull_request.title}
44
43
45 * ${_('Description')}:
44 * ${_('Description')}:
46
45
47 ${pull_request.description | trim}
46 ${pull_request.description | trim}
48
47
49 * Changed commits:
48 * Changed commits:
50
49
51 - Added: ${len(added_commits)}
50 - Added: ${len(added_commits)}
52 - Removed: ${len(removed_commits)}
51 - Removed: ${len(removed_commits)}
53
52
54 * Changed files:
53 * Changed files:
55
54
56 %if not changed_files:
55 %if not changed_files:
57 No file changes found
56 No file changes found
58 %else:
57 %else:
59 %for file_name in added_files:
58 %for file_name in added_files:
60 - A `${file_name}`
59 - A `${file_name}`
61 %endfor
60 %endfor
62 %for file_name in modified_files:
61 %for file_name in modified_files:
63 - M `${file_name}`
62 - M `${file_name}`
64 %endfor
63 %endfor
65 %for file_name in removed_files:
64 %for file_name in removed_files:
66 - R `${file_name}`
65 - R `${file_name}`
67 %endfor
66 %endfor
68 %endif
67 %endif
69
68
70 ---
69 ---
71 ${self.plaintext_footer()}
70 ${self.plaintext_footer()}
72 </%def>
71 </%def>
73 <%
72 <%
74 data = {
73 data = {
75 'updating_user': h.person(updating_user),
74 'updating_user': h.person(updating_user),
76 'pr_id': pull_request.pull_request_id,
75 'pr_id': pull_request.pull_request_id,
77 'pr_title': pull_request.title_safe,
76 'pr_title': pull_request.title_safe,
78 'source_ref_type': pull_request.source_ref_parts.type,
77 'source_ref_type': pull_request.source_ref_parts.type,
79 'source_ref_name': pull_request.source_ref_parts.name,
78 'source_ref_name': pull_request.source_ref_parts.name,
80 'target_ref_type': pull_request.target_ref_parts.type,
79 'target_ref_type': pull_request.target_ref_parts.type,
81 'target_ref_name': pull_request.target_ref_parts.name,
80 'target_ref_name': pull_request.target_ref_parts.name,
82 'repo_url': pull_request_source_repo_url,
81 'repo_url': pull_request_source_repo_url,
83 'source_repo': pull_request_source_repo.repo_name,
82 'source_repo': pull_request_source_repo.repo_name,
84 'target_repo': pull_request_target_repo.repo_name,
83 'target_repo': pull_request_target_repo.repo_name,
85 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
84 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
86 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
85 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
87 }
86 }
88 %>
87 %>
89
88
90 ## header
89 ## header
91 <table style="text-align:left;vertical-align:middle;width: 100%">
90 <table style="text-align:left;vertical-align:middle;width: 100%">
92 <tr>
91 <tr>
93 <td style="width:100%;border-bottom:1px solid #dbd9da;">
92 <td style="width:100%;border-bottom:1px solid #dbd9da;">
94
93
95 <div style="margin: 0; font-weight: bold">
94 <div style="margin: 0; font-weight: bold">
96 <div class="clear-both" style="margin-bottom: 4px">
95 <div class="clear-both" style="margin-bottom: 4px">
97 <span style="color:#7E7F7F">@${h.person(updating_user.username)}</span>
96 <span style="color:#7E7F7F">@${h.person(updating_user.username)}</span>
98 ${_('updated')}
97 ${_('updated')}
99 <a href="${pull_request_url}" style="${base.link_css()}">
98 <a href="${pull_request_url}" style="${base.link_css()}">
100 ${_('pull request.').format(**data) }
99 ${_('pull request.').format(**data) }
101 </a>
100 </a>
102 </div>
101 </div>
103 <div style="margin-top: 10px"></div>
102 <div style="margin-top: 10px"></div>
104 ${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
103 ${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
105 </div>
104 </div>
106
105
107 </td>
106 </td>
108 </tr>
107 </tr>
109
108
110 </table>
109 </table>
111 <div class="clear-both"></div>
110 <div class="clear-both"></div>
112 ## main body
111 ## main body
113 <table style="text-align:left;vertical-align:middle;width: 100%">
112 <table style="text-align:left;vertical-align:middle;width: 100%">
114 ## spacing def
113 ## spacing def
115 <tr>
114 <tr>
116 <td style="width: 130px"></td>
115 <td style="width: 130px"></td>
117 <td></td>
116 <td></td>
118 </tr>
117 </tr>
119
118
120 <tr>
119 <tr>
121 <td style="padding-right:20px;">${_('Pull request')}:</td>
120 <td style="padding-right:20px;">${_('Pull request')}:</td>
122 <td>
121 <td>
123 <a href="${pull_request_url}" style="${base.link_css()}">
122 <a href="${pull_request_url}" style="${base.link_css()}">
124 !${pull_request.pull_request_id}
123 !${pull_request.pull_request_id}
125 </a>
124 </a>
126 </td>
125 </td>
127 </tr>
126 </tr>
128
127
129 <tr>
128 <tr>
130 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
129 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
131 <td style="line-height:20px;">
130 <td style="line-height:20px;">
132 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
131 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
133 &rarr;
132 &rarr;
134 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
133 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
135 </td>
134 </td>
136 </tr>
135 </tr>
137
136
138 <tr>
137 <tr>
139 <td style="padding-right:20px;">${_('Description')}:</td>
138 <td style="padding-right:20px;">${_('Description')}:</td>
140 <td style="white-space:pre-wrap"><code>${pull_request.description | trim}</code></td>
139 <td style="white-space:pre-wrap"><code>${pull_request.description | trim}</code></td>
141 </tr>
140 </tr>
142 <tr>
141 <tr>
143 <td style="padding-right:20px;">${_('Changes')}:</td>
142 <td style="padding-right:20px;">${_('Changes')}:</td>
144 <td>
143 <td>
145 <strong>Changed commits:</strong>
144 <strong>Changed commits:</strong>
146 <ul class="changes-ul">
145 <ul class="changes-ul">
147 <li>- Added: ${len(added_commits)}</li>
146 <li>- Added: ${len(added_commits)}</li>
148 <li>- Removed: ${len(removed_commits)}</li>
147 <li>- Removed: ${len(removed_commits)}</li>
149 </ul>
148 </ul>
150
149
151 <strong>Changed files:</strong>
150 <strong>Changed files:</strong>
152 <ul class="changes-ul">
151 <ul class="changes-ul">
153
152
154 %if not changed_files:
153 %if not changed_files:
155 <li>No file changes found</li>
154 <li>No file changes found</li>
156 %else:
155 %else:
157 %for file_name in added_files:
156 %for file_name in added_files:
158 <li>- A <a href="${pull_request_url + '#a_' + h.FID(ancestor_commit_id, file_name)}">${file_name}</a></li>
157 <li>- A <a href="${pull_request_url + '#a_' + h.FID(ancestor_commit_id, file_name)}">${file_name}</a></li>
159 %endfor
158 %endfor
160 %for file_name in modified_files:
159 %for file_name in modified_files:
161 <li>- M <a href="${pull_request_url + '#a_' + h.FID(ancestor_commit_id, file_name)}">${file_name}</a></li>
160 <li>- M <a href="${pull_request_url + '#a_' + h.FID(ancestor_commit_id, file_name)}">${file_name}</a></li>
162 %endfor
161 %endfor
163 %for file_name in removed_files:
162 %for file_name in removed_files:
164 <li>- R <a href="${pull_request_url + '#a_' + h.FID(ancestor_commit_id, file_name)}">${file_name}</a></li>
163 <li>- R <a href="${pull_request_url + '#a_' + h.FID(ancestor_commit_id, file_name)}">${file_name}</a></li>
165 %endfor
164 %endfor
166 %endif
165 %endif
167
166
168 </ul>
167 </ul>
169 </td>
168 </td>
170 </tr>
169 </tr>
171
170
172 </table>
171 </table>
@@ -1,18 +1,17 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3
2
4 <%def name="subject()" filter="n,trim,whitespace_filter">
3 <%def name="subject()" filter="n,trim,whitespace_filter">
5 Test "Subject" ${_('hello "world"')|n}
4 Test "Subject" ${_('hello "world"')|n}
6 </%def>
5 </%def>
7
6
8 ## plain text version of the email. Empty by default
7 ## plain text version of the email. Empty by default
9 <%def name="body_plaintext()" filter="n,trim">
8 <%def name="body_plaintext()" filter="n,trim">
10 Email Plaintext Body
9 Email Plaintext Body
11 </%def>
10 </%def>
12
11
13 ## BODY GOES BELOW
12 ## BODY GOES BELOW
14 <strong>Email Body</strong>
13 <strong>Email Body</strong>
15 <br/>
14 <br/>
16 <br/>
15 <br/>
17 `h.short_id()`: ${h.short_id('0' * 40)}<br/>
16 `h.short_id()`: ${h.short_id('0' * 40)}<br/>
18 ${_('Translation String')}<br/>
17 ${_('Translation String')}<br/>
@@ -1,32 +1,31 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3
2
4 <%def name="subject()" filter="n,trim,whitespace_filter">
3 <%def name="subject()" filter="n,trim,whitespace_filter">
5 New Version of RhodeCode is available !
4 New Version of RhodeCode is available !
6 </%def>
5 </%def>
7
6
8 ## plain text version of the email. Empty by default
7 ## plain text version of the email. Empty by default
9 <%def name="body_plaintext()" filter="n,trim">
8 <%def name="body_plaintext()" filter="n,trim">
10 A new version of RhodeCode is available!
9 A new version of RhodeCode is available!
11
10
12 Your version: ${current_ver}
11 Your version: ${current_ver}
13 New version: ${latest_ver}
12 New version: ${latest_ver}
14
13
15 Release notes:
14 Release notes:
16
15
17 https://docs.rhodecode.com/RhodeCode-Enterprise/release-notes/release-notes-${latest_ver}.html
16 https://docs.rhodecode.com/RhodeCode-Enterprise/release-notes/release-notes-${latest_ver}.html
18 </%def>
17 </%def>
19
18
20 ## BODY GOES BELOW
19 ## BODY GOES BELOW
21
20
22 <h3>A new version of RhodeCode is available!</h3>
21 <h3>A new version of RhodeCode is available!</h3>
23 <br/>
22 <br/>
24 Your version: ${current_ver}<br/>
23 Your version: ${current_ver}<br/>
25 New version: <strong>${latest_ver}</strong><br/>
24 New version: <strong>${latest_ver}</strong><br/>
26
25
27 <h4>Release notes</h4>
26 <h4>Release notes</h4>
28
27
29 <a href="https://docs.rhodecode.com/RhodeCode-Enterprise/release-notes/release-notes-${latest_ver}.html">
28 <a href="https://docs.rhodecode.com/RhodeCode-Enterprise/release-notes/release-notes-${latest_ver}.html">
30 https://docs.rhodecode.com/RhodeCode-Enterprise/release-notes/release-notes-${latest_ver}.html
29 https://docs.rhodecode.com/RhodeCode-Enterprise/release-notes/release-notes-${latest_ver}.html
31 </a>
30 </a>
32
31
@@ -1,60 +1,59 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
1 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
2 <%namespace name="base" file="base.mako"/>
4
3
5 <%def name="subject()" filter="n,trim,whitespace_filter">
4 <%def name="subject()" filter="n,trim,whitespace_filter">
6 RhodeCode new user registration: ${user.username}
5 RhodeCode new user registration: ${user.username}
7 </%def>
6 </%def>
8
7
9 <%def name="body_plaintext()" filter="n,trim">
8 <%def name="body_plaintext()" filter="n,trim">
10
9
11 A new user `${user.username}` has registered on ${h.format_date(date)}
10 A new user `${user.username}` has registered on ${h.format_date(date)}
12
11
13 - Username: ${user.username}
12 - Username: ${user.username}
14 - Full Name: ${user.first_name} ${user.last_name}
13 - Full Name: ${user.first_name} ${user.last_name}
15 - Email: ${user.email}
14 - Email: ${user.email}
16 - Profile link: ${h.route_url('user_profile', username=user.username)}
15 - Profile link: ${h.route_url('user_profile', username=user.username)}
17
16
18 ---
17 ---
19 ${self.plaintext_footer()}
18 ${self.plaintext_footer()}
20 </%def>
19 </%def>
21
20
22 ## header
21 ## header
23 <table style="text-align:left;vertical-align:middle;width: 100%">
22 <table style="text-align:left;vertical-align:middle;width: 100%">
24 <tr>
23 <tr>
25 <td style="width:100%;border-bottom:1px solid #dbd9da;">
24 <td style="width:100%;border-bottom:1px solid #dbd9da;">
26 <h4 style="margin: 0">
25 <h4 style="margin: 0">
27 <a href="${h.route_url('user_profile', username=user.username)}" style="${base.link_css()}">
26 <a href="${h.route_url('user_profile', username=user.username)}" style="${base.link_css()}">
28 ${_('New user {user} has registered on {date}').format(user=user.username, date=h.format_date(date))}
27 ${_('New user {user} has registered on {date}').format(user=user.username, date=h.format_date(date))}
29 </a>
28 </a>
30 </h4>
29 </h4>
31 </td>
30 </td>
32 </tr>
31 </tr>
33 </table>
32 </table>
34 <div class="clear-both"></div>
33 <div class="clear-both"></div>
35 ## main body
34 ## main body
36 <table style="text-align:left;vertical-align:middle;width: 100%">
35 <table style="text-align:left;vertical-align:middle;width: 100%">
37 ## spacing def
36 ## spacing def
38 <tr>
37 <tr>
39 <td style="width: 130px"></td>
38 <td style="width: 130px"></td>
40 <td></td>
39 <td></td>
41 </tr>
40 </tr>
42 <tr>
41 <tr>
43 <td style="padding-right:20px;padding-top:20px;">${_('Username')}:</td>
42 <td style="padding-right:20px;padding-top:20px;">${_('Username')}:</td>
44 <td style="line-height:1;padding-top:20px;">${user.username}</td>
43 <td style="line-height:1;padding-top:20px;">${user.username}</td>
45 </tr>
44 </tr>
46 <tr>
45 <tr>
47 <td style="padding-right:20px;">${_('Full Name')}:</td>
46 <td style="padding-right:20px;">${_('Full Name')}:</td>
48 <td>${user.first_name} ${user.last_name}</td>
47 <td>${user.first_name} ${user.last_name}</td>
49 </tr>
48 </tr>
50 <tr>
49 <tr>
51 <td style="padding-right:20px;">${_('Email')}:</td>
50 <td style="padding-right:20px;">${_('Email')}:</td>
52 <td>${user.email}</td>
51 <td>${user.email}</td>
53 </tr>
52 </tr>
54 <tr>
53 <tr>
55 <td style="padding-right:20px;">${_('Profile')}:</td>
54 <td style="padding-right:20px;">${_('Profile')}:</td>
56 <td>
55 <td>
57 <a href="${h.route_url('user_profile', username=user.username)}">${h.route_url('user_profile', username=user.username)}</a>
56 <a href="${h.route_url('user_profile', username=user.username)}">${h.route_url('user_profile', username=user.username)}</a>
58 </td>
57 </td>
59 </tr>
58 </tr>
60 </table>
59 </table>
@@ -1,112 +1,111 b''
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html>
1 <!DOCTYPE html>
3 <html xmlns="http://www.w3.org/1999/xhtml">
2 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
3 <head>
5 <title>Error - ${c.error_message}</title>
4 <title>Error - ${c.error_message}</title>
6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
5 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 <meta name="robots" content="index, nofollow"/>
6 <meta name="robots" content="index, nofollow"/>
8
7
9 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
10 %if c.redirect_time:
9 %if c.redirect_time:
11 <meta http-equiv="refresh" content="${c.redirect_time}; url=${c.url_redirect}"/>
10 <meta http-equiv="refresh" content="${c.redirect_time}; url=${c.url_redirect}"/>
12 %endif
11 %endif
13
12
14 <link id="favicon" rel="shortcut icon" type="image/png" href="data:image/png;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMiIiK1OTk5ADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEsLCz/SUlJ/xUVFcM3NzcAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAM8eHh7/8/Pz//39/f9BQUH/Dw8P0DY2NgMzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAMcjIyP/8vLy////////////9/f3/0RERf8REhTINzc3ADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAKUWFhb/7Ozs///////o6Of/6Onq///////z+v//NUFh/xgaIao3NjIAMzMzADMzMwAAAAAAAAAAAAAAAGgAAAD/0dHR///////o5+X/7O/2/+v5///j5Oj//+ic/92wMv83MB3/Jys2ajMzMwAzMzMAAAAAAAAAABYAAAD4kZGR///////p6er/7Pf//+jv+//my4D/6q0J9PqkAJz/zAAlXlcoeRshOf8zMzMaMzMzAAAAAAAAAACRMDAw///////09fj/6vj//+Xcwv/vtBns/7UAav+8AAP/vgAAyZUKACotNQAtLzXyMzMzsDMzMwAAAAAKAAAA8aSjov//////6PX//+fOif/2qwCH/7YAAKN7EgBsWSQAU0gqAC4wNAAqLTUANTQyZjMzM/8zMzMOAAAAUBMTEv/x8vb/9f///+nLdfL2ogAz/7kAAG5bIwAFFD81Dhs9ShskOU8qLTZMNTQyKTMzMwAzMzP/MzMzZgAAAIVJSEf//////+nRjeb4pQAV/9sAAKiFFQAADkEAMDE0UzQ0M+IzMzOOMzMzvDMzM2QzMzMAMzMz3zMzM6oAAACeXGV9////7/j/yAAe/70AALiDAAA0NTcALDJAADMzMlEzMzPVMzMzgDMzM30zMzMjMzMzADMzM8MzMzPIAAAAnWBlaf//5V86nGYAACgeAAAAAAAABgcNACsrKQA2NjYKMzMzEDMzMwwzMzMGMzMzDDMzMwAzMzPNMzMzvwAAAG0bFQv/JRgHfQAAAB4AAAAAAAAAAAAAAAADAwMAMjIyADY2NgAzMzMAMzMzADMzMxIzMzOKMzMz/zMzM3EAAAADAAAAjAAAAP8AAAD/AAAA/QAAANAAAACZAgICXzExMV82NjaZMzMz0DMzM/wzMzP/MzMz/zMzM5gzMzMAAAAAAAAAAAAAAAAAAAAAOAAAAIoAAADKAAAA9AICAv8xMTH/NjY29DMzM8ozMzOLMzMzODMzMwAzMzMAMzMzAP5/AAD8PwAA+B8AAPAPAADgBwAA4AcAAMAbAACA+QAAgf0AAIf9AAAPjAAAH5wAAD/8AAC/+QAAgYEAAPAPAAAoAAAAIAAAAEAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICtjExMbk2NjYAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAM4BAQH/MDAw/zY2NtEzMzMNMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACMAAADsAAAA/wEBAf8XFxf/MDAw/zU1Ne4zMzMmMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2AAAA/QAAAP8AAAD/eXl5/56env8ODg7/Jycn/zY2Nv8zMzM6MzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQAAAP8AAAD/AAAA/4SEhP///////////6Ghof8QEBD/IiIi/zc3N/8zMzNFMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEAAAD/AAAA/wAAAP+bm5v//////+/v7//u7u7//////7S0tP8VFRX/ICAg/zc3N/8zMzNFMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAAA/wAAAP8AAAD/p6en///////u7u7/6urq/+rq6v/t7e3//////729vf8WFhb/ICAg/zc3N/8zMzM6MzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAAPgAAAD/AAAA/6ampv//////7e3t/+rq6v/r6+v/6+vr/+rq6v/s7Oz//////729vf8UFBT/IyMj/zY2NvozMzMlMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAADdAAAA/wAAAP+ampr//////+3t7f/q6ur/6+vr/+vr6//r6+v/6+vr/+rq6v/s7Oz//////7Kysf8PDw//KSkp/zU1NeAzMzMIMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsQAAAP8AAAD/f39////////u7u7/6urq/+vr6//r6+v/6+vr/+vr6//r6+v/6+vr/+rq6f/t7e///////5ynwf8KEy3/MC8t/zQ0M7UzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHUAAAD/AAAA/1paWv//////8vLy/+rq6v/r6+v/6+vr/+vr6//r6+v/6+vr/+vq6f/r7PD/7/f//+v3///o6Oj//+mZ/3FcJv8OGDL/NjUy/zMzM3ozMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAuAAAA/wAAAP8sLCz///////v7+//p6en/6+vr/+vr6//r6+v/6+vr/+vq6f/r6+7/7/j//+r2///h2sf/37tY/9+iA//zpgD//74A/2BRJv8eJTn/MzMz/zMzMzIzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAMUAAAD/AAAA/9DQ0P//////6Ojo/+vr6//r6+v/6+vr/+vr6v/r6uv/7vX+/+v4///i2sb/4LZC/+OfAP/sngD/9K0A/fCuALz/zgBgoIMYRRAZPPUzMzP/MzMzyTMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAABfAAAA/wAAAP9+fn7//////+np6f/r6+v/6+vr/+vr6//r6uj/7O/z/+36///k5OH/4btP/+WfAP/voQD/9K8AyvCwAGTvrgAQ764AAP/CAABrWSUAFyA6eTMzM/8zMzP/MzMzYzMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAN4AAAD/HR0d//r6+v/4+Pj/6urq/+vr6//r6+v/6+rp/+31///o9P//4sqI/+SjAP/unwD/9K8Aou+vACjurgAA8K8AAPayAAD/xAAA6K0FACwuNAArLjUAMzMz2jMzM/8zMzPiMzMzADMzMwAzMzMAAAAAAAAAAAAAAABgAAAA/wAAAP+dnZ3//////+jo6P/r6+v/6+rq/+zr7f/t+f//5ebi/+OzMv/rnQD/8aoAnfKxABT/ugAA/8IAAP/EAAD/wQAA/LYAAP+5AACNbhoAEh48ADU0MwAzMzNaMzMz/zMzM/8zMzNkMzMzADMzMwAAAAAAAAAAAAAAAMgAAAD/IiIi//z8/P/09PT/6+vr/+vq6f/s7fD/6/r//+TYsf/npQP/8aEAwe+tAB34uAAA/8MAAN+iBAC+jg0Apn8TAHJcIgBYSykAPDkwACcrNgAxMjQAMzMzADMzMwAzMzPYMzMz/zMzM8wzMzMAMzMzAAAAAAAAAAAwAAAA/wAAAP+Hh4f//////+np6f/r6un/7O/z/+r4///lzIf/658A+/KoAFburQAA/8EAAP+/AACCZR0AKSw2ABwkOQAWIDsAEBw8ABoiOgAjKDcALzA0ADU0MgAzMzMAMzMzADMzM3AzMzP/MzMz/zMzMzQzMzMAAAAAAAAAAHoAAAD/AAAA/9ra2v//////6+rp/+zv8//q+P//5cdy/+2eAMvyqwAP7KwAAP+/AADqrQMAUEUrAAcWPwAkKTcAMDE0ADIyMwA0MzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzGTMzM/8zMzP/MzMzfzMzMwAAAAAkAAAAvgAAAP8+Pj7//////+3s6//s7fD/6vj//+fIdP/ungCa8a0AAO6uAAD+uAAA6q0DADAxMwAMGT4ANTQzCDQ0M8gzMzOOMzMzKjMzM8QzMzOQMzMz1DMzM0szMzO9MzMzSTMzMwAzMzMAMzMzvDMzM/8zMzPCMzMzJwAAAFMAAADsAAAA/3d3d///////6urq/+r5///nz4v/7p4AffGsAADvrwAA7asAAP/OAACUdRoAABBAADc1MgAzMzMAMzMzyzMzM6QzMzOFMzMzyDMzM0AzMzPXMzMzLzMzM+gzMzMcMzMzADMzMwAzMzOAMzMz/zMzM+8zMzNXAAAAegAAAP8AAAD/mJiY///////r9///6dyz/+6hAHfwqwAA768AAO2sAAD/vgAA8LQDADUzMgAmKjcAMzMzADMzMwAzMzOdMzMz4zMzM+szMzN4MzMzADMzM+UzMzPPMzMz1DMzMwAzMzMAMzMzADMzM1ozMzP/MzMz/zMzM3wAAACUAAAA/wAAAP+traz//////+ns5//uqguL8KcAAO2tAAD5tAAA/9IAAP/UAABoVCkADho8ADc2MgAzMzMAMzMzADMzM8IzMzOoMzMzdjMzM9ozMzMkMzMz5TMzM5QzMzMmMzMzADMzMwAzMzMAMzMzQjMzM/8zMzP/MzMzkwAAAJ4AAAD/AAAA/7S1tv//////7L5RtfCfAAD8uwAA/9MAAPy9AACxfQAASTgLABYhPwA+Pj0ANDQzADIyMgAzMzMGMzMzwzMzM8kzMzPNMzMzRDMzM24zMzPiMzMzADMzMyEzMzNTMzMzFDMzMwAzMzM5MzMz/zMzM/8zMzOaAAAAlAAAAP8AAAD/q7fS///80O//tgAQ/9MAAPSzAACUagAAIBcAAAAAAAAAAAAABwcHACcnJgA9PT0AOjo6ADIyMgEzMzMBMzMzATMzMwEzMzMAMzMzEDMzMwYzMzMAMzMzRjMzM1wzMzMSMzMzADMzM0IzMzP/MzMz/zMzM5MAAAB5AAAA/wAAAP+fp6r///5ZR96WAAB0VQAADgoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8PDwAvLy8ANjY2ADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMBMzMzATMzMwAzMzMAMzMzWzMzM/8zMzP/MzMzegAAAE0AAADmAAAA/1BDKeFvUA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAAzMzMANjY2ADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzOrMzMz/zMzM+ozMzNRAAAAEgAAAKkAAAD/AAAA/wAAAPUAAACnAAAAVgAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICADExMQA2NjYAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzDzMzM1UzMzOlMzMz9TMzM/8zMzP/MzMzrjMzMxYAAAAAAAAAMAAAAOoAAAD/AAAA/wAAAP8AAAD/AAAA/QAAAMgAAACQAAAAXgAAADEAAAAKAAAAAAAAAAACAgIAMTExADY2NgAzMzMAMzMzCTMzMzEzMzNdMzMzjzMzM8czMzP8MzMz/zMzM/8zMzP/MzMz/zMzM+wzMzMzMzMzAAAAAAAAAAAAAAAAAAAAAD0AAACaAAAA5wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPYAAADPAAAArAICAoQxMTGDNjY2qzMzM88zMzP1MzMz/zMzM/8zMzP/MzMz/zMzM/8zMzP/MzMz6TMzM5wzMzM/MzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgAAAHQAAACvAAAA5QAAAP8AAAD/AAAA/wAAAP8AAAD/AgIC/zExMf82Njb/MzMz/zMzM/8zMzP/MzMz/zMzM+UzMzOvMzMzdjMzMzQzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAAAFEAAAB7AAAAowAAAMYCAgLqMTEx6zY2NsczMzOkMzMzfDMzM1EzMzMjMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAP/+f////D////gf///wD///4Af//8AD//+AAf//AAD//gAAf/wAAD/8AAA/+AAAH/AAAY/wAA/P4AA/x+AA/+fAA//jwA//88Af//OAP5FxgP+FcYH/jHkB/5T4A/+N+Af///iP///5j///8YP//8HAP/wD8AAAD/8AAP//+B//">
13 <link id="favicon" rel="shortcut icon" type="image/png" href="data:image/png;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMiIiK1OTk5ADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEsLCz/SUlJ/xUVFcM3NzcAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAM8eHh7/8/Pz//39/f9BQUH/Dw8P0DY2NgMzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAMcjIyP/8vLy////////////9/f3/0RERf8REhTINzc3ADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAKUWFhb/7Ozs///////o6Of/6Onq///////z+v//NUFh/xgaIao3NjIAMzMzADMzMwAAAAAAAAAAAAAAAGgAAAD/0dHR///////o5+X/7O/2/+v5///j5Oj//+ic/92wMv83MB3/Jys2ajMzMwAzMzMAAAAAAAAAABYAAAD4kZGR///////p6er/7Pf//+jv+//my4D/6q0J9PqkAJz/zAAlXlcoeRshOf8zMzMaMzMzAAAAAAAAAACRMDAw///////09fj/6vj//+Xcwv/vtBns/7UAav+8AAP/vgAAyZUKACotNQAtLzXyMzMzsDMzMwAAAAAKAAAA8aSjov//////6PX//+fOif/2qwCH/7YAAKN7EgBsWSQAU0gqAC4wNAAqLTUANTQyZjMzM/8zMzMOAAAAUBMTEv/x8vb/9f///+nLdfL2ogAz/7kAAG5bIwAFFD81Dhs9ShskOU8qLTZMNTQyKTMzMwAzMzP/MzMzZgAAAIVJSEf//////+nRjeb4pQAV/9sAAKiFFQAADkEAMDE0UzQ0M+IzMzOOMzMzvDMzM2QzMzMAMzMz3zMzM6oAAACeXGV9////7/j/yAAe/70AALiDAAA0NTcALDJAADMzMlEzMzPVMzMzgDMzM30zMzMjMzMzADMzM8MzMzPIAAAAnWBlaf//5V86nGYAACgeAAAAAAAABgcNACsrKQA2NjYKMzMzEDMzMwwzMzMGMzMzDDMzMwAzMzPNMzMzvwAAAG0bFQv/JRgHfQAAAB4AAAAAAAAAAAAAAAADAwMAMjIyADY2NgAzMzMAMzMzADMzMxIzMzOKMzMz/zMzM3EAAAADAAAAjAAAAP8AAAD/AAAA/QAAANAAAACZAgICXzExMV82NjaZMzMz0DMzM/wzMzP/MzMz/zMzM5gzMzMAAAAAAAAAAAAAAAAAAAAAOAAAAIoAAADKAAAA9AICAv8xMTH/NjY29DMzM8ozMzOLMzMzODMzMwAzMzMAMzMzAP5/AAD8PwAA+B8AAPAPAADgBwAA4AcAAMAbAACA+QAAgf0AAIf9AAAPjAAAH5wAAD/8AAC/+QAAgYEAAPAPAAAoAAAAIAAAAEAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICtjExMbk2NjYAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAM4BAQH/MDAw/zY2NtEzMzMNMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACMAAADsAAAA/wEBAf8XFxf/MDAw/zU1Ne4zMzMmMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2AAAA/QAAAP8AAAD/eXl5/56env8ODg7/Jycn/zY2Nv8zMzM6MzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQAAAP8AAAD/AAAA/4SEhP///////////6Ghof8QEBD/IiIi/zc3N/8zMzNFMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEAAAD/AAAA/wAAAP+bm5v//////+/v7//u7u7//////7S0tP8VFRX/ICAg/zc3N/8zMzNFMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAAA/wAAAP8AAAD/p6en///////u7u7/6urq/+rq6v/t7e3//////729vf8WFhb/ICAg/zc3N/8zMzM6MzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAAPgAAAD/AAAA/6ampv//////7e3t/+rq6v/r6+v/6+vr/+rq6v/s7Oz//////729vf8UFBT/IyMj/zY2NvozMzMlMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAADdAAAA/wAAAP+ampr//////+3t7f/q6ur/6+vr/+vr6//r6+v/6+vr/+rq6v/s7Oz//////7Kysf8PDw//KSkp/zU1NeAzMzMIMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsQAAAP8AAAD/f39////////u7u7/6urq/+vr6//r6+v/6+vr/+vr6//r6+v/6+vr/+rq6f/t7e///////5ynwf8KEy3/MC8t/zQ0M7UzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHUAAAD/AAAA/1paWv//////8vLy/+rq6v/r6+v/6+vr/+vr6//r6+v/6+vr/+vq6f/r7PD/7/f//+v3///o6Oj//+mZ/3FcJv8OGDL/NjUy/zMzM3ozMzMAMzMzADMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAuAAAA/wAAAP8sLCz///////v7+//p6en/6+vr/+vr6//r6+v/6+vr/+vq6f/r6+7/7/j//+r2///h2sf/37tY/9+iA//zpgD//74A/2BRJv8eJTn/MzMz/zMzMzIzMzMAMzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAMUAAAD/AAAA/9DQ0P//////6Ojo/+vr6//r6+v/6+vr/+vr6v/r6uv/7vX+/+v4///i2sb/4LZC/+OfAP/sngD/9K0A/fCuALz/zgBgoIMYRRAZPPUzMzP/MzMzyTMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAABfAAAA/wAAAP9+fn7//////+np6f/r6+v/6+vr/+vr6//r6uj/7O/z/+36///k5OH/4btP/+WfAP/voQD/9K8AyvCwAGTvrgAQ764AAP/CAABrWSUAFyA6eTMzM/8zMzP/MzMzYzMzMwAzMzMAMzMzAAAAAAAAAAAAAAAAAAAAAN4AAAD/HR0d//r6+v/4+Pj/6urq/+vr6//r6+v/6+rp/+31///o9P//4sqI/+SjAP/unwD/9K8Aou+vACjurgAA8K8AAPayAAD/xAAA6K0FACwuNAArLjUAMzMz2jMzM/8zMzPiMzMzADMzMwAzMzMAAAAAAAAAAAAAAABgAAAA/wAAAP+dnZ3//////+jo6P/r6+v/6+rq/+zr7f/t+f//5ebi/+OzMv/rnQD/8aoAnfKxABT/ugAA/8IAAP/EAAD/wQAA/LYAAP+5AACNbhoAEh48ADU0MwAzMzNaMzMz/zMzM/8zMzNkMzMzADMzMwAAAAAAAAAAAAAAAMgAAAD/IiIi//z8/P/09PT/6+vr/+vq6f/s7fD/6/r//+TYsf/npQP/8aEAwe+tAB34uAAA/8MAAN+iBAC+jg0Apn8TAHJcIgBYSykAPDkwACcrNgAxMjQAMzMzADMzMwAzMzPYMzMz/zMzM8wzMzMAMzMzAAAAAAAAAAAwAAAA/wAAAP+Hh4f//////+np6f/r6un/7O/z/+r4///lzIf/658A+/KoAFburQAA/8EAAP+/AACCZR0AKSw2ABwkOQAWIDsAEBw8ABoiOgAjKDcALzA0ADU0MgAzMzMAMzMzADMzM3AzMzP/MzMz/zMzMzQzMzMAAAAAAAAAAHoAAAD/AAAA/9ra2v//////6+rp/+zv8//q+P//5cdy/+2eAMvyqwAP7KwAAP+/AADqrQMAUEUrAAcWPwAkKTcAMDE0ADIyMwA0MzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzGTMzM/8zMzP/MzMzfzMzMwAAAAAkAAAAvgAAAP8+Pj7//////+3s6//s7fD/6vj//+fIdP/ungCa8a0AAO6uAAD+uAAA6q0DADAxMwAMGT4ANTQzCDQ0M8gzMzOOMzMzKjMzM8QzMzOQMzMz1DMzM0szMzO9MzMzSTMzMwAzMzMAMzMzvDMzM/8zMzPCMzMzJwAAAFMAAADsAAAA/3d3d///////6urq/+r5///nz4v/7p4AffGsAADvrwAA7asAAP/OAACUdRoAABBAADc1MgAzMzMAMzMzyzMzM6QzMzOFMzMzyDMzM0AzMzPXMzMzLzMzM+gzMzMcMzMzADMzMwAzMzOAMzMz/zMzM+8zMzNXAAAAegAAAP8AAAD/mJiY///////r9///6dyz/+6hAHfwqwAA768AAO2sAAD/vgAA8LQDADUzMgAmKjcAMzMzADMzMwAzMzOdMzMz4zMzM+szMzN4MzMzADMzM+UzMzPPMzMz1DMzMwAzMzMAMzMzADMzM1ozMzP/MzMz/zMzM3wAAACUAAAA/wAAAP+traz//////+ns5//uqguL8KcAAO2tAAD5tAAA/9IAAP/UAABoVCkADho8ADc2MgAzMzMAMzMzADMzM8IzMzOoMzMzdjMzM9ozMzMkMzMz5TMzM5QzMzMmMzMzADMzMwAzMzMAMzMzQjMzM/8zMzP/MzMzkwAAAJ4AAAD/AAAA/7S1tv//////7L5RtfCfAAD8uwAA/9MAAPy9AACxfQAASTgLABYhPwA+Pj0ANDQzADIyMgAzMzMGMzMzwzMzM8kzMzPNMzMzRDMzM24zMzPiMzMzADMzMyEzMzNTMzMzFDMzMwAzMzM5MzMz/zMzM/8zMzOaAAAAlAAAAP8AAAD/q7fS///80O//tgAQ/9MAAPSzAACUagAAIBcAAAAAAAAAAAAABwcHACcnJgA9PT0AOjo6ADIyMgEzMzMBMzMzATMzMwEzMzMAMzMzEDMzMwYzMzMAMzMzRjMzM1wzMzMSMzMzADMzM0IzMzP/MzMz/zMzM5MAAAB5AAAA/wAAAP+fp6r///5ZR96WAAB0VQAADgoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8PDwAvLy8ANjY2ADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMBMzMzATMzMwAzMzMAMzMzWzMzM/8zMzP/MzMzegAAAE0AAADmAAAA/1BDKeFvUA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAAzMzMANjY2ADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzOrMzMz/zMzM+ozMzNRAAAAEgAAAKkAAAD/AAAA/wAAAPUAAACnAAAAVgAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICADExMQA2NjYAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzDzMzM1UzMzOlMzMz9TMzM/8zMzP/MzMzrjMzMxYAAAAAAAAAMAAAAOoAAAD/AAAA/wAAAP8AAAD/AAAA/QAAAMgAAACQAAAAXgAAADEAAAAKAAAAAAAAAAACAgIAMTExADY2NgAzMzMAMzMzCTMzMzEzMzNdMzMzjzMzM8czMzP8MzMz/zMzM/8zMzP/MzMz/zMzM+wzMzMzMzMzAAAAAAAAAAAAAAAAAAAAAD0AAACaAAAA5wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAPYAAADPAAAArAICAoQxMTGDNjY2qzMzM88zMzP1MzMz/zMzM/8zMzP/MzMz/zMzM/8zMzP/MzMz6TMzM5wzMzM/MzMzADMzMwAzMzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgAAAHQAAACvAAAA5QAAAP8AAAD/AAAA/wAAAP8AAAD/AgIC/zExMf82Njb/MzMz/zMzM/8zMzP/MzMz/zMzM+UzMzOvMzMzdjMzMzQzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAAAFEAAAB7AAAAowAAAMYCAgLqMTEx6zY2NsczMzOkMzMzfDMzM1EzMzMjMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzADMzMwAzMzMAMzMzAP/+f////D////gf///wD///4Af//8AD//+AAf//AAD//gAAf/wAAD/8AAA/+AAAH/AAAY/wAA/P4AA/x+AA/+fAA//jwA//88Af//OAP5FxgP+FcYH/jHkB/5T4A/+N+Af///iP///5j///8YP//8HAP/wD8AAAD/8AAP//+B//">
15 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
14 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
16 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
15 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
17
16
18 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
17 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
19 <style>body { background:#eeeeee; }</style>
18 <style>body { background:#eeeeee; }</style>
20 <script type="text/javascript">
19 <script type="text/javascript">
21 // register templateContext to pass template variables to JS
20 // register templateContext to pass template variables to JS
22 var templateContext = {timeago: {}};
21 var templateContext = {timeago: {}};
23 </script>
22 </script>
24 <%include file="/base/plugins_base.mako"/>
23 <%include file="/base/plugins_base.mako"/>
25 <script type="text/javascript" src="${h.asset('js/scripts.min.js', ver=c.rhodecode_version_hash)}"></script>
24 <script type="text/javascript" src="${h.asset('js/scripts.min.js', ver=c.rhodecode_version_hash)}"></script>
26 </head>
25 </head>
27 <body>
26 <body>
28
27
29 <div class="wrapper error_page">
28 <div class="wrapper error_page">
30 <div class="sidebar">
29 <div class="sidebar">
31 <a href="${h.route_path('home')}"><img class="error-page-logo" src="${h.asset('images/RhodeCode_Logo_Black.png')}" alt="RhodeCode"/></a>
30 <a href="${h.route_path('home')}"><img class="error-page-logo" src="${h.asset('images/RhodeCode_Logo_Black.png')}" alt="RhodeCode"/></a>
32 </div>
31 </div>
33 <div class="main-content">
32 <div class="main-content">
34 <h1>
33 <h1>
35 <span class="error-branding">
34 <span class="error-branding">
36 ${h.branding(c.rhodecode_name)}
35 ${h.branding(c.rhodecode_name)}
37 </span><br/>
36 </span><br/>
38 ${c.error_message}
37 ${c.error_message}
39 <br/>
38 <br/>
40 <span class="error_message">${c.error_explanation}</span>
39 <span class="error_message">${c.error_explanation}</span>
41 </h1>
40 </h1>
42 % if c.messages:
41 % if c.messages:
43 % for message in c.messages:
42 % for message in c.messages:
44 <div class="alert alert-${message.category}">${message}</div>
43 <div class="alert alert-${message.category}">${message}</div>
45 % endfor
44 % endfor
46 % endif
45 % endif
47 %if c.redirect_time:
46 %if c.redirect_time:
48 <p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
47 <p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
49 %endif
48 %endif
50 <div class="inner-column">
49 <div class="inner-column">
51 <h4>Possible Causes</h4>
50 <h4>Possible Causes</h4>
52 <ul>
51 <ul>
53 % if c.causes:
52 % if c.causes:
54 %for cause in c.causes:
53 %for cause in c.causes:
55 <li>${cause}</li>
54 <li>${cause}</li>
56 %endfor
55 %endfor
57 %else:
56 %else:
58 <li>The resource may have been deleted.</li>
57 <li>The resource may have been deleted.</li>
59 <li>You may not have access to this repository.</li>
58 <li>You may not have access to this repository.</li>
60 <li>The link may be incorrect.</li>
59 <li>The link may be incorrect.</li>
61 %endif
60 %endif
62 </ul>
61 </ul>
63 </div>
62 </div>
64 <div class="inner-column">
63 <div class="inner-column">
65 <h4>Support</h4>
64 <h4>Support</h4>
66 <p>For help and support, go to the <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support Page')}</a>.
65 <p>For help and support, go to the <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support Page')}</a>.
67 It may be useful to include your log file; see the log file locations <a href="${h.route_url('enterprise_log_file_locations')}">here</a>.
66 It may be useful to include your log file; see the log file locations <a href="${h.route_url('enterprise_log_file_locations')}">here</a>.
68 </p>
67 </p>
69
68
70 </div>
69 </div>
71 <div class="inner-column">
70 <div class="inner-column">
72 <h4>Documentation</h4>
71 <h4>Documentation</h4>
73 <p>For more information, see <a href="${h.route_url('enterprise_docs')}">docs.rhodecode.com</a>.</p>
72 <p>For more information, see <a href="${h.route_url('enterprise_docs')}">docs.rhodecode.com</a>.</p>
74 </div>
73 </div>
75 </div>
74 </div>
76
75
77 % if c.show_exception_id:
76 % if c.show_exception_id:
78 <div class="sidebar" style="width: 130px">
77 <div class="sidebar" style="width: 130px">
79
78
80 </div>
79 </div>
81 <div class="main-content">
80 <div class="main-content">
82 <p>
81 <p>
83 <strong>Exception ID: <code><a href="${c.exception_id_url}">${c.exception_id}</a></code> </strong> <br/>
82 <strong>Exception ID: <code><a href="${c.exception_id_url}">${c.exception_id}</a></code> </strong> <br/>
84
83
85 Super-admins can see details of the above error in the exception tracker found under
84 Super-admins can see details of the above error in the exception tracker found under
86 <a href="${h.route_url('admin_settings_exception_tracker')}">admin > settings > exception tracker</a>.
85 <a href="${h.route_url('admin_settings_exception_tracker')}">admin > settings > exception tracker</a>.
87
86
88 % if c.exception_debug:
87 % if c.exception_debug:
89 <pre>
88 <pre>
90 <strong>DEBUG MODE ON FOR EXCEPTION: ${c.exception_id}</strong>
89 <strong>DEBUG MODE ON FOR EXCEPTION: ${c.exception_id}</strong>
91 <strong>REQUEST_ID: ${getattr(request, 'req_id', None)}</strong>
90 <strong>REQUEST_ID: ${getattr(request, 'req_id', None)}</strong>
92 ----------------
91 ----------------
93 debug mode is controlled by
92 debug mode is controlled by
94 ${c.exception_config_ini}
93 ${c.exception_config_ini}
95 file settings:
94 file settings:
96
95
97 debug = true
96 debug = true
98 ----------------
97 ----------------
99
98
100 % for rec in getattr(request, 'req_id_bucket', []):
99 % for rec in getattr(request, 'req_id_bucket', []):
101 ${rec}
100 ${rec}
102 % endfor
101 % endfor
103 </pre>
102 </pre>
104 % endif
103 % endif
105 </p>
104 </p>
106 </div>
105 </div>
107 % endif
106 % endif
108 </div>
107 </div>
109
108
110 </body>
109 </body>
111
110
112 </html>
111 </html>
@@ -1,38 +1,37 b''
1 ## -*- coding: utf-8 -*-
2
1
3 ${_('%(user)s committed on %(date)s UTC') % {
2 ${_('%(user)s committed on %(date)s UTC') % {
4 'user': h.person(commit.author),
3 'user': h.person(commit.author),
5 'date': h.format_date(commit.date)
4 'date': h.format_date(commit.date)
6 }}
5 }}
7 <br/>
6 <br/>
8 % if commit.branch:
7 % if commit.branch:
9 branch: ${commit.branch} <br/>
8 branch: ${commit.branch} <br/>
10 % endif
9 % endif
11
10
12 % for bookmark in getattr(commit, 'bookmarks', []):
11 % for bookmark in getattr(commit, 'bookmarks', []):
13 bookmark: ${bookmark} <br/>
12 bookmark: ${bookmark} <br/>
14 % endfor
13 % endfor
15
14
16 % for tag in commit.tags:
15 % for tag in commit.tags:
17 tag: ${tag} <br/>
16 tag: ${tag} <br/>
18 % endfor
17 % endfor
19
18
20 % if has_hidden_changes:
19 % if has_hidden_changes:
21 Has hidden changes<br/>
20 Has hidden changes<br/>
22 % endif
21 % endif
23
22
24 commit: <a href="${h.route_url('repo_commit', repo_name=c.rhodecode_db_repo.repo_name, commit_id=commit.raw_id)}">${h.show_id(commit)}</a>
23 commit: <a href="${h.route_url('repo_commit', repo_name=c.rhodecode_db_repo.repo_name, commit_id=commit.raw_id)}">${h.show_id(commit)}</a>
25 <pre>
24 <pre>
26 ${h.urlify_commit_message(commit.message)}
25 ${h.urlify_commit_message(commit.message)}
27
26
28 % for change in parsed_diff:
27 % for change in parsed_diff:
29 % if limited_diff:
28 % if limited_diff:
30 ${_('Commit was too big and was cut off...')}
29 ${_('Commit was too big and was cut off...')}
31 % endif
30 % endif
32 ${change['operation']} ${change['filename']} ${'(%(added)s lines added, %(removed)s lines removed)' % {'added': change['stats']['added'], 'removed': change['stats']['deleted']}}
31 ${change['operation']} ${change['filename']} ${'(%(added)s lines added, %(removed)s lines removed)' % {'added': change['stats']['added'], 'removed': change['stats']['deleted']}}
33 % endfor
32 % endfor
34
33
35 % if feed_include_diff:
34 % if feed_include_diff:
36 ${c.path_filter.get_raw_patch(diff_processor)}
35 ${c.path_filter.get_raw_patch(diff_processor)}
37 % endif
36 % endif
38 </pre>
37 </pre>
@@ -1,124 +1,123 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Fork repository %s') % c.repo_name}
4 ${_('Fork repository %s') % c.repo_name}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='repositories')}
13 ${self.menu_items(active='repositories')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.repo_menu(active='options')}
17 ${self.repo_menu(active='options')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23 ${h.secure_form(h.route_path('repo_fork_create',repo_name=c.rhodecode_db_repo.repo_name), request=request)}
22 ${h.secure_form(h.route_path('repo_fork_create',repo_name=c.rhodecode_db_repo.repo_name), request=request)}
24 <div class="form">
23 <div class="form">
25 <!-- fields -->
24 <!-- fields -->
26 <div class="fields">
25 <div class="fields">
27
26
28 <div class="field">
27 <div class="field">
29 <div class="label">
28 <div class="label">
30 <label for="repo_name">${_('Fork name')}:</label>
29 <label for="repo_name">${_('Fork name')}:</label>
31 </div>
30 </div>
32 <div class="input">
31 <div class="input">
33 ${h.text('repo_name', class_="medium")}
32 ${h.text('repo_name', class_="medium")}
34 ${h.hidden('repo_type',c.rhodecode_db_repo.repo_type)}
33 ${h.hidden('repo_type',c.rhodecode_db_repo.repo_type)}
35 ${h.hidden('fork_parent_id',c.rhodecode_db_repo.repo_id)}
34 ${h.hidden('fork_parent_id',c.rhodecode_db_repo.repo_id)}
36 </div>
35 </div>
37 </div>
36 </div>
38
37
39 <div class="field">
38 <div class="field">
40 <div class="label">
39 <div class="label">
41 <label for="repo_group">${_('Repository group')}:</label>
40 <label for="repo_group">${_('Repository group')}:</label>
42 </div>
41 </div>
43 <div class="select">
42 <div class="select">
44 ${h.select('repo_group','',c.repo_groups,class_="medium")}
43 ${h.select('repo_group','',c.repo_groups,class_="medium")}
45 % if c.personal_repo_group:
44 % if c.personal_repo_group:
46 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
45 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
47 ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}
46 ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}
48 </a>
47 </a>
49 % endif
48 % endif
50 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
49 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
51 </div>
50 </div>
52 </div>
51 </div>
53
52
54 <div class="field">
53 <div class="field">
55 <div class="label label-textarea">
54 <div class="label label-textarea">
56 <label for="description">${_('Description')}:</label>
55 <label for="description">${_('Description')}:</label>
57 </div>
56 </div>
58 <div class="textarea editor">
57 <div class="textarea editor">
59 ${h.textarea('description',cols=23,rows=5,class_="medium")}
58 ${h.textarea('description',cols=23,rows=5,class_="medium")}
60 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
59 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
61 <span class="help-block">
60 <span class="help-block">
62 % if c.visual.stylify_metatags:
61 % if c.visual.stylify_metatags:
63 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
62 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
64 % else:
63 % else:
65 ${_('Plain text format.')}
64 ${_('Plain text format.')}
66 % endif
65 % endif
67 ${_('Add a README file for longer descriptions')}
66 ${_('Add a README file for longer descriptions')}
68 </span>
67 </span>
69 <span id="meta-tags-desc" style="display: none">
68 <span id="meta-tags-desc" style="display: none">
70 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
69 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
71 ${dt.metatags_help()}
70 ${dt.metatags_help()}
72 </span>
71 </span>
73 </div>
72 </div>
74 </div>
73 </div>
75
74
76 <div class="field">
75 <div class="field">
77 <div class="label label-checkbox">
76 <div class="label label-checkbox">
78 <label for="private">${_('Copy permissions')}:</label>
77 <label for="private">${_('Copy permissions')}:</label>
79 </div>
78 </div>
80 <div class="checkboxes">
79 <div class="checkboxes">
81 ${h.checkbox('copy_permissions',value="True", checked="checked")}
80 ${h.checkbox('copy_permissions',value="True", checked="checked")}
82 <span class="help-block">${_('Copy permissions from parent repository.')}</span>
81 <span class="help-block">${_('Copy permissions from parent repository.')}</span>
83 </div>
82 </div>
84 </div>
83 </div>
85
84
86 <div class="field">
85 <div class="field">
87 <div class="label label-checkbox">
86 <div class="label label-checkbox">
88 <label for="private">${_('Private')}:</label>
87 <label for="private">${_('Private')}:</label>
89 </div>
88 </div>
90 <div class="checkboxes">
89 <div class="checkboxes">
91 ${h.checkbox('private',value="True")}
90 ${h.checkbox('private',value="True")}
92 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
91 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
93 </div>
92 </div>
94 </div>
93 </div>
95
94
96 <div class="buttons">
95 <div class="buttons">
97 ${h.submit('',_('Fork this Repository'),class_="btn")}
96 ${h.submit('',_('Fork this Repository'),class_="btn")}
98 </div>
97 </div>
99 </div>
98 </div>
100 </div>
99 </div>
101 ${h.end_form()}
100 ${h.end_form()}
102 </div>
101 </div>
103 <script>
102 <script>
104 $(document).ready(function(){
103 $(document).ready(function(){
105 $("#repo_group").select2({
104 $("#repo_group").select2({
106 'dropdownAutoWidth': true,
105 'dropdownAutoWidth': true,
107 'containerCssClass': "drop-menu",
106 'containerCssClass': "drop-menu",
108 'dropdownCssClass': "drop-menu-dropdown",
107 'dropdownCssClass': "drop-menu-dropdown",
109 'width': "resolve"
108 'width': "resolve"
110 });
109 });
111 $("#landing_rev").select2({
110 $("#landing_rev").select2({
112 'containerCssClass': "drop-menu",
111 'containerCssClass': "drop-menu",
113 'dropdownCssClass': "drop-menu-dropdown",
112 'dropdownCssClass': "drop-menu-dropdown",
114 'minimumResultsForSearch': -1
113 'minimumResultsForSearch': -1
115 });
114 });
116 $('#repo_name').focus();
115 $('#repo_name').focus();
117
116
118 $('#select_my_group').on('click', function(e){
117 $('#select_my_group').on('click', function(e){
119 e.preventDefault();
118 e.preventDefault();
120 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
119 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
121 })
120 })
122 })
121 })
123 </script>
122 </script>
124 </%def>
123 </%def>
@@ -1,104 +1,103 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('%s Forks') % c.repo_name}
4 ${_('%s Forks') % c.repo_name}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='repositories')}
13 ${self.menu_items(active='repositories')}
15 </%def>
14 </%def>
16
15
17 <%def name="menu_bar_subnav()">
16 <%def name="menu_bar_subnav()">
18 ${self.repo_menu(active='summary')}
17 ${self.repo_menu(active='summary')}
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <div class="box">
21 <div class="box">
23 <div class="title">
22 <div class="title">
24
23
25 <ul class="links">
24 <ul class="links">
26 <li>
25 <li>
27 <a class="btn btn-small btn-success" href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">
26 <a class="btn btn-small btn-success" href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">
28 ${_('Create new fork')}
27 ${_('Create new fork')}
29 </a>
28 </a>
30 </li>
29 </li>
31 </ul>
30 </ul>
32 </div>
31 </div>
33
32
34 <div id="fork_list_wrap">
33 <div id="fork_list_wrap">
35 <table id="fork_list_table" class="display"></table>
34 <table id="fork_list_table" class="display"></table>
36 </div>
35 </div>
37 </div>
36 </div>
38
37
39
38
40
39
41 <script type="text/javascript">
40 <script type="text/javascript">
42
41
43 $(document).ready(function() {
42 $(document).ready(function() {
44 var $forksListTable = $('#fork_list_table');
43 var $forksListTable = $('#fork_list_table');
45
44
46 // fork list
45 // fork list
47 $forksListTable.DataTable({
46 $forksListTable.DataTable({
48 processing: true,
47 processing: true,
49 serverSide: true,
48 serverSide: true,
50 ajax: {
49 ajax: {
51 "url": "${h.route_path('repo_forks_data', repo_name=c.repo_name)}",
50 "url": "${h.route_path('repo_forks_data', repo_name=c.repo_name)}",
52 },
51 },
53 dom: 'rtp',
52 dom: 'rtp',
54 pageLength: ${c.visual.dashboard_items},
53 pageLength: ${c.visual.dashboard_items},
55 order: [[ 0, "asc" ]],
54 order: [[ 0, "asc" ]],
56 columns: [
55 columns: [
57 { data: {"_": "username",
56 { data: {"_": "username",
58 "sort": "username"}, title: "${_('Owner')}", className: "td-user" },
57 "sort": "username"}, title: "${_('Owner')}", className: "td-user" },
59 { data: {"_": "fork_name",
58 { data: {"_": "fork_name",
60 "sort": "fork_name"}, title: "${_('Fork name')}", className: "td-email" },
59 "sort": "fork_name"}, title: "${_('Fork name')}", className: "td-email" },
61 { data: {"_": "description",
60 { data: {"_": "description",
62 "sort": "description"}, title: "${_('Description')}", className: "td-user" },
61 "sort": "description"}, title: "${_('Description')}", className: "td-user" },
63 { data: {"_": "fork_date",
62 { data: {"_": "fork_date",
64 "sort": "fork_date"}, title: "${_('Forked')}", className: "td-user" },
63 "sort": "fork_date"}, title: "${_('Forked')}", className: "td-user" },
65 { data: {"_": "last_activity",
64 { data: {"_": "last_activity",
66 "sort": "last_activity",
65 "sort": "last_activity",
67 "type": Number}, title: "${_('Last activity')}", className: "td-time" },
66 "type": Number}, title: "${_('Last activity')}", className: "td-time" },
68 { data: {"_": "action",
67 { data: {"_": "action",
69 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
68 "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false }
70 ],
69 ],
71
70
72 language: {
71 language: {
73 paginate: DEFAULT_GRID_PAGINATION,
72 paginate: DEFAULT_GRID_PAGINATION,
74 sProcessing: _gettext('loading...'),
73 sProcessing: _gettext('loading...'),
75 emptyTable: _gettext("No forks available yet.")
74 emptyTable: _gettext("No forks available yet.")
76 },
75 },
77
76
78 "createdRow": function ( row, data, index ) {
77 "createdRow": function ( row, data, index ) {
79 if (!data['active_raw']){
78 if (!data['active_raw']){
80 $(row).addClass('closed')
79 $(row).addClass('closed')
81 }
80 }
82 }
81 }
83 });
82 });
84
83
85 $forksListTable.on('xhr.dt', function(e, settings, json, xhr){
84 $forksListTable.on('xhr.dt', function(e, settings, json, xhr){
86 $forksListTable.css('opacity', 1);
85 $forksListTable.css('opacity', 1);
87 });
86 });
88
87
89 $forksListTable.on('preXhr.dt', function(e, settings, data){
88 $forksListTable.on('preXhr.dt', function(e, settings, data){
90 $forksListTable.css('opacity', 0.3);
89 $forksListTable.css('opacity', 0.3);
91 });
90 });
92
91
93 // filter
92 // filter
94 $('#q_filter').on('keyup',
93 $('#q_filter').on('keyup',
95 $.debounce(250, function() {
94 $.debounce(250, function() {
96 $forksListTable.DataTable().search(
95 $forksListTable.DataTable().search(
97 $('#q_filter').val()
96 $('#q_filter').val()
98 ).draw();
97 ).draw();
99 })
98 })
100 );
99 );
101
100
102 });
101 });
103 </script>
102 </script>
104 </%def>
103 </%def>
@@ -1,15 +1,14 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="index_base.mako"/>
1 <%inherit file="index_base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Dashboard')}
4 ${_('Dashboard')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs()"></%def>
10 <%def name="breadcrumbs()"></%def>
12
11
13 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='repositories')}
13 ${self.menu_items(active='repositories')}
15 </%def>
14 </%def>
@@ -1,23 +1,22 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="index_base.mako"/>
1 <%inherit file="index_base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('%s Repository group dashboard') % c.repo_group.group_name}
4 ${_('%s Repository group dashboard') % c.repo_group.group_name}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10
9
11 <%def name="breadcrumbs()">
10 <%def name="breadcrumbs()">
12 <span class="groups_breadcrumbs">
11 <span class="groups_breadcrumbs">
13 ${h.link_to(_(u'Home'), h.route_path('home'))}
12 ${h.link_to(_(u'Home'), h.route_path('home'))}
14 %if c.repo_group.parent_group:
13 %if c.repo_group.parent_group:
15 &raquo; ${h.link_to(c.repo_group.parent_group.name, h.route_path('repo_group_home', repo_group_name=c.repo_group.parent_group.group_name))}
14 &raquo; ${h.link_to(c.repo_group.parent_group.name, h.route_path('repo_group_home', repo_group_name=c.repo_group.parent_group.group_name))}
16 %endif
15 %endif
17 &raquo; ${c.repo_group.name}
16 &raquo; ${c.repo_group.name}
18 </span>
17 </span>
19 </%def>
18 </%def>
20
19
21 <%def name="menu_bar_nav()">
20 <%def name="menu_bar_nav()">
22 ${self.menu_items(active='repositories')}
21 ${self.menu_items(active='repositories')}
23 </%def>
22 </%def>
@@ -1,52 +1,51 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%def name="title()">
2 <%def name="title()">
4 ${_('Journal')}
3 ${_('Journal')}
5 %if c.rhodecode_name:
4 %if c.rhodecode_name:
6 &middot; ${h.branding(c.rhodecode_name)}
5 &middot; ${h.branding(c.rhodecode_name)}
7 %endif
6 %endif
8 </%def>
7 </%def>
9
8
10 <%def name="breadcrumbs_links()">
9 <%def name="breadcrumbs_links()">
11 ${h.form(None, id_="filter_form", method="get")}
10 ${h.form(None, id_="filter_form", method="get")}
12 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term}" placeholder="${_('quick filter...')}"/>
11 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term}" placeholder="${_('quick filter...')}"/>
13 <input type='submit' value="${_('filter')}" class="btn" />
12 <input type='submit' value="${_('filter')}" class="btn" />
14 ${_('Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
13 ${_('Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
15 ${h.end_form()}
14 ${h.end_form()}
16 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
15 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
17 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
16 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
18 </%def>
17 </%def>
19
18
20 <%def name="menu_bar_nav()">
19 <%def name="menu_bar_nav()">
21 ${self.menu_items(active='journal')}
20 ${self.menu_items(active='journal')}
22 </%def>
21 </%def>
23
22
24 <%def name="head_extra()">
23 <%def name="head_extra()">
25 <link href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
24 <link href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
26 <link href="${h.route_path('journal_rss', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
25 <link href="${h.route_path('journal_rss', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
27 </%def>
26 </%def>
28
27
29 <%def name="main()">
28 <%def name="main()">
30
29
31 <div class="box">
30 <div class="box">
32 <!-- box / title -->
31 <!-- box / title -->
33 <div class="title journal">
32 <div class="title journal">
34 ${self.breadcrumbs()}
33 ${self.breadcrumbs()}
35 <ul class="links icon-only-links block-right">
34 <ul class="links icon-only-links block-right">
36 <li>
35 <li>
37 <span><a id="refresh" href="${h.route_path('journal')}"><i class="icon-refresh"></i></a></span>
36 <span><a id="refresh" href="${h.route_path('journal')}"><i class="icon-refresh"></i></a></span>
38 </li>
37 </li>
39 <li>
38 <li>
40 <span>
39 <span>
41 <a href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="RSS Feed" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
40 <a href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="RSS Feed" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
42 </span>
41 </span>
43 </li>
42 </li>
44 </ul>
43 </ul>
45 </div>
44 </div>
46 <div id="journal">${c.journal_data|n}</div>
45 <div id="journal">${c.journal_data|n}</div>
47 </div>
46 </div>
48
47
49 <script type="text/javascript">
48 <script type="text/javascript">
50 $('#j_filter').autoGrowInput();
49 $('#j_filter').autoGrowInput();
51 </script>
50 </script>
52 </%def>
51 </%def>
@@ -1,47 +1,46 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3
2
4 %if c.journal_day_aggreagate:
3 %if c.journal_day_aggreagate:
5 %for day,items in c.journal_day_aggreagate:
4 %for day,items in c.journal_day_aggreagate:
6 <div class="journal_day">${day}</div>
5 <div class="journal_day">${day}</div>
7 % for user,entries in items:
6 % for user,entries in items:
8 <div class="journal_container">
7 <div class="journal_container">
9 ${base.gravatar(user.email if user else '', 30)}
8 ${base.gravatar(user.email if user else '', 30)}
10 %if user:
9 %if user:
11 <div class="journal_user user">${h.link_to_user(user.username)}</div>
10 <div class="journal_user user">${h.link_to_user(user.username)}</div>
12 %else:
11 %else:
13 <div class="journal_user user deleted">${entries[0].username}</div>
12 <div class="journal_user user deleted">${entries[0].username}</div>
14 %endif
13 %endif
15 <div class="journal_action_container">
14 <div class="journal_action_container">
16 % for entry in entries:
15 % for entry in entries:
17 <div class="journal_icon"> ${h.action_parser(request, entry)[2]()}</div>
16 <div class="journal_icon"> ${h.action_parser(request, entry)[2]()}</div>
18 <div class="journal_action">${h.action_parser(request, entry)[0]()}</div>
17 <div class="journal_action">${h.action_parser(request, entry)[0]()}</div>
19 <div class="journal_repo">
18 <div class="journal_repo">
20 <span class="journal_repo_name">
19 <span class="journal_repo_name">
21 %if entry.repository is not None:
20 %if entry.repository is not None:
22 ${h.link_to(entry.repository.repo_name,
21 ${h.link_to(entry.repository.repo_name,
23 h.route_path('repo_summary',repo_name=entry.repository.repo_name))}
22 h.route_path('repo_summary',repo_name=entry.repository.repo_name))}
24 %else:
23 %else:
25 ${entry.repository_name}
24 ${entry.repository_name}
26 %endif
25 %endif
27 </span>
26 </span>
28 </div>
27 </div>
29 <div class="journal_action_params">${h.literal(h.action_parser(request, entry)[1]())}</div>
28 <div class="journal_action_params">${h.literal(h.action_parser(request, entry)[1]())}</div>
30 <div class="date">
29 <div class="date">
31 ${h.age_component(entry.action_date, time_is_local=True)}
30 ${h.age_component(entry.action_date, time_is_local=True)}
32 </div>
31 </div>
33 %endfor
32 %endfor
34 </div>
33 </div>
35 </div>
34 </div>
36 %endfor
35 %endfor
37 %endfor
36 %endfor
38
37
39 <div class="pagination-wh pagination-left">
38 <div class="pagination-wh pagination-left">
40 ${c.journal_pager.render()}
39 ${c.journal_pager.render()}
41 </div>
40 </div>
42
41
43 %else:
42 %else:
44 <div>
43 <div>
45 ${_('No entries yet')}
44 ${_('No entries yet')}
46 </div>
45 </div>
47 %endif
46 %endif
@@ -1,43 +1,42 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%def name="title()">
2 <%def name="title()">
4 ${_('Public Journal')}
3 ${_('Public Journal')}
5 %if c.rhodecode_name:
4 %if c.rhodecode_name:
6 &middot; ${h.branding(c.rhodecode_name)}
5 &middot; ${h.branding(c.rhodecode_name)}
7 %endif
6 %endif
8 </%def>
7 </%def>
9
8
10 <%def name="breadcrumbs()">
9 <%def name="breadcrumbs()">
11 <h1 class="block-left">
10 <h1 class="block-left">
12 ${_('Public Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
11 ${_('Public Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
13 </h1>
12 </h1>
14 </%def>
13 </%def>
15
14
16 <%def name="menu_bar_nav()">
15 <%def name="menu_bar_nav()">
17 ${self.menu_items(active='journal')}
16 ${self.menu_items(active='journal')}
18 </%def>
17 </%def>
19
18
20 <%def name="head_extra()">
19 <%def name="head_extra()">
21 <link href="${h.route_path('journal_public_atom')}" rel="alternate" title="${_('ATOM public journal feed')}" type="application/atom+xml" />
20 <link href="${h.route_path('journal_public_atom')}" rel="alternate" title="${_('ATOM public journal feed')}" type="application/atom+xml" />
22 <link href="${h.route_path('journal_public_rss')}" rel="alternate" title="${_('RSS public journal feed')}" type="application/rss+xml" />
21 <link href="${h.route_path('journal_public_rss')}" rel="alternate" title="${_('RSS public journal feed')}" type="application/rss+xml" />
23 </%def>
22 </%def>
24
23
25 <%def name="main()">
24 <%def name="main()">
26
25
27 <div class="box">
26 <div class="box">
28 <!-- box / title -->
27 <!-- box / title -->
29 <div class="title journal">
28 <div class="title journal">
30 ${self.breadcrumbs()}
29 ${self.breadcrumbs()}
31
30
32 <ul class="links icon-only-links block-right">
31 <ul class="links icon-only-links block-right">
33 <li>
32 <li>
34 <span>
33 <span>
35 <a href="${h.route_path('journal_public_atom')}"> <i class="icon-rss-sign" ></i></a>
34 <a href="${h.route_path('journal_public_atom')}"> <i class="icon-rss-sign" ></i></a>
36 </span>
35 </span>
37 </li>
36 </li>
38 </ul>
37 </ul>
39 </div>
38 </div>
40 <div id="journal">${c.journal_data|n}</div>
39 <div id="journal">${c.journal_data|n}</div>
41 </div>
40 </div>
42
41
43 </%def>
42 </%def>
@@ -1,106 +1,105 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/root.mako"/>
1 <%inherit file="base/root.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Sign In')}
4 ${_('Sign In')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10 <style>body{background-color:#eeeeee;}</style>
9 <style>body{background-color:#eeeeee;}</style>
11
10
12 <div class="loginbox">
11 <div class="loginbox">
13 <div class="header-account">
12 <div class="header-account">
14 <div id="header-inner" class="title">
13 <div id="header-inner" class="title">
15 <div id="logo">
14 <div id="logo">
16 <div class="logo-wrapper">
15 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
16 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
18 </div>
17 </div>
19 % if c.rhodecode_name:
18 % if c.rhodecode_name:
20 <div class="branding">
19 <div class="branding">
21 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
20 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
22 </div>
21 </div>
23 % endif
22 % endif
24 </div>
23 </div>
25 </div>
24 </div>
26 </div>
25 </div>
27
26
28 <div class="loginwrapper">
27 <div class="loginwrapper">
29 <rhodecode-toast id="notifications"></rhodecode-toast>
28 <rhodecode-toast id="notifications"></rhodecode-toast>
30
29
31 <div class="auth-image-wrapper">
30 <div class="auth-image-wrapper">
32 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
31 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
33 </div>
32 </div>
34
33
35 <div id="login">
34 <div id="login">
36 <%block name="above_login_button" />
35 <%block name="above_login_button" />
37 <!-- login -->
36 <!-- login -->
38 <div class="sign-in-title">
37 <div class="sign-in-title">
39 <h1>${_('Sign In using username/password')}</h1>
38 <h1>${_('Sign In using username/password')}</h1>
40 </div>
39 </div>
41 <div class="inner form">
40 <div class="inner form">
42 ${h.form(request.route_path('login', _query={'came_from': c.came_from}), needs_csrf_token=False)}
41 ${h.form(request.route_path('login', _query={'came_from': c.came_from}), needs_csrf_token=False)}
43
42
44 <label for="username">${_('Username')}:</label>
43 <label for="username">${_('Username')}:</label>
45 ${h.text('username', class_='focus', value=defaults.get('username'))}
44 ${h.text('username', class_='focus', value=defaults.get('username'))}
46 %if 'username' in errors:
45 %if 'username' in errors:
47 <span class="error-message">${errors.get('username')}</span>
46 <span class="error-message">${errors.get('username')}</span>
48 <br />
47 <br />
49 %endif
48 %endif
50
49
51 <label for="password">${_('Password')}:
50 <label for="password">${_('Password')}:
52 %if h.HasPermissionAny('hg.password_reset.enabled')():
51 %if h.HasPermissionAny('hg.password_reset.enabled')():
53 <div class="pull-right">${h.link_to(_('Forgot your password?'), h.route_path('reset_password'), class_='pwd_reset', tabindex="-1")}</div>
52 <div class="pull-right">${h.link_to(_('Forgot your password?'), h.route_path('reset_password'), class_='pwd_reset', tabindex="-1")}</div>
54 %endif
53 %endif
55
54
56 </label>
55 </label>
57 ${h.password('password', class_='focus')}
56 ${h.password('password', class_='focus')}
58 %if 'password' in errors:
57 %if 'password' in errors:
59 <span class="error-message">${errors.get('password')}</span>
58 <span class="error-message">${errors.get('password')}</span>
60 <br />
59 <br />
61 %endif
60 %endif
62
61
63 ${h.checkbox('remember', value=True, checked=defaults.get('remember'))}
62 ${h.checkbox('remember', value=True, checked=defaults.get('remember'))}
64 <% timeout = request.registry.settings.get('beaker.session.timeout', '0') %>
63 <% timeout = request.registry.settings.get('beaker.session.timeout', '0') %>
65 % if timeout == '0':
64 % if timeout == '0':
66 <% remember_label = _('Remember my indefinitely') %>
65 <% remember_label = _('Remember my indefinitely') %>
67 % else:
66 % else:
68 <% remember_label = _('Remember me for {}').format(h.age_from_seconds(timeout)) %>
67 <% remember_label = _('Remember me for {}').format(h.age_from_seconds(timeout)) %>
69 % endif
68 % endif
70 <label class="checkbox" for="remember">${remember_label}</label>
69 <label class="checkbox" for="remember">${remember_label}</label>
71
70
72 <p class="links">
71 <p class="links">
73 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
72 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
74 ${h.link_to(_("Create a new account."), request.route_path('register'), class_='new_account')}
73 ${h.link_to(_("Create a new account."), request.route_path('register'), class_='new_account')}
75 %endif
74 %endif
76 </p>
75 </p>
77
76
78 %if not h.HasPermissionAny('hg.password_reset.enabled')():
77 %if not h.HasPermissionAny('hg.password_reset.enabled')():
79 ## password reset hidden or disabled.
78 ## password reset hidden or disabled.
80 <p class="help-block">
79 <p class="help-block">
81 ${_('Password reset is disabled.')} <br/>
80 ${_('Password reset is disabled.')} <br/>
82 ${_('Please contact ')}
81 ${_('Please contact ')}
83 % if c.visual.rhodecode_support_url:
82 % if c.visual.rhodecode_support_url:
84 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
83 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
85 ${_('or')}
84 ${_('or')}
86 % endif
85 % endif
87 ${_('an administrator if you need help.')}
86 ${_('an administrator if you need help.')}
88 </p>
87 </p>
89 %endif
88 %endif
90
89
91 ${h.submit('sign_in', _('Sign In'), class_="btn sign-in", title=_('Sign in to {}').format(c.rhodecode_edition))}
90 ${h.submit('sign_in', _('Sign In'), class_="btn sign-in", title=_('Sign in to {}').format(c.rhodecode_edition))}
92
91
93 ${h.end_form()}
92 ${h.end_form()}
94 <script type="text/javascript">
93 <script type="text/javascript">
95 $(document).ready(function(){
94 $(document).ready(function(){
96 $('#username').focus();
95 $('#username').focus();
97 })
96 })
98 </script>
97 </script>
99
98
100 </div>
99 </div>
101 <!-- end login -->
100 <!-- end login -->
102
101
103 <%block name="below_login_button" />
102 <%block name="below_login_button" />
104 </div>
103 </div>
105 </div>
104 </div>
106 </div>
105 </div>
@@ -1,104 +1,103 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/root.mako"/>
1 <%inherit file="base/root.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Reset Password')}
4 ${_('Reset Password')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10 <style>body{background-color:#eeeeee;}</style>
9 <style>body{background-color:#eeeeee;}</style>
11
10
12 <div class="loginbox">
11 <div class="loginbox">
13 <div class="header-account">
12 <div class="header-account">
14 <div id="header-inner" class="title">
13 <div id="header-inner" class="title">
15 <div id="logo">
14 <div id="logo">
16 <div class="logo-wrapper">
15 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
16 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
18 </div>
17 </div>
19 % if c.rhodecode_name:
18 % if c.rhodecode_name:
20 <div class="branding">
19 <div class="branding">
21 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
20 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
22 </div>
21 </div>
23 % endif
22 % endif
24 </div>
23 </div>
25 </div>
24 </div>
26 </div>
25 </div>
27
26
28 <div class="loginwrapper">
27 <div class="loginwrapper">
29 <rhodecode-toast id="notifications"></rhodecode-toast>
28 <rhodecode-toast id="notifications"></rhodecode-toast>
30
29
31 <div class="auth-image-wrapper">
30 <div class="auth-image-wrapper">
32 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
31 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
33 </div>
32 </div>
34
33
35 %if h.HasPermissionAny('hg.password_reset.disabled')():
34 %if h.HasPermissionAny('hg.password_reset.disabled')():
36 <div class="right-column">
35 <div class="right-column">
37 <p>
36 <p>
38 ${_('Password reset is disabled. Please contact ')}
37 ${_('Password reset is disabled. Please contact ')}
39 % if c.visual.rhodecode_support_url:
38 % if c.visual.rhodecode_support_url:
40 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
39 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
41 ${_('or')}
40 ${_('or')}
42 % endif
41 % endif
43 ${_('an administrator if you need help.')}
42 ${_('an administrator if you need help.')}
44 </p>
43 </p>
45 </div>
44 </div>
46 %else:
45 %else:
47 <div id="register">
46 <div id="register">
48 <!-- login -->
47 <!-- login -->
49 <div class="sign-in-title">
48 <div class="sign-in-title">
50 <h1>${_('Reset your Password')}</h1>
49 <h1>${_('Reset your Password')}</h1>
51 <h4>${h.link_to(_("Go to the login page to sign in."), request.route_path('login'))}</h4>
50 <h4>${h.link_to(_("Go to the login page to sign in."), request.route_path('login'))}</h4>
52 </div>
51 </div>
53 <div class="inner form">
52 <div class="inner form">
54 ${h.form(request.route_path('reset_password'), needs_csrf_token=False)}
53 ${h.form(request.route_path('reset_password'), needs_csrf_token=False)}
55 <label for="email">${_('Email Address')}:</label>
54 <label for="email">${_('Email Address')}:</label>
56 ${h.text('email', defaults.get('email'))}
55 ${h.text('email', defaults.get('email'))}
57 %if 'email' in errors:
56 %if 'email' in errors:
58 <span class="error-message">${errors.get('email')}</span>
57 <span class="error-message">${errors.get('email')}</span>
59 <br />
58 <br />
60 %endif
59 %endif
61 <p class="help-block">${_('Password reset link will be sent to matching email address')}</p>
60 <p class="help-block">${_('Password reset link will be sent to matching email address')}</p>
62
61
63 %if captcha_active:
62 %if captcha_active:
64 <div class="login-captcha">
63 <div class="login-captcha">
65 <label for="email">${_('Captcha')}:</label>
64 <label for="email">${_('Captcha')}:</label>
66 ${h.hidden('recaptcha_field')}
65 ${h.hidden('recaptcha_field')}
67 <div id="recaptcha"></div>
66 <div id="recaptcha"></div>
68
67
69 %if 'recaptcha_field' in errors:
68 %if 'recaptcha_field' in errors:
70 <span class="error-message">${errors.get('recaptcha_field')}</span>
69 <span class="error-message">${errors.get('recaptcha_field')}</span>
71 <br />
70 <br />
72 %endif
71 %endif
73 </div>
72 </div>
74 %endif
73 %endif
75
74
76 ${h.submit('send', _('Send password reset email'), class_="btn sign-in")}
75 ${h.submit('send', _('Send password reset email'), class_="btn sign-in")}
77 <p class="help-block pull-right">
76 <p class="help-block pull-right">
78 RhodeCode ${c.rhodecode_edition}
77 RhodeCode ${c.rhodecode_edition}
79 </p>
78 </p>
80
79
81 ${h.end_form()}
80 ${h.end_form()}
82 </div>
81 </div>
83 </div>
82 </div>
84 %endif
83 %endif
85 </div>
84 </div>
86 </div>
85 </div>
87
86
88 <script type="text/javascript">
87 <script type="text/javascript">
89 $(document).ready(function(){
88 $(document).ready(function(){
90 $('#email').focus();
89 $('#email').focus();
91 });
90 });
92 </script>
91 </script>
93
92
94 % if captcha_active:
93 % if captcha_active:
95 <script type="text/javascript">
94 <script type="text/javascript">
96 var onloadCallback = function() {
95 var onloadCallback = function() {
97 grecaptcha.render('recaptcha', {
96 grecaptcha.render('recaptcha', {
98 'sitekey' : "${captcha_public_key}"
97 'sitekey' : "${captcha_public_key}"
99 });
98 });
100 };
99 };
101 </script>
100 </script>
102 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
101 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
103 % endif
102 % endif
104
103
@@ -1,150 +1,149 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/root.mako"/>
1 <%inherit file="base/root.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 ${_('Create an Account')}
4 ${_('Create an Account')}
6 %if c.rhodecode_name:
5 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
7 %endif
9 </%def>
8 </%def>
10 <style>body{background-color:#eeeeee;}</style>
9 <style>body{background-color:#eeeeee;}</style>
11
10
12 <div class="loginbox">
11 <div class="loginbox">
13 <div class="header-account">
12 <div class="header-account">
14 <div id="header-inner" class="title">
13 <div id="header-inner" class="title">
15 <div id="logo">
14 <div id="logo">
16 <div class="logo-wrapper">
15 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
16 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
18 </div>
17 </div>
19 % if c.rhodecode_name:
18 % if c.rhodecode_name:
20 <div class="branding">
19 <div class="branding">
21 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
20 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
22 </div>
21 </div>
23 % endif
22 % endif
24 </div>
23 </div>
25 </div>
24 </div>
26 </div>
25 </div>
27
26
28 <div class="loginwrapper">
27 <div class="loginwrapper">
29 <rhodecode-toast id="notifications"></rhodecode-toast>
28 <rhodecode-toast id="notifications"></rhodecode-toast>
30
29
31 <div class="auth-image-wrapper">
30 <div class="auth-image-wrapper">
32 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
31 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
33 </div>
32 </div>
34
33
35 <div id="register">
34 <div id="register">
36 <%block name="above_register_button" />
35 <%block name="above_register_button" />
37 <!-- login -->
36 <!-- login -->
38 <div class="sign-in-title">
37 <div class="sign-in-title">
39 % if external_auth_provider:
38 % if external_auth_provider:
40 <h1>${_('Create an account linked with {}').format(external_auth_provider)}</h1>
39 <h1>${_('Create an account linked with {}').format(external_auth_provider)}</h1>
41 % else:
40 % else:
42 <h1>${_('Create an account')}</h1>
41 <h1>${_('Create an account')}</h1>
43 % endif
42 % endif
44
43
45 <h4>${h.link_to(_("Go to the login page to sign in with an existing account."), request.route_path('login'))}</h4>
44 <h4>${h.link_to(_("Go to the login page to sign in with an existing account."), request.route_path('login'))}</h4>
46 </div>
45 </div>
47 <div class="inner form">
46 <div class="inner form">
48 ${h.form(request.route_path('register'), needs_csrf_token=False)}
47 ${h.form(request.route_path('register'), needs_csrf_token=False)}
49
48
50 <label for="username">${_('Username')}:</label>
49 <label for="username">${_('Username')}:</label>
51 ${h.text('username', defaults.get('username'))}
50 ${h.text('username', defaults.get('username'))}
52 %if 'username' in errors:
51 %if 'username' in errors:
53 <span class="error-message">${errors.get('username')}</span>
52 <span class="error-message">${errors.get('username')}</span>
54 <br />
53 <br />
55 %endif
54 %endif
56
55
57 % if external_auth_provider:
56 % if external_auth_provider:
58 ## store internal marker about external identity
57 ## store internal marker about external identity
59 ${h.hidden('external_identity', external_auth_provider)}
58 ${h.hidden('external_identity', external_auth_provider)}
60 ## hide password prompts for social auth
59 ## hide password prompts for social auth
61 <div style="display: none">
60 <div style="display: none">
62 % endif
61 % endif
63
62
64 <label for="password">${_('Password')}:</label>
63 <label for="password">${_('Password')}:</label>
65 ${h.password('password', defaults.get('password'))}
64 ${h.password('password', defaults.get('password'))}
66 %if 'password' in errors:
65 %if 'password' in errors:
67 <span class="error-message">${errors.get('password')}</span>
66 <span class="error-message">${errors.get('password')}</span>
68 <br />
67 <br />
69 %endif
68 %endif
70
69
71 <label for="password_confirmation">${_('Re-enter password')}:</label>
70 <label for="password_confirmation">${_('Re-enter password')}:</label>
72 ${h.password('password_confirmation', defaults.get('password_confirmation'))}
71 ${h.password('password_confirmation', defaults.get('password_confirmation'))}
73 %if 'password_confirmation' in errors:
72 %if 'password_confirmation' in errors:
74 <span class="error-message">${errors.get('password_confirmation')}</span>
73 <span class="error-message">${errors.get('password_confirmation')}</span>
75 <br />
74 <br />
76 %endif
75 %endif
77
76
78 % if external_auth_provider:
77 % if external_auth_provider:
79 ## hide password prompts for social auth
78 ## hide password prompts for social auth
80 </div>
79 </div>
81 % endif
80 % endif
82
81
83 <label for="firstname">${_('First Name')}:</label>
82 <label for="firstname">${_('First Name')}:</label>
84 ${h.text('firstname', defaults.get('firstname'))}
83 ${h.text('firstname', defaults.get('firstname'))}
85 %if 'firstname' in errors:
84 %if 'firstname' in errors:
86 <span class="error-message">${errors.get('firstname')}</span>
85 <span class="error-message">${errors.get('firstname')}</span>
87 <br />
86 <br />
88 %endif
87 %endif
89
88
90 <label for="lastname">${_('Last Name')}:</label>
89 <label for="lastname">${_('Last Name')}:</label>
91 ${h.text('lastname', defaults.get('lastname'))}
90 ${h.text('lastname', defaults.get('lastname'))}
92 %if 'lastname' in errors:
91 %if 'lastname' in errors:
93 <span class="error-message">${errors.get('lastname')}</span>
92 <span class="error-message">${errors.get('lastname')}</span>
94 <br />
93 <br />
95 %endif
94 %endif
96
95
97 <label for="email">${_('Email')}:</label>
96 <label for="email">${_('Email')}:</label>
98 ${h.text('email', defaults.get('email'))}
97 ${h.text('email', defaults.get('email'))}
99 %if 'email' in errors:
98 %if 'email' in errors:
100 <span class="error-message">${errors.get('email')}</span>
99 <span class="error-message">${errors.get('email')}</span>
101 <br />
100 <br />
102 %endif
101 %endif
103
102
104 %if captcha_active:
103 %if captcha_active:
105 <div>
104 <div>
106 <label for="recaptcha">${_('Captcha')}:</label>
105 <label for="recaptcha">${_('Captcha')}:</label>
107 ${h.hidden('recaptcha_field')}
106 ${h.hidden('recaptcha_field')}
108 <div id="recaptcha"></div>
107 <div id="recaptcha"></div>
109 %if 'recaptcha_field' in errors:
108 %if 'recaptcha_field' in errors:
110 <span class="error-message">${errors.get('recaptcha_field')}</span>
109 <span class="error-message">${errors.get('recaptcha_field')}</span>
111 <br />
110 <br />
112 %endif
111 %endif
113 </div>
112 </div>
114 %endif
113 %endif
115
114
116 %if not auto_active:
115 %if not auto_active:
117 <p class="activation_msg">
116 <p class="activation_msg">
118 ${_('Account activation requires admin approval.')}
117 ${_('Account activation requires admin approval.')}
119 </p>
118 </p>
120 %endif
119 %endif
121 <p class="register_message">
120 <p class="register_message">
122 ${register_message|n}
121 ${register_message|n}
123 </p>
122 </p>
124
123
125 ${h.submit('sign_up',_('Create Account'), class_="btn sign-in", title=_('Create Account in {}').format(c.rhodecode_edition))}
124 ${h.submit('sign_up',_('Create Account'), class_="btn sign-in", title=_('Create Account in {}').format(c.rhodecode_edition))}
126 ${h.end_form()}
125 ${h.end_form()}
127 </div>
126 </div>
128 <%block name="below_register_button" />
127 <%block name="below_register_button" />
129 </div>
128 </div>
130 </div>
129 </div>
131 </div>
130 </div>
132
131
133
132
134 <script type="text/javascript">
133 <script type="text/javascript">
135 $(document).ready(function(){
134 $(document).ready(function(){
136 $('#username').focus();
135 $('#username').focus();
137 });
136 });
138 </script>
137 </script>
139
138
140 % if captcha_active:
139 % if captcha_active:
141 <script type="text/javascript">
140 <script type="text/javascript">
142 var onloadCallback = function() {
141 var onloadCallback = function() {
143 grecaptcha.render('recaptcha', {
142 grecaptcha.render('recaptcha', {
144 'sitekey' : "${captcha_public_key}"
143 'sitekey' : "${captcha_public_key}"
145 });
144 });
146 };
145 };
147 </script>
146 </script>
148 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
147 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
149 % endif
148 % endif
150
149
@@ -1,4 +1,3 b''
1 ## -*- coding: utf-8 -*-
2 Auto status change to |new_status|
1 Auto status change to |new_status|
3
2
4 .. |new_status| replace:: *"${new_status_label}"* No newline at end of file
3 .. |new_status| replace:: *"${new_status_label}"*
@@ -1,27 +1,26 b''
1 ## -*- coding: utf-8 -*-
2 Pull request updated. Auto status change to |under_review|
1 Pull request updated. Auto status change to |under_review|
3
2
4 .. role:: added
3 .. role:: added
5 .. role:: removed
4 .. role:: removed
6 .. parsed-literal::
5 .. parsed-literal::
7
6
8 Changed commits:
7 Changed commits:
9 * :added:`${len(added_commits)} added`
8 * :added:`${len(added_commits)} added`
10 * :removed:`${len(removed_commits)} removed`
9 * :removed:`${len(removed_commits)} removed`
11
10
12 %if not changed_files:
11 %if not changed_files:
13 No file changes found
12 No file changes found
14 %else:
13 %else:
15 Changed files:
14 Changed files:
16 %for file_name in added_files:
15 %for file_name in added_files:
17 * `A ${file_name} <#${'a_' + h.FID(ancestor_commit_id, file_name)}>`_
16 * `A ${file_name} <#${'a_' + h.FID(ancestor_commit_id, file_name)}>`_
18 %endfor
17 %endfor
19 %for file_name in modified_files:
18 %for file_name in modified_files:
20 * `M ${file_name} <#${'a_' + h.FID(ancestor_commit_id, file_name)}>`_
19 * `M ${file_name} <#${'a_' + h.FID(ancestor_commit_id, file_name)}>`_
21 %endfor
20 %endfor
22 %for file_name in removed_files:
21 %for file_name in removed_files:
23 * `R ${file_name}`
22 * `R ${file_name}`
24 %endfor
23 %endfor
25 %endif
24 %endif
26
25
27 .. |under_review| replace:: *"${under_review_label}"* No newline at end of file
26 .. |under_review| replace:: *"${under_review_label}"*
@@ -1,241 +1,240 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3
2
4 <%def name="title()">
3 <%def name="title()">
5 %if c.repo_name:
4 %if c.repo_name:
6 ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)}
5 ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)}
7 %elif c.repo_group_name:
6 %elif c.repo_group_name:
8 ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)}
7 ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)}
9 %else:
8 %else:
10 ${_('Search inside all accessible repositories')}
9 ${_('Search inside all accessible repositories')}
11 %endif
10 %endif
12 %if c.rhodecode_name:
11 %if c.rhodecode_name:
13 &middot; ${h.branding(c.rhodecode_name)}
12 &middot; ${h.branding(c.rhodecode_name)}
14 %endif
13 %endif
15 </%def>
14 </%def>
16
15
17 <%def name="breadcrumbs_links()">
16 <%def name="breadcrumbs_links()">
18 %if c.repo_name:
17 %if c.repo_name:
19 ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)}
18 ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)}
20 %elif c.repo_group_name:
19 %elif c.repo_group_name:
21 ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)}
20 ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)}
22 %else:
21 %else:
23 ${_('Search inside all accessible repositories')}
22 ${_('Search inside all accessible repositories')}
24 %endif
23 %endif
25
24
26 </%def>
25 </%def>
27
26
28 <%def name="menu_bar_nav()">
27 <%def name="menu_bar_nav()">
29 %if c.repo_name:
28 %if c.repo_name:
30 ${self.menu_items(active='search')}
29 ${self.menu_items(active='search')}
31 %elif c.repo_group_name:
30 %elif c.repo_group_name:
32 ${self.menu_items(active='search')}
31 ${self.menu_items(active='search')}
33 %else:
32 %else:
34 ${self.menu_items(active='search')}
33 ${self.menu_items(active='search')}
35 %endif
34 %endif
36 </%def>
35 </%def>
37
36
38 <%def name="menu_bar_subnav()">
37 <%def name="menu_bar_subnav()">
39 %if c.repo_name:
38 %if c.repo_name:
40 <% active_entry = {'content':'files', 'path':'files', 'commit':'commits'}.get(c.search_type, 'summary')%>
39 <% active_entry = {'content':'files', 'path':'files', 'commit':'commits'}.get(c.search_type, 'summary')%>
41 ${self.repo_menu(active=active_entry)}
40 ${self.repo_menu(active=active_entry)}
42 %elif c.repo_group_name:
41 %elif c.repo_group_name:
43 ${self.repo_group_menu(active='home')}
42 ${self.repo_group_menu(active='home')}
44 %endif
43 %endif
45 </%def>
44 </%def>
46
45
47 <%def name="repo_icon(db_repo)">
46 <%def name="repo_icon(db_repo)">
48 %if h.is_hg(db_repo):
47 %if h.is_hg(db_repo):
49 <i class="icon-hg"></i>
48 <i class="icon-hg"></i>
50 %endif
49 %endif
51 %if h.is_git(db_repo):
50 %if h.is_git(db_repo):
52 <i class="icon-git"></i>
51 <i class="icon-git"></i>
53 %endif
52 %endif
54 %if h.is_svn(db_repo):
53 %if h.is_svn(db_repo):
55 <i class="icon-svn"></i>
54 <i class="icon-svn"></i>
56 %endif
55 %endif
57 </%def>
56 </%def>
58
57
59 <%def name="repo_group_icon()">
58 <%def name="repo_group_icon()">
60 <i class="icon-repo-group"></i>
59 <i class="icon-repo-group"></i>
61 </%def>
60 </%def>
62
61
63
62
64 <%def name="field_sort(field_name)">
63 <%def name="field_sort(field_name)">
65
64
66 <%
65 <%
67 if c.sort.startswith('asc:'):
66 if c.sort.startswith('asc:'):
68 return h.current_route_path(request, sort='desc:{}'.format(field_name))
67 return h.current_route_path(request, sort='desc:{}'.format(field_name))
69 elif c.sort.startswith('desc:'):
68 elif c.sort.startswith('desc:'):
70 return h.current_route_path(request, sort='asc:{}'.format(field_name))
69 return h.current_route_path(request, sort='asc:{}'.format(field_name))
71
70
72 return h.current_route_path(request, sort='asc:{}'.format(field_name))
71 return h.current_route_path(request, sort='asc:{}'.format(field_name))
73 %>
72 %>
74 </%def>
73 </%def>
75
74
76
75
77 <%def name="main()">
76 <%def name="main()">
78 <div class="box">
77 <div class="box">
79 %if c.repo_name:
78 %if c.repo_name:
80 <!-- box / title -->
79 <!-- box / title -->
81 ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')}
80 ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')}
82 %elif c.repo_group_name:
81 %elif c.repo_group_name:
83 <!-- box / title -->
82 <!-- box / title -->
84 ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')}
83 ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')}
85 %else:
84 %else:
86 <!-- box / title -->
85 <!-- box / title -->
87 <div class="title">
86 <div class="title">
88 ${self.breadcrumbs()}
87 ${self.breadcrumbs()}
89 <ul class="links">&nbsp;</ul>
88 <ul class="links">&nbsp;</ul>
90 </div>
89 </div>
91 <!-- end box / title -->
90 <!-- end box / title -->
92 ${h.form(h.route_path('search'), method='get')}
91 ${h.form(h.route_path('search'), method='get')}
93 %endif
92 %endif
94 <div class="form search-form">
93 <div class="form search-form">
95 <div class="fields">
94 <div class="fields">
96
95
97 ${h.text('q', c.cur_query, placeholder="Enter query...")}
96 ${h.text('q', c.cur_query, placeholder="Enter query...")}
98
97
99 ${h.select('type',c.search_type,[('content',_('Files')), ('path',_('File path')),('commit',_('Commits'))],id='id_search_type')}
98 ${h.select('type',c.search_type,[('content',_('Files')), ('path',_('File path')),('commit',_('Commits'))],id='id_search_type')}
100 ${h.hidden('max_lines', '10')}
99 ${h.hidden('max_lines', '10')}
101
100
102 <input type="submit" value="${_('Search')}" class="btn"/>
101 <input type="submit" value="${_('Search')}" class="btn"/>
103 <br/>
102 <br/>
104
103
105 <div class="search-tags">
104 <div class="search-tags">
106 <span class="tag tag8">
105 <span class="tag tag8">
107 %if c.repo_name:
106 %if c.repo_name:
108 <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a>
107 <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a>
109 %elif c.repo_group_name:
108 %elif c.repo_group_name:
110 <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a>
109 <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a>
111 % else:
110 % else:
112 ${_('Global Search')}
111 ${_('Global Search')}
113 %endif
112 %endif
114 </span>
113 </span>
115
114
116 %if c.repo_name:
115 %if c.repo_name:
117 »
116 »
118 <span class="tag tag8">
117 <span class="tag tag8">
119 ${repo_icon(c.rhodecode_db_repo)}
118 ${repo_icon(c.rhodecode_db_repo)}
120 ${c.repo_name}
119 ${c.repo_name}
121 </span>
120 </span>
122
121
123 %elif c.repo_group_name:
122 %elif c.repo_group_name:
124 »
123 »
125 <span class="tag tag8">
124 <span class="tag tag8">
126 ${repo_group_icon()}
125 ${repo_group_icon()}
127 ${c.repo_group_name}
126 ${c.repo_group_name}
128 </span>
127 </span>
129 %endif
128 %endif
130
129
131 % if c.sort_tag:
130 % if c.sort_tag:
132 <span class="tag tag8">
131 <span class="tag tag8">
133 % if c.sort_tag_dir == 'asc':
132 % if c.sort_tag_dir == 'asc':
134 <i class="icon-angle-down"></i>
133 <i class="icon-angle-down"></i>
135 % elif c.sort_tag_dir == 'desc':
134 % elif c.sort_tag_dir == 'desc':
136 <i class="icon-angle-up"></i>
135 <i class="icon-angle-up"></i>
137 % endif
136 % endif
138 ${_('sort')}:${c.sort_tag}
137 ${_('sort')}:${c.sort_tag}
139 </span>
138 </span>
140 % endif
139 % endif
141
140
142 % for search_tag in c.search_tags:
141 % for search_tag in c.search_tags:
143 <br/><span class="tag disabled" style="margin-top: 3px">${search_tag}</span>
142 <br/><span class="tag disabled" style="margin-top: 3px">${search_tag}</span>
144 % endfor
143 % endfor
145
144
146 </div>
145 </div>
147
146
148 <div class="search-feedback-items">
147 <div class="search-feedback-items">
149 % for error in c.errors:
148 % for error in c.errors:
150 <span class="error-message">
149 <span class="error-message">
151 % for k,v in error.asdict().items():
150 % for k,v in error.asdict().items():
152 ${k} - ${v}
151 ${k} - ${v}
153 % endfor
152 % endfor
154 </span>
153 </span>
155 % endfor
154 % endfor
156 <div class="field">
155 <div class="field">
157 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Query Language examples')}</p>
156 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Query Language examples')}</p>
158 <pre id="search-help" style="display: none">\
157 <pre id="search-help" style="display: none">\
159
158
160 % if c.searcher.name == 'whoosh':
159 % if c.searcher.name == 'whoosh':
161 Example filter terms for `Whoosh` search:
160 Example filter terms for `Whoosh` search:
162 query lang: <a href="${c.searcher.query_lang_doc}">Whoosh Query Language</a>
161 query lang: <a href="${c.searcher.query_lang_doc}">Whoosh Query Language</a>
163 Whoosh has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition.
162 Whoosh has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition.
164
163
165 Generate wildcards using '*' character:
164 Generate wildcards using '*' character:
166 "repo_name:vcs*" - search everything starting with 'vcs'
165 "repo_name:vcs*" - search everything starting with 'vcs'
167 "repo_name:*vcs*" - search for repository containing 'vcs'
166 "repo_name:*vcs*" - search for repository containing 'vcs'
168
167
169 Optional AND / OR operators in queries
168 Optional AND / OR operators in queries
170 "repo_name:vcs OR repo_name:test"
169 "repo_name:vcs OR repo_name:test"
171 "owner:test AND repo_name:test*" AND extension:py
170 "owner:test AND repo_name:test*" AND extension:py
172
171
173 Move advanced search is available via ElasticSearch6 backend in EE edition.
172 Move advanced search is available via ElasticSearch6 backend in EE edition.
174 % elif c.searcher.name == 'elasticsearch' and c.searcher.es_version == '2':
173 % elif c.searcher.name == 'elasticsearch' and c.searcher.es_version == '2':
175 Example filter terms for `ElasticSearch-${c.searcher.es_version}`search:
174 Example filter terms for `ElasticSearch-${c.searcher.es_version}`search:
176 ElasticSearch-2 has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition.
175 ElasticSearch-2 has limited query capabilities. For advanced search use ElasticSearch 6 from RhodeCode EE edition.
177
176
178 search type: content (File Content)
177 search type: content (File Content)
179 indexed fields: content
178 indexed fields: content
180
179
181 # search for `fix` string in all files
180 # search for `fix` string in all files
182 fix
181 fix
183
182
184 search type: commit (Commit message)
183 search type: commit (Commit message)
185 indexed fields: message
184 indexed fields: message
186
185
187 search type: path (File name)
186 search type: path (File name)
188 indexed fields: path
187 indexed fields: path
189
188
190 % else:
189 % else:
191 Example filter terms for `ElasticSearch-${c.searcher.es_version}`search:
190 Example filter terms for `ElasticSearch-${c.searcher.es_version}`search:
192 query lang: <a href="${c.searcher.query_lang_doc}">ES 6 Query Language</a>
191 query lang: <a href="${c.searcher.query_lang_doc}">ES 6 Query Language</a>
193 The reserved characters needed espace by `\`: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /
192 The reserved characters needed espace by `\`: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /
194 % for handler in c.searcher.get_handlers().values():
193 % for handler in c.searcher.get_handlers().values():
195
194
196 search type: ${handler.search_type_label}
195 search type: ${handler.search_type_label}
197 *indexed fields*: ${', '.join( [('\n ' if x[0]%4==0 else '')+x[1] for x in enumerate(handler.es_6_field_names)])}
196 *indexed fields*: ${', '.join( [('\n ' if x[0]%4==0 else '')+x[1] for x in enumerate(handler.es_6_field_names)])}
198 % for entry in handler.es_6_example_queries:
197 % for entry in handler.es_6_example_queries:
199 ${entry.rstrip()}
198 ${entry.rstrip()}
200 % endfor
199 % endfor
201 % endfor
200 % endfor
202
201
203 % endif
202 % endif
204 </pre>
203 </pre>
205 </div>
204 </div>
206
205
207 <div class="field">${c.runtime}</div>
206 <div class="field">${c.runtime}</div>
208 </div>
207 </div>
209 </div>
208 </div>
210 </div>
209 </div>
211
210
212 ${h.end_form()}
211 ${h.end_form()}
213 <div class="search">
212 <div class="search">
214 % if c.search_type == 'content':
213 % if c.search_type == 'content':
215 <%include file='search_content.mako'/>
214 <%include file='search_content.mako'/>
216 % elif c.search_type == 'path':
215 % elif c.search_type == 'path':
217 <%include file='search_path.mako'/>
216 <%include file='search_path.mako'/>
218 % elif c.search_type == 'commit':
217 % elif c.search_type == 'commit':
219 <%include file='search_commit.mako'/>
218 <%include file='search_commit.mako'/>
220 % elif c.search_type == 'repository':
219 % elif c.search_type == 'repository':
221 <%include file='search_repository.mako'/>
220 <%include file='search_repository.mako'/>
222 % endif
221 % endif
223 </div>
222 </div>
224 </div>
223 </div>
225 <script>
224 <script>
226 $(document).ready(function(){
225 $(document).ready(function(){
227 $("#id_search_type").select2({
226 $("#id_search_type").select2({
228 'containerCssClass': "drop-menu",
227 'containerCssClass': "drop-menu",
229 'dropdownCssClass': "drop-menu-dropdown",
228 'dropdownCssClass': "drop-menu-dropdown",
230 'dropdownAutoWidth': true,
229 'dropdownAutoWidth': true,
231 'minimumResultsForSearch': -1
230 'minimumResultsForSearch': -1
232 });
231 });
233
232
234 $('#q').autoGrowInput({maxWidth: 920});
233 $('#q').autoGrowInput({maxWidth: 920});
235
234
236 setTimeout(function() {
235 setTimeout(function() {
237 $('#q').keyup()
236 $('#q').keyup()
238 }, 1);
237 }, 1);
239 })
238 })
240 </script>
239 </script>
241 </%def>
240 </%def>
@@ -1,169 +1,168 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
3 %if c.repo_commits:
2 %if c.repo_commits:
4 <table class="rctable table-bordered">
3 <table class="rctable table-bordered">
5 <tr>
4 <tr>
6
5
7 <th class="status"></th>
6 <th class="status"></th>
8 <th></th>
7 <th></th>
9 <th>${_('Commit message')}</th>
8 <th>${_('Commit message')}</th>
10 <th>${_('Age')}</th>
9 <th>${_('Age')}</th>
11 <th>${_('Author')}</th>
10 <th>${_('Author')}</th>
12 <th colspan="2">${_('Refs')}</th>
11 <th colspan="2">${_('Refs')}</th>
13 </tr>
12 </tr>
14
13
15 ## to speed up lookups cache some functions before the loop
14 ## to speed up lookups cache some functions before the loop
16 <%
15 <%
17 active_patterns = h.get_active_pattern_entries(c.repo_name)
16 active_patterns = h.get_active_pattern_entries(c.repo_name)
18 urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns)
17 urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns)
19 %>
18 %>
20 %for cnt,cs in enumerate(c.repo_commits):
19 %for cnt,cs in enumerate(c.repo_commits):
21 <tr class="parity${cnt%2}">
20 <tr class="parity${cnt%2}">
22
21
23 <td class="td-status">
22 <td class="td-status">
24 %if c.statuses.get(cs.raw_id):
23 %if c.statuses.get(cs.raw_id):
25 <div class="changeset-status-ico shortlog">
24 <div class="changeset-status-ico shortlog">
26 %if c.statuses.get(cs.raw_id)[2]:
25 %if c.statuses.get(cs.raw_id)[2]:
27 <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
26 <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
28 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
27 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
29 </a>
28 </a>
30 %else:
29 %else:
31 <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(cs.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
30 <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(cs.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
32 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
31 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
33 </a>
32 </a>
34 %endif
33 %endif
35 </div>
34 </div>
36 %else:
35 %else:
37 <i class="icon-circle review-status-not_reviewed" title="${_('Commit status: Not Reviewed')}"></i>
36 <i class="icon-circle review-status-not_reviewed" title="${_('Commit status: Not Reviewed')}"></i>
38 %endif
37 %endif
39 </td>
38 </td>
40 <td class="td-hash">
39 <td class="td-hash">
41 <code>
40 <code>
42 <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=cs.raw_id)}">${h.show_id(cs)}</a>
41 <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=cs.raw_id)}">${h.show_id(cs)}</a>
43 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${cs.raw_id}" title="${_('Copy the full commit id')}"></i>
42 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${cs.raw_id}" title="${_('Copy the full commit id')}"></i>
44 </code>
43 </code>
45 </td>
44 </td>
46
45
47 <td class="td-description mid">
46 <td class="td-description mid">
48 <div class="log-container truncate-wrap">
47 <div class="log-container truncate-wrap">
49 <div class="message truncate" id="c-${cs.raw_id}">${urlify_commit_message(cs.message, c.repo_name)}</div>
48 <div class="message truncate" id="c-${cs.raw_id}">${urlify_commit_message(cs.message, c.repo_name)}</div>
50 </div>
49 </div>
51 </td>
50 </td>
52
51
53 <td class="td-time">
52 <td class="td-time">
54 ${h.age_component(cs.date)}
53 ${h.age_component(cs.date)}
55 </td>
54 </td>
56 <td class="td-user author">
55 <td class="td-user author">
57 ${base.gravatar_with_user(cs.author, tooltip=True)}
56 ${base.gravatar_with_user(cs.author, tooltip=True)}
58 </td>
57 </td>
59
58
60 <td class="td-tags">
59 <td class="td-tags">
61 <div class="autoexpand">
60 <div class="autoexpand">
62 %if h.is_hg(c.rhodecode_repo):
61 %if h.is_hg(c.rhodecode_repo):
63 %for book in cs.bookmarks:
62 %for book in cs.bookmarks:
64 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
63 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
65 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
64 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
66 </span>
65 </span>
67 %endfor
66 %endfor
68 %endif
67 %endif
69 ## tags
68 ## tags
70 %for tag in cs.tags:
69 %for tag in cs.tags:
71 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
70 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
72 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
71 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
73 </span>
72 </span>
74 %endfor
73 %endfor
75
74
76 ## branch
75 ## branch
77 %if cs.branch:
76 %if cs.branch:
78 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % cs.branch)}">
77 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % cs.branch)}">
79 <a href="${h.route_path('repo_commits',repo_name=c.repo_name,_query=dict(branch=cs.branch))}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
78 <a href="${h.route_path('repo_commits',repo_name=c.repo_name,_query=dict(branch=cs.branch))}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
80 </span>
79 </span>
81 %endif
80 %endif
82 </div>
81 </div>
83 </td>
82 </td>
84 <td class="td-comments">
83 <td class="td-comments">
85 <% cs_comments = c.comments.get(cs.raw_id,[]) %>
84 <% cs_comments = c.comments.get(cs.raw_id,[]) %>
86 % if cs_comments:
85 % if cs_comments:
87 <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % cs_comments[0].comment_id)}">
86 <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % cs_comments[0].comment_id)}">
88 <i class="icon-comment"></i> ${len(cs_comments)}
87 <i class="icon-comment"></i> ${len(cs_comments)}
89 </a>
88 </a>
90 % else:
89 % else:
91 <i class="icon-comment"></i> ${len(cs_comments)}
90 <i class="icon-comment"></i> ${len(cs_comments)}
92 % endif
91 % endif
93 </td>
92 </td>
94 </tr>
93 </tr>
95 %endfor
94 %endfor
96
95
97 </table>
96 </table>
98
97
99 <script type="text/javascript">
98 <script type="text/javascript">
100 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 5000, scrollTo: false, push: false});
99 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 5000, scrollTo: false, push: false});
101 $(document).on('pjax:success', function(){ timeagoActivate(); tooltipActivate();});
100 $(document).on('pjax:success', function(){ timeagoActivate(); tooltipActivate();});
102 $(document).on('pjax:timeout', function(event) {
101 $(document).on('pjax:timeout', function(event) {
103 // Prevent default timeout redirection behavior
102 // Prevent default timeout redirection behavior
104 event.preventDefault()
103 event.preventDefault()
105 })
104 })
106
105
107 </script>
106 </script>
108
107
109 <div class="pagination-wh pagination-left">
108 <div class="pagination-wh pagination-left">
110 ${c.repo_commits.render()}
109 ${c.repo_commits.render()}
111 </div>
110 </div>
112 %else:
111 %else:
113
112
114
113
115 <div class="quick_start">
114 <div class="quick_start">
116 <div class="fieldset">
115 <div class="fieldset">
117 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
116 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
118 <p><b>${_('Add or upload files directly via RhodeCode:')}</b></p>
117 <p><b>${_('Add or upload files directly via RhodeCode:')}</b></p>
119 <div class="pull-left">
118 <div class="pull-left">
120 <a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Add New File')}</a>
119 <a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Add New File')}</a>
121 </div>
120 </div>
122 <div class="pull-left">
121 <div class="pull-left">
123 <a href="${h.route_path('repo_files_upload_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Upload New File')}</a>
122 <a href="${h.route_path('repo_files_upload_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Upload New File')}</a>
124 </div>
123 </div>
125 %endif
124 %endif
126 </div>
125 </div>
127
126
128
127
129 <div class="fieldset">
128 <div class="fieldset">
130 <p><b>${_('Push new repo:')}</b></p>
129 <p><b>${_('Push new repo:')}</b></p>
131 <pre>
130 <pre>
132 %if h.is_git(c.rhodecode_repo):
131 %if h.is_git(c.rhodecode_repo):
133 git clone ${c.clone_repo_url}
132 git clone ${c.clone_repo_url}
134 git add README # add first file
133 git add README # add first file
135 git commit -m "Initial commit" # commit with message
134 git commit -m "Initial commit" # commit with message
136 git remote add origin ${c.clone_repo_url}
135 git remote add origin ${c.clone_repo_url}
137 git push -u origin master # push changes back to default master branch
136 git push -u origin master # push changes back to default master branch
138 %elif h.is_hg(c.rhodecode_repo):
137 %elif h.is_hg(c.rhodecode_repo):
139 hg clone ${c.clone_repo_url}
138 hg clone ${c.clone_repo_url}
140 hg add README # add first file
139 hg add README # add first file
141 hg commit -m "Initial commit" # commit with message
140 hg commit -m "Initial commit" # commit with message
142 hg push ${c.clone_repo_url}
141 hg push ${c.clone_repo_url}
143 %elif h.is_svn(c.rhodecode_repo):
142 %elif h.is_svn(c.rhodecode_repo):
144 svn co ${c.clone_repo_url}
143 svn co ${c.clone_repo_url}
145 svn add README # add first file
144 svn add README # add first file
146 svn commit -m "Initial commit"
145 svn commit -m "Initial commit"
147 svn commit # send changes back to the server
146 svn commit # send changes back to the server
148 %endif
147 %endif
149 </pre>
148 </pre>
150 </div>
149 </div>
151
150
152 <div class="fieldset">
151 <div class="fieldset">
153 <p><b>${_('Existing repository?')}</b></p>
152 <p><b>${_('Existing repository?')}</b></p>
154 <pre>
153 <pre>
155 %if h.is_git(c.rhodecode_repo):
154 %if h.is_git(c.rhodecode_repo):
156 git remote add origin ${c.clone_repo_url}
155 git remote add origin ${c.clone_repo_url}
157 git push -u origin master
156 git push -u origin master
158 %elif h.is_hg(c.rhodecode_repo):
157 %elif h.is_hg(c.rhodecode_repo):
159 hg push ${c.clone_repo_url}
158 hg push ${c.clone_repo_url}
160 %elif h.is_svn(c.rhodecode_repo):
159 %elif h.is_svn(c.rhodecode_repo):
161 svn co ${c.clone_repo_url}
160 svn co ${c.clone_repo_url}
162 %endif
161 %endif
163 </pre>
162 </pre>
164
163
165 </div>
164 </div>
166
165
167
166
168 </div>
167 </div>
169 %endif
168 %endif
@@ -1,118 +1,117 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
3 <%namespace name="components" file="/summary/components.mako"/>
2 <%namespace name="components" file="/summary/components.mako"/>
4
3
5 <%def name="title()">
4 <%def name="title()">
6 ${_('{} Tags').format(c.repo_name)}
5 ${_('{} Tags').format(c.repo_name)}
7 %if c.rhodecode_name:
6 %if c.rhodecode_name:
8 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
9 %endif
8 %endif
10 </%def>
9 </%def>
11
10
12 <%def name="breadcrumbs_links()"></%def>
11 <%def name="breadcrumbs_links()"></%def>
13
12
14 <%def name="menu_bar_nav()">
13 <%def name="menu_bar_nav()">
15 ${self.menu_items(active='repositories')}
14 ${self.menu_items(active='repositories')}
16 </%def>
15 </%def>
17
16
18 <%def name="menu_bar_subnav()">
17 <%def name="menu_bar_subnav()">
19 ${self.repo_menu(active='summary')}
18 ${self.repo_menu(active='summary')}
20 </%def>
19 </%def>
21
20
22 <%def name="main()">
21 <%def name="main()">
23 <div id="repo-summary" class="summary">
22 <div id="repo-summary" class="summary">
24 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False, simplified=True)}
23 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False, simplified=True)}
25 </div>
24 </div>
26
25
27 <div class="box">
26 <div class="box">
28 <div class="title">
27 <div class="title">
29
28
30 %if c.has_references:
29 %if c.has_references:
31 <ul class="links">
30 <ul class="links">
32 <li>
31 <li>
33 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Tags')}">
32 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Tags')}">
34 </li>
33 </li>
35 </ul>
34 </ul>
36 %endif
35 %endif
37 %if c.has_references:
36 %if c.has_references:
38 <div class="grid-quick-filter">
37 <div class="grid-quick-filter">
39 <ul class="grid-filter-box">
38 <ul class="grid-filter-box">
40 <li class="grid-filter-box-icon">
39 <li class="grid-filter-box-icon">
41 <i class="icon-search"></i>
40 <i class="icon-search"></i>
42 </li>
41 </li>
43 <li class="grid-filter-box-input">
42 <li class="grid-filter-box-input">
44 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
43 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
45 </li>
44 </li>
46 </ul>
45 </ul>
47 </div>
46 </div>
48 <div id="obj_count">0</div>
47 <div id="obj_count">0</div>
49 %endif
48 %endif
50 </div>
49 </div>
51 <table id="obj_list_table" class="rctable table-bordered"></table>
50 <table id="obj_list_table" class="rctable table-bordered"></table>
52 </div>
51 </div>
53
52
54
53
55 <script type="text/javascript">
54 <script type="text/javascript">
56 $(document).ready(function() {
55 $(document).ready(function() {
57
56
58 var get_datatable_count = function(){
57 var get_datatable_count = function(){
59 var api = $('#obj_list_table').dataTable().api();
58 var api = $('#obj_list_table').dataTable().api();
60 var total = api.page.info().recordsDisplay
59 var total = api.page.info().recordsDisplay
61 var _text = _ngettext('{0} tag', '{0} tags', total).format(total);
60 var _text = _ngettext('{0} tag', '{0} tags', total).format(total);
62
61
63 $('#obj_count').text(_text);
62 $('#obj_count').text(_text);
64 };
63 };
65
64
66 // object list
65 // object list
67 $('#obj_list_table').DataTable({
66 $('#obj_list_table').DataTable({
68 data: ${c.data|n},
67 data: ${c.data|n},
69 dom: 'rtp',
68 dom: 'rtp',
70 pageLength: ${c.visual.dashboard_items},
69 pageLength: ${c.visual.dashboard_items},
71 order: [[ 0, "asc" ]],
70 order: [[ 0, "asc" ]],
72 columns: [
71 columns: [
73 { data: {"_": "name",
72 { data: {"_": "name",
74 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
73 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
75 { data: {"_": "date",
74 { data: {"_": "date",
76 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
75 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
77 { data: {"_": "author",
76 { data: {"_": "author",
78 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
77 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
79 { data: {"_": "commit",
78 { data: {"_": "commit",
80 "sort": "commit_raw",
79 "sort": "commit_raw",
81 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
80 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
82 { data: {"_": "compare",
81 { data: {"_": "compare",
83 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
82 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
84 ],
83 ],
85 language: {
84 language: {
86 paginate: DEFAULT_GRID_PAGINATION,
85 paginate: DEFAULT_GRID_PAGINATION,
87 emptyTable: _gettext("No tags available yet.")
86 emptyTable: _gettext("No tags available yet.")
88 },
87 },
89 "initComplete": function(settings, json) {
88 "initComplete": function(settings, json) {
90 get_datatable_count();
89 get_datatable_count();
91 timeagoActivate();
90 timeagoActivate();
92 tooltipActivate();
91 tooltipActivate();
93 compare_radio_buttons("${c.repo_name}", 'tag');
92 compare_radio_buttons("${c.repo_name}", 'tag');
94 }
93 }
95 });
94 });
96
95
97 // update when things change
96 // update when things change
98 $('#obj_list_table').on('draw.dt', function() {
97 $('#obj_list_table').on('draw.dt', function() {
99 get_datatable_count();
98 get_datatable_count();
100 timeagoActivate();
99 timeagoActivate();
101 tooltipActivate();
100 tooltipActivate();
102 });
101 });
103
102
104 // filter, filter both grids
103 // filter, filter both grids
105 $('#q_filter').on('keyup', function() {
104 $('#q_filter').on('keyup', function() {
106 var obj_api = $('#obj_list_table').dataTable().api();
105 var obj_api = $('#obj_list_table').dataTable().api();
107 obj_api
106 obj_api
108 .columns(0)
107 .columns(0)
109 .search(this.value)
108 .search(this.value)
110 .draw();
109 .draw();
111 });
110 });
112
111
113 // refilter table if page load via back button
112 // refilter table if page load via back button
114 $("#q_filter").trigger('keyup');
113 $("#q_filter").trigger('keyup');
115 });
114 });
116
115
117 </script>
116 </script>
118 </%def>
117 </%def>
General Comments 0
You need to be logged in to leave comments. Login now