Show More
@@ -1,108 +1,108 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="robots()"> |
|
4 | <%def name="robots()"> | |
5 | %if c.gist.gist_type != 'public': |
|
5 | %if c.gist.gist_type != 'public': | |
6 | <meta name="robots" content="noindex, nofollow"> |
|
6 | <meta name="robots" content="noindex, nofollow"> | |
7 | %else: |
|
7 | %else: | |
8 | ${parent.robots()} |
|
8 | ${parent.robots()} | |
9 | %endif |
|
9 | %endif | |
10 | </%def> |
|
10 | </%def> | |
11 |
|
11 | |||
12 | <%def name="title()"> |
|
12 | <%def name="title()"> | |
13 | ${_('Gist')} · ${c.gist.gist_access_id} |
|
13 | ${_('Gist')} · ${c.gist.gist_access_id} | |
14 | %if c.rhodecode_name: |
|
14 | %if c.rhodecode_name: | |
15 | · ${h.branding(c.rhodecode_name)} |
|
15 | · ${h.branding(c.rhodecode_name)} | |
16 | %endif |
|
16 | %endif | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%def name="breadcrumbs_links()"> |
|
19 | <%def name="breadcrumbs_links()"> | |
20 | ${_('Gist')} · ${c.gist.gist_access_id} |
|
20 | ${_('Gist')} · ${c.gist.gist_access_id} | |
21 | / ${_('URL')}: ${c.gist.gist_url()} |
|
21 | / ${_('URL')}: ${c.gist.gist_url()} | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%def name="menu_bar_nav()"> |
|
24 | <%def name="menu_bar_nav()"> | |
25 | ${self.menu_items(active='gists')} |
|
25 | ${self.menu_items(active='gists')} | |
26 | </%def> |
|
26 | </%def> | |
27 |
|
27 | |||
28 | <%def name="main()"> |
|
28 | <%def name="main()"> | |
29 | <div class="box"> |
|
29 | <div class="box"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
33 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
34 | <ul class="links"> |
|
34 | <ul class="links"> | |
35 | <li> |
|
35 | <li> | |
36 | <a href="${h.url('new_gist')}" class="btn btn-primary">${_(u'Create New Gist')}</a> |
|
36 | <a href="${h.url('new_gist')}" class="btn btn-primary">${_(u'Create New Gist')}</a> | |
37 | </li> |
|
37 | </li> | |
38 | </ul> |
|
38 | </ul> | |
39 | %endif |
|
39 | %endif | |
40 | </div> |
|
40 | </div> | |
41 | <div class="table"> |
|
41 | <div class="table"> | |
42 | <div id="files_data"> |
|
42 | <div id="files_data"> | |
43 | <div id="codeblock" class="codeblock"> |
|
43 | <div id="codeblock" class="codeblock"> | |
44 | <div class="code-header"> |
|
44 | <div class="code-header"> | |
45 | <div class="stats"> |
|
45 | <div class="stats"> | |
46 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: |
|
46 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: | |
47 | <div class="remove_gist"> |
|
47 | <div class="remove_gist"> | |
48 | ${h.secure_form(url('gist', gist_id=c.gist.gist_access_id),method='delete')} |
|
48 | ${h.secure_form(url('gist', gist_id=c.gist.gist_access_id),method='delete')} | |
49 | ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} |
|
49 | ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} | |
50 | ${h.end_form()} |
|
50 | ${h.end_form()} | |
51 | </div> |
|
51 | </div> | |
52 | %endif |
|
52 | %endif | |
53 | <div class="buttons"> |
|
53 | <div class="buttons"> | |
54 | ## only owner should see that |
|
54 | ## only owner should see that | |
55 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: |
|
55 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: | |
56 | ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")} |
|
56 | ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")} | |
57 | %endif |
|
57 | %endif | |
58 | ${h.link_to(_('Show as Raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="btn btn-mini")} |
|
58 | ${h.link_to(_('Show as Raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="btn btn-mini")} | |
59 | </div> |
|
59 | </div> | |
60 | <div class="left" > |
|
60 | <div class="left" > | |
61 | %if c.gist.gist_type != 'public': |
|
61 | %if c.gist.gist_type != 'public': | |
62 | <span class="tag tag-ok disabled">${_('Private Gist')}</span> |
|
62 | <span class="tag tag-ok disabled">${_('Private Gist')}</span> | |
63 | %endif |
|
63 | %endif | |
64 | <span> ${c.gist.gist_description}</span> |
|
64 | <span> ${c.gist.gist_description}</span> | |
65 | <span>${_('Expires')}: |
|
65 | <span>${_('Expires')}: | |
66 | %if c.gist.gist_expires == -1: |
|
66 | %if c.gist.gist_expires == -1: | |
67 | ${_('never')} |
|
67 | ${_('never')} | |
68 | %else: |
|
68 | %else: | |
69 | ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))} |
|
69 | ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))} | |
70 | %endif |
|
70 | %endif | |
71 | </span> |
|
71 | </span> | |
72 | </div> |
|
72 | </div> | |
73 | </div> |
|
73 | </div> | |
74 |
|
74 | |||
75 | <div class="author"> |
|
75 | <div class="author"> | |
76 | <div title="${c.file_last_commit.author}"> |
|
76 | <div title="${h.tooltip(c.file_last_commit.author)}"> | |
77 | ${self.gravatar_with_user(c.file_last_commit.author, 16)} - ${_('created')} ${h.age_component(c.file_last_commit.date)} |
|
77 | ${self.gravatar_with_user(c.file_last_commit.author, 16)} - ${_('created')} ${h.age_component(c.file_last_commit.date)} | |
78 | </div> |
|
78 | </div> | |
79 |
|
79 | |||
80 | </div> |
|
80 | </div> | |
81 | <div class="commit">${h.urlify_commit_message(c.file_last_commit.message,c.repo_name)}</div> |
|
81 | <div class="commit">${h.urlify_commit_message(c.file_last_commit.message,c.repo_name)}</div> | |
82 | </div> |
|
82 | </div> | |
83 |
|
83 | |||
84 | ## iterate over the files |
|
84 | ## iterate over the files | |
85 | % for file in c.files: |
|
85 | % for file in c.files: | |
86 | <% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%> |
|
86 | <% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%> | |
87 | <!-- <div id="${h.FID('G', file.path)}" class="stats" > |
|
87 | <!-- <div id="${h.FID('G', file.path)}" class="stats" > | |
88 | <a href="${c.gist.gist_url()}">ΒΆ</a> |
|
88 | <a href="${c.gist.gist_url()}">ΒΆ</a> | |
89 | <b >${file.path}</b> |
|
89 | <b >${file.path}</b> | |
90 | <div> |
|
90 | <div> | |
91 | ${h.link_to(_('Show as raw'),h.url('formatted_gist_file', gist_id=c.gist.gist_access_id, format='raw', revision=file.commit.raw_id, f_path=file.path),class_="btn btn-mini")} |
|
91 | ${h.link_to(_('Show as raw'),h.url('formatted_gist_file', gist_id=c.gist.gist_access_id, format='raw', revision=file.commit.raw_id, f_path=file.path),class_="btn btn-mini")} | |
92 | </div> |
|
92 | </div> | |
93 | </div> --> |
|
93 | </div> --> | |
94 | <div class="code-body textarea text-area editor"> |
|
94 | <div class="code-body textarea text-area editor"> | |
95 | %if renderer: |
|
95 | %if renderer: | |
96 | ${h.render(file.content, renderer=renderer)} |
|
96 | ${h.render(file.content, renderer=renderer)} | |
97 | %else: |
|
97 | %else: | |
98 | ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
|
98 | ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} | |
99 | %endif |
|
99 | %endif | |
100 | </div> |
|
100 | </div> | |
101 | %endfor |
|
101 | %endfor | |
102 | </div> |
|
102 | </div> | |
103 | </div> |
|
103 | </div> | |
104 | </div> |
|
104 | </div> | |
105 |
|
105 | |||
106 |
|
106 | |||
107 | </div> |
|
107 | </div> | |
108 | </%def> |
|
108 | </%def> |
@@ -1,123 +1,123 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 |
|
2 | |||
3 | <div class="panel panel-default"> |
|
3 | <div class="panel panel-default"> | |
4 | <div class="panel-heading"> |
|
4 | <div class="panel-heading"> | |
5 | <h3 class="panel-title">${_('Repository Permissions')}</h3> |
|
5 | <h3 class="panel-title">${_('Repository Permissions')}</h3> | |
6 | </div> |
|
6 | </div> | |
7 | <div class="panel-body"> |
|
7 | <div class="panel-body"> | |
8 | ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), method='POST')} |
|
8 | ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), method='POST')} | |
9 | <table id="permissions_manage" class="rctable permissions"> |
|
9 | <table id="permissions_manage" class="rctable permissions"> | |
10 | <tr> |
|
10 | <tr> | |
11 | <th class="td-radio">${_('None')}</th> |
|
11 | <th class="td-radio">${_('None')}</th> | |
12 | <th class="td-radio">${_('Read')}</th> |
|
12 | <th class="td-radio">${_('Read')}</th> | |
13 | <th class="td-radio">${_('Write')}</th> |
|
13 | <th class="td-radio">${_('Write')}</th> | |
14 | <th class="td-radio">${_('Admin')}</th> |
|
14 | <th class="td-radio">${_('Admin')}</th> | |
15 | <th class="td-owner">${_('User/User Group')}</th> |
|
15 | <th class="td-owner">${_('User/User Group')}</th> | |
16 | <th></th> |
|
16 | <th></th> | |
17 | </tr> |
|
17 | </tr> | |
18 | ## USERS |
|
18 | ## USERS | |
19 | %for _user in c.repo_info.permissions(): |
|
19 | %for _user in c.repo_info.permissions(): | |
20 | %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None): |
|
20 | %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None): | |
21 | <tr class="perm_admin_row"> |
|
21 | <tr class="perm_admin_row"> | |
22 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td> |
|
22 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td> | |
23 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td> |
|
23 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td> | |
24 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td> |
|
24 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td> | |
25 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td> |
|
25 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td> | |
26 | <td class="td-user"> |
|
26 | <td class="td-user"> | |
27 | ${base.gravatar(_user.email, 16)} |
|
27 | ${base.gravatar(_user.email, 16)} | |
28 | ${h.link_to_user(_user.username)} |
|
28 | ${h.link_to_user(_user.username)} | |
29 | %if getattr(_user, 'admin_row', None): |
|
29 | %if getattr(_user, 'admin_row', None): | |
30 | (${_('super admin')}) |
|
30 | (${_('super admin')}) | |
31 | %endif |
|
31 | %endif | |
32 | %if getattr(_user, 'owner_row', None): |
|
32 | %if getattr(_user, 'owner_row', None): | |
33 | (${_('owner')}) |
|
33 | (${_('owner')}) | |
34 | %endif |
|
34 | %endif | |
35 | </td> |
|
35 | </td> | |
36 | <td></td> |
|
36 | <td></td> | |
37 | </tr> |
|
37 | </tr> | |
38 | %elif _user.username == h.DEFAULT_USER and c.repo_info.private: |
|
38 | %elif _user.username == h.DEFAULT_USER and c.repo_info.private: | |
39 | <tr> |
|
39 | <tr> | |
40 | <td colspan="4"> |
|
40 | <td colspan="4"> | |
41 | <span class="private_repo_msg"> |
|
41 | <span class="private_repo_msg"> | |
42 | <strong title="${_user.permission}">${_('private repository')}</strong> |
|
42 | <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong> | |
43 | </span> |
|
43 | </span> | |
44 | </td> |
|
44 | </td> | |
45 | <td class="private_repo_msg"> |
|
45 | <td class="private_repo_msg"> | |
46 | ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)} |
|
46 | ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)} | |
47 | ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td> |
|
47 | ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td> | |
48 | <td></td> |
|
48 | <td></td> | |
49 | </tr> |
|
49 | </tr> | |
50 | %else: |
|
50 | %else: | |
51 | <tr> |
|
51 | <tr> | |
52 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none')}</td> |
|
52 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none')}</td> | |
53 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read')}</td> |
|
53 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read')}</td> | |
54 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td> |
|
54 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td> | |
55 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td> |
|
55 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td> | |
56 | <td class="td-user"> |
|
56 | <td class="td-user"> | |
57 | ${base.gravatar(_user.email, 16)} |
|
57 | ${base.gravatar(_user.email, 16)} | |
58 | <span class="user"> |
|
58 | <span class="user"> | |
59 | % if _user.username == h.DEFAULT_USER: |
|
59 | % if _user.username == h.DEFAULT_USER: | |
60 | ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span> |
|
60 | ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span> | |
61 | % else: |
|
61 | % else: | |
62 | ${h.link_to_user(_user.username)} |
|
62 | ${h.link_to_user(_user.username)} | |
63 | % endif |
|
63 | % endif | |
64 | </span> |
|
64 | </span> | |
65 | </td> |
|
65 | </td> | |
66 | <td class="td-action"> |
|
66 | <td class="td-action"> | |
67 | %if _user.username != h.DEFAULT_USER: |
|
67 | %if _user.username != h.DEFAULT_USER: | |
68 | <span class="btn btn-link btn-danger revoke_perm" |
|
68 | <span class="btn btn-link btn-danger revoke_perm" | |
69 | member="${_user.user_id}" member_type="user"> |
|
69 | member="${_user.user_id}" member_type="user"> | |
70 | <i class="icon-remove"></i> ${_('Revoke')} |
|
70 | <i class="icon-remove"></i> ${_('Revoke')} | |
71 | </span> |
|
71 | </span> | |
72 | %endif |
|
72 | %endif | |
73 | </td> |
|
73 | </td> | |
74 | </tr> |
|
74 | </tr> | |
75 | %endif |
|
75 | %endif | |
76 | %endfor |
|
76 | %endfor | |
77 |
|
77 | |||
78 | ## USER GROUPS |
|
78 | ## USER GROUPS | |
79 | %for _user_group in c.repo_info.permission_user_groups(): |
|
79 | %for _user_group in c.repo_info.permission_user_groups(): | |
80 | <tr> |
|
80 | <tr> | |
81 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td> |
|
81 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td> | |
82 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td> |
|
82 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td> | |
83 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td> |
|
83 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td> | |
84 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td> |
|
84 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td> | |
85 | <td class="td-componentname"> |
|
85 | <td class="td-componentname"> | |
86 | <i class="icon-group" ></i> |
|
86 | <i class="icon-group" ></i> | |
87 | %if h.HasPermissionAny('hg.admin')(): |
|
87 | %if h.HasPermissionAny('hg.admin')(): | |
88 | <a href="${h.url('edit_users_group',user_group_id=_user_group.users_group_id)}"> |
|
88 | <a href="${h.url('edit_users_group',user_group_id=_user_group.users_group_id)}"> | |
89 | ${_user_group.users_group_name} |
|
89 | ${_user_group.users_group_name} | |
90 | </a> |
|
90 | </a> | |
91 | %else: |
|
91 | %else: | |
92 | ${_user_group.users_group_name} |
|
92 | ${_user_group.users_group_name} | |
93 | %endif |
|
93 | %endif | |
94 | </td> |
|
94 | </td> | |
95 | <td class="td-action"> |
|
95 | <td class="td-action"> | |
96 | <span class="btn btn-link btn-danger revoke_perm" |
|
96 | <span class="btn btn-link btn-danger revoke_perm" | |
97 | member="${_user_group.users_group_id}" member_type="user_group"> |
|
97 | member="${_user_group.users_group_id}" member_type="user_group"> | |
98 | <i class="icon-remove"></i> ${_('Revoke')} |
|
98 | <i class="icon-remove"></i> ${_('Revoke')} | |
99 | </span> |
|
99 | </span> | |
100 | </td> |
|
100 | </td> | |
101 | </tr> |
|
101 | </tr> | |
102 | %endfor |
|
102 | %endfor | |
103 | <tr class="new_members" id="add_perm_input"></tr> |
|
103 | <tr class="new_members" id="add_perm_input"></tr> | |
104 | </table> |
|
104 | </table> | |
105 | <div id="add_perm" class="link"> |
|
105 | <div id="add_perm" class="link"> | |
106 | ${_('Add new')} |
|
106 | ${_('Add new')} | |
107 | </div> |
|
107 | </div> | |
108 | <div class="buttons"> |
|
108 | <div class="buttons"> | |
109 | ${h.submit('save',_('Save'),class_="btn btn-primary")} |
|
109 | ${h.submit('save',_('Save'),class_="btn btn-primary")} | |
110 | ${h.reset('reset',_('Reset'),class_="btn btn-danger")} |
|
110 | ${h.reset('reset',_('Reset'),class_="btn btn-danger")} | |
111 | </div> |
|
111 | </div> | |
112 | ${h.end_form()} |
|
112 | ${h.end_form()} | |
113 | </div> |
|
113 | </div> | |
114 | </div> |
|
114 | </div> | |
115 |
|
115 | |||
116 | <script type="text/javascript"> |
|
116 | <script type="text/javascript"> | |
117 | $('#add_perm').on('click', function(e){ |
|
117 | $('#add_perm').on('click', function(e){ | |
118 | addNewPermInput($(this), 'repository'); |
|
118 | addNewPermInput($(this), 'repository'); | |
119 | }); |
|
119 | }); | |
120 | $('.revoke_perm').on('click', function(e){ |
|
120 | $('.revoke_perm').on('click', function(e){ | |
121 | markRevokePermInput($(this), 'repository'); |
|
121 | markRevokePermInput($(this), 'repository'); | |
122 | }); |
|
122 | }); | |
123 | </script> |
|
123 | </script> |
@@ -1,56 +1,56 b'' | |||||
1 | <div class="panel panel-default"> |
|
1 | <div class="panel panel-default"> | |
2 | <div class="panel-heading"> |
|
2 | <div class="panel-heading"> | |
3 | <h3 class="panel-title">${_('Email Configuration')}</h3> |
|
3 | <h3 class="panel-title">${_('Email Configuration')}</h3> | |
4 | </div> |
|
4 | </div> | |
5 | <div class="panel-body"> |
|
5 | <div class="panel-body"> | |
6 | <% |
|
6 | <% | |
7 | elems = [ |
|
7 | elems = [ | |
8 | (_('Email prefix'), c.rhodecode_ini.get('email_prefix'), ''), |
|
8 | (_('Email prefix'), c.rhodecode_ini.get('email_prefix'), ''), | |
9 | (_('RhodeCode email from'), c.rhodecode_ini.get('app_email_from'), ''), |
|
9 | (_('RhodeCode email from'), c.rhodecode_ini.get('app_email_from'), ''), | |
10 | (_('Error email from'), c.rhodecode_ini.get('error_email_from'), ''), |
|
10 | (_('Error email from'), c.rhodecode_ini.get('error_email_from'), ''), | |
11 | (_('Error email recipients'), c.rhodecode_ini.get('email_to'), ''), |
|
11 | (_('Error email recipients'), c.rhodecode_ini.get('email_to'), ''), | |
12 |
|
12 | |||
13 | (_('SMTP server'), c.rhodecode_ini.get('smtp_server'), ''), |
|
13 | (_('SMTP server'), c.rhodecode_ini.get('smtp_server'), ''), | |
14 | (_('SMTP username'), c.rhodecode_ini.get('smtp_username'), ''), |
|
14 | (_('SMTP username'), c.rhodecode_ini.get('smtp_username'), ''), | |
15 | (_('SMTP password'), '%s chars' % len(c.rhodecode_ini.get('smtp_password', '')), ''), |
|
15 | (_('SMTP password'), '%s chars' % len(c.rhodecode_ini.get('smtp_password', '')), ''), | |
16 | (_('SMTP port'), c.rhodecode_ini.get('smtp_port'), ''), |
|
16 | (_('SMTP port'), c.rhodecode_ini.get('smtp_port'), ''), | |
17 |
|
17 | |||
18 | (_('SMTP use TLS'), c.rhodecode_ini.get('smtp_use_tls'), ''), |
|
18 | (_('SMTP use TLS'), c.rhodecode_ini.get('smtp_use_tls'), ''), | |
19 | (_('SMTP use SSL'), c.rhodecode_ini.get('smtp_use_ssl'), ''), |
|
19 | (_('SMTP use SSL'), c.rhodecode_ini.get('smtp_use_ssl'), ''), | |
20 | (_('SMTP auth'), c.rhodecode_ini.get('smtp_auth'), ''), |
|
20 | (_('SMTP auth'), c.rhodecode_ini.get('smtp_auth'), ''), | |
21 | ] |
|
21 | ] | |
22 | %> |
|
22 | %> | |
23 | <dl class="dl-horizontal settings"> |
|
23 | <dl class="dl-horizontal settings"> | |
24 | %for dt, dd, tt in elems: |
|
24 | %for dt, dd, tt in elems: | |
25 | <dt >${dt}:</dt> |
|
25 | <dt >${dt}:</dt> | |
26 | <dd title="${tt}">${dd}</dd> |
|
26 | <dd title="${h.tooltip(tt)}">${dd}</dd> | |
27 | %endfor |
|
27 | %endfor | |
28 | </dl> |
|
28 | </dl> | |
29 | </div> |
|
29 | </div> | |
30 | </div> |
|
30 | </div> | |
31 |
|
31 | |||
32 | <div class="panel panel-default"> |
|
32 | <div class="panel panel-default"> | |
33 | <div class="panel-heading"> |
|
33 | <div class="panel-heading"> | |
34 | <h3 class="panel-title">${_('Test Email')}</h3> |
|
34 | <h3 class="panel-title">${_('Test Email')}</h3> | |
35 | </div> |
|
35 | </div> | |
36 | <div class="panel-body"> |
|
36 | <div class="panel-body"> | |
37 | ${h.secure_form(url('admin_settings_email'), method='post')} |
|
37 | ${h.secure_form(url('admin_settings_email'), method='post')} | |
38 |
|
38 | |||
39 | <div class="field input"> |
|
39 | <div class="field input"> | |
40 | ${h.text('test_email', size=60, placeholder=_('enter valid email'))} |
|
40 | ${h.text('test_email', size=60, placeholder=_('enter valid email'))} | |
41 | </div> |
|
41 | </div> | |
42 | <div class="field"> |
|
42 | <div class="field"> | |
43 | <span class="help-block"> |
|
43 | <span class="help-block"> | |
44 | ${_('Send an auto-generated email from this server to above email...')} |
|
44 | ${_('Send an auto-generated email from this server to above email...')} | |
45 | </span> |
|
45 | </span> | |
46 | </div> |
|
46 | </div> | |
47 | <div class="buttons"> |
|
47 | <div class="buttons"> | |
48 | ${h.submit('send',_('Send'),class_="btn")} |
|
48 | ${h.submit('send',_('Send'),class_="btn")} | |
49 | </div> |
|
49 | </div> | |
50 | ${h.end_form()} |
|
50 | ${h.end_form()} | |
51 | </div> |
|
51 | </div> | |
52 | </div> |
|
52 | </div> | |
53 |
|
53 | |||
54 |
|
54 | |||
55 |
|
55 | |||
56 |
|
56 |
@@ -1,62 +1,62 b'' | |||||
1 | <div class="panel panel-default"> |
|
1 | <div class="panel panel-default"> | |
2 | <div class="panel-heading"> |
|
2 | <div class="panel-heading"> | |
3 | <h3 class="panel-title">${_('User Sessions Configuration')}</h3> |
|
3 | <h3 class="panel-title">${_('User Sessions Configuration')}</h3> | |
4 | </div> |
|
4 | </div> | |
5 | <div class="panel-body"> |
|
5 | <div class="panel-body"> | |
6 | <% |
|
6 | <% | |
7 | elems = [ |
|
7 | elems = [ | |
8 | (_('Session type'), c.session_model.SESSION_TYPE, ''), |
|
8 | (_('Session type'), c.session_model.SESSION_TYPE, ''), | |
9 | (_('Session expiration period'), '{} seconds'.format(c.session_conf.get('beaker.session.timeout', 0)), ''), |
|
9 | (_('Session expiration period'), '{} seconds'.format(c.session_conf.get('beaker.session.timeout', 0)), ''), | |
10 |
|
10 | |||
11 | (_('Total sessions'), c.session_count, ''), |
|
11 | (_('Total sessions'), c.session_count, ''), | |
12 | (_('Expired sessions ({} days)').format(c.cleanup_older_days ), c.session_expired_count, ''), |
|
12 | (_('Expired sessions ({} days)').format(c.cleanup_older_days ), c.session_expired_count, ''), | |
13 |
|
13 | |||
14 | ] |
|
14 | ] | |
15 | %> |
|
15 | %> | |
16 | <dl class="dl-horizontal settings"> |
|
16 | <dl class="dl-horizontal settings"> | |
17 | %for dt, dd, tt in elems: |
|
17 | %for dt, dd, tt in elems: | |
18 | <dt>${dt}:</dt> |
|
18 | <dt>${dt}:</dt> | |
19 | <dd title="${tt}">${dd}</dd> |
|
19 | <dd title="${h.tooltip(tt)}">${dd}</dd> | |
20 | %endfor |
|
20 | %endfor | |
21 | </dl> |
|
21 | </dl> | |
22 | </div> |
|
22 | </div> | |
23 | </div> |
|
23 | </div> | |
24 |
|
24 | |||
25 |
|
25 | |||
26 | <div class="panel panel-warning"> |
|
26 | <div class="panel panel-warning"> | |
27 | <div class="panel-heading"> |
|
27 | <div class="panel-heading"> | |
28 | <h3 class="panel-title">${_('Cleanup Old Sessions')}</h3> |
|
28 | <h3 class="panel-title">${_('Cleanup Old Sessions')}</h3> | |
29 | </div> |
|
29 | </div> | |
30 | <div class="panel-body"> |
|
30 | <div class="panel-body"> | |
31 | ${h.secure_form(h.route_path('admin_settings_sessions_cleanup'), method='post')} |
|
31 | ${h.secure_form(h.route_path('admin_settings_sessions_cleanup'), method='post')} | |
32 |
|
32 | |||
33 | <p> |
|
33 | <p> | |
34 | ${_('Cleanup user sessions that were not active during chosen time frame.')} <br/> |
|
34 | ${_('Cleanup user sessions that were not active during chosen time frame.')} <br/> | |
35 | ${_('After performing this action users whose session will be removed will be required to log in again.')} <br/> |
|
35 | ${_('After performing this action users whose session will be removed will be required to log in again.')} <br/> | |
36 | <strong>${_('Picking `All` will log-out you, and all users in the system.')}</strong> |
|
36 | <strong>${_('Picking `All` will log-out you, and all users in the system.')}</strong> | |
37 | </p> |
|
37 | </p> | |
38 |
|
38 | |||
39 | <script type="text/javascript"> |
|
39 | <script type="text/javascript"> | |
40 | $(document).ready(function() { |
|
40 | $(document).ready(function() { | |
41 | $('#expire_days').select2({ |
|
41 | $('#expire_days').select2({ | |
42 | containerCssClass: 'drop-menu', |
|
42 | containerCssClass: 'drop-menu', | |
43 | dropdownCssClass: 'drop-menu-dropdown', |
|
43 | dropdownCssClass: 'drop-menu-dropdown', | |
44 | dropdownAutoWidth: true, |
|
44 | dropdownAutoWidth: true, | |
45 | minimumResultsForSearch: -1 |
|
45 | minimumResultsForSearch: -1 | |
46 | }); |
|
46 | }); | |
47 | }); |
|
47 | }); | |
48 | </script> |
|
48 | </script> | |
49 | <select id="expire_days" name="expire_days"> |
|
49 | <select id="expire_days" name="expire_days"> | |
50 | % for n in [60, 90, 30, 7, 0]: |
|
50 | % for n in [60, 90, 30, 7, 0]: | |
51 | <option value="${n}">${'{} days'.format(n) if n != 0 else 'All'}</option> |
|
51 | <option value="${n}">${'{} days'.format(n) if n != 0 else 'All'}</option> | |
52 | % endfor |
|
52 | % endfor | |
53 | </select> |
|
53 | </select> | |
54 | <button class="btn btn-small" type="submit" |
|
54 | <button class="btn btn-small" type="submit" | |
55 | onclick="return confirm('${_('Confirm to cleanup user sessions')}');"> |
|
55 | onclick="return confirm('${_('Confirm to cleanup user sessions')}');"> | |
56 | ${_('Cleanup sessions')} |
|
56 | ${_('Cleanup sessions')} | |
57 | </button> |
|
57 | </button> | |
58 | ${h.end_form()} |
|
58 | ${h.end_form()} | |
59 | </div> |
|
59 | </div> | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 |
|
62 |
@@ -1,604 +1,604 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="root.mako"/> |
|
2 | <%inherit file="root.mako"/> | |
3 |
|
3 | |||
4 | <div class="outerwrapper"> |
|
4 | <div class="outerwrapper"> | |
5 | <!-- HEADER --> |
|
5 | <!-- HEADER --> | |
6 | <div class="header"> |
|
6 | <div class="header"> | |
7 | <div id="header-inner" class="wrapper"> |
|
7 | <div id="header-inner" class="wrapper"> | |
8 | <div id="logo"> |
|
8 | <div id="logo"> | |
9 | <div class="logo-wrapper"> |
|
9 | <div class="logo-wrapper"> | |
10 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a> |
|
10 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a> | |
11 | </div> |
|
11 | </div> | |
12 | %if c.rhodecode_name: |
|
12 | %if c.rhodecode_name: | |
13 | <div class="branding">- ${h.branding(c.rhodecode_name)}</div> |
|
13 | <div class="branding">- ${h.branding(c.rhodecode_name)}</div> | |
14 | %endif |
|
14 | %endif | |
15 | </div> |
|
15 | </div> | |
16 | <!-- MENU BAR NAV --> |
|
16 | <!-- MENU BAR NAV --> | |
17 | ${self.menu_bar_nav()} |
|
17 | ${self.menu_bar_nav()} | |
18 | <!-- END MENU BAR NAV --> |
|
18 | <!-- END MENU BAR NAV --> | |
19 | </div> |
|
19 | </div> | |
20 | </div> |
|
20 | </div> | |
21 | ${self.menu_bar_subnav()} |
|
21 | ${self.menu_bar_subnav()} | |
22 | <!-- END HEADER --> |
|
22 | <!-- END HEADER --> | |
23 |
|
23 | |||
24 | <!-- CONTENT --> |
|
24 | <!-- CONTENT --> | |
25 | <div id="content" class="wrapper"> |
|
25 | <div id="content" class="wrapper"> | |
26 |
|
26 | |||
27 | <rhodecode-toast id="notifications"></rhodecode-toast> |
|
27 | <rhodecode-toast id="notifications"></rhodecode-toast> | |
28 |
|
28 | |||
29 | <div class="main"> |
|
29 | <div class="main"> | |
30 | ${next.main()} |
|
30 | ${next.main()} | |
31 | </div> |
|
31 | </div> | |
32 | </div> |
|
32 | </div> | |
33 | <!-- END CONTENT --> |
|
33 | <!-- END CONTENT --> | |
34 |
|
34 | |||
35 | </div> |
|
35 | </div> | |
36 | <!-- FOOTER --> |
|
36 | <!-- FOOTER --> | |
37 | <div id="footer"> |
|
37 | <div id="footer"> | |
38 | <div id="footer-inner" class="title wrapper"> |
|
38 | <div id="footer-inner" class="title wrapper"> | |
39 | <div> |
|
39 | <div> | |
40 | <p class="footer-link-right"> |
|
40 | <p class="footer-link-right"> | |
41 | % if c.visual.show_version: |
|
41 | % if c.visual.show_version: | |
42 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} |
|
42 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} | |
43 | % endif |
|
43 | % endif | |
44 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. |
|
44 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. | |
45 | % if c.visual.rhodecode_support_url: |
|
45 | % if c.visual.rhodecode_support_url: | |
46 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
|
46 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> | |
47 | % endif |
|
47 | % endif | |
48 | </p> |
|
48 | </p> | |
49 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> |
|
49 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> | |
50 | <p class="server-instance" style="display:${sid}"> |
|
50 | <p class="server-instance" style="display:${sid}"> | |
51 | ## display hidden instance ID if specially defined |
|
51 | ## display hidden instance ID if specially defined | |
52 | % if c.rhodecode_instanceid: |
|
52 | % if c.rhodecode_instanceid: | |
53 | ${_('RhodeCode instance id: %s') % c.rhodecode_instanceid} |
|
53 | ${_('RhodeCode instance id: %s') % c.rhodecode_instanceid} | |
54 | % endif |
|
54 | % endif | |
55 | </p> |
|
55 | </p> | |
56 | </div> |
|
56 | </div> | |
57 | </div> |
|
57 | </div> | |
58 | </div> |
|
58 | </div> | |
59 |
|
59 | |||
60 | <!-- END FOOTER --> |
|
60 | <!-- END FOOTER --> | |
61 |
|
61 | |||
62 | ### MAKO DEFS ### |
|
62 | ### MAKO DEFS ### | |
63 |
|
63 | |||
64 | <%def name="menu_bar_subnav()"> |
|
64 | <%def name="menu_bar_subnav()"> | |
65 | </%def> |
|
65 | </%def> | |
66 |
|
66 | |||
67 | <%def name="breadcrumbs(class_='breadcrumbs')"> |
|
67 | <%def name="breadcrumbs(class_='breadcrumbs')"> | |
68 | <div class="${class_}"> |
|
68 | <div class="${class_}"> | |
69 | ${self.breadcrumbs_links()} |
|
69 | ${self.breadcrumbs_links()} | |
70 | </div> |
|
70 | </div> | |
71 | </%def> |
|
71 | </%def> | |
72 |
|
72 | |||
73 | <%def name="admin_menu()"> |
|
73 | <%def name="admin_menu()"> | |
74 | <ul class="admin_menu submenu"> |
|
74 | <ul class="admin_menu submenu"> | |
75 | <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> |
|
75 | <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> | |
76 | <li><a href="${h.url('repos')}">${_('Repositories')}</a></li> |
|
76 | <li><a href="${h.url('repos')}">${_('Repositories')}</a></li> | |
77 | <li><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li> |
|
77 | <li><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li> | |
78 | <li><a href="${h.route_path('users')}">${_('Users')}</a></li> |
|
78 | <li><a href="${h.route_path('users')}">${_('Users')}</a></li> | |
79 | <li><a href="${h.url('users_groups')}">${_('User groups')}</a></li> |
|
79 | <li><a href="${h.url('users_groups')}">${_('User groups')}</a></li> | |
80 | <li><a href="${h.url('admin_permissions_application')}">${_('Permissions')}</a></li> |
|
80 | <li><a href="${h.url('admin_permissions_application')}">${_('Permissions')}</a></li> | |
81 | <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> |
|
81 | <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> | |
82 | <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> |
|
82 | <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> | |
83 | <li><a href="${h.url('admin_defaults_repositories')}">${_('Defaults')}</a></li> |
|
83 | <li><a href="${h.url('admin_defaults_repositories')}">${_('Defaults')}</a></li> | |
84 | <li class="last"><a href="${h.url('admin_settings')}">${_('Settings')}</a></li> |
|
84 | <li class="last"><a href="${h.url('admin_settings')}">${_('Settings')}</a></li> | |
85 | </ul> |
|
85 | </ul> | |
86 | </%def> |
|
86 | </%def> | |
87 |
|
87 | |||
88 |
|
88 | |||
89 | <%def name="dt_info_panel(elements)"> |
|
89 | <%def name="dt_info_panel(elements)"> | |
90 | <dl class="dl-horizontal"> |
|
90 | <dl class="dl-horizontal"> | |
91 | %for dt, dd, title, show_items in elements: |
|
91 | %for dt, dd, title, show_items in elements: | |
92 | <dt>${dt}:</dt> |
|
92 | <dt>${dt}:</dt> | |
93 | <dd title="${title}"> |
|
93 | <dd title="${h.tooltip(title)}"> | |
94 | %if callable(dd): |
|
94 | %if callable(dd): | |
95 | ## allow lazy evaluation of elements |
|
95 | ## allow lazy evaluation of elements | |
96 | ${dd()} |
|
96 | ${dd()} | |
97 | %else: |
|
97 | %else: | |
98 | ${dd} |
|
98 | ${dd} | |
99 | %endif |
|
99 | %endif | |
100 | %if show_items: |
|
100 | %if show_items: | |
101 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> |
|
101 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> | |
102 | %endif |
|
102 | %endif | |
103 | </dd> |
|
103 | </dd> | |
104 |
|
104 | |||
105 | %if show_items: |
|
105 | %if show_items: | |
106 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> |
|
106 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> | |
107 | %for item in show_items: |
|
107 | %for item in show_items: | |
108 | <dt></dt> |
|
108 | <dt></dt> | |
109 | <dd>${item}</dd> |
|
109 | <dd>${item}</dd> | |
110 | %endfor |
|
110 | %endfor | |
111 | </div> |
|
111 | </div> | |
112 | %endif |
|
112 | %endif | |
113 |
|
113 | |||
114 | %endfor |
|
114 | %endfor | |
115 | </dl> |
|
115 | </dl> | |
116 | </%def> |
|
116 | </%def> | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | <%def name="gravatar(email, size=16)"> |
|
119 | <%def name="gravatar(email, size=16)"> | |
120 | <% |
|
120 | <% | |
121 | if (size > 16): |
|
121 | if (size > 16): | |
122 | gravatar_class = 'gravatar gravatar-large' |
|
122 | gravatar_class = 'gravatar gravatar-large' | |
123 | else: |
|
123 | else: | |
124 | gravatar_class = 'gravatar' |
|
124 | gravatar_class = 'gravatar' | |
125 | %> |
|
125 | %> | |
126 | <%doc> |
|
126 | <%doc> | |
127 | TODO: johbo: For now we serve double size images to make it smooth |
|
127 | TODO: johbo: For now we serve double size images to make it smooth | |
128 | for retina. This is how it worked until now. Should be replaced |
|
128 | for retina. This is how it worked until now. Should be replaced | |
129 | with a better solution at some point. |
|
129 | with a better solution at some point. | |
130 | </%doc> |
|
130 | </%doc> | |
131 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> |
|
131 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> | |
132 | </%def> |
|
132 | </%def> | |
133 |
|
133 | |||
134 |
|
134 | |||
135 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> |
|
135 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> | |
136 | <% email = h.email_or_none(contact) %> |
|
136 | <% email = h.email_or_none(contact) %> | |
137 | <div class="rc-user tooltip" title="${h.author_string(email)}"> |
|
137 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
138 | ${self.gravatar(email, size)} |
|
138 | ${self.gravatar(email, size)} | |
139 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> |
|
139 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> | |
140 | </div> |
|
140 | </div> | |
141 | </%def> |
|
141 | </%def> | |
142 |
|
142 | |||
143 |
|
143 | |||
144 | ## admin menu used for people that have some admin resources |
|
144 | ## admin menu used for people that have some admin resources | |
145 | <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)"> |
|
145 | <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)"> | |
146 | <ul class="submenu"> |
|
146 | <ul class="submenu"> | |
147 | %if repositories: |
|
147 | %if repositories: | |
148 | <li class="local-admin-repos"><a href="${h.url('repos')}">${_('Repositories')}</a></li> |
|
148 | <li class="local-admin-repos"><a href="${h.url('repos')}">${_('Repositories')}</a></li> | |
149 | %endif |
|
149 | %endif | |
150 | %if repository_groups: |
|
150 | %if repository_groups: | |
151 | <li class="local-admin-repo-groups"><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li> |
|
151 | <li class="local-admin-repo-groups"><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li> | |
152 | %endif |
|
152 | %endif | |
153 | %if user_groups: |
|
153 | %if user_groups: | |
154 | <li class="local-admin-user-groups"><a href="${h.url('users_groups')}">${_('User groups')}</a></li> |
|
154 | <li class="local-admin-user-groups"><a href="${h.url('users_groups')}">${_('User groups')}</a></li> | |
155 | %endif |
|
155 | %endif | |
156 | </ul> |
|
156 | </ul> | |
157 | </%def> |
|
157 | </%def> | |
158 |
|
158 | |||
159 | <%def name="repo_page_title(repo_instance)"> |
|
159 | <%def name="repo_page_title(repo_instance)"> | |
160 | <div class="title-content"> |
|
160 | <div class="title-content"> | |
161 | <div class="title-main"> |
|
161 | <div class="title-main"> | |
162 | ## SVN/HG/GIT icons |
|
162 | ## SVN/HG/GIT icons | |
163 | %if h.is_hg(repo_instance): |
|
163 | %if h.is_hg(repo_instance): | |
164 | <i class="icon-hg"></i> |
|
164 | <i class="icon-hg"></i> | |
165 | %endif |
|
165 | %endif | |
166 | %if h.is_git(repo_instance): |
|
166 | %if h.is_git(repo_instance): | |
167 | <i class="icon-git"></i> |
|
167 | <i class="icon-git"></i> | |
168 | %endif |
|
168 | %endif | |
169 | %if h.is_svn(repo_instance): |
|
169 | %if h.is_svn(repo_instance): | |
170 | <i class="icon-svn"></i> |
|
170 | <i class="icon-svn"></i> | |
171 | %endif |
|
171 | %endif | |
172 |
|
172 | |||
173 | ## public/private |
|
173 | ## public/private | |
174 | %if repo_instance.private: |
|
174 | %if repo_instance.private: | |
175 | <i class="icon-repo-private"></i> |
|
175 | <i class="icon-repo-private"></i> | |
176 | %else: |
|
176 | %else: | |
177 | <i class="icon-repo-public"></i> |
|
177 | <i class="icon-repo-public"></i> | |
178 | %endif |
|
178 | %endif | |
179 |
|
179 | |||
180 | ## repo name with group name |
|
180 | ## repo name with group name | |
181 | ${h.breadcrumb_repo_link(c.rhodecode_db_repo)} |
|
181 | ${h.breadcrumb_repo_link(c.rhodecode_db_repo)} | |
182 |
|
182 | |||
183 | </div> |
|
183 | </div> | |
184 |
|
184 | |||
185 | ## FORKED |
|
185 | ## FORKED | |
186 | %if repo_instance.fork: |
|
186 | %if repo_instance.fork: | |
187 | <p> |
|
187 | <p> | |
188 | <i class="icon-code-fork"></i> ${_('Fork of')} |
|
188 | <i class="icon-code-fork"></i> ${_('Fork of')} | |
189 | <a href="${h.route_path('repo_summary',repo_name=repo_instance.fork.repo_name)}">${repo_instance.fork.repo_name}</a> |
|
189 | <a href="${h.route_path('repo_summary',repo_name=repo_instance.fork.repo_name)}">${repo_instance.fork.repo_name}</a> | |
190 | </p> |
|
190 | </p> | |
191 | %endif |
|
191 | %endif | |
192 |
|
192 | |||
193 | ## IMPORTED FROM REMOTE |
|
193 | ## IMPORTED FROM REMOTE | |
194 | %if repo_instance.clone_uri: |
|
194 | %if repo_instance.clone_uri: | |
195 | <p> |
|
195 | <p> | |
196 | <i class="icon-code-fork"></i> ${_('Clone from')} |
|
196 | <i class="icon-code-fork"></i> ${_('Clone from')} | |
197 | <a href="${h.url(h.safe_str(h.hide_credentials(repo_instance.clone_uri)))}">${h.hide_credentials(repo_instance.clone_uri)}</a> |
|
197 | <a href="${h.url(h.safe_str(h.hide_credentials(repo_instance.clone_uri)))}">${h.hide_credentials(repo_instance.clone_uri)}</a> | |
198 | </p> |
|
198 | </p> | |
199 | %endif |
|
199 | %endif | |
200 |
|
200 | |||
201 | ## LOCKING STATUS |
|
201 | ## LOCKING STATUS | |
202 | %if repo_instance.locked[0]: |
|
202 | %if repo_instance.locked[0]: | |
203 | <p class="locking_locked"> |
|
203 | <p class="locking_locked"> | |
204 | <i class="icon-repo-lock"></i> |
|
204 | <i class="icon-repo-lock"></i> | |
205 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} |
|
205 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} | |
206 | </p> |
|
206 | </p> | |
207 | %elif repo_instance.enable_locking: |
|
207 | %elif repo_instance.enable_locking: | |
208 | <p class="locking_unlocked"> |
|
208 | <p class="locking_unlocked"> | |
209 | <i class="icon-repo-unlock"></i> |
|
209 | <i class="icon-repo-unlock"></i> | |
210 | ${_('Repository not locked. Pull repository to lock it.')} |
|
210 | ${_('Repository not locked. Pull repository to lock it.')} | |
211 | </p> |
|
211 | </p> | |
212 | %endif |
|
212 | %endif | |
213 |
|
213 | |||
214 | </div> |
|
214 | </div> | |
215 | </%def> |
|
215 | </%def> | |
216 |
|
216 | |||
217 | <%def name="repo_menu(active=None)"> |
|
217 | <%def name="repo_menu(active=None)"> | |
218 | <% |
|
218 | <% | |
219 | def is_active(selected): |
|
219 | def is_active(selected): | |
220 | if selected == active: |
|
220 | if selected == active: | |
221 | return "active" |
|
221 | return "active" | |
222 | %> |
|
222 | %> | |
223 |
|
223 | |||
224 | <!--- CONTEXT BAR --> |
|
224 | <!--- CONTEXT BAR --> | |
225 | <div id="context-bar"> |
|
225 | <div id="context-bar"> | |
226 | <div class="wrapper"> |
|
226 | <div class="wrapper"> | |
227 | <ul id="context-pages" class="horizontal-list navigation"> |
|
227 | <ul id="context-pages" class="horizontal-list navigation"> | |
228 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> |
|
228 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> | |
229 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.url('changelog_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> |
|
229 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.url('changelog_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> | |
230 | <li class="${is_active('files')}"><a class="menulink" href="${h.url('files_home', repo_name=c.repo_name, revision=c.rhodecode_db_repo.landing_rev[1])}"><div class="menulabel">${_('Files')}</div></a></li> |
|
230 | <li class="${is_active('files')}"><a class="menulink" href="${h.url('files_home', repo_name=c.repo_name, revision=c.rhodecode_db_repo.landing_rev[1])}"><div class="menulabel">${_('Files')}</div></a></li> | |
231 | <li class="${is_active('compare')}"> |
|
231 | <li class="${is_active('compare')}"> | |
232 | <a class="menulink" href="${h.url('compare_home',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a> |
|
232 | <a class="menulink" href="${h.url('compare_home',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a> | |
233 | </li> |
|
233 | </li> | |
234 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" |
|
234 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" | |
235 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
235 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
236 | <li class="${is_active('showpullrequest')}"> |
|
236 | <li class="${is_active('showpullrequest')}"> | |
237 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}"> |
|
237 | <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)}"> | |
238 | %if c.repository_pull_requests: |
|
238 | %if c.repository_pull_requests: | |
239 | <span class="pr_notifications">${c.repository_pull_requests}</span> |
|
239 | <span class="pr_notifications">${c.repository_pull_requests}</span> | |
240 | %endif |
|
240 | %endif | |
241 | <div class="menulabel">${_('Pull Requests')}</div> |
|
241 | <div class="menulabel">${_('Pull Requests')}</div> | |
242 | </a> |
|
242 | </a> | |
243 | </li> |
|
243 | </li> | |
244 | %endif |
|
244 | %endif | |
245 | <li class="${is_active('options')}"> |
|
245 | <li class="${is_active('options')}"> | |
246 | <a class="menulink dropdown"> |
|
246 | <a class="menulink dropdown"> | |
247 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
247 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |
248 | </a> |
|
248 | </a> | |
249 | <ul class="submenu"> |
|
249 | <ul class="submenu"> | |
250 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
250 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
251 | <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Settings')}</a></li> |
|
251 | <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Settings')}</a></li> | |
252 | %endif |
|
252 | %endif | |
253 | %if c.rhodecode_db_repo.fork: |
|
253 | %if c.rhodecode_db_repo.fork: | |
254 | <li><a href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1], target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], merge=1)}"> |
|
254 | <li><a href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1], target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], merge=1)}"> | |
255 | ${_('Compare fork')}</a></li> |
|
255 | ${_('Compare fork')}</a></li> | |
256 | %endif |
|
256 | %endif | |
257 |
|
257 | |||
258 | <li><a href="${h.route_path('search_repo',repo_name=c.repo_name)}">${_('Search')}</a></li> |
|
258 | <li><a href="${h.route_path('search_repo',repo_name=c.repo_name)}">${_('Search')}</a></li> | |
259 |
|
259 | |||
260 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: |
|
260 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
261 | %if c.rhodecode_db_repo.locked[0]: |
|
261 | %if c.rhodecode_db_repo.locked[0]: | |
262 | <li><a class="locking_del" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> |
|
262 | <li><a class="locking_del" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> | |
263 | %else: |
|
263 | %else: | |
264 | <li><a class="locking_add" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> |
|
264 | <li><a class="locking_add" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> | |
265 | %endif |
|
265 | %endif | |
266 | %endif |
|
266 | %endif | |
267 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
267 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
268 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
268 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
269 | <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}">${_('Fork')}</a></li> |
|
269 | <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}">${_('Fork')}</a></li> | |
270 | <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> |
|
270 | <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> | |
271 | %endif |
|
271 | %endif | |
272 | %endif |
|
272 | %endif | |
273 | </ul> |
|
273 | </ul> | |
274 | </li> |
|
274 | </li> | |
275 | </ul> |
|
275 | </ul> | |
276 | </div> |
|
276 | </div> | |
277 | <div class="clear"></div> |
|
277 | <div class="clear"></div> | |
278 | </div> |
|
278 | </div> | |
279 | <!--- END CONTEXT BAR --> |
|
279 | <!--- END CONTEXT BAR --> | |
280 |
|
280 | |||
281 | </%def> |
|
281 | </%def> | |
282 |
|
282 | |||
283 | <%def name="usermenu(active=False)"> |
|
283 | <%def name="usermenu(active=False)"> | |
284 | ## USER MENU |
|
284 | ## USER MENU | |
285 | <li id="quick_login_li" class="${'active' if active else ''}"> |
|
285 | <li id="quick_login_li" class="${'active' if active else ''}"> | |
286 | <a id="quick_login_link" class="menulink childs"> |
|
286 | <a id="quick_login_link" class="menulink childs"> | |
287 | ${gravatar(c.rhodecode_user.email, 20)} |
|
287 | ${gravatar(c.rhodecode_user.email, 20)} | |
288 | <span class="user"> |
|
288 | <span class="user"> | |
289 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
289 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
290 | <span class="menu_link_user">${c.rhodecode_user.username}</span><div class="show_more"></div> |
|
290 | <span class="menu_link_user">${c.rhodecode_user.username}</span><div class="show_more"></div> | |
291 | %else: |
|
291 | %else: | |
292 | <span>${_('Sign in')}</span> |
|
292 | <span>${_('Sign in')}</span> | |
293 | %endif |
|
293 | %endif | |
294 | </span> |
|
294 | </span> | |
295 | </a> |
|
295 | </a> | |
296 |
|
296 | |||
297 | <div class="user-menu submenu"> |
|
297 | <div class="user-menu submenu"> | |
298 | <div id="quick_login"> |
|
298 | <div id="quick_login"> | |
299 | %if c.rhodecode_user.username == h.DEFAULT_USER: |
|
299 | %if c.rhodecode_user.username == h.DEFAULT_USER: | |
300 | <h4>${_('Sign in to your account')}</h4> |
|
300 | <h4>${_('Sign in to your account')}</h4> | |
301 | ${h.form(h.route_path('login', _query={'came_from': h.url.current()}), needs_csrf_token=False)} |
|
301 | ${h.form(h.route_path('login', _query={'came_from': h.url.current()}), needs_csrf_token=False)} | |
302 | <div class="form form-vertical"> |
|
302 | <div class="form form-vertical"> | |
303 | <div class="fields"> |
|
303 | <div class="fields"> | |
304 | <div class="field"> |
|
304 | <div class="field"> | |
305 | <div class="label"> |
|
305 | <div class="label"> | |
306 | <label for="username">${_('Username')}:</label> |
|
306 | <label for="username">${_('Username')}:</label> | |
307 | </div> |
|
307 | </div> | |
308 | <div class="input"> |
|
308 | <div class="input"> | |
309 | ${h.text('username',class_='focus',tabindex=1)} |
|
309 | ${h.text('username',class_='focus',tabindex=1)} | |
310 | </div> |
|
310 | </div> | |
311 |
|
311 | |||
312 | </div> |
|
312 | </div> | |
313 | <div class="field"> |
|
313 | <div class="field"> | |
314 | <div class="label"> |
|
314 | <div class="label"> | |
315 | <label for="password">${_('Password')}:</label> |
|
315 | <label for="password">${_('Password')}:</label> | |
316 | %if h.HasPermissionAny('hg.password_reset.enabled')(): |
|
316 | %if h.HasPermissionAny('hg.password_reset.enabled')(): | |
317 | <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.route_path('reset_password'), class_='pwd_reset')}</span> |
|
317 | <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.route_path('reset_password'), class_='pwd_reset')}</span> | |
318 | %endif |
|
318 | %endif | |
319 | </div> |
|
319 | </div> | |
320 | <div class="input"> |
|
320 | <div class="input"> | |
321 | ${h.password('password',class_='focus',tabindex=2)} |
|
321 | ${h.password('password',class_='focus',tabindex=2)} | |
322 | </div> |
|
322 | </div> | |
323 | </div> |
|
323 | </div> | |
324 | <div class="buttons"> |
|
324 | <div class="buttons"> | |
325 | <div class="register"> |
|
325 | <div class="register"> | |
326 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): |
|
326 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): | |
327 | ${h.link_to(_("Don't have an account?"),h.route_path('register'))} <br/> |
|
327 | ${h.link_to(_("Don't have an account?"),h.route_path('register'))} <br/> | |
328 | %endif |
|
328 | %endif | |
329 | ${h.link_to(_("Using external auth? Sign In here."),h.route_path('login'))} |
|
329 | ${h.link_to(_("Using external auth? Sign In here."),h.route_path('login'))} | |
330 | </div> |
|
330 | </div> | |
331 | <div class="submit"> |
|
331 | <div class="submit"> | |
332 | ${h.submit('sign_in',_('Sign In'),class_="btn btn-small",tabindex=3)} |
|
332 | ${h.submit('sign_in',_('Sign In'),class_="btn btn-small",tabindex=3)} | |
333 | </div> |
|
333 | </div> | |
334 | </div> |
|
334 | </div> | |
335 | </div> |
|
335 | </div> | |
336 | </div> |
|
336 | </div> | |
337 | ${h.end_form()} |
|
337 | ${h.end_form()} | |
338 | %else: |
|
338 | %else: | |
339 | <div class=""> |
|
339 | <div class=""> | |
340 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> |
|
340 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> | |
341 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> |
|
341 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> | |
342 | <div class="email">${c.rhodecode_user.email}</div> |
|
342 | <div class="email">${c.rhodecode_user.email}</div> | |
343 | </div> |
|
343 | </div> | |
344 | <div class=""> |
|
344 | <div class=""> | |
345 | <ol class="links"> |
|
345 | <ol class="links"> | |
346 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> |
|
346 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> | |
347 | % if c.rhodecode_user.personal_repo_group: |
|
347 | % if c.rhodecode_user.personal_repo_group: | |
348 | <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> |
|
348 | <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> | |
349 | % endif |
|
349 | % endif | |
350 | <li class="logout"> |
|
350 | <li class="logout"> | |
351 | ${h.secure_form(h.route_path('logout'))} |
|
351 | ${h.secure_form(h.route_path('logout'))} | |
352 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} |
|
352 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} | |
353 | ${h.end_form()} |
|
353 | ${h.end_form()} | |
354 | </li> |
|
354 | </li> | |
355 | </ol> |
|
355 | </ol> | |
356 | </div> |
|
356 | </div> | |
357 | %endif |
|
357 | %endif | |
358 | </div> |
|
358 | </div> | |
359 | </div> |
|
359 | </div> | |
360 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
360 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
361 | <div class="pill_container"> |
|
361 | <div class="pill_container"> | |
362 | % if c.unread_notifications == 0: |
|
362 | % if c.unread_notifications == 0: | |
363 | <a class="menu_link_notifications empty" href="${h.url('notifications')}">${c.unread_notifications}</a> |
|
363 | <a class="menu_link_notifications empty" href="${h.url('notifications')}">${c.unread_notifications}</a> | |
364 | % else: |
|
364 | % else: | |
365 | <a class="menu_link_notifications" href="${h.url('notifications')}">${c.unread_notifications}</a> |
|
365 | <a class="menu_link_notifications" href="${h.url('notifications')}">${c.unread_notifications}</a> | |
366 | % endif |
|
366 | % endif | |
367 | </div> |
|
367 | </div> | |
368 | % endif |
|
368 | % endif | |
369 | </li> |
|
369 | </li> | |
370 | </%def> |
|
370 | </%def> | |
371 |
|
371 | |||
372 | <%def name="menu_items(active=None)"> |
|
372 | <%def name="menu_items(active=None)"> | |
373 | <% |
|
373 | <% | |
374 | def is_active(selected): |
|
374 | def is_active(selected): | |
375 | if selected == active: |
|
375 | if selected == active: | |
376 | return "active" |
|
376 | return "active" | |
377 | return "" |
|
377 | return "" | |
378 | %> |
|
378 | %> | |
379 | <ul id="quick" class="main_nav navigation horizontal-list"> |
|
379 | <ul id="quick" class="main_nav navigation horizontal-list"> | |
380 | <!-- repo switcher --> |
|
380 | <!-- repo switcher --> | |
381 | <li class="${is_active('repositories')} repo_switcher_li has_select2"> |
|
381 | <li class="${is_active('repositories')} repo_switcher_li has_select2"> | |
382 | <input id="repo_switcher" name="repo_switcher" type="hidden"> |
|
382 | <input id="repo_switcher" name="repo_switcher" type="hidden"> | |
383 | </li> |
|
383 | </li> | |
384 |
|
384 | |||
385 | ## ROOT MENU |
|
385 | ## ROOT MENU | |
386 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
386 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
387 | <li class="${is_active('journal')}"> |
|
387 | <li class="${is_active('journal')}"> | |
388 | <a class="menulink" title="${_('Show activity journal')}" href="${h.url('journal')}"> |
|
388 | <a class="menulink" title="${_('Show activity journal')}" href="${h.url('journal')}"> | |
389 | <div class="menulabel">${_('Journal')}</div> |
|
389 | <div class="menulabel">${_('Journal')}</div> | |
390 | </a> |
|
390 | </a> | |
391 | </li> |
|
391 | </li> | |
392 | %else: |
|
392 | %else: | |
393 | <li class="${is_active('journal')}"> |
|
393 | <li class="${is_active('journal')}"> | |
394 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.url('public_journal')}"> |
|
394 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.url('public_journal')}"> | |
395 | <div class="menulabel">${_('Public journal')}</div> |
|
395 | <div class="menulabel">${_('Public journal')}</div> | |
396 | </a> |
|
396 | </a> | |
397 | </li> |
|
397 | </li> | |
398 | %endif |
|
398 | %endif | |
399 | <li class="${is_active('gists')}"> |
|
399 | <li class="${is_active('gists')}"> | |
400 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.url('gists')}"> |
|
400 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.url('gists')}"> | |
401 | <div class="menulabel">${_('Gists')}</div> |
|
401 | <div class="menulabel">${_('Gists')}</div> | |
402 | </a> |
|
402 | </a> | |
403 | </li> |
|
403 | </li> | |
404 | <li class="${is_active('search')}"> |
|
404 | <li class="${is_active('search')}"> | |
405 | <a class="menulink" title="${_('Search in repositories you have access to')}" href="${h.route_path('search')}"> |
|
405 | <a class="menulink" title="${_('Search in repositories you have access to')}" href="${h.route_path('search')}"> | |
406 | <div class="menulabel">${_('Search')}</div> |
|
406 | <div class="menulabel">${_('Search')}</div> | |
407 | </a> |
|
407 | </a> | |
408 | </li> |
|
408 | </li> | |
409 | % if h.HasPermissionAll('hg.admin')('access admin main page'): |
|
409 | % if h.HasPermissionAll('hg.admin')('access admin main page'): | |
410 | <li class="${is_active('admin')}"> |
|
410 | <li class="${is_active('admin')}"> | |
411 | <a class="menulink childs" title="${_('Admin settings')}" href="#" onclick="return false;"> |
|
411 | <a class="menulink childs" title="${_('Admin settings')}" href="#" onclick="return false;"> | |
412 | <div class="menulabel">${_('Admin')} <div class="show_more"></div></div> |
|
412 | <div class="menulabel">${_('Admin')} <div class="show_more"></div></div> | |
413 | </a> |
|
413 | </a> | |
414 | ${admin_menu()} |
|
414 | ${admin_menu()} | |
415 | </li> |
|
415 | </li> | |
416 | % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin: |
|
416 | % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin: | |
417 | <li class="${is_active('admin')}"> |
|
417 | <li class="${is_active('admin')}"> | |
418 | <a class="menulink childs" title="${_('Delegated Admin settings')}"> |
|
418 | <a class="menulink childs" title="${_('Delegated Admin settings')}"> | |
419 | <div class="menulabel">${_('Admin')} <div class="show_more"></div></div> |
|
419 | <div class="menulabel">${_('Admin')} <div class="show_more"></div></div> | |
420 | </a> |
|
420 | </a> | |
421 | ${admin_menu_simple(c.rhodecode_user.repositories_admin, |
|
421 | ${admin_menu_simple(c.rhodecode_user.repositories_admin, | |
422 | c.rhodecode_user.repository_groups_admin, |
|
422 | c.rhodecode_user.repository_groups_admin, | |
423 | c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())} |
|
423 | c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())} | |
424 | </li> |
|
424 | </li> | |
425 | % endif |
|
425 | % endif | |
426 | % if c.debug_style: |
|
426 | % if c.debug_style: | |
427 | <li class="${is_active('debug_style')}"> |
|
427 | <li class="${is_active('debug_style')}"> | |
428 | <a class="menulink" title="${_('Style')}" href="${h.url('debug_style_home')}"> |
|
428 | <a class="menulink" title="${_('Style')}" href="${h.url('debug_style_home')}"> | |
429 | <div class="menulabel">${_('Style')}</div> |
|
429 | <div class="menulabel">${_('Style')}</div> | |
430 | </a> |
|
430 | </a> | |
431 | </li> |
|
431 | </li> | |
432 | % endif |
|
432 | % endif | |
433 | ## render extra user menu |
|
433 | ## render extra user menu | |
434 | ${usermenu(active=(active=='my_account'))} |
|
434 | ${usermenu(active=(active=='my_account'))} | |
435 | </ul> |
|
435 | </ul> | |
436 |
|
436 | |||
437 | <script type="text/javascript"> |
|
437 | <script type="text/javascript"> | |
438 | var visual_show_public_icon = "${c.visual.show_public_icon}" == "True"; |
|
438 | var visual_show_public_icon = "${c.visual.show_public_icon}" == "True"; | |
439 |
|
439 | |||
440 | /*format the look of items in the list*/ |
|
440 | /*format the look of items in the list*/ | |
441 | var format = function(state, escapeMarkup){ |
|
441 | var format = function(state, escapeMarkup){ | |
442 | if (!state.id){ |
|
442 | if (!state.id){ | |
443 | return state.text; // optgroup |
|
443 | return state.text; // optgroup | |
444 | } |
|
444 | } | |
445 | var obj_dict = state.obj; |
|
445 | var obj_dict = state.obj; | |
446 | var tmpl = ''; |
|
446 | var tmpl = ''; | |
447 |
|
447 | |||
448 | if(obj_dict && state.type == 'repo'){ |
|
448 | if(obj_dict && state.type == 'repo'){ | |
449 | if(obj_dict['repo_type'] === 'hg'){ |
|
449 | if(obj_dict['repo_type'] === 'hg'){ | |
450 | tmpl += '<i class="icon-hg"></i> '; |
|
450 | tmpl += '<i class="icon-hg"></i> '; | |
451 | } |
|
451 | } | |
452 | else if(obj_dict['repo_type'] === 'git'){ |
|
452 | else if(obj_dict['repo_type'] === 'git'){ | |
453 | tmpl += '<i class="icon-git"></i> '; |
|
453 | tmpl += '<i class="icon-git"></i> '; | |
454 | } |
|
454 | } | |
455 | else if(obj_dict['repo_type'] === 'svn'){ |
|
455 | else if(obj_dict['repo_type'] === 'svn'){ | |
456 | tmpl += '<i class="icon-svn"></i> '; |
|
456 | tmpl += '<i class="icon-svn"></i> '; | |
457 | } |
|
457 | } | |
458 | if(obj_dict['private']){ |
|
458 | if(obj_dict['private']){ | |
459 | tmpl += '<i class="icon-lock" ></i> '; |
|
459 | tmpl += '<i class="icon-lock" ></i> '; | |
460 | } |
|
460 | } | |
461 | else if(visual_show_public_icon){ |
|
461 | else if(visual_show_public_icon){ | |
462 | tmpl += '<i class="icon-unlock-alt"></i> '; |
|
462 | tmpl += '<i class="icon-unlock-alt"></i> '; | |
463 | } |
|
463 | } | |
464 | } |
|
464 | } | |
465 | if(obj_dict && state.type == 'commit') { |
|
465 | if(obj_dict && state.type == 'commit') { | |
466 | tmpl += '<i class="icon-tag"></i>'; |
|
466 | tmpl += '<i class="icon-tag"></i>'; | |
467 | } |
|
467 | } | |
468 | if(obj_dict && state.type == 'group'){ |
|
468 | if(obj_dict && state.type == 'group'){ | |
469 | tmpl += '<i class="icon-folder-close"></i> '; |
|
469 | tmpl += '<i class="icon-folder-close"></i> '; | |
470 | } |
|
470 | } | |
471 | tmpl += escapeMarkup(state.text); |
|
471 | tmpl += escapeMarkup(state.text); | |
472 | return tmpl; |
|
472 | return tmpl; | |
473 | }; |
|
473 | }; | |
474 |
|
474 | |||
475 | var formatResult = function(result, container, query, escapeMarkup) { |
|
475 | var formatResult = function(result, container, query, escapeMarkup) { | |
476 | return format(result, escapeMarkup); |
|
476 | return format(result, escapeMarkup); | |
477 | }; |
|
477 | }; | |
478 |
|
478 | |||
479 | var formatSelection = function(data, container, escapeMarkup) { |
|
479 | var formatSelection = function(data, container, escapeMarkup) { | |
480 | return format(data, escapeMarkup); |
|
480 | return format(data, escapeMarkup); | |
481 | }; |
|
481 | }; | |
482 |
|
482 | |||
483 | $("#repo_switcher").select2({ |
|
483 | $("#repo_switcher").select2({ | |
484 | cachedDataSource: {}, |
|
484 | cachedDataSource: {}, | |
485 | minimumInputLength: 2, |
|
485 | minimumInputLength: 2, | |
486 | placeholder: '<div class="menulabel">${_('Go to')} <div class="show_more"></div></div>', |
|
486 | placeholder: '<div class="menulabel">${_('Go to')} <div class="show_more"></div></div>', | |
487 | dropdownAutoWidth: true, |
|
487 | dropdownAutoWidth: true, | |
488 | formatResult: formatResult, |
|
488 | formatResult: formatResult, | |
489 | formatSelection: formatSelection, |
|
489 | formatSelection: formatSelection, | |
490 | containerCssClass: "repo-switcher", |
|
490 | containerCssClass: "repo-switcher", | |
491 | dropdownCssClass: "repo-switcher-dropdown", |
|
491 | dropdownCssClass: "repo-switcher-dropdown", | |
492 | escapeMarkup: function(m){ |
|
492 | escapeMarkup: function(m){ | |
493 | // don't escape our custom placeholder |
|
493 | // don't escape our custom placeholder | |
494 | if(m.substr(0,23) == '<div class="menulabel">'){ |
|
494 | if(m.substr(0,23) == '<div class="menulabel">'){ | |
495 | return m; |
|
495 | return m; | |
496 | } |
|
496 | } | |
497 |
|
497 | |||
498 | return Select2.util.escapeMarkup(m); |
|
498 | return Select2.util.escapeMarkup(m); | |
499 | }, |
|
499 | }, | |
500 | query: $.debounce(250, function(query){ |
|
500 | query: $.debounce(250, function(query){ | |
501 | self = this; |
|
501 | self = this; | |
502 | var cacheKey = query.term; |
|
502 | var cacheKey = query.term; | |
503 | var cachedData = self.cachedDataSource[cacheKey]; |
|
503 | var cachedData = self.cachedDataSource[cacheKey]; | |
504 |
|
504 | |||
505 | if (cachedData) { |
|
505 | if (cachedData) { | |
506 | query.callback({results: cachedData.results}); |
|
506 | query.callback({results: cachedData.results}); | |
507 | } else { |
|
507 | } else { | |
508 | $.ajax({ |
|
508 | $.ajax({ | |
509 | url: pyroutes.url('goto_switcher_data'), |
|
509 | url: pyroutes.url('goto_switcher_data'), | |
510 | data: {'query': query.term}, |
|
510 | data: {'query': query.term}, | |
511 | dataType: 'json', |
|
511 | dataType: 'json', | |
512 | type: 'GET', |
|
512 | type: 'GET', | |
513 | success: function(data) { |
|
513 | success: function(data) { | |
514 | self.cachedDataSource[cacheKey] = data; |
|
514 | self.cachedDataSource[cacheKey] = data; | |
515 | query.callback({results: data.results}); |
|
515 | query.callback({results: data.results}); | |
516 | }, |
|
516 | }, | |
517 | error: function(data, textStatus, errorThrown) { |
|
517 | error: function(data, textStatus, errorThrown) { | |
518 | alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); |
|
518 | alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); | |
519 | } |
|
519 | } | |
520 | }) |
|
520 | }) | |
521 | } |
|
521 | } | |
522 | }) |
|
522 | }) | |
523 | }); |
|
523 | }); | |
524 |
|
524 | |||
525 | $("#repo_switcher").on('select2-selecting', function(e){ |
|
525 | $("#repo_switcher").on('select2-selecting', function(e){ | |
526 | e.preventDefault(); |
|
526 | e.preventDefault(); | |
527 | window.location = e.choice.url; |
|
527 | window.location = e.choice.url; | |
528 | }); |
|
528 | }); | |
529 |
|
529 | |||
530 | </script> |
|
530 | </script> | |
531 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> |
|
531 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> | |
532 | </%def> |
|
532 | </%def> | |
533 |
|
533 | |||
534 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
|
534 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
535 | <div class="modal-dialog"> |
|
535 | <div class="modal-dialog"> | |
536 | <div class="modal-content"> |
|
536 | <div class="modal-content"> | |
537 | <div class="modal-header"> |
|
537 | <div class="modal-header"> | |
538 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
538 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
539 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> |
|
539 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> | |
540 | </div> |
|
540 | </div> | |
541 | <div class="modal-body"> |
|
541 | <div class="modal-body"> | |
542 | <div class="block-left"> |
|
542 | <div class="block-left"> | |
543 | <table class="keyboard-mappings"> |
|
543 | <table class="keyboard-mappings"> | |
544 | <tbody> |
|
544 | <tbody> | |
545 | <tr> |
|
545 | <tr> | |
546 | <th></th> |
|
546 | <th></th> | |
547 | <th>${_('Site-wide shortcuts')}</th> |
|
547 | <th>${_('Site-wide shortcuts')}</th> | |
548 | </tr> |
|
548 | </tr> | |
549 | <% |
|
549 | <% | |
550 | elems = [ |
|
550 | elems = [ | |
551 | ('/', 'Open quick search box'), |
|
551 | ('/', 'Open quick search box'), | |
552 | ('g h', 'Goto home page'), |
|
552 | ('g h', 'Goto home page'), | |
553 | ('g g', 'Goto my private gists page'), |
|
553 | ('g g', 'Goto my private gists page'), | |
554 | ('g G', 'Goto my public gists page'), |
|
554 | ('g G', 'Goto my public gists page'), | |
555 | ('n r', 'New repository page'), |
|
555 | ('n r', 'New repository page'), | |
556 | ('n g', 'New gist page'), |
|
556 | ('n g', 'New gist page'), | |
557 | ] |
|
557 | ] | |
558 | %> |
|
558 | %> | |
559 | %for key, desc in elems: |
|
559 | %for key, desc in elems: | |
560 | <tr> |
|
560 | <tr> | |
561 | <td class="keys"> |
|
561 | <td class="keys"> | |
562 | <span class="key tag">${key}</span> |
|
562 | <span class="key tag">${key}</span> | |
563 | </td> |
|
563 | </td> | |
564 | <td>${desc}</td> |
|
564 | <td>${desc}</td> | |
565 | </tr> |
|
565 | </tr> | |
566 | %endfor |
|
566 | %endfor | |
567 | </tbody> |
|
567 | </tbody> | |
568 | </table> |
|
568 | </table> | |
569 | </div> |
|
569 | </div> | |
570 | <div class="block-left"> |
|
570 | <div class="block-left"> | |
571 | <table class="keyboard-mappings"> |
|
571 | <table class="keyboard-mappings"> | |
572 | <tbody> |
|
572 | <tbody> | |
573 | <tr> |
|
573 | <tr> | |
574 | <th></th> |
|
574 | <th></th> | |
575 | <th>${_('Repositories')}</th> |
|
575 | <th>${_('Repositories')}</th> | |
576 | </tr> |
|
576 | </tr> | |
577 | <% |
|
577 | <% | |
578 | elems = [ |
|
578 | elems = [ | |
579 | ('g s', 'Goto summary page'), |
|
579 | ('g s', 'Goto summary page'), | |
580 | ('g c', 'Goto changelog page'), |
|
580 | ('g c', 'Goto changelog page'), | |
581 | ('g f', 'Goto files page'), |
|
581 | ('g f', 'Goto files page'), | |
582 | ('g F', 'Goto files page with file search activated'), |
|
582 | ('g F', 'Goto files page with file search activated'), | |
583 | ('g p', 'Goto pull requests page'), |
|
583 | ('g p', 'Goto pull requests page'), | |
584 | ('g o', 'Goto repository settings'), |
|
584 | ('g o', 'Goto repository settings'), | |
585 | ('g O', 'Goto repository permissions settings'), |
|
585 | ('g O', 'Goto repository permissions settings'), | |
586 | ] |
|
586 | ] | |
587 | %> |
|
587 | %> | |
588 | %for key, desc in elems: |
|
588 | %for key, desc in elems: | |
589 | <tr> |
|
589 | <tr> | |
590 | <td class="keys"> |
|
590 | <td class="keys"> | |
591 | <span class="key tag">${key}</span> |
|
591 | <span class="key tag">${key}</span> | |
592 | </td> |
|
592 | </td> | |
593 | <td>${desc}</td> |
|
593 | <td>${desc}</td> | |
594 | </tr> |
|
594 | </tr> | |
595 | %endfor |
|
595 | %endfor | |
596 | </tbody> |
|
596 | </tbody> | |
597 | </table> |
|
597 | </table> | |
598 | </div> |
|
598 | </div> | |
599 | </div> |
|
599 | </div> | |
600 | <div class="modal-footer"> |
|
600 | <div class="modal-footer"> | |
601 | </div> |
|
601 | </div> | |
602 | </div><!-- /.modal-content --> |
|
602 | </div><!-- /.modal-content --> | |
603 | </div><!-- /.modal-dialog --> |
|
603 | </div><!-- /.modal-dialog --> | |
604 | </div><!-- /.modal --> |
|
604 | </div><!-- /.modal --> |
@@ -1,33 +1,33 b'' | |||||
1 | ## DATA TABLE RE USABLE ELEMENTS FOR BOOKMARKS |
|
1 | ## DATA TABLE RE USABLE ELEMENTS FOR BOOKMARKS | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="bookmarks" file="/bookmarks/bookmarks_data.mako"/> |
|
3 | ## <%namespace name="bookmarks" file="/bookmarks/bookmarks_data.mako"/> | |
4 | ## bookmarks.<func_name>(arg,arg2) |
|
4 | ## bookmarks.<func_name>(arg,arg2) | |
5 |
|
5 | |||
6 | <%def name="compare(commit_id)"> |
|
6 | <%def name="compare(commit_id)"> | |
7 | <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/> |
|
7 | <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/> | |
8 | <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/> |
|
8 | <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/> | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 |
|
11 | |||
12 | <%def name="name(name, files_url)"> |
|
12 | <%def name="name(name, files_url)"> | |
13 | <span class="tag booktag" title="${_('Bookmark %s') % (name,)}"> |
|
13 | <span class="tag booktag" title="${h.tooltip(_('Bookmark %s') % (name,))}"> | |
14 | <a href="${files_url}"> |
|
14 | <a href="${files_url}"> | |
15 | <i class="icon-bookmark"></i> |
|
15 | <i class="icon-bookmark"></i> | |
16 | ${name} |
|
16 | ${name} | |
17 | </a> |
|
17 | </a> | |
18 | </span> |
|
18 | </span> | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="date(date)"> |
|
21 | <%def name="date(date)"> | |
22 | ${h.age_component(date)} |
|
22 | ${h.age_component(date)} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="author(author)"> |
|
25 | <%def name="author(author)"> | |
26 | <span class="tooltip" title="${author}">${h.link_to_user(author)}</span> |
|
26 | <span class="tooltip" title="${h.tooltip(author)}">${h.link_to_user(author)}</span> | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%def name="commit(message, commit_id, commit_idx)"> |
|
29 | <%def name="commit(message, commit_id, commit_idx)"> | |
30 | <div> |
|
30 | <div> | |
31 | <pre><a title="${message}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre> |
|
31 | <pre><a title="${h.tooltip(message)}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre> | |
32 | </div> |
|
32 | </div> | |
33 | </%def> |
|
33 | </%def> |
@@ -1,33 +1,33 b'' | |||||
1 | ## DATA TABLE RE USABLE ELEMENTS FOR BRANCHES |
|
1 | ## DATA TABLE RE USABLE ELEMENTS FOR BRANCHES | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="branch" file="/branches/branches_data.mako"/> |
|
3 | ## <%namespace name="branch" file="/branches/branches_data.mako"/> | |
4 | ## branch.<func_name>(arg,arg2) |
|
4 | ## branch.<func_name>(arg,arg2) | |
5 |
|
5 | |||
6 | <%def name="compare(commit_id)"> |
|
6 | <%def name="compare(commit_id)"> | |
7 | <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/> |
|
7 | <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/> | |
8 | <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/> |
|
8 | <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/> | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="name(name, files_url)"> |
|
11 | <%def name="name(name, files_url)"> | |
12 | <span class="tag branchtag" title="${_('Branch %s') % (name,)}"> |
|
12 | <span class="tag branchtag" title="${h.tooltip(_('Branch %s') % (name,))}"> | |
13 | <a href="${files_url}"><i class="icon-code-fork"></i>${name} |
|
13 | <a href="${files_url}"><i class="icon-code-fork"></i>${name} | |
14 | %if name in c.closed_branches: |
|
14 | %if name in c.closed_branches: | |
15 | [closed] |
|
15 | [closed] | |
16 | %endif |
|
16 | %endif | |
17 | </a> |
|
17 | </a> | |
18 | </span> |
|
18 | </span> | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="date(date)"> |
|
21 | <%def name="date(date)"> | |
22 | ${h.age_component(date)} |
|
22 | ${h.age_component(date)} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="author(author)"> |
|
25 | <%def name="author(author)"> | |
26 | <span class="tooltip" title="${author}">${h.link_to_user(author)}</span> |
|
26 | <span class="tooltip" title="${h.tooltip(author)}">${h.link_to_user(author)}</span> | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%def name="commit(message, commit_id, commit_idx)"> |
|
29 | <%def name="commit(message, commit_id, commit_idx)"> | |
30 | <div> |
|
30 | <div> | |
31 | <pre><a title="${message}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre> |
|
31 | <pre><a title="${h.tooltip(message)}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre> | |
32 | </div> |
|
32 | </div> | |
33 | </%def> |
|
33 | </%def> |
@@ -1,299 +1,299 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.mako"/> |
|
3 | <%inherit file="/base/base.mako"/> | |
4 |
|
4 | |||
5 | <%def name="title()"> |
|
5 | <%def name="title()"> | |
6 | ${_('%s Changelog') % c.repo_name} |
|
6 | ${_('%s Changelog') % c.repo_name} | |
7 | %if c.changelog_for_path: |
|
7 | %if c.changelog_for_path: | |
8 | /${c.changelog_for_path} |
|
8 | /${c.changelog_for_path} | |
9 | %endif |
|
9 | %endif | |
10 | %if c.rhodecode_name: |
|
10 | %if c.rhodecode_name: | |
11 | · ${h.branding(c.rhodecode_name)} |
|
11 | · ${h.branding(c.rhodecode_name)} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%def name="breadcrumbs_links()"> |
|
15 | <%def name="breadcrumbs_links()"> | |
16 | %if c.changelog_for_path: |
|
16 | %if c.changelog_for_path: | |
17 | /${c.changelog_for_path} |
|
17 | /${c.changelog_for_path} | |
18 | %endif |
|
18 | %endif | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="menu_bar_nav()"> |
|
21 | <%def name="menu_bar_nav()"> | |
22 | ${self.menu_items(active='repositories')} |
|
22 | ${self.menu_items(active='repositories')} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="menu_bar_subnav()"> |
|
25 | <%def name="menu_bar_subnav()"> | |
26 | ${self.repo_menu(active='changelog')} |
|
26 | ${self.repo_menu(active='changelog')} | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%def name="main()"> |
|
29 | <%def name="main()"> | |
30 |
|
30 | |||
31 | <div class="box"> |
|
31 | <div class="box"> | |
32 | <div class="title"> |
|
32 | <div class="title"> | |
33 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
33 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
34 | <ul class="links"> |
|
34 | <ul class="links"> | |
35 | <li> |
|
35 | <li> | |
36 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a> |
|
36 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a> | |
37 | %if c.rhodecode_db_repo.fork: |
|
37 | %if c.rhodecode_db_repo.fork: | |
38 | <span> |
|
38 | <span> | |
39 | <a id="compare_fork_button" |
|
39 | <a id="compare_fork_button" | |
40 | title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" |
|
40 | title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" | |
41 | class="btn btn-small" |
|
41 | class="btn btn-small" | |
42 | href="${h.url('compare_url', |
|
42 | href="${h.url('compare_url', | |
43 | repo_name=c.rhodecode_db_repo.fork.repo_name, |
|
43 | repo_name=c.rhodecode_db_repo.fork.repo_name, | |
44 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], |
|
44 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], | |
45 | source_ref=c.rhodecode_db_repo.landing_rev[1], |
|
45 | source_ref=c.rhodecode_db_repo.landing_rev[1], | |
46 | target_repo=c.repo_name, |
|
46 | target_repo=c.repo_name, | |
47 | target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], |
|
47 | target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], | |
48 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], |
|
48 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], | |
49 | merge=1)}" |
|
49 | merge=1)}" | |
50 | > |
|
50 | > | |
51 | <i class="icon-loop"></i> |
|
51 | <i class="icon-loop"></i> | |
52 | ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)} |
|
52 | ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)} | |
53 | </a> |
|
53 | </a> | |
54 | </span> |
|
54 | </span> | |
55 | %endif |
|
55 | %endif | |
56 |
|
56 | |||
57 | ## pr open link |
|
57 | ## pr open link | |
58 | %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo): |
|
58 | %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo): | |
59 | <span> |
|
59 | <span> | |
60 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}"> |
|
60 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}"> | |
61 | ${_('Open new pull request')} |
|
61 | ${_('Open new pull request')} | |
62 | </a> |
|
62 | </a> | |
63 | </span> |
|
63 | </span> | |
64 | %endif |
|
64 | %endif | |
65 |
|
65 | |||
66 | ## clear selection |
|
66 | ## clear selection | |
67 | <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none"> |
|
67 | <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none"> | |
68 | ${_('Clear selection')} |
|
68 | ${_('Clear selection')} | |
69 | </div> |
|
69 | </div> | |
70 |
|
70 | |||
71 | </li> |
|
71 | </li> | |
72 | </ul> |
|
72 | </ul> | |
73 | </div> |
|
73 | </div> | |
74 |
|
74 | |||
75 | % if c.pagination: |
|
75 | % if c.pagination: | |
76 | <script type="text/javascript" src="${h.asset('js/jquery.commits-graph.js')}"></script> |
|
76 | <script type="text/javascript" src="${h.asset('js/jquery.commits-graph.js')}"></script> | |
77 |
|
77 | |||
78 | <div class="graph-header"> |
|
78 | <div class="graph-header"> | |
79 | <div id="filter_changelog"> |
|
79 | <div id="filter_changelog"> | |
80 | ${h.hidden('branch_filter')} |
|
80 | ${h.hidden('branch_filter')} | |
81 | %if c.selected_name: |
|
81 | %if c.selected_name: | |
82 | <div class="btn btn-default" id="clear_filter" > |
|
82 | <div class="btn btn-default" id="clear_filter" > | |
83 | ${_('Clear filter')} |
|
83 | ${_('Clear filter')} | |
84 | </div> |
|
84 | </div> | |
85 | %endif |
|
85 | %endif | |
86 | </div> |
|
86 | </div> | |
87 | ${self.breadcrumbs('breadcrumbs_light')} |
|
87 | ${self.breadcrumbs('breadcrumbs_light')} | |
88 | <div id="commit-counter" data-total=${c.total_cs} class="pull-right"> |
|
88 | <div id="commit-counter" data-total=${c.total_cs} class="pull-right"> | |
89 | ${ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)} |
|
89 | ${ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)} | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 |
|
92 | |||
93 | <div id="graph"> |
|
93 | <div id="graph"> | |
94 | <div class="graph-col-wrapper"> |
|
94 | <div class="graph-col-wrapper"> | |
95 | <div id="graph_nodes"> |
|
95 | <div id="graph_nodes"> | |
96 | <div id="graph_canvas"></div> |
|
96 | <div id="graph_canvas"></div> | |
97 | </div> |
|
97 | </div> | |
98 | <div id="graph_content" class="main-content graph_full_width"> |
|
98 | <div id="graph_content" class="main-content graph_full_width"> | |
99 |
|
99 | |||
100 | <div class="table"> |
|
100 | <div class="table"> | |
101 | <table id="changesets" class="rctable"> |
|
101 | <table id="changesets" class="rctable"> | |
102 | <tr> |
|
102 | <tr> | |
103 | ## checkbox |
|
103 | ## checkbox | |
104 | <th></th> |
|
104 | <th></th> | |
105 | <th colspan="2"></th> |
|
105 | <th colspan="2"></th> | |
106 |
|
106 | |||
107 | <th>${_('Commit')}</th> |
|
107 | <th>${_('Commit')}</th> | |
108 | ## commit message expand arrow |
|
108 | ## commit message expand arrow | |
109 | <th></th> |
|
109 | <th></th> | |
110 | <th>${_('Commit Message')}</th> |
|
110 | <th>${_('Commit Message')}</th> | |
111 |
|
111 | |||
112 | <th>${_('Age')}</th> |
|
112 | <th>${_('Age')}</th> | |
113 | <th>${_('Author')}</th> |
|
113 | <th>${_('Author')}</th> | |
114 |
|
114 | |||
115 | <th>${_('Refs')}</th> |
|
115 | <th>${_('Refs')}</th> | |
116 | </tr> |
|
116 | </tr> | |
117 |
|
117 | |||
118 | <tbody class="commits-range"> |
|
118 | <tbody class="commits-range"> | |
119 | <%include file='changelog_elements.mako'/> |
|
119 | <%include file='changelog_elements.mako'/> | |
120 | </tbody> |
|
120 | </tbody> | |
121 | </table> |
|
121 | </table> | |
122 | </div> |
|
122 | </div> | |
123 | </div> |
|
123 | </div> | |
124 | <div class="pagination-wh pagination-left"> |
|
124 | <div class="pagination-wh pagination-left"> | |
125 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
125 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
126 | </div> |
|
126 | </div> | |
127 | </div> |
|
127 | </div> | |
128 |
|
128 | |||
129 | <script type="text/javascript"> |
|
129 | <script type="text/javascript"> | |
130 | var cache = {}; |
|
130 | var cache = {}; | |
131 | $(function(){ |
|
131 | $(function(){ | |
132 |
|
132 | |||
133 | // Create links to commit ranges when range checkboxes are selected |
|
133 | // Create links to commit ranges when range checkboxes are selected | |
134 | var $commitCheckboxes = $('.commit-range'); |
|
134 | var $commitCheckboxes = $('.commit-range'); | |
135 | // cache elements |
|
135 | // cache elements | |
136 | var $commitRangeContainer = $('#rev_range_container'); |
|
136 | var $commitRangeContainer = $('#rev_range_container'); | |
137 | var $commitRangeClear = $('#rev_range_clear'); |
|
137 | var $commitRangeClear = $('#rev_range_clear'); | |
138 |
|
138 | |||
139 | var checkboxRangeSelector = function(e){ |
|
139 | var checkboxRangeSelector = function(e){ | |
140 | var selectedCheckboxes = []; |
|
140 | var selectedCheckboxes = []; | |
141 | for (pos in $commitCheckboxes){ |
|
141 | for (pos in $commitCheckboxes){ | |
142 | if($commitCheckboxes[pos].checked){ |
|
142 | if($commitCheckboxes[pos].checked){ | |
143 | selectedCheckboxes.push($commitCheckboxes[pos]); |
|
143 | selectedCheckboxes.push($commitCheckboxes[pos]); | |
144 | } |
|
144 | } | |
145 | } |
|
145 | } | |
146 | var open_new_pull_request = $('#open_new_pull_request'); |
|
146 | var open_new_pull_request = $('#open_new_pull_request'); | |
147 | if(open_new_pull_request){ |
|
147 | if(open_new_pull_request){ | |
148 | var selected_changes = selectedCheckboxes.length; |
|
148 | var selected_changes = selectedCheckboxes.length; | |
149 | if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type != 'hg') { |
|
149 | if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type != 'hg') { | |
150 | open_new_pull_request.hide(); |
|
150 | open_new_pull_request.hide(); | |
151 | } else { |
|
151 | } else { | |
152 | if (selected_changes == 1) { |
|
152 | if (selected_changes == 1) { | |
153 | open_new_pull_request.html(_gettext('Open new pull request for selected commit')); |
|
153 | open_new_pull_request.html(_gettext('Open new pull request for selected commit')); | |
154 | } else if (selected_changes == 0) { |
|
154 | } else if (selected_changes == 0) { | |
155 | open_new_pull_request.html(_gettext('Open new pull request')); |
|
155 | open_new_pull_request.html(_gettext('Open new pull request')); | |
156 | } |
|
156 | } | |
157 | open_new_pull_request.show(); |
|
157 | open_new_pull_request.show(); | |
158 | } |
|
158 | } | |
159 | } |
|
159 | } | |
160 |
|
160 | |||
161 | if (selectedCheckboxes.length>0){ |
|
161 | if (selectedCheckboxes.length>0){ | |
162 | var revEnd = selectedCheckboxes[0].name; |
|
162 | var revEnd = selectedCheckboxes[0].name; | |
163 | var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name; |
|
163 | var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name; | |
164 | var url = pyroutes.url('changeset_home', |
|
164 | var url = pyroutes.url('changeset_home', | |
165 | {'repo_name': '${c.repo_name}', |
|
165 | {'repo_name': '${c.repo_name}', | |
166 | 'revision': revStart+'...'+revEnd}); |
|
166 | 'revision': revStart+'...'+revEnd}); | |
167 |
|
167 | |||
168 | var link = (revStart == revEnd) |
|
168 | var link = (revStart == revEnd) | |
169 | ? _gettext('Show selected commit __S') |
|
169 | ? _gettext('Show selected commit __S') | |
170 | : _gettext('Show selected commits __S ... __E'); |
|
170 | : _gettext('Show selected commits __S ... __E'); | |
171 |
|
171 | |||
172 | link = link.replace('__S', revStart.substr(0,6)); |
|
172 | link = link.replace('__S', revStart.substr(0,6)); | |
173 | link = link.replace('__E', revEnd.substr(0,6)); |
|
173 | link = link.replace('__E', revEnd.substr(0,6)); | |
174 |
|
174 | |||
175 | $commitRangeContainer |
|
175 | $commitRangeContainer | |
176 | .attr('href',url) |
|
176 | .attr('href',url) | |
177 | .html(link) |
|
177 | .html(link) | |
178 | .show(); |
|
178 | .show(); | |
179 |
|
179 | |||
180 | $commitRangeClear.show(); |
|
180 | $commitRangeClear.show(); | |
181 | var _url = pyroutes.url('pullrequest_home', |
|
181 | var _url = pyroutes.url('pullrequest_home', | |
182 | {'repo_name': '${c.repo_name}', |
|
182 | {'repo_name': '${c.repo_name}', | |
183 | 'commit': revEnd}); |
|
183 | 'commit': revEnd}); | |
184 | open_new_pull_request.attr('href', _url); |
|
184 | open_new_pull_request.attr('href', _url); | |
185 | $('#compare_fork_button').hide(); |
|
185 | $('#compare_fork_button').hide(); | |
186 | } else { |
|
186 | } else { | |
187 | $commitRangeContainer.hide(); |
|
187 | $commitRangeContainer.hide(); | |
188 | $commitRangeClear.hide(); |
|
188 | $commitRangeClear.hide(); | |
189 |
|
189 | |||
190 | %if c.branch_name: |
|
190 | %if c.branch_name: | |
191 | var _url = pyroutes.url('pullrequest_home', |
|
191 | var _url = pyroutes.url('pullrequest_home', | |
192 | {'repo_name': '${c.repo_name}', |
|
192 | {'repo_name': '${c.repo_name}', | |
193 | 'branch':'${c.branch_name}'}); |
|
193 | 'branch':'${c.branch_name}'}); | |
194 | open_new_pull_request.attr('href', _url); |
|
194 | open_new_pull_request.attr('href', _url); | |
195 | %else: |
|
195 | %else: | |
196 | var _url = pyroutes.url('pullrequest_home', |
|
196 | var _url = pyroutes.url('pullrequest_home', | |
197 | {'repo_name': '${c.repo_name}'}); |
|
197 | {'repo_name': '${c.repo_name}'}); | |
198 | open_new_pull_request.attr('href', _url); |
|
198 | open_new_pull_request.attr('href', _url); | |
199 | %endif |
|
199 | %endif | |
200 | $('#compare_fork_button').show(); |
|
200 | $('#compare_fork_button').show(); | |
201 | } |
|
201 | } | |
202 | }; |
|
202 | }; | |
203 |
|
203 | |||
204 | $commitCheckboxes.on('click', checkboxRangeSelector); |
|
204 | $commitCheckboxes.on('click', checkboxRangeSelector); | |
205 |
|
205 | |||
206 | $commitRangeClear.on('click',function(e) { |
|
206 | $commitRangeClear.on('click',function(e) { | |
207 | $commitCheckboxes.attr('checked', false); |
|
207 | $commitCheckboxes.attr('checked', false); | |
208 | checkboxRangeSelector(); |
|
208 | checkboxRangeSelector(); | |
209 | e.preventDefault(); |
|
209 | e.preventDefault(); | |
210 | }); |
|
210 | }); | |
211 |
|
211 | |||
212 | // make sure the buttons are consistent when navigate back and forth |
|
212 | // make sure the buttons are consistent when navigate back and forth | |
213 | checkboxRangeSelector(); |
|
213 | checkboxRangeSelector(); | |
214 |
|
214 | |||
215 | var msgs = $('.message'); |
|
215 | var msgs = $('.message'); | |
216 | // get first element height |
|
216 | // get first element height | |
217 | var el = $('#graph_content .container')[0]; |
|
217 | var el = $('#graph_content .container')[0]; | |
218 | var row_h = el.clientHeight; |
|
218 | var row_h = el.clientHeight; | |
219 | for (var i=0; i < msgs.length; i++) { |
|
219 | for (var i=0; i < msgs.length; i++) { | |
220 | var m = msgs[i]; |
|
220 | var m = msgs[i]; | |
221 |
|
221 | |||
222 | var h = m.clientHeight; |
|
222 | var h = m.clientHeight; | |
223 | var pad = $(m).css('padding'); |
|
223 | var pad = $(m).css('padding'); | |
224 | if (h > row_h) { |
|
224 | if (h > row_h) { | |
225 | var offset = row_h - (h+12); |
|
225 | var offset = row_h - (h+12); | |
226 | $(m.nextElementSibling).css('display','block'); |
|
226 | $(m.nextElementSibling).css('display','block'); | |
227 | $(m.nextElementSibling).css('margin-top',offset+'px'); |
|
227 | $(m.nextElementSibling).css('margin-top',offset+'px'); | |
228 | } |
|
228 | } | |
229 | } |
|
229 | } | |
230 |
|
230 | |||
231 | $("#clear_filter").on("click", function() { |
|
231 | $("#clear_filter").on("click", function() { | |
232 | var filter = {'repo_name': '${c.repo_name}'}; |
|
232 | var filter = {'repo_name': '${c.repo_name}'}; | |
233 | window.location = pyroutes.url('changelog_home', filter); |
|
233 | window.location = pyroutes.url('changelog_home', filter); | |
234 | }); |
|
234 | }); | |
235 |
|
235 | |||
236 | $("#branch_filter").select2({ |
|
236 | $("#branch_filter").select2({ | |
237 | 'dropdownAutoWidth': true, |
|
237 | 'dropdownAutoWidth': true, | |
238 | 'width': 'resolve', |
|
238 | 'width': 'resolve', | |
239 | 'placeholder': "${c.selected_name or _('Filter changelog')}", |
|
239 | 'placeholder': "${c.selected_name or _('Filter changelog')}", | |
240 | containerCssClass: "drop-menu", |
|
240 | containerCssClass: "drop-menu", | |
241 | dropdownCssClass: "drop-menu-dropdown", |
|
241 | dropdownCssClass: "drop-menu-dropdown", | |
242 | query: function(query){ |
|
242 | query: function(query){ | |
243 | var key = 'cache'; |
|
243 | var key = 'cache'; | |
244 | var cached = cache[key] ; |
|
244 | var cached = cache[key] ; | |
245 | if(cached) { |
|
245 | if(cached) { | |
246 | var data = {results: []}; |
|
246 | var data = {results: []}; | |
247 | //filter results |
|
247 | //filter results | |
248 | $.each(cached.results, function(){ |
|
248 | $.each(cached.results, function(){ | |
249 | var section = this.text; |
|
249 | var section = this.text; | |
250 | var children = []; |
|
250 | var children = []; | |
251 | $.each(this.children, function(){ |
|
251 | $.each(this.children, function(){ | |
252 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
252 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
253 | children.push({'id': this.id, 'text': this.text, 'type': this.type}) |
|
253 | children.push({'id': this.id, 'text': this.text, 'type': this.type}) | |
254 | } |
|
254 | } | |
255 | }); |
|
255 | }); | |
256 | data.results.push({'text': section, 'children': children}); |
|
256 | data.results.push({'text': section, 'children': children}); | |
257 | query.callback({results: data.results}); |
|
257 | query.callback({results: data.results}); | |
258 | }); |
|
258 | }); | |
259 | }else{ |
|
259 | }else{ | |
260 | $.ajax({ |
|
260 | $.ajax({ | |
261 | url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}), |
|
261 | url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}), | |
262 | data: {}, |
|
262 | data: {}, | |
263 | dataType: 'json', |
|
263 | dataType: 'json', | |
264 | type: 'GET', |
|
264 | type: 'GET', | |
265 | success: function(data) { |
|
265 | success: function(data) { | |
266 | cache[key] = data; |
|
266 | cache[key] = data; | |
267 | query.callback({results: data.results}); |
|
267 | query.callback({results: data.results}); | |
268 | } |
|
268 | } | |
269 | }) |
|
269 | }) | |
270 | } |
|
270 | } | |
271 | } |
|
271 | } | |
272 | }); |
|
272 | }); | |
273 | $('#branch_filter').on('change', function(e){ |
|
273 | $('#branch_filter').on('change', function(e){ | |
274 | var data = $('#branch_filter').select2('data'); |
|
274 | var data = $('#branch_filter').select2('data'); | |
275 | var selected = data.text; |
|
275 | var selected = data.text; | |
276 | var filter = {'repo_name': '${c.repo_name}'}; |
|
276 | var filter = {'repo_name': '${c.repo_name}'}; | |
277 | if(data.type == 'branch' || data.type == 'branch_closed'){ |
|
277 | if(data.type == 'branch' || data.type == 'branch_closed'){ | |
278 | filter["branch"] = selected; |
|
278 | filter["branch"] = selected; | |
279 | } |
|
279 | } | |
280 | else if (data.type == 'book'){ |
|
280 | else if (data.type == 'book'){ | |
281 | filter["bookmark"] = selected; |
|
281 | filter["bookmark"] = selected; | |
282 | } |
|
282 | } | |
283 | window.location = pyroutes.url('changelog_home', filter); |
|
283 | window.location = pyroutes.url('changelog_home', filter); | |
284 | }); |
|
284 | }); | |
285 |
|
285 | |||
286 | commitsController = new CommitsController(); |
|
286 | commitsController = new CommitsController(); | |
287 | % if not c.changelog_for_path: |
|
287 | % if not c.changelog_for_path: | |
288 | commitsController.reloadGraph(); |
|
288 | commitsController.reloadGraph(); | |
289 | % endif |
|
289 | % endif | |
290 |
|
290 | |||
291 | }); |
|
291 | }); | |
292 |
|
292 | |||
293 | </script> |
|
293 | </script> | |
294 | </div> |
|
294 | </div> | |
295 | % else: |
|
295 | % else: | |
296 | ${_('There are no changes yet')} |
|
296 | ${_('There are no changes yet')} | |
297 | % endif |
|
297 | % endif | |
298 | </div> |
|
298 | </div> | |
299 | </%def> |
|
299 | </%def> |
@@ -1,142 +1,142 b'' | |||||
1 | ## small box that displays changed/added/removed details fetched by AJAX |
|
1 | ## small box that displays changed/added/removed details fetched by AJAX | |
2 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | <%namespace name="base" file="/base/base.mako"/> | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | % if c.prev_page: |
|
5 | % if c.prev_page: | |
6 | <tr> |
|
6 | <tr> | |
7 | <td colspan="9" class="load-more-commits"> |
|
7 | <td colspan="9" class="load-more-commits"> | |
8 | <a class="prev-commits" href="#loadPrevCommits" onclick="commitsController.loadPrev(this, ${c.prev_page}, '${c.branch_name}');return false"> |
|
8 | <a class="prev-commits" href="#loadPrevCommits" onclick="commitsController.loadPrev(this, ${c.prev_page}, '${c.branch_name}');return false"> | |
9 | ${_('load previous')} |
|
9 | ${_('load previous')} | |
10 | </a> |
|
10 | </a> | |
11 | </td> |
|
11 | </td> | |
12 | </tr> |
|
12 | </tr> | |
13 | % endif |
|
13 | % endif | |
14 |
|
14 | |||
15 | % for cnt,commit in enumerate(c.pagination): |
|
15 | % for cnt,commit in enumerate(c.pagination): | |
16 | <tr id="sha_${commit.raw_id}" class="changelogRow container ${'tablerow%s' % (cnt%2)}"> |
|
16 | <tr id="sha_${commit.raw_id}" class="changelogRow container ${'tablerow%s' % (cnt%2)}"> | |
17 |
|
17 | |||
18 | <td class="td-checkbox"> |
|
18 | <td class="td-checkbox"> | |
19 | ${h.checkbox(commit.raw_id,class_="commit-range")} |
|
19 | ${h.checkbox(commit.raw_id,class_="commit-range")} | |
20 | </td> |
|
20 | </td> | |
21 | <td class="td-status"> |
|
21 | <td class="td-status"> | |
22 |
|
22 | |||
23 | %if c.statuses.get(commit.raw_id): |
|
23 | %if c.statuses.get(commit.raw_id): | |
24 | <div class="changeset-status-ico"> |
|
24 | <div class="changeset-status-ico"> | |
25 | %if c.statuses.get(commit.raw_id)[2]: |
|
25 | %if c.statuses.get(commit.raw_id)[2]: | |
26 | <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]), c.statuses.get(commit.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}"> |
|
26 | <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]), c.statuses.get(commit.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}"> | |
27 | <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div> |
|
27 | <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div> | |
28 | </a> |
|
28 | </a> | |
29 | %else: |
|
29 | %else: | |
30 | <a class="tooltip" title="${_('Commit status: %s') % h.commit_status_lbl(c.statuses.get(commit.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id,anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> |
|
30 | <a class="tooltip" title="${_('Commit status: %s') % h.commit_status_lbl(c.statuses.get(commit.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id,anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> | |
31 | <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div> |
|
31 | <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div> | |
32 | </a> |
|
32 | </a> | |
33 | %endif |
|
33 | %endif | |
34 | </div> |
|
34 | </div> | |
35 | %else: |
|
35 | %else: | |
36 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> |
|
36 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> | |
37 | %endif |
|
37 | %endif | |
38 | </td> |
|
38 | </td> | |
39 | <td class="td-comments comments-col"> |
|
39 | <td class="td-comments comments-col"> | |
40 | %if c.comments.get(commit.raw_id): |
|
40 | %if c.comments.get(commit.raw_id): | |
41 | <a title="${_('Commit has comments')}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id,anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> |
|
41 | <a title="${_('Commit has comments')}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id,anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> | |
42 | <i class="icon-comment"></i> ${len(c.comments[commit.raw_id])} |
|
42 | <i class="icon-comment"></i> ${len(c.comments[commit.raw_id])} | |
43 | </a> |
|
43 | </a> | |
44 | %endif |
|
44 | %endif | |
45 | </td> |
|
45 | </td> | |
46 | <td class="td-hash"> |
|
46 | <td class="td-hash"> | |
47 | <code> |
|
47 | <code> | |
48 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}"> |
|
48 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}"> | |
49 | <span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span> |
|
49 | <span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span> | |
50 | </a> |
|
50 | </a> | |
51 | % if hasattr(commit, 'phase'): |
|
51 | % if hasattr(commit, 'phase'): | |
52 | % if commit.phase != 'public': |
|
52 | % if commit.phase != 'public': | |
53 | <span class="tag phase-${commit.phase} tooltip" title="${_('Commit phase')}">${commit.phase}</span> |
|
53 | <span class="tag phase-${commit.phase} tooltip" title="${_('Commit phase')}">${commit.phase}</span> | |
54 | % endif |
|
54 | % endif | |
55 | % endif |
|
55 | % endif | |
56 |
|
56 | |||
57 | ## obsolete commits |
|
57 | ## obsolete commits | |
58 | % if hasattr(commit, 'obsolete'): |
|
58 | % if hasattr(commit, 'obsolete'): | |
59 | % if commit.obsolete: |
|
59 | % if commit.obsolete: | |
60 | <span class="tag obsolete-${commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> |
|
60 | <span class="tag obsolete-${commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> | |
61 | % endif |
|
61 | % endif | |
62 | % endif |
|
62 | % endif | |
63 |
|
63 | |||
64 | ## hidden commits |
|
64 | ## hidden commits | |
65 | % if hasattr(commit, 'hidden'): |
|
65 | % if hasattr(commit, 'hidden'): | |
66 | % if commit.hidden: |
|
66 | % if commit.hidden: | |
67 | <span class="tag obsolete-${commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> |
|
67 | <span class="tag obsolete-${commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> | |
68 | % endif |
|
68 | % endif | |
69 | % endif |
|
69 | % endif | |
70 |
|
70 | |||
71 | </code> |
|
71 | </code> | |
72 | </td> |
|
72 | </td> | |
73 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false"> |
|
73 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false"> | |
74 | <div class="show_more_col"> |
|
74 | <div class="show_more_col"> | |
75 | <i class="show_more"></i> |
|
75 | <i class="show_more"></i> | |
76 | </div> |
|
76 | </div> | |
77 | </td> |
|
77 | </td> | |
78 | <td class="td-description mid"> |
|
78 | <td class="td-description mid"> | |
79 | <div class="log-container truncate-wrap"> |
|
79 | <div class="log-container truncate-wrap"> | |
80 | <div class="message truncate" id="c-${commit.raw_id}">${h.urlify_commit_message(commit.message, c.repo_name)}</div> |
|
80 | <div class="message truncate" id="c-${commit.raw_id}">${h.urlify_commit_message(commit.message, c.repo_name)}</div> | |
81 | </div> |
|
81 | </div> | |
82 | </td> |
|
82 | </td> | |
83 |
|
83 | |||
84 | <td class="td-time"> |
|
84 | <td class="td-time"> | |
85 | ${h.age_component(commit.date)} |
|
85 | ${h.age_component(commit.date)} | |
86 | </td> |
|
86 | </td> | |
87 | <td class="td-user"> |
|
87 | <td class="td-user"> | |
88 | ${base.gravatar_with_user(commit.author)} |
|
88 | ${base.gravatar_with_user(commit.author)} | |
89 | </td> |
|
89 | </td> | |
90 |
|
90 | |||
91 | <td class="td-tags tags-col"> |
|
91 | <td class="td-tags tags-col"> | |
92 | <div id="t-${commit.raw_id}"> |
|
92 | <div id="t-${commit.raw_id}"> | |
93 |
|
93 | |||
94 | ## merge |
|
94 | ## merge | |
95 | %if commit.merge: |
|
95 | %if commit.merge: | |
96 | <span class="tag mergetag"> |
|
96 | <span class="tag mergetag"> | |
97 | <i class="icon-merge"></i>${_('merge')} |
|
97 | <i class="icon-merge"></i>${_('merge')} | |
98 | </span> |
|
98 | </span> | |
99 | %endif |
|
99 | %endif | |
100 |
|
100 | |||
101 | ## branch |
|
101 | ## branch | |
102 | %if commit.branch: |
|
102 | %if commit.branch: | |
103 | <span class="tag branchtag" title="${_('Branch %s') % commit.branch}"> |
|
103 | <span class="tag branchtag" title="${h.tooltip(_('Branch %s') % commit.branch)}"> | |
104 | <a href="${h.url('changelog_home',repo_name=c.repo_name,branch=commit.branch)}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> |
|
104 | <a href="${h.url('changelog_home',repo_name=c.repo_name,branch=commit.branch)}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> | |
105 | </span> |
|
105 | </span> | |
106 | %endif |
|
106 | %endif | |
107 |
|
107 | |||
108 | ## bookmarks |
|
108 | ## bookmarks | |
109 | %if h.is_hg(c.rhodecode_repo): |
|
109 | %if h.is_hg(c.rhodecode_repo): | |
110 | %for book in commit.bookmarks: |
|
110 | %for book in commit.bookmarks: | |
111 | <span class="tag booktag" title="${_('Bookmark %s') % book}"> |
|
111 | <span class="tag booktag" title="${h.tooltip(_('Bookmark %s') % book)}"> | |
112 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
112 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> | |
113 | </span> |
|
113 | </span> | |
114 | %endfor |
|
114 | %endfor | |
115 | %endif |
|
115 | %endif | |
116 |
|
116 | |||
117 | ## tags |
|
117 | ## tags | |
118 | %for tag in commit.tags: |
|
118 | %for tag in commit.tags: | |
119 | <span class="tag tagtag" title="${_('Tag %s') % tag}"> |
|
119 | <span class="tag tagtag" title="${h.tooltip(_('Tag %s') % tag)}"> | |
120 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a> |
|
120 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a> | |
121 | </span> |
|
121 | </span> | |
122 | %endfor |
|
122 | %endfor | |
123 |
|
123 | |||
124 | </div> |
|
124 | </div> | |
125 | </td> |
|
125 | </td> | |
126 | </tr> |
|
126 | </tr> | |
127 | % endfor |
|
127 | % endfor | |
128 |
|
128 | |||
129 | % if c.next_page: |
|
129 | % if c.next_page: | |
130 | <tr> |
|
130 | <tr> | |
131 | <td colspan="9" class="load-more-commits"> |
|
131 | <td colspan="9" class="load-more-commits"> | |
132 | <a class="next-commits" href="#loadNextCommits" onclick="commitsController.loadNext(this, ${c.next_page}, '${c.branch_name}');return false"> |
|
132 | <a class="next-commits" href="#loadNextCommits" onclick="commitsController.loadNext(this, ${c.next_page}, '${c.branch_name}');return false"> | |
133 | ${_('load next')} |
|
133 | ${_('load next')} | |
134 | </a> |
|
134 | </a> | |
135 | </td> |
|
135 | </td> | |
136 | </tr> |
|
136 | </tr> | |
137 | % endif |
|
137 | % endif | |
138 | <tr class="chunk-graph-data" style="display:none" |
|
138 | <tr class="chunk-graph-data" style="display:none" | |
139 | data-graph='${c.graph_data|n}' |
|
139 | data-graph='${c.graph_data|n}' | |
140 | data-node='${c.prev_page}:${c.next_page}' |
|
140 | data-node='${c.prev_page}:${c.next_page}' | |
141 | data-commits='${c.graph_commits|n}'> |
|
141 | data-commits='${c.graph_commits|n}'> | |
142 | </tr> No newline at end of file |
|
142 | </tr> |
@@ -1,39 +1,39 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 | <div class="table"> |
|
2 | <div class="table"> | |
3 |
|
3 | |||
4 | <table class="table rctable file_history"> |
|
4 | <table class="table rctable file_history"> | |
5 | %for cnt,cs in enumerate(c.pagination): |
|
5 | %for cnt,cs in enumerate(c.pagination): | |
6 | <tr id="chg_${cnt+1}" class="${'tablerow%s' % (cnt%2)}"> |
|
6 | <tr id="chg_${cnt+1}" class="${'tablerow%s' % (cnt%2)}"> | |
7 | <td class="td-user"> |
|
7 | <td class="td-user"> | |
8 | ${base.gravatar_with_user(cs.author, 16)} |
|
8 | ${base.gravatar_with_user(cs.author, 16)} | |
9 | </td> |
|
9 | </td> | |
10 | <td class="td-time"> |
|
10 | <td class="td-time"> | |
11 | <div class="date"> |
|
11 | <div class="date"> | |
12 | ${h.age_component(cs.date)} |
|
12 | ${h.age_component(cs.date)} | |
13 | </div> |
|
13 | </div> | |
14 | </td> |
|
14 | </td> | |
15 | <td class="td-message"> |
|
15 | <td class="td-message"> | |
16 | <div class="log-container"> |
|
16 | <div class="log-container"> | |
17 | <div class="message_history" title="${cs.message}"> |
|
17 | <div class="message_history" title="${h.tooltip(cs.message)}"> | |
18 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> |
|
18 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> | |
19 | ${h.shorter(cs.message, 75)} |
|
19 | ${h.shorter(cs.message, 75)} | |
20 | </a> |
|
20 | </a> | |
21 | </div> |
|
21 | </div> | |
22 | </div> |
|
22 | </div> | |
23 | </td> |
|
23 | </td> | |
24 | <td class="td-hash"> |
|
24 | <td class="td-hash"> | |
25 | <code> |
|
25 | <code> | |
26 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> |
|
26 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> | |
27 | <span>${h.show_id(cs)}</span> |
|
27 | <span>${h.show_id(cs)}</span> | |
28 | </a> |
|
28 | </a> | |
29 | </code> |
|
29 | </code> | |
30 | </td> |
|
30 | </td> | |
31 | <td class="td-actions"> |
|
31 | <td class="td-actions"> | |
32 | <a href="${h.url('files_home',repo_name=c.repo_name,f_path=c.changelog_for_path,revision=cs.raw_id)}"> |
|
32 | <a href="${h.url('files_home',repo_name=c.repo_name,f_path=c.changelog_for_path,revision=cs.raw_id)}"> | |
33 | ${_('Show File')} |
|
33 | ${_('Show File')} | |
34 | </a> |
|
34 | </a> | |
35 | </td> |
|
35 | </td> | |
36 | </tr> |
|
36 | </tr> | |
37 | %endfor |
|
37 | %endfor | |
38 | </table> |
|
38 | </table> | |
39 | </div> |
|
39 | </div> |
@@ -1,351 +1,351 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.mako"/> |
|
3 | <%inherit file="/base/base.mako"/> | |
4 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> |
|
4 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> | |
5 |
|
5 | |||
6 | <%def name="title()"> |
|
6 | <%def name="title()"> | |
7 | ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)} |
|
7 | ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)} | |
8 | %if c.rhodecode_name: |
|
8 | %if c.rhodecode_name: | |
9 | · ${h.branding(c.rhodecode_name)} |
|
9 | · ${h.branding(c.rhodecode_name)} | |
10 | %endif |
|
10 | %endif | |
11 | </%def> |
|
11 | </%def> | |
12 |
|
12 | |||
13 | <%def name="menu_bar_nav()"> |
|
13 | <%def name="menu_bar_nav()"> | |
14 | ${self.menu_items(active='repositories')} |
|
14 | ${self.menu_items(active='repositories')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_subnav()"> |
|
17 | <%def name="menu_bar_subnav()"> | |
18 | ${self.repo_menu(active='changelog')} |
|
18 | ${self.repo_menu(active='changelog')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <script> |
|
22 | <script> | |
23 | // TODO: marcink switch this to pyroutes |
|
23 | // TODO: marcink switch this to pyroutes | |
24 | AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
24 | AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
25 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; |
|
25 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; | |
26 | </script> |
|
26 | </script> | |
27 | <div class="box"> |
|
27 | <div class="box"> | |
28 | <div class="title"> |
|
28 | <div class="title"> | |
29 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
29 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
30 | </div> |
|
30 | </div> | |
31 |
|
31 | |||
32 | <div id="changeset_compare_view_content" class="summary changeset"> |
|
32 | <div id="changeset_compare_view_content" class="summary changeset"> | |
33 | <div class="summary-detail"> |
|
33 | <div class="summary-detail"> | |
34 | <div class="summary-detail-header"> |
|
34 | <div class="summary-detail-header"> | |
35 | <span class="breadcrumbs files_location"> |
|
35 | <span class="breadcrumbs files_location"> | |
36 | <h4>${_('Commit')} |
|
36 | <h4>${_('Commit')} | |
37 | <code> |
|
37 | <code> | |
38 | ${h.show_id(c.commit)} |
|
38 | ${h.show_id(c.commit)} | |
39 | % if hasattr(c.commit, 'phase'): |
|
39 | % if hasattr(c.commit, 'phase'): | |
40 | <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span> |
|
40 | <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span> | |
41 | % endif |
|
41 | % endif | |
42 |
|
42 | |||
43 | ## obsolete commits |
|
43 | ## obsolete commits | |
44 | % if hasattr(c.commit, 'obsolete'): |
|
44 | % if hasattr(c.commit, 'obsolete'): | |
45 | % if c.commit.obsolete: |
|
45 | % if c.commit.obsolete: | |
46 | <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> |
|
46 | <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> | |
47 | % endif |
|
47 | % endif | |
48 | % endif |
|
48 | % endif | |
49 |
|
49 | |||
50 | ## hidden commits |
|
50 | ## hidden commits | |
51 | % if hasattr(c.commit, 'hidden'): |
|
51 | % if hasattr(c.commit, 'hidden'): | |
52 | % if c.commit.hidden: |
|
52 | % if c.commit.hidden: | |
53 | <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> |
|
53 | <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> | |
54 | % endif |
|
54 | % endif | |
55 | % endif |
|
55 | % endif | |
56 |
|
56 | |||
57 | </code> |
|
57 | </code> | |
58 | </h4> |
|
58 | </h4> | |
59 | </span> |
|
59 | </span> | |
60 | <div class="pull-right"> |
|
60 | <div class="pull-right"> | |
61 | <span id="parent_link"> |
|
61 | <span id="parent_link"> | |
62 | <a href="#" title="${_('Parent Commit')}">${_('Parent')}</a> |
|
62 | <a href="#" title="${_('Parent Commit')}">${_('Parent')}</a> | |
63 | </span> |
|
63 | </span> | |
64 | | |
|
64 | | | |
65 | <span id="child_link"> |
|
65 | <span id="child_link"> | |
66 | <a href="#" title="${_('Child Commit')}">${_('Child')}</a> |
|
66 | <a href="#" title="${_('Child Commit')}">${_('Child')}</a> | |
67 | </span> |
|
67 | </span> | |
68 | </div> |
|
68 | </div> | |
69 | </div> |
|
69 | </div> | |
70 |
|
70 | |||
71 | <div class="fieldset"> |
|
71 | <div class="fieldset"> | |
72 | <div class="left-label"> |
|
72 | <div class="left-label"> | |
73 | ${_('Description')}: |
|
73 | ${_('Description')}: | |
74 | </div> |
|
74 | </div> | |
75 | <div class="right-content"> |
|
75 | <div class="right-content"> | |
76 | <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> |
|
76 | <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> | |
77 | <div id="message_expand" style="display:none;"> |
|
77 | <div id="message_expand" style="display:none;"> | |
78 | ${_('Expand')} |
|
78 | ${_('Expand')} | |
79 | </div> |
|
79 | </div> | |
80 | </div> |
|
80 | </div> | |
81 | </div> |
|
81 | </div> | |
82 |
|
82 | |||
83 | %if c.statuses: |
|
83 | %if c.statuses: | |
84 | <div class="fieldset"> |
|
84 | <div class="fieldset"> | |
85 | <div class="left-label"> |
|
85 | <div class="left-label"> | |
86 | ${_('Commit status')}: |
|
86 | ${_('Commit status')}: | |
87 | </div> |
|
87 | </div> | |
88 | <div class="right-content"> |
|
88 | <div class="right-content"> | |
89 | <div class="changeset-status-ico"> |
|
89 | <div class="changeset-status-ico"> | |
90 | <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div> |
|
90 | <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div> | |
91 | </div> |
|
91 | </div> | |
92 | <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div> |
|
92 | <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div> | |
93 | </div> |
|
93 | </div> | |
94 | </div> |
|
94 | </div> | |
95 | %endif |
|
95 | %endif | |
96 |
|
96 | |||
97 | <div class="fieldset"> |
|
97 | <div class="fieldset"> | |
98 | <div class="left-label"> |
|
98 | <div class="left-label"> | |
99 | ${_('References')}: |
|
99 | ${_('References')}: | |
100 | </div> |
|
100 | </div> | |
101 | <div class="right-content"> |
|
101 | <div class="right-content"> | |
102 | <div class="tags"> |
|
102 | <div class="tags"> | |
103 |
|
103 | |||
104 | %if c.commit.merge: |
|
104 | %if c.commit.merge: | |
105 | <span class="mergetag tag"> |
|
105 | <span class="mergetag tag"> | |
106 | <i class="icon-merge"></i>${_('merge')} |
|
106 | <i class="icon-merge"></i>${_('merge')} | |
107 | </span> |
|
107 | </span> | |
108 | %endif |
|
108 | %endif | |
109 |
|
109 | |||
110 | %if h.is_hg(c.rhodecode_repo): |
|
110 | %if h.is_hg(c.rhodecode_repo): | |
111 | %for book in c.commit.bookmarks: |
|
111 | %for book in c.commit.bookmarks: | |
112 | <span class="booktag tag" title="${_('Bookmark %s') % book}"> |
|
112 | <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}"> | |
113 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
113 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> | |
114 | </span> |
|
114 | </span> | |
115 | %endfor |
|
115 | %endfor | |
116 | %endif |
|
116 | %endif | |
117 |
|
117 | |||
118 | %for tag in c.commit.tags: |
|
118 | %for tag in c.commit.tags: | |
119 | <span class="tagtag tag" title="${_('Tag %s') % tag}"> |
|
119 | <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}"> | |
120 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-tag"></i>${tag}</a> |
|
120 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-tag"></i>${tag}</a> | |
121 | </span> |
|
121 | </span> | |
122 | %endfor |
|
122 | %endfor | |
123 |
|
123 | |||
124 | %if c.commit.branch: |
|
124 | %if c.commit.branch: | |
125 | <span class="branchtag tag" title="${_('Branch %s') % c.commit.branch}"> |
|
125 | <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}"> | |
126 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a> |
|
126 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a> | |
127 | </span> |
|
127 | </span> | |
128 | %endif |
|
128 | %endif | |
129 | </div> |
|
129 | </div> | |
130 | </div> |
|
130 | </div> | |
131 | </div> |
|
131 | </div> | |
132 |
|
132 | |||
133 | <div class="fieldset"> |
|
133 | <div class="fieldset"> | |
134 | <div class="left-label"> |
|
134 | <div class="left-label"> | |
135 | ${_('Diff options')}: |
|
135 | ${_('Diff options')}: | |
136 | </div> |
|
136 | </div> | |
137 | <div class="right-content"> |
|
137 | <div class="right-content"> | |
138 | <div class="diff-actions"> |
|
138 | <div class="diff-actions"> | |
139 | <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
139 | <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> | |
140 | ${_('Raw Diff')} |
|
140 | ${_('Raw Diff')} | |
141 | </a> |
|
141 | </a> | |
142 | | |
|
142 | | | |
143 | <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> |
|
143 | <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> | |
144 | ${_('Patch Diff')} |
|
144 | ${_('Patch Diff')} | |
145 | </a> |
|
145 | </a> | |
146 | | |
|
146 | | | |
147 | <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.commit.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
147 | <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.commit.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> | |
148 | ${_('Download Diff')} |
|
148 | ${_('Download Diff')} | |
149 | </a> |
|
149 | </a> | |
150 | | |
|
150 | | | |
151 | ${c.ignorews_url(request.GET)} |
|
151 | ${c.ignorews_url(request.GET)} | |
152 | | |
|
152 | | | |
153 | ${c.context_url(request.GET)} |
|
153 | ${c.context_url(request.GET)} | |
154 | </div> |
|
154 | </div> | |
155 | </div> |
|
155 | </div> | |
156 | </div> |
|
156 | </div> | |
157 |
|
157 | |||
158 | <div class="fieldset"> |
|
158 | <div class="fieldset"> | |
159 | <div class="left-label"> |
|
159 | <div class="left-label"> | |
160 | ${_('Comments')}: |
|
160 | ${_('Comments')}: | |
161 | </div> |
|
161 | </div> | |
162 | <div class="right-content"> |
|
162 | <div class="right-content"> | |
163 | <div class="comments-number"> |
|
163 | <div class="comments-number"> | |
164 | %if c.comments: |
|
164 | %if c.comments: | |
165 | <a href="#comments">${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>, |
|
165 | <a href="#comments">${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>, | |
166 | %else: |
|
166 | %else: | |
167 | ${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)} |
|
167 | ${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)} | |
168 | %endif |
|
168 | %endif | |
169 | %if c.inline_cnt: |
|
169 | %if c.inline_cnt: | |
170 | <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> |
|
170 | <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> | |
171 | %else: |
|
171 | %else: | |
172 | ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} |
|
172 | ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} | |
173 | %endif |
|
173 | %endif | |
174 | </div> |
|
174 | </div> | |
175 | </div> |
|
175 | </div> | |
176 | </div> |
|
176 | </div> | |
177 |
|
177 | |||
178 | <div class="fieldset"> |
|
178 | <div class="fieldset"> | |
179 | <div class="left-label"> |
|
179 | <div class="left-label"> | |
180 | ${_('Unresolved TODOs')}: |
|
180 | ${_('Unresolved TODOs')}: | |
181 | </div> |
|
181 | </div> | |
182 | <div class="right-content"> |
|
182 | <div class="right-content"> | |
183 | <div class="comments-number"> |
|
183 | <div class="comments-number"> | |
184 | % if c.unresolved_comments: |
|
184 | % if c.unresolved_comments: | |
185 | % for co in c.unresolved_comments: |
|
185 | % for co in c.unresolved_comments: | |
186 | <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','} |
|
186 | <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','} | |
187 | % endfor |
|
187 | % endfor | |
188 | % else: |
|
188 | % else: | |
189 | ${_('There are no unresolved TODOs')} |
|
189 | ${_('There are no unresolved TODOs')} | |
190 | % endif |
|
190 | % endif | |
191 | </div> |
|
191 | </div> | |
192 | </div> |
|
192 | </div> | |
193 | </div> |
|
193 | </div> | |
194 |
|
194 | |||
195 | </div> <!-- end summary-detail --> |
|
195 | </div> <!-- end summary-detail --> | |
196 |
|
196 | |||
197 | <div id="commit-stats" class="sidebar-right"> |
|
197 | <div id="commit-stats" class="sidebar-right"> | |
198 | <div class="summary-detail-header"> |
|
198 | <div class="summary-detail-header"> | |
199 | <h4 class="item"> |
|
199 | <h4 class="item"> | |
200 | ${_('Author')} |
|
200 | ${_('Author')} | |
201 | </h4> |
|
201 | </h4> | |
202 | </div> |
|
202 | </div> | |
203 | <div class="sidebar-right-content"> |
|
203 | <div class="sidebar-right-content"> | |
204 | ${self.gravatar_with_user(c.commit.author)} |
|
204 | ${self.gravatar_with_user(c.commit.author)} | |
205 | <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div> |
|
205 | <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div> | |
206 | </div> |
|
206 | </div> | |
207 | </div><!-- end sidebar --> |
|
207 | </div><!-- end sidebar --> | |
208 | </div> <!-- end summary --> |
|
208 | </div> <!-- end summary --> | |
209 | <div class="cs_files"> |
|
209 | <div class="cs_files"> | |
210 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
210 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> | |
211 | ${cbdiffs.render_diffset_menu()} |
|
211 | ${cbdiffs.render_diffset_menu()} | |
212 | ${cbdiffs.render_diffset( |
|
212 | ${cbdiffs.render_diffset( | |
213 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True)} |
|
213 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True)} | |
214 | </div> |
|
214 | </div> | |
215 |
|
215 | |||
216 | ## template for inline comment form |
|
216 | ## template for inline comment form | |
217 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
217 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
218 |
|
218 | |||
219 | ## render comments |
|
219 | ## render comments | |
220 | ${comment.generate_comments(c.comments)} |
|
220 | ${comment.generate_comments(c.comments)} | |
221 |
|
221 | |||
222 | ## main comment form and it status |
|
222 | ## main comment form and it status | |
223 | ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.commit.raw_id), |
|
223 | ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.commit.raw_id), | |
224 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} |
|
224 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} | |
225 | </div> |
|
225 | </div> | |
226 |
|
226 | |||
227 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS |
|
227 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS | |
228 | <script type="text/javascript"> |
|
228 | <script type="text/javascript"> | |
229 |
|
229 | |||
230 | $(document).ready(function() { |
|
230 | $(document).ready(function() { | |
231 |
|
231 | |||
232 | var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); |
|
232 | var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); | |
233 | if($('#trimmed_message_box').height() === boxmax){ |
|
233 | if($('#trimmed_message_box').height() === boxmax){ | |
234 | $('#message_expand').show(); |
|
234 | $('#message_expand').show(); | |
235 | } |
|
235 | } | |
236 |
|
236 | |||
237 | $('#message_expand').on('click', function(e){ |
|
237 | $('#message_expand').on('click', function(e){ | |
238 | $('#trimmed_message_box').css('max-height', 'none'); |
|
238 | $('#trimmed_message_box').css('max-height', 'none'); | |
239 | $(this).hide(); |
|
239 | $(this).hide(); | |
240 | }); |
|
240 | }); | |
241 |
|
241 | |||
242 | $('.show-inline-comments').on('click', function(e){ |
|
242 | $('.show-inline-comments').on('click', function(e){ | |
243 | var boxid = $(this).attr('data-comment-id'); |
|
243 | var boxid = $(this).attr('data-comment-id'); | |
244 | var button = $(this); |
|
244 | var button = $(this); | |
245 |
|
245 | |||
246 | if(button.hasClass("comments-visible")) { |
|
246 | if(button.hasClass("comments-visible")) { | |
247 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
247 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
248 | $(this).hide(); |
|
248 | $(this).hide(); | |
249 | }); |
|
249 | }); | |
250 | button.removeClass("comments-visible"); |
|
250 | button.removeClass("comments-visible"); | |
251 | } else { |
|
251 | } else { | |
252 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
252 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
253 | $(this).show(); |
|
253 | $(this).show(); | |
254 | }); |
|
254 | }); | |
255 | button.addClass("comments-visible"); |
|
255 | button.addClass("comments-visible"); | |
256 | } |
|
256 | } | |
257 | }); |
|
257 | }); | |
258 |
|
258 | |||
259 |
|
259 | |||
260 | // next links |
|
260 | // next links | |
261 | $('#child_link').on('click', function(e){ |
|
261 | $('#child_link').on('click', function(e){ | |
262 | // fetch via ajax what is going to be the next link, if we have |
|
262 | // fetch via ajax what is going to be the next link, if we have | |
263 | // >1 links show them to user to choose |
|
263 | // >1 links show them to user to choose | |
264 | if(!$('#child_link').hasClass('disabled')){ |
|
264 | if(!$('#child_link').hasClass('disabled')){ | |
265 | $.ajax({ |
|
265 | $.ajax({ | |
266 | url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.commit.raw_id)}', |
|
266 | url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.commit.raw_id)}', | |
267 | success: function(data) { |
|
267 | success: function(data) { | |
268 | if(data.results.length === 0){ |
|
268 | if(data.results.length === 0){ | |
269 | $('#child_link').html("${_('No Child Commits')}").addClass('disabled'); |
|
269 | $('#child_link').html("${_('No Child Commits')}").addClass('disabled'); | |
270 | } |
|
270 | } | |
271 | if(data.results.length === 1){ |
|
271 | if(data.results.length === 1){ | |
272 | var commit = data.results[0]; |
|
272 | var commit = data.results[0]; | |
273 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); |
|
273 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); | |
274 | } |
|
274 | } | |
275 | else if(data.results.length === 2){ |
|
275 | else if(data.results.length === 2){ | |
276 | $('#child_link').addClass('disabled'); |
|
276 | $('#child_link').addClass('disabled'); | |
277 | $('#child_link').addClass('double'); |
|
277 | $('#child_link').addClass('double'); | |
278 | var _html = ''; |
|
278 | var _html = ''; | |
279 | _html +='<a title="__title__" href="__url__">__rev__</a> ' |
|
279 | _html +='<a title="__title__" href="__url__">__rev__</a> ' | |
280 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
280 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |
281 | .replace('__title__', data.results[0].message) |
|
281 | .replace('__title__', data.results[0].message) | |
282 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); |
|
282 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); | |
283 | _html +=' | '; |
|
283 | _html +=' | '; | |
284 | _html +='<a title="__title__" href="__url__">__rev__</a> ' |
|
284 | _html +='<a title="__title__" href="__url__">__rev__</a> ' | |
285 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
285 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |
286 | .replace('__title__', data.results[1].message) |
|
286 | .replace('__title__', data.results[1].message) | |
287 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); |
|
287 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); | |
288 | $('#child_link').html(_html); |
|
288 | $('#child_link').html(_html); | |
289 | } |
|
289 | } | |
290 | } |
|
290 | } | |
291 | }); |
|
291 | }); | |
292 | e.preventDefault(); |
|
292 | e.preventDefault(); | |
293 | } |
|
293 | } | |
294 | }); |
|
294 | }); | |
295 |
|
295 | |||
296 | // prev links |
|
296 | // prev links | |
297 | $('#parent_link').on('click', function(e){ |
|
297 | $('#parent_link').on('click', function(e){ | |
298 | // fetch via ajax what is going to be the next link, if we have |
|
298 | // fetch via ajax what is going to be the next link, if we have | |
299 | // >1 links show them to user to choose |
|
299 | // >1 links show them to user to choose | |
300 | if(!$('#parent_link').hasClass('disabled')){ |
|
300 | if(!$('#parent_link').hasClass('disabled')){ | |
301 | $.ajax({ |
|
301 | $.ajax({ | |
302 | url: '${h.url("changeset_parents",repo_name=c.repo_name, revision=c.commit.raw_id)}', |
|
302 | url: '${h.url("changeset_parents",repo_name=c.repo_name, revision=c.commit.raw_id)}', | |
303 | success: function(data) { |
|
303 | success: function(data) { | |
304 | if(data.results.length === 0){ |
|
304 | if(data.results.length === 0){ | |
305 | $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); |
|
305 | $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); | |
306 | } |
|
306 | } | |
307 | if(data.results.length === 1){ |
|
307 | if(data.results.length === 1){ | |
308 | var commit = data.results[0]; |
|
308 | var commit = data.results[0]; | |
309 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); |
|
309 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); | |
310 | } |
|
310 | } | |
311 | else if(data.results.length === 2){ |
|
311 | else if(data.results.length === 2){ | |
312 | $('#parent_link').addClass('disabled'); |
|
312 | $('#parent_link').addClass('disabled'); | |
313 | $('#parent_link').addClass('double'); |
|
313 | $('#parent_link').addClass('double'); | |
314 | var _html = ''; |
|
314 | var _html = ''; | |
315 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' |
|
315 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' | |
316 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
316 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |
317 | .replace('__title__', data.results[0].message) |
|
317 | .replace('__title__', data.results[0].message) | |
318 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); |
|
318 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); | |
319 | _html +=' | '; |
|
319 | _html +=' | '; | |
320 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' |
|
320 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' | |
321 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
321 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |
322 | .replace('__title__', data.results[1].message) |
|
322 | .replace('__title__', data.results[1].message) | |
323 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); |
|
323 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); | |
324 | $('#parent_link').html(_html); |
|
324 | $('#parent_link').html(_html); | |
325 | } |
|
325 | } | |
326 | } |
|
326 | } | |
327 | }); |
|
327 | }); | |
328 | e.preventDefault(); |
|
328 | e.preventDefault(); | |
329 | } |
|
329 | } | |
330 | }); |
|
330 | }); | |
331 |
|
331 | |||
332 | if (location.hash) { |
|
332 | if (location.hash) { | |
333 | var result = splitDelimitedHash(location.hash); |
|
333 | var result = splitDelimitedHash(location.hash); | |
334 | var line = $('html').find(result.loc); |
|
334 | var line = $('html').find(result.loc); | |
335 | if (line.length > 0){ |
|
335 | if (line.length > 0){ | |
336 | offsetScroll(line, 70); |
|
336 | offsetScroll(line, 70); | |
337 | } |
|
337 | } | |
338 | } |
|
338 | } | |
339 |
|
339 | |||
340 | // browse tree @ revision |
|
340 | // browse tree @ revision | |
341 | $('#files_link').on('click', function(e){ |
|
341 | $('#files_link').on('click', function(e){ | |
342 | window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}'; |
|
342 | window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}'; | |
343 | e.preventDefault(); |
|
343 | e.preventDefault(); | |
344 | }); |
|
344 | }); | |
345 |
|
345 | |||
346 | // inject comments into their proper positions |
|
346 | // inject comments into their proper positions | |
347 | var file_comments = $('.inline-comment-placeholder'); |
|
347 | var file_comments = $('.inline-comment-placeholder'); | |
348 | }) |
|
348 | }) | |
349 | </script> |
|
349 | </script> | |
350 |
|
350 | |||
351 | </%def> |
|
351 | </%def> |
@@ -1,672 +1,672 b'' | |||||
1 | <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/> |
|
1 | <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/> | |
2 |
|
2 | |||
3 | <%def name="diff_line_anchor(filename, line, type)"><% |
|
3 | <%def name="diff_line_anchor(filename, line, type)"><% | |
4 | return '%s_%s_%i' % (h.safeid(filename), type, line) |
|
4 | return '%s_%s_%i' % (h.safeid(filename), type, line) | |
5 | %></%def> |
|
5 | %></%def> | |
6 |
|
6 | |||
7 | <%def name="action_class(action)"> |
|
7 | <%def name="action_class(action)"> | |
8 | <% |
|
8 | <% | |
9 | return { |
|
9 | return { | |
10 | '-': 'cb-deletion', |
|
10 | '-': 'cb-deletion', | |
11 | '+': 'cb-addition', |
|
11 | '+': 'cb-addition', | |
12 | ' ': 'cb-context', |
|
12 | ' ': 'cb-context', | |
13 | }.get(action, 'cb-empty') |
|
13 | }.get(action, 'cb-empty') | |
14 | %> |
|
14 | %> | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="op_class(op_id)"> |
|
17 | <%def name="op_class(op_id)"> | |
18 | <% |
|
18 | <% | |
19 | return { |
|
19 | return { | |
20 | DEL_FILENODE: 'deletion', # file deleted |
|
20 | DEL_FILENODE: 'deletion', # file deleted | |
21 | BIN_FILENODE: 'warning' # binary diff hidden |
|
21 | BIN_FILENODE: 'warning' # binary diff hidden | |
22 | }.get(op_id, 'addition') |
|
22 | }.get(op_id, 'addition') | |
23 | %> |
|
23 | %> | |
24 | </%def> |
|
24 | </%def> | |
25 |
|
25 | |||
26 | <%def name="link_for(**kw)"> |
|
26 | <%def name="link_for(**kw)"> | |
27 | <% |
|
27 | <% | |
28 | new_args = request.GET.mixed() |
|
28 | new_args = request.GET.mixed() | |
29 | new_args.update(kw) |
|
29 | new_args.update(kw) | |
30 | return h.url('', **new_args) |
|
30 | return h.url('', **new_args) | |
31 | %> |
|
31 | %> | |
32 | </%def> |
|
32 | </%def> | |
33 |
|
33 | |||
34 | <%def name="render_diffset(diffset, commit=None, |
|
34 | <%def name="render_diffset(diffset, commit=None, | |
35 |
|
35 | |||
36 | # collapse all file diff entries when there are more than this amount of files in the diff |
|
36 | # collapse all file diff entries when there are more than this amount of files in the diff | |
37 | collapse_when_files_over=20, |
|
37 | collapse_when_files_over=20, | |
38 |
|
38 | |||
39 | # collapse lines in the diff when more than this amount of lines changed in the file diff |
|
39 | # collapse lines in the diff when more than this amount of lines changed in the file diff | |
40 | lines_changed_limit=500, |
|
40 | lines_changed_limit=500, | |
41 |
|
41 | |||
42 | # add a ruler at to the output |
|
42 | # add a ruler at to the output | |
43 | ruler_at_chars=0, |
|
43 | ruler_at_chars=0, | |
44 |
|
44 | |||
45 | # show inline comments |
|
45 | # show inline comments | |
46 | use_comments=False, |
|
46 | use_comments=False, | |
47 |
|
47 | |||
48 | # disable new comments |
|
48 | # disable new comments | |
49 | disable_new_comments=False, |
|
49 | disable_new_comments=False, | |
50 |
|
50 | |||
51 | # special file-comments that were deleted in previous versions |
|
51 | # special file-comments that were deleted in previous versions | |
52 | # it's used for showing outdated comments for deleted files in a PR |
|
52 | # it's used for showing outdated comments for deleted files in a PR | |
53 | deleted_files_comments=None |
|
53 | deleted_files_comments=None | |
54 |
|
54 | |||
55 | )"> |
|
55 | )"> | |
56 |
|
56 | |||
57 | %if use_comments: |
|
57 | %if use_comments: | |
58 | <div id="cb-comments-inline-container-template" class="js-template"> |
|
58 | <div id="cb-comments-inline-container-template" class="js-template"> | |
59 | ${inline_comments_container([])} |
|
59 | ${inline_comments_container([])} | |
60 | </div> |
|
60 | </div> | |
61 | <div class="js-template" id="cb-comment-inline-form-template"> |
|
61 | <div class="js-template" id="cb-comment-inline-form-template"> | |
62 | <div class="comment-inline-form ac"> |
|
62 | <div class="comment-inline-form ac"> | |
63 |
|
63 | |||
64 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
64 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
65 | ## render template for inline comments |
|
65 | ## render template for inline comments | |
66 | ${commentblock.comment_form(form_type='inline')} |
|
66 | ${commentblock.comment_form(form_type='inline')} | |
67 | %else: |
|
67 | %else: | |
68 | ${h.form('', class_='inline-form comment-form-login', method='get')} |
|
68 | ${h.form('', class_='inline-form comment-form-login', method='get')} | |
69 | <div class="pull-left"> |
|
69 | <div class="pull-left"> | |
70 | <div class="comment-help pull-right"> |
|
70 | <div class="comment-help pull-right"> | |
71 | ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a> |
|
71 | ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a> | |
72 | </div> |
|
72 | </div> | |
73 | </div> |
|
73 | </div> | |
74 | <div class="comment-button pull-right"> |
|
74 | <div class="comment-button pull-right"> | |
75 | <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);"> |
|
75 | <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);"> | |
76 | ${_('Cancel')} |
|
76 | ${_('Cancel')} | |
77 | </button> |
|
77 | </button> | |
78 | </div> |
|
78 | </div> | |
79 | <div class="clearfix"></div> |
|
79 | <div class="clearfix"></div> | |
80 | ${h.end_form()} |
|
80 | ${h.end_form()} | |
81 | %endif |
|
81 | %endif | |
82 | </div> |
|
82 | </div> | |
83 | </div> |
|
83 | </div> | |
84 |
|
84 | |||
85 | %endif |
|
85 | %endif | |
86 | <% |
|
86 | <% | |
87 | collapse_all = len(diffset.files) > collapse_when_files_over |
|
87 | collapse_all = len(diffset.files) > collapse_when_files_over | |
88 | %> |
|
88 | %> | |
89 |
|
89 | |||
90 | %if c.diffmode == 'sideside': |
|
90 | %if c.diffmode == 'sideside': | |
91 | <style> |
|
91 | <style> | |
92 | .wrapper { |
|
92 | .wrapper { | |
93 | max-width: 1600px !important; |
|
93 | max-width: 1600px !important; | |
94 | } |
|
94 | } | |
95 | </style> |
|
95 | </style> | |
96 | %endif |
|
96 | %endif | |
97 |
|
97 | |||
98 | %if ruler_at_chars: |
|
98 | %if ruler_at_chars: | |
99 | <style> |
|
99 | <style> | |
100 | .diff table.cb .cb-content:after { |
|
100 | .diff table.cb .cb-content:after { | |
101 | content: ""; |
|
101 | content: ""; | |
102 | border-left: 1px solid blue; |
|
102 | border-left: 1px solid blue; | |
103 | position: absolute; |
|
103 | position: absolute; | |
104 | top: 0; |
|
104 | top: 0; | |
105 | height: 18px; |
|
105 | height: 18px; | |
106 | opacity: .2; |
|
106 | opacity: .2; | |
107 | z-index: 10; |
|
107 | z-index: 10; | |
108 | //## +5 to account for diff action (+/-) |
|
108 | //## +5 to account for diff action (+/-) | |
109 | left: ${ruler_at_chars + 5}ch; |
|
109 | left: ${ruler_at_chars + 5}ch; | |
110 | </style> |
|
110 | </style> | |
111 | %endif |
|
111 | %endif | |
112 |
|
112 | |||
113 | <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}"> |
|
113 | <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}"> | |
114 | <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}"> |
|
114 | <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}"> | |
115 | %if commit: |
|
115 | %if commit: | |
116 | <div class="pull-right"> |
|
116 | <div class="pull-right"> | |
117 | <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}"> |
|
117 | <a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}"> | |
118 | ${_('Browse Files')} |
|
118 | ${_('Browse Files')} | |
119 | </a> |
|
119 | </a> | |
120 | </div> |
|
120 | </div> | |
121 | %endif |
|
121 | %endif | |
122 | <h2 class="clearinner"> |
|
122 | <h2 class="clearinner"> | |
123 | %if commit: |
|
123 | %if commit: | |
124 | <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> - |
|
124 | <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> - | |
125 | ${h.age_component(commit.date)} - |
|
125 | ${h.age_component(commit.date)} - | |
126 | %endif |
|
126 | %endif | |
127 | %if diffset.limited_diff: |
|
127 | %if diffset.limited_diff: | |
128 | ${_('The requested commit is too big and content was truncated.')} |
|
128 | ${_('The requested commit is too big and content was truncated.')} | |
129 |
|
129 | |||
130 | ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} |
|
130 | ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} | |
131 | <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
131 | <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |
132 | %else: |
|
132 | %else: | |
133 | ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', |
|
133 | ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', | |
134 | '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}} |
|
134 | '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}} | |
135 | %endif |
|
135 | %endif | |
136 |
|
136 | |||
137 | </h2> |
|
137 | </h2> | |
138 | </div> |
|
138 | </div> | |
139 |
|
139 | |||
140 | %if not diffset.files: |
|
140 | %if not diffset.files: | |
141 | <p class="empty_data">${_('No files')}</p> |
|
141 | <p class="empty_data">${_('No files')}</p> | |
142 | %endif |
|
142 | %endif | |
143 |
|
143 | |||
144 | <div class="filediffs"> |
|
144 | <div class="filediffs"> | |
145 | ## initial value could be marked as False later on |
|
145 | ## initial value could be marked as False later on | |
146 | <% over_lines_changed_limit = False %> |
|
146 | <% over_lines_changed_limit = False %> | |
147 | %for i, filediff in enumerate(diffset.files): |
|
147 | %for i, filediff in enumerate(diffset.files): | |
148 |
|
148 | |||
149 | <% |
|
149 | <% | |
150 | lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted'] |
|
150 | lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted'] | |
151 | over_lines_changed_limit = lines_changed > lines_changed_limit |
|
151 | over_lines_changed_limit = lines_changed > lines_changed_limit | |
152 | %> |
|
152 | %> | |
153 | <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox"> |
|
153 | <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox"> | |
154 | <div |
|
154 | <div | |
155 | class="filediff" |
|
155 | class="filediff" | |
156 | data-f-path="${filediff['patch']['filename']}" |
|
156 | data-f-path="${filediff['patch']['filename']}" | |
157 | id="a_${h.FID('', filediff['patch']['filename'])}"> |
|
157 | id="a_${h.FID('', filediff['patch']['filename'])}"> | |
158 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> |
|
158 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> | |
159 | <div class="filediff-collapse-indicator"></div> |
|
159 | <div class="filediff-collapse-indicator"></div> | |
160 | ${diff_ops(filediff)} |
|
160 | ${diff_ops(filediff)} | |
161 | </label> |
|
161 | </label> | |
162 | ${diff_menu(filediff, use_comments=use_comments)} |
|
162 | ${diff_menu(filediff, use_comments=use_comments)} | |
163 | <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> |
|
163 | <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> | |
164 | %if not filediff.hunks: |
|
164 | %if not filediff.hunks: | |
165 | %for op_id, op_text in filediff['patch']['stats']['ops'].items(): |
|
165 | %for op_id, op_text in filediff['patch']['stats']['ops'].items(): | |
166 | <tr> |
|
166 | <tr> | |
167 | <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}> |
|
167 | <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}> | |
168 | %if op_id == DEL_FILENODE: |
|
168 | %if op_id == DEL_FILENODE: | |
169 | ${_('File was deleted')} |
|
169 | ${_('File was deleted')} | |
170 | %elif op_id == BIN_FILENODE: |
|
170 | %elif op_id == BIN_FILENODE: | |
171 | ${_('Binary file hidden')} |
|
171 | ${_('Binary file hidden')} | |
172 | %else: |
|
172 | %else: | |
173 | ${op_text} |
|
173 | ${op_text} | |
174 | %endif |
|
174 | %endif | |
175 | </td> |
|
175 | </td> | |
176 | </tr> |
|
176 | </tr> | |
177 | %endfor |
|
177 | %endfor | |
178 | %endif |
|
178 | %endif | |
179 | %if filediff.patch['is_limited_diff']: |
|
179 | %if filediff.patch['is_limited_diff']: | |
180 | <tr class="cb-warning cb-collapser"> |
|
180 | <tr class="cb-warning cb-collapser"> | |
181 | <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}> |
|
181 | <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}> | |
182 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
182 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |
183 | </td> |
|
183 | </td> | |
184 | </tr> |
|
184 | </tr> | |
185 | %else: |
|
185 | %else: | |
186 | %if over_lines_changed_limit: |
|
186 | %if over_lines_changed_limit: | |
187 | <tr class="cb-warning cb-collapser"> |
|
187 | <tr class="cb-warning cb-collapser"> | |
188 | <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}> |
|
188 | <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}> | |
189 | ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)} |
|
189 | ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)} | |
190 | <a href="#" class="cb-expand" |
|
190 | <a href="#" class="cb-expand" | |
191 | onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')} |
|
191 | onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')} | |
192 | </a> |
|
192 | </a> | |
193 | <a href="#" class="cb-collapse" |
|
193 | <a href="#" class="cb-collapse" | |
194 | onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')} |
|
194 | onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')} | |
195 | </a> |
|
195 | </a> | |
196 | </td> |
|
196 | </td> | |
197 | </tr> |
|
197 | </tr> | |
198 | %endif |
|
198 | %endif | |
199 | %endif |
|
199 | %endif | |
200 |
|
200 | |||
201 | %for hunk in filediff.hunks: |
|
201 | %for hunk in filediff.hunks: | |
202 | <tr class="cb-hunk"> |
|
202 | <tr class="cb-hunk"> | |
203 | <td ${c.diffmode == 'unified' and 'colspan=3' or ''}> |
|
203 | <td ${c.diffmode == 'unified' and 'colspan=3' or ''}> | |
204 | ## TODO: dan: add ajax loading of more context here |
|
204 | ## TODO: dan: add ajax loading of more context here | |
205 | ## <a href="#"> |
|
205 | ## <a href="#"> | |
206 | <i class="icon-more"></i> |
|
206 | <i class="icon-more"></i> | |
207 | ## </a> |
|
207 | ## </a> | |
208 | </td> |
|
208 | </td> | |
209 | <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}> |
|
209 | <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}> | |
210 | @@ |
|
210 | @@ | |
211 | -${hunk.source_start},${hunk.source_length} |
|
211 | -${hunk.source_start},${hunk.source_length} | |
212 | +${hunk.target_start},${hunk.target_length} |
|
212 | +${hunk.target_start},${hunk.target_length} | |
213 | ${hunk.section_header} |
|
213 | ${hunk.section_header} | |
214 | </td> |
|
214 | </td> | |
215 | </tr> |
|
215 | </tr> | |
216 | %if c.diffmode == 'unified': |
|
216 | %if c.diffmode == 'unified': | |
217 | ${render_hunk_lines_unified(hunk, use_comments=use_comments)} |
|
217 | ${render_hunk_lines_unified(hunk, use_comments=use_comments)} | |
218 | %elif c.diffmode == 'sideside': |
|
218 | %elif c.diffmode == 'sideside': | |
219 | ${render_hunk_lines_sideside(hunk, use_comments=use_comments)} |
|
219 | ${render_hunk_lines_sideside(hunk, use_comments=use_comments)} | |
220 | %else: |
|
220 | %else: | |
221 | <tr class="cb-line"> |
|
221 | <tr class="cb-line"> | |
222 | <td>unknown diff mode</td> |
|
222 | <td>unknown diff mode</td> | |
223 | </tr> |
|
223 | </tr> | |
224 | %endif |
|
224 | %endif | |
225 | %endfor |
|
225 | %endfor | |
226 |
|
226 | |||
227 | ## outdated comments that do not fit into currently displayed lines |
|
227 | ## outdated comments that do not fit into currently displayed lines | |
228 | % for lineno, comments in filediff.left_comments.items(): |
|
228 | % for lineno, comments in filediff.left_comments.items(): | |
229 |
|
229 | |||
230 | %if c.diffmode == 'unified': |
|
230 | %if c.diffmode == 'unified': | |
231 | <tr class="cb-line"> |
|
231 | <tr class="cb-line"> | |
232 | <td class="cb-data cb-context"></td> |
|
232 | <td class="cb-data cb-context"></td> | |
233 | <td class="cb-lineno cb-context"></td> |
|
233 | <td class="cb-lineno cb-context"></td> | |
234 | <td class="cb-lineno cb-context"></td> |
|
234 | <td class="cb-lineno cb-context"></td> | |
235 | <td class="cb-content cb-context"> |
|
235 | <td class="cb-content cb-context"> | |
236 | ${inline_comments_container(comments)} |
|
236 | ${inline_comments_container(comments)} | |
237 | </td> |
|
237 | </td> | |
238 | </tr> |
|
238 | </tr> | |
239 | %elif c.diffmode == 'sideside': |
|
239 | %elif c.diffmode == 'sideside': | |
240 | <tr class="cb-line"> |
|
240 | <tr class="cb-line"> | |
241 | <td class="cb-data cb-context"></td> |
|
241 | <td class="cb-data cb-context"></td> | |
242 | <td class="cb-lineno cb-context"></td> |
|
242 | <td class="cb-lineno cb-context"></td> | |
243 | <td class="cb-content cb-context"></td> |
|
243 | <td class="cb-content cb-context"></td> | |
244 |
|
244 | |||
245 | <td class="cb-data cb-context"></td> |
|
245 | <td class="cb-data cb-context"></td> | |
246 | <td class="cb-lineno cb-context"></td> |
|
246 | <td class="cb-lineno cb-context"></td> | |
247 | <td class="cb-content cb-context"> |
|
247 | <td class="cb-content cb-context"> | |
248 | ${inline_comments_container(comments)} |
|
248 | ${inline_comments_container(comments)} | |
249 | </td> |
|
249 | </td> | |
250 | </tr> |
|
250 | </tr> | |
251 | %endif |
|
251 | %endif | |
252 |
|
252 | |||
253 | % endfor |
|
253 | % endfor | |
254 |
|
254 | |||
255 | </table> |
|
255 | </table> | |
256 | </div> |
|
256 | </div> | |
257 | %endfor |
|
257 | %endfor | |
258 |
|
258 | |||
259 | ## outdated comments that are made for a file that has been deleted |
|
259 | ## outdated comments that are made for a file that has been deleted | |
260 | % for filename, comments_dict in (deleted_files_comments or {}).items(): |
|
260 | % for filename, comments_dict in (deleted_files_comments or {}).items(): | |
261 |
|
261 | |||
262 | <div class="filediffs filediff-outdated" style="display: none"> |
|
262 | <div class="filediffs filediff-outdated" style="display: none"> | |
263 | <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox"> |
|
263 | <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox"> | |
264 | <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}"> |
|
264 | <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}"> | |
265 | <label for="filediff-collapse-${id(filename)}" class="filediff-heading"> |
|
265 | <label for="filediff-collapse-${id(filename)}" class="filediff-heading"> | |
266 | <div class="filediff-collapse-indicator"></div> |
|
266 | <div class="filediff-collapse-indicator"></div> | |
267 | <span class="pill"> |
|
267 | <span class="pill"> | |
268 | ## file was deleted |
|
268 | ## file was deleted | |
269 | <strong>${filename}</strong> |
|
269 | <strong>${filename}</strong> | |
270 | </span> |
|
270 | </span> | |
271 | <span class="pill-group" style="float: left"> |
|
271 | <span class="pill-group" style="float: left"> | |
272 | ## file op, doesn't need translation |
|
272 | ## file op, doesn't need translation | |
273 | <span class="pill" op="removed">removed in this version</span> |
|
273 | <span class="pill" op="removed">removed in this version</span> | |
274 | </span> |
|
274 | </span> | |
275 | <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a> |
|
275 | <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a> | |
276 | <span class="pill-group" style="float: right"> |
|
276 | <span class="pill-group" style="float: right"> | |
277 | <span class="pill" op="deleted">-${comments_dict['stats']}</span> |
|
277 | <span class="pill" op="deleted">-${comments_dict['stats']}</span> | |
278 | </span> |
|
278 | </span> | |
279 | </label> |
|
279 | </label> | |
280 |
|
280 | |||
281 | <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> |
|
281 | <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> | |
282 | <tr> |
|
282 | <tr> | |
283 | % if c.diffmode == 'unified': |
|
283 | % if c.diffmode == 'unified': | |
284 | <td></td> |
|
284 | <td></td> | |
285 | %endif |
|
285 | %endif | |
286 |
|
286 | |||
287 | <td></td> |
|
287 | <td></td> | |
288 | <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}> |
|
288 | <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}> | |
289 | ${_('File was deleted in this version, and outdated comments were made on it')} |
|
289 | ${_('File was deleted in this version, and outdated comments were made on it')} | |
290 | </td> |
|
290 | </td> | |
291 | </tr> |
|
291 | </tr> | |
292 | %if c.diffmode == 'unified': |
|
292 | %if c.diffmode == 'unified': | |
293 | <tr class="cb-line"> |
|
293 | <tr class="cb-line"> | |
294 | <td class="cb-data cb-context"></td> |
|
294 | <td class="cb-data cb-context"></td> | |
295 | <td class="cb-lineno cb-context"></td> |
|
295 | <td class="cb-lineno cb-context"></td> | |
296 | <td class="cb-lineno cb-context"></td> |
|
296 | <td class="cb-lineno cb-context"></td> | |
297 | <td class="cb-content cb-context"> |
|
297 | <td class="cb-content cb-context"> | |
298 | ${inline_comments_container(comments_dict['comments'])} |
|
298 | ${inline_comments_container(comments_dict['comments'])} | |
299 | </td> |
|
299 | </td> | |
300 | </tr> |
|
300 | </tr> | |
301 | %elif c.diffmode == 'sideside': |
|
301 | %elif c.diffmode == 'sideside': | |
302 | <tr class="cb-line"> |
|
302 | <tr class="cb-line"> | |
303 | <td class="cb-data cb-context"></td> |
|
303 | <td class="cb-data cb-context"></td> | |
304 | <td class="cb-lineno cb-context"></td> |
|
304 | <td class="cb-lineno cb-context"></td> | |
305 | <td class="cb-content cb-context"></td> |
|
305 | <td class="cb-content cb-context"></td> | |
306 |
|
306 | |||
307 | <td class="cb-data cb-context"></td> |
|
307 | <td class="cb-data cb-context"></td> | |
308 | <td class="cb-lineno cb-context"></td> |
|
308 | <td class="cb-lineno cb-context"></td> | |
309 | <td class="cb-content cb-context"> |
|
309 | <td class="cb-content cb-context"> | |
310 | ${inline_comments_container(comments_dict['comments'])} |
|
310 | ${inline_comments_container(comments_dict['comments'])} | |
311 | </td> |
|
311 | </td> | |
312 | </tr> |
|
312 | </tr> | |
313 | %endif |
|
313 | %endif | |
314 | </table> |
|
314 | </table> | |
315 | </div> |
|
315 | </div> | |
316 | </div> |
|
316 | </div> | |
317 | % endfor |
|
317 | % endfor | |
318 |
|
318 | |||
319 | </div> |
|
319 | </div> | |
320 | </div> |
|
320 | </div> | |
321 | </%def> |
|
321 | </%def> | |
322 |
|
322 | |||
323 | <%def name="diff_ops(filediff)"> |
|
323 | <%def name="diff_ops(filediff)"> | |
324 | <% |
|
324 | <% | |
325 | stats = filediff['patch']['stats'] |
|
325 | stats = filediff['patch']['stats'] | |
326 | from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ |
|
326 | from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ | |
327 | MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE |
|
327 | MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE | |
328 | %> |
|
328 | %> | |
329 | <span class="pill"> |
|
329 | <span class="pill"> | |
330 | %if filediff.source_file_path and filediff.target_file_path: |
|
330 | %if filediff.source_file_path and filediff.target_file_path: | |
331 | %if filediff.source_file_path != filediff.target_file_path: |
|
331 | %if filediff.source_file_path != filediff.target_file_path: | |
332 | ## file was renamed, or copied |
|
332 | ## file was renamed, or copied | |
333 | %if RENAMED_FILENODE in stats['ops']: |
|
333 | %if RENAMED_FILENODE in stats['ops']: | |
334 | <strong>${filediff.target_file_path}</strong> β¬ <del>${filediff.source_file_path}</del> |
|
334 | <strong>${filediff.target_file_path}</strong> β¬ <del>${filediff.source_file_path}</del> | |
335 | %elif COPIED_FILENODE in stats['ops']: |
|
335 | %elif COPIED_FILENODE in stats['ops']: | |
336 | <strong>${filediff.target_file_path}</strong> β¬ ${filediff.source_file_path} |
|
336 | <strong>${filediff.target_file_path}</strong> β¬ ${filediff.source_file_path} | |
337 | %endif |
|
337 | %endif | |
338 | %else: |
|
338 | %else: | |
339 | ## file was modified |
|
339 | ## file was modified | |
340 | <strong>${filediff.source_file_path}</strong> |
|
340 | <strong>${filediff.source_file_path}</strong> | |
341 | %endif |
|
341 | %endif | |
342 | %else: |
|
342 | %else: | |
343 | %if filediff.source_file_path: |
|
343 | %if filediff.source_file_path: | |
344 | ## file was deleted |
|
344 | ## file was deleted | |
345 | <strong>${filediff.source_file_path}</strong> |
|
345 | <strong>${filediff.source_file_path}</strong> | |
346 | %else: |
|
346 | %else: | |
347 | ## file was added |
|
347 | ## file was added | |
348 | <strong>${filediff.target_file_path}</strong> |
|
348 | <strong>${filediff.target_file_path}</strong> | |
349 | %endif |
|
349 | %endif | |
350 | %endif |
|
350 | %endif | |
351 | </span> |
|
351 | </span> | |
352 | <span class="pill-group" style="float: left"> |
|
352 | <span class="pill-group" style="float: left"> | |
353 | %if filediff.patch['is_limited_diff']: |
|
353 | %if filediff.patch['is_limited_diff']: | |
354 | <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span> |
|
354 | <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span> | |
355 | %endif |
|
355 | %endif | |
356 |
|
356 | |||
357 | %if RENAMED_FILENODE in stats['ops']: |
|
357 | %if RENAMED_FILENODE in stats['ops']: | |
358 | <span class="pill" op="renamed">renamed</span> |
|
358 | <span class="pill" op="renamed">renamed</span> | |
359 | %endif |
|
359 | %endif | |
360 |
|
360 | |||
361 | %if COPIED_FILENODE in stats['ops']: |
|
361 | %if COPIED_FILENODE in stats['ops']: | |
362 | <span class="pill" op="copied">copied</span> |
|
362 | <span class="pill" op="copied">copied</span> | |
363 | %endif |
|
363 | %endif | |
364 |
|
364 | |||
365 | %if NEW_FILENODE in stats['ops']: |
|
365 | %if NEW_FILENODE in stats['ops']: | |
366 | <span class="pill" op="created">created</span> |
|
366 | <span class="pill" op="created">created</span> | |
367 | %if filediff['target_mode'].startswith('120'): |
|
367 | %if filediff['target_mode'].startswith('120'): | |
368 | <span class="pill" op="symlink">symlink</span> |
|
368 | <span class="pill" op="symlink">symlink</span> | |
369 | %else: |
|
369 | %else: | |
370 | <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span> |
|
370 | <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span> | |
371 | %endif |
|
371 | %endif | |
372 | %endif |
|
372 | %endif | |
373 |
|
373 | |||
374 | %if DEL_FILENODE in stats['ops']: |
|
374 | %if DEL_FILENODE in stats['ops']: | |
375 | <span class="pill" op="removed">removed</span> |
|
375 | <span class="pill" op="removed">removed</span> | |
376 | %endif |
|
376 | %endif | |
377 |
|
377 | |||
378 | %if CHMOD_FILENODE in stats['ops']: |
|
378 | %if CHMOD_FILENODE in stats['ops']: | |
379 | <span class="pill" op="mode"> |
|
379 | <span class="pill" op="mode"> | |
380 | ${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])} |
|
380 | ${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])} | |
381 | </span> |
|
381 | </span> | |
382 | %endif |
|
382 | %endif | |
383 | </span> |
|
383 | </span> | |
384 |
|
384 | |||
385 | <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a> |
|
385 | <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a> | |
386 |
|
386 | |||
387 | <span class="pill-group" style="float: right"> |
|
387 | <span class="pill-group" style="float: right"> | |
388 | %if BIN_FILENODE in stats['ops']: |
|
388 | %if BIN_FILENODE in stats['ops']: | |
389 | <span class="pill" op="binary">binary</span> |
|
389 | <span class="pill" op="binary">binary</span> | |
390 | %if MOD_FILENODE in stats['ops']: |
|
390 | %if MOD_FILENODE in stats['ops']: | |
391 | <span class="pill" op="modified">modified</span> |
|
391 | <span class="pill" op="modified">modified</span> | |
392 | %endif |
|
392 | %endif | |
393 | %endif |
|
393 | %endif | |
394 | %if stats['added']: |
|
394 | %if stats['added']: | |
395 | <span class="pill" op="added">+${stats['added']}</span> |
|
395 | <span class="pill" op="added">+${stats['added']}</span> | |
396 | %endif |
|
396 | %endif | |
397 | %if stats['deleted']: |
|
397 | %if stats['deleted']: | |
398 | <span class="pill" op="deleted">-${stats['deleted']}</span> |
|
398 | <span class="pill" op="deleted">-${stats['deleted']}</span> | |
399 | %endif |
|
399 | %endif | |
400 | </span> |
|
400 | </span> | |
401 |
|
401 | |||
402 | </%def> |
|
402 | </%def> | |
403 |
|
403 | |||
404 | <%def name="nice_mode(filemode)"> |
|
404 | <%def name="nice_mode(filemode)"> | |
405 | ${filemode.startswith('100') and filemode[3:] or filemode} |
|
405 | ${filemode.startswith('100') and filemode[3:] or filemode} | |
406 | </%def> |
|
406 | </%def> | |
407 |
|
407 | |||
408 | <%def name="diff_menu(filediff, use_comments=False)"> |
|
408 | <%def name="diff_menu(filediff, use_comments=False)"> | |
409 | <div class="filediff-menu"> |
|
409 | <div class="filediff-menu"> | |
410 | %if filediff.diffset.source_ref: |
|
410 | %if filediff.diffset.source_ref: | |
411 | %if filediff.patch['operation'] in ['D', 'M']: |
|
411 | %if filediff.patch['operation'] in ['D', 'M']: | |
412 | <a |
|
412 | <a | |
413 | class="tooltip" |
|
413 | class="tooltip" | |
414 | href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}" |
|
414 | href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}" | |
415 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
415 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" | |
416 | > |
|
416 | > | |
417 | ${_('Show file before')} |
|
417 | ${_('Show file before')} | |
418 | </a> | |
|
418 | </a> | | |
419 | %else: |
|
419 | %else: | |
420 | <span |
|
420 | <span | |
421 | class="tooltip" |
|
421 | class="tooltip" | |
422 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
422 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" | |
423 | > |
|
423 | > | |
424 | ${_('Show file before')} |
|
424 | ${_('Show file before')} | |
425 | </span> | |
|
425 | </span> | | |
426 | %endif |
|
426 | %endif | |
427 | %if filediff.patch['operation'] in ['A', 'M']: |
|
427 | %if filediff.patch['operation'] in ['A', 'M']: | |
428 | <a |
|
428 | <a | |
429 | class="tooltip" |
|
429 | class="tooltip" | |
430 | href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}" |
|
430 | href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}" | |
431 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
431 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" | |
432 | > |
|
432 | > | |
433 | ${_('Show file after')} |
|
433 | ${_('Show file after')} | |
434 | </a> | |
|
434 | </a> | | |
435 | %else: |
|
435 | %else: | |
436 | <span |
|
436 | <span | |
437 | class="tooltip" |
|
437 | class="tooltip" | |
438 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
438 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" | |
439 | > |
|
439 | > | |
440 | ${_('Show file after')} |
|
440 | ${_('Show file after')} | |
441 | </span> | |
|
441 | </span> | | |
442 | %endif |
|
442 | %endif | |
443 | <a |
|
443 | <a | |
444 | class="tooltip" |
|
444 | class="tooltip" | |
445 | title="${h.tooltip(_('Raw diff'))}" |
|
445 | title="${h.tooltip(_('Raw diff'))}" | |
446 | href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}" |
|
446 | href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}" | |
447 | > |
|
447 | > | |
448 | ${_('Raw diff')} |
|
448 | ${_('Raw diff')} | |
449 | </a> | |
|
449 | </a> | | |
450 | <a |
|
450 | <a | |
451 | class="tooltip" |
|
451 | class="tooltip" | |
452 | title="${h.tooltip(_('Download diff'))}" |
|
452 | title="${h.tooltip(_('Download diff'))}" | |
453 | href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}" |
|
453 | href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}" | |
454 | > |
|
454 | > | |
455 | ${_('Download diff')} |
|
455 | ${_('Download diff')} | |
456 | </a> |
|
456 | </a> | |
457 | % if use_comments: |
|
457 | % if use_comments: | |
458 | | |
|
458 | | | |
459 | % endif |
|
459 | % endif | |
460 |
|
460 | |||
461 | ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks) |
|
461 | ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks) | |
462 | %if hasattr(c, 'ignorews_url'): |
|
462 | %if hasattr(c, 'ignorews_url'): | |
463 | ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))} |
|
463 | ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))} | |
464 | %endif |
|
464 | %endif | |
465 | %if hasattr(c, 'context_url'): |
|
465 | %if hasattr(c, 'context_url'): | |
466 | ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))} |
|
466 | ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))} | |
467 | %endif |
|
467 | %endif | |
468 |
|
468 | |||
469 | %if use_comments: |
|
469 | %if use_comments: | |
470 | <a href="#" onclick="return Rhodecode.comments.toggleComments(this);"> |
|
470 | <a href="#" onclick="return Rhodecode.comments.toggleComments(this);"> | |
471 | <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span> |
|
471 | <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span> | |
472 | </a> |
|
472 | </a> | |
473 | %endif |
|
473 | %endif | |
474 | %endif |
|
474 | %endif | |
475 | </div> |
|
475 | </div> | |
476 | </%def> |
|
476 | </%def> | |
477 |
|
477 | |||
478 |
|
478 | |||
479 | <%def name="inline_comments_container(comments)"> |
|
479 | <%def name="inline_comments_container(comments)"> | |
480 | <div class="inline-comments"> |
|
480 | <div class="inline-comments"> | |
481 | %for comment in comments: |
|
481 | %for comment in comments: | |
482 | ${commentblock.comment_block(comment, inline=True)} |
|
482 | ${commentblock.comment_block(comment, inline=True)} | |
483 | %endfor |
|
483 | %endfor | |
484 |
|
484 | |||
485 | % if comments and comments[-1].outdated: |
|
485 | % if comments and comments[-1].outdated: | |
486 | <span class="btn btn-secondary cb-comment-add-button comment-outdated}" |
|
486 | <span class="btn btn-secondary cb-comment-add-button comment-outdated}" | |
487 | style="display: none;}"> |
|
487 | style="display: none;}"> | |
488 | ${_('Add another comment')} |
|
488 | ${_('Add another comment')} | |
489 | </span> |
|
489 | </span> | |
490 | % else: |
|
490 | % else: | |
491 | <span onclick="return Rhodecode.comments.createComment(this)" |
|
491 | <span onclick="return Rhodecode.comments.createComment(this)" | |
492 | class="btn btn-secondary cb-comment-add-button"> |
|
492 | class="btn btn-secondary cb-comment-add-button"> | |
493 | ${_('Add another comment')} |
|
493 | ${_('Add another comment')} | |
494 | </span> |
|
494 | </span> | |
495 | % endif |
|
495 | % endif | |
496 |
|
496 | |||
497 | </div> |
|
497 | </div> | |
498 | </%def> |
|
498 | </%def> | |
499 |
|
499 | |||
500 |
|
500 | |||
501 | <%def name="render_hunk_lines_sideside(hunk, use_comments=False)"> |
|
501 | <%def name="render_hunk_lines_sideside(hunk, use_comments=False)"> | |
502 | %for i, line in enumerate(hunk.sideside): |
|
502 | %for i, line in enumerate(hunk.sideside): | |
503 | <% |
|
503 | <% | |
504 | old_line_anchor, new_line_anchor = None, None |
|
504 | old_line_anchor, new_line_anchor = None, None | |
505 | if line.original.lineno: |
|
505 | if line.original.lineno: | |
506 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o') |
|
506 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o') | |
507 | if line.modified.lineno: |
|
507 | if line.modified.lineno: | |
508 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n') |
|
508 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n') | |
509 | %> |
|
509 | %> | |
510 |
|
510 | |||
511 | <tr class="cb-line"> |
|
511 | <tr class="cb-line"> | |
512 | <td class="cb-data ${action_class(line.original.action)}" |
|
512 | <td class="cb-data ${action_class(line.original.action)}" | |
513 | data-line-number="${line.original.lineno}" |
|
513 | data-line-number="${line.original.lineno}" | |
514 | > |
|
514 | > | |
515 | <div> |
|
515 | <div> | |
516 | %if line.original.comments: |
|
516 | %if line.original.comments: | |
517 | <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
517 | <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> | |
518 | %endif |
|
518 | %endif | |
519 | </div> |
|
519 | </div> | |
520 | </td> |
|
520 | </td> | |
521 | <td class="cb-lineno ${action_class(line.original.action)}" |
|
521 | <td class="cb-lineno ${action_class(line.original.action)}" | |
522 | data-line-number="${line.original.lineno}" |
|
522 | data-line-number="${line.original.lineno}" | |
523 | %if old_line_anchor: |
|
523 | %if old_line_anchor: | |
524 | id="${old_line_anchor}" |
|
524 | id="${old_line_anchor}" | |
525 | %endif |
|
525 | %endif | |
526 | > |
|
526 | > | |
527 | %if line.original.lineno: |
|
527 | %if line.original.lineno: | |
528 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a> |
|
528 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a> | |
529 | %endif |
|
529 | %endif | |
530 | </td> |
|
530 | </td> | |
531 | <td class="cb-content ${action_class(line.original.action)}" |
|
531 | <td class="cb-content ${action_class(line.original.action)}" | |
532 | data-line-number="o${line.original.lineno}" |
|
532 | data-line-number="o${line.original.lineno}" | |
533 | > |
|
533 | > | |
534 | %if use_comments and line.original.lineno: |
|
534 | %if use_comments and line.original.lineno: | |
535 | ${render_add_comment_button()} |
|
535 | ${render_add_comment_button()} | |
536 | %endif |
|
536 | %endif | |
537 | <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span> |
|
537 | <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span> | |
538 | %if use_comments and line.original.lineno and line.original.comments: |
|
538 | %if use_comments and line.original.lineno and line.original.comments: | |
539 | ${inline_comments_container(line.original.comments)} |
|
539 | ${inline_comments_container(line.original.comments)} | |
540 | %endif |
|
540 | %endif | |
541 | </td> |
|
541 | </td> | |
542 | <td class="cb-data ${action_class(line.modified.action)}" |
|
542 | <td class="cb-data ${action_class(line.modified.action)}" | |
543 | data-line-number="${line.modified.lineno}" |
|
543 | data-line-number="${line.modified.lineno}" | |
544 | > |
|
544 | > | |
545 | <div> |
|
545 | <div> | |
546 | %if line.modified.comments: |
|
546 | %if line.modified.comments: | |
547 | <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
547 | <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> | |
548 | %endif |
|
548 | %endif | |
549 | </div> |
|
549 | </div> | |
550 | </td> |
|
550 | </td> | |
551 | <td class="cb-lineno ${action_class(line.modified.action)}" |
|
551 | <td class="cb-lineno ${action_class(line.modified.action)}" | |
552 | data-line-number="${line.modified.lineno}" |
|
552 | data-line-number="${line.modified.lineno}" | |
553 | %if new_line_anchor: |
|
553 | %if new_line_anchor: | |
554 | id="${new_line_anchor}" |
|
554 | id="${new_line_anchor}" | |
555 | %endif |
|
555 | %endif | |
556 | > |
|
556 | > | |
557 | %if line.modified.lineno: |
|
557 | %if line.modified.lineno: | |
558 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a> |
|
558 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a> | |
559 | %endif |
|
559 | %endif | |
560 | </td> |
|
560 | </td> | |
561 | <td class="cb-content ${action_class(line.modified.action)}" |
|
561 | <td class="cb-content ${action_class(line.modified.action)}" | |
562 | data-line-number="n${line.modified.lineno}" |
|
562 | data-line-number="n${line.modified.lineno}" | |
563 | > |
|
563 | > | |
564 | %if use_comments and line.modified.lineno: |
|
564 | %if use_comments and line.modified.lineno: | |
565 | ${render_add_comment_button()} |
|
565 | ${render_add_comment_button()} | |
566 | %endif |
|
566 | %endif | |
567 | <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span> |
|
567 | <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span> | |
568 | %if use_comments and line.modified.lineno and line.modified.comments: |
|
568 | %if use_comments and line.modified.lineno and line.modified.comments: | |
569 | ${inline_comments_container(line.modified.comments)} |
|
569 | ${inline_comments_container(line.modified.comments)} | |
570 | %endif |
|
570 | %endif | |
571 | </td> |
|
571 | </td> | |
572 | </tr> |
|
572 | </tr> | |
573 | %endfor |
|
573 | %endfor | |
574 | </%def> |
|
574 | </%def> | |
575 |
|
575 | |||
576 |
|
576 | |||
577 | <%def name="render_hunk_lines_unified(hunk, use_comments=False)"> |
|
577 | <%def name="render_hunk_lines_unified(hunk, use_comments=False)"> | |
578 | %for old_line_no, new_line_no, action, content, comments in hunk.unified: |
|
578 | %for old_line_no, new_line_no, action, content, comments in hunk.unified: | |
579 | <% |
|
579 | <% | |
580 | old_line_anchor, new_line_anchor = None, None |
|
580 | old_line_anchor, new_line_anchor = None, None | |
581 | if old_line_no: |
|
581 | if old_line_no: | |
582 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o') |
|
582 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o') | |
583 | if new_line_no: |
|
583 | if new_line_no: | |
584 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n') |
|
584 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n') | |
585 | %> |
|
585 | %> | |
586 | <tr class="cb-line"> |
|
586 | <tr class="cb-line"> | |
587 | <td class="cb-data ${action_class(action)}"> |
|
587 | <td class="cb-data ${action_class(action)}"> | |
588 | <div> |
|
588 | <div> | |
589 | %if comments: |
|
589 | %if comments: | |
590 | <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
590 | <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> | |
591 | %endif |
|
591 | %endif | |
592 | </div> |
|
592 | </div> | |
593 | </td> |
|
593 | </td> | |
594 | <td class="cb-lineno ${action_class(action)}" |
|
594 | <td class="cb-lineno ${action_class(action)}" | |
595 | data-line-number="${old_line_no}" |
|
595 | data-line-number="${old_line_no}" | |
596 | %if old_line_anchor: |
|
596 | %if old_line_anchor: | |
597 | id="${old_line_anchor}" |
|
597 | id="${old_line_anchor}" | |
598 | %endif |
|
598 | %endif | |
599 | > |
|
599 | > | |
600 | %if old_line_anchor: |
|
600 | %if old_line_anchor: | |
601 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a> |
|
601 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a> | |
602 | %endif |
|
602 | %endif | |
603 | </td> |
|
603 | </td> | |
604 | <td class="cb-lineno ${action_class(action)}" |
|
604 | <td class="cb-lineno ${action_class(action)}" | |
605 | data-line-number="${new_line_no}" |
|
605 | data-line-number="${new_line_no}" | |
606 | %if new_line_anchor: |
|
606 | %if new_line_anchor: | |
607 | id="${new_line_anchor}" |
|
607 | id="${new_line_anchor}" | |
608 | %endif |
|
608 | %endif | |
609 | > |
|
609 | > | |
610 | %if new_line_anchor: |
|
610 | %if new_line_anchor: | |
611 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a> |
|
611 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a> | |
612 | %endif |
|
612 | %endif | |
613 | </td> |
|
613 | </td> | |
614 | <td class="cb-content ${action_class(action)}" |
|
614 | <td class="cb-content ${action_class(action)}" | |
615 | data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}" |
|
615 | data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}" | |
616 | > |
|
616 | > | |
617 | %if use_comments: |
|
617 | %if use_comments: | |
618 | ${render_add_comment_button()} |
|
618 | ${render_add_comment_button()} | |
619 | %endif |
|
619 | %endif | |
620 | <span class="cb-code">${action} ${content or '' | n}</span> |
|
620 | <span class="cb-code">${action} ${content or '' | n}</span> | |
621 | %if use_comments and comments: |
|
621 | %if use_comments and comments: | |
622 | ${inline_comments_container(comments)} |
|
622 | ${inline_comments_container(comments)} | |
623 | %endif |
|
623 | %endif | |
624 | </td> |
|
624 | </td> | |
625 | </tr> |
|
625 | </tr> | |
626 | %endfor |
|
626 | %endfor | |
627 | </%def> |
|
627 | </%def> | |
628 |
|
628 | |||
629 | <%def name="render_add_comment_button()"> |
|
629 | <%def name="render_add_comment_button()"> | |
630 | <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)"> |
|
630 | <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)"> | |
631 | <span><i class="icon-comment"></i></span> |
|
631 | <span><i class="icon-comment"></i></span> | |
632 | </button> |
|
632 | </button> | |
633 | </%def> |
|
633 | </%def> | |
634 |
|
634 | |||
635 | <%def name="render_diffset_menu()"> |
|
635 | <%def name="render_diffset_menu()"> | |
636 |
|
636 | |||
637 | <div class="diffset-menu clearinner"> |
|
637 | <div class="diffset-menu clearinner"> | |
638 | <div class="pull-right"> |
|
638 | <div class="pull-right"> | |
639 | <div class="btn-group"> |
|
639 | <div class="btn-group"> | |
640 |
|
640 | |||
641 | <a |
|
641 | <a | |
642 | class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip" |
|
642 | class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip" | |
643 | title="${_('View side by side')}" |
|
643 | title="${h.tooltip(_('View side by side'))}" | |
644 | href="${h.url_replace(diffmode='sideside')}"> |
|
644 | href="${h.url_replace(diffmode='sideside')}"> | |
645 | <span>${_('Side by Side')}</span> |
|
645 | <span>${_('Side by Side')}</span> | |
646 | </a> |
|
646 | </a> | |
647 | <a |
|
647 | <a | |
648 | class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip" |
|
648 | class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip" | |
649 | title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}"> |
|
649 | title="${h.tooltip(_('View unified'))}" href="${h.url_replace(diffmode='unified')}"> | |
650 | <span>${_('Unified')}</span> |
|
650 | <span>${_('Unified')}</span> | |
651 | </a> |
|
651 | </a> | |
652 | </div> |
|
652 | </div> | |
653 | </div> |
|
653 | </div> | |
654 |
|
654 | |||
655 | <div class="pull-left"> |
|
655 | <div class="pull-left"> | |
656 | <div class="btn-group"> |
|
656 | <div class="btn-group"> | |
657 | <a |
|
657 | <a | |
658 | class="btn" |
|
658 | class="btn" | |
659 | href="#" |
|
659 | href="#" | |
660 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a> |
|
660 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a> | |
661 | <a |
|
661 | <a | |
662 | class="btn" |
|
662 | class="btn" | |
663 | href="#" |
|
663 | href="#" | |
664 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a> |
|
664 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a> | |
665 | <a |
|
665 | <a | |
666 | class="btn" |
|
666 | class="btn" | |
667 | href="#" |
|
667 | href="#" | |
668 | onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a> |
|
668 | onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a> | |
669 | </div> |
|
669 | </div> | |
670 | </div> |
|
670 | </div> | |
671 | </div> |
|
671 | </div> | |
672 | </%def> |
|
672 | </%def> |
@@ -1,90 +1,91 b'' | |||||
1 | <%def name="render_line(line_num, tokens, |
|
1 | <%def name="render_line(line_num, tokens, | |
2 | annotation=None, |
|
2 | annotation=None, | |
3 | bgcolor=None, show_annotation=None)"> |
|
3 | bgcolor=None, show_annotation=None)"> | |
4 | <% |
|
4 | <% | |
5 | from rhodecode.lib.codeblocks import render_tokenstream |
|
5 | from rhodecode.lib.codeblocks import render_tokenstream | |
6 | # avoid module lookup for performance |
|
6 | # avoid module lookup for performance | |
7 | html_escape = h.html_escape |
|
7 | html_escape = h.html_escape | |
|
8 | tooltip = h.tooltip | |||
8 | %> |
|
9 | %> | |
9 | <tr class="cb-line cb-line-fresh ${'cb-annotate' if show_annotation else ''}" |
|
10 | <tr class="cb-line cb-line-fresh ${'cb-annotate' if show_annotation else ''}" | |
10 | %if annotation: |
|
11 | %if annotation: | |
11 | data-revision="${annotation.revision}" |
|
12 | data-revision="${annotation.revision}" | |
12 | %endif |
|
13 | %endif | |
13 | > |
|
14 | > | |
14 |
|
15 | |||
15 | % if annotation: |
|
16 | % if annotation: | |
16 | % if show_annotation: |
|
17 | % if show_annotation: | |
17 | <td class="cb-annotate-info tooltip" |
|
18 | <td class="cb-annotate-info tooltip" | |
18 | title="Author: ${annotation.author | entity}<br>Date: ${annotation.date}<br>Message: ${annotation.message | entity}" |
|
19 | title="Author: ${tooltip(annotation.author) | entity}<br>Date: ${annotation.date}<br>Message: ${annotation.message | entity}" | |
19 | > |
|
20 | > | |
20 | ${h.gravatar_with_user(annotation.author, 16) | n} |
|
21 | ${h.gravatar_with_user(annotation.author, 16) | n} | |
21 | <div class="cb-annotate-message truncate-wrap">${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}</div> |
|
22 | <div class="cb-annotate-message truncate-wrap">${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}</div> | |
22 | </td> |
|
23 | </td> | |
23 | <td class="cb-annotate-message-spacer"> |
|
24 | <td class="cb-annotate-message-spacer"> | |
24 | <a class="tooltip" href="#show-previous-annotation" onclick="return annotationController.previousAnnotation('${annotation.raw_id}', '${c.f_path}')" title="${_('view annotation from before this change')}"> |
|
25 | <a class="tooltip" href="#show-previous-annotation" onclick="return annotationController.previousAnnotation('${annotation.raw_id}', '${c.f_path}')" title="${tooltip(_('view annotation from before this change'))}"> | |
25 | <i class="icon-left"></i> |
|
26 | <i class="icon-left"></i> | |
26 | </a> |
|
27 | </a> | |
27 | </td> |
|
28 | </td> | |
28 | <td |
|
29 | <td | |
29 | class="cb-annotate-revision" |
|
30 | class="cb-annotate-revision" | |
30 | data-revision="${annotation.revision}" |
|
31 | data-revision="${annotation.revision}" | |
31 | onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')" |
|
32 | onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')" | |
32 | style="background: ${bgcolor}"> |
|
33 | style="background: ${bgcolor}"> | |
33 | <a class="cb-annotate" href="${h.url('changeset_home',repo_name=c.repo_name,revision=annotation.raw_id)}"> |
|
34 | <a class="cb-annotate" href="${h.url('changeset_home',repo_name=c.repo_name,revision=annotation.raw_id)}"> | |
34 | r${annotation.revision} |
|
35 | r${annotation.revision} | |
35 | </a> |
|
36 | </a> | |
36 | </td> |
|
37 | </td> | |
37 | % else: |
|
38 | % else: | |
38 | <td></td> |
|
39 | <td></td> | |
39 | <td class="cb-annotate-message-spacer"></td> |
|
40 | <td class="cb-annotate-message-spacer"></td> | |
40 | <td |
|
41 | <td | |
41 | class="cb-annotate-revision" |
|
42 | class="cb-annotate-revision" | |
42 | data-revision="${annotation.revision}" |
|
43 | data-revision="${annotation.revision}" | |
43 | onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')" |
|
44 | onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')" | |
44 | style="background: ${bgcolor}"> |
|
45 | style="background: ${bgcolor}"> | |
45 | </td> |
|
46 | </td> | |
46 | % endif |
|
47 | % endif | |
47 | % else: |
|
48 | % else: | |
48 | <td colspan="3"></td> |
|
49 | <td colspan="3"></td> | |
49 | % endif |
|
50 | % endif | |
50 |
|
51 | |||
51 |
|
52 | |||
52 | <td class="cb-lineno" id="L${line_num}"> |
|
53 | <td class="cb-lineno" id="L${line_num}"> | |
53 | <a data-line-no="${line_num}" href="#L${line_num}"></a> |
|
54 | <a data-line-no="${line_num}" href="#L${line_num}"></a> | |
54 | </td> |
|
55 | </td> | |
55 | <td class="cb-content cb-content-fresh" |
|
56 | <td class="cb-content cb-content-fresh" | |
56 | %if bgcolor: |
|
57 | %if bgcolor: | |
57 | style="background: ${bgcolor}" |
|
58 | style="background: ${bgcolor}" | |
58 | %endif |
|
59 | %endif | |
59 | > |
|
60 | > | |
60 | ## newline at end is necessary for highlight to work when line is empty |
|
61 | ## newline at end is necessary for highlight to work when line is empty | |
61 | ## and for copy pasting code to work as expected |
|
62 | ## and for copy pasting code to work as expected | |
62 | <span class="cb-code">${render_tokenstream(tokens)|n}${'\n'}</span> |
|
63 | <span class="cb-code">${render_tokenstream(tokens)|n}${'\n'}</span> | |
63 | </td> |
|
64 | </td> | |
64 | </tr> |
|
65 | </tr> | |
65 | </%def> |
|
66 | </%def> | |
66 |
|
67 | |||
67 | <%def name="render_annotation_lines(annotation, lines, color_hasher)"> |
|
68 | <%def name="render_annotation_lines(annotation, lines, color_hasher)"> | |
68 | % for line_num, tokens in lines: |
|
69 | % for line_num, tokens in lines: | |
69 | ${render_line(line_num, tokens, |
|
70 | ${render_line(line_num, tokens, | |
70 | bgcolor=color_hasher(annotation and annotation.raw_id or ''), |
|
71 | bgcolor=color_hasher(annotation and annotation.raw_id or ''), | |
71 | annotation=annotation, show_annotation=loop.first |
|
72 | annotation=annotation, show_annotation=loop.first | |
72 | )} |
|
73 | )} | |
73 | % endfor |
|
74 | % endfor | |
74 | <script> |
|
75 | <script> | |
75 | var AnnotationController = function() { |
|
76 | var AnnotationController = function() { | |
76 | var self = this; |
|
77 | var self = this; | |
77 |
|
78 | |||
78 | this.previousAnnotation = function(commitId, fPath) { |
|
79 | this.previousAnnotation = function(commitId, fPath) { | |
79 | var params = { |
|
80 | var params = { | |
80 | 'repo_name': templateContext.repo_name, |
|
81 | 'repo_name': templateContext.repo_name, | |
81 | 'revision': commitId, |
|
82 | 'revision': commitId, | |
82 | 'f_path': fPath |
|
83 | 'f_path': fPath | |
83 | }; |
|
84 | }; | |
84 | window.location = pyroutes.url('files_annotate_previous', params); |
|
85 | window.location = pyroutes.url('files_annotate_previous', params); | |
85 | return false; |
|
86 | return false; | |
86 | }; |
|
87 | }; | |
87 | }; |
|
88 | }; | |
88 | var annotationController = new AnnotationController(); |
|
89 | var annotationController = new AnnotationController(); | |
89 | </script> |
|
90 | </script> | |
90 | </%def> |
|
91 | </%def> |
@@ -1,317 +1,317 b'' | |||||
1 | ## DATA TABLE RE USABLE ELEMENTS |
|
1 | ## DATA TABLE RE USABLE ELEMENTS | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
3 | ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/> | |
4 | <%namespace name="base" file="/base/base.mako"/> |
|
4 | <%namespace name="base" file="/base/base.mako"/> | |
5 |
|
5 | |||
6 | ## REPOSITORY RENDERERS |
|
6 | ## REPOSITORY RENDERERS | |
7 | <%def name="quick_menu(repo_name)"> |
|
7 | <%def name="quick_menu(repo_name)"> | |
8 | <i class="pointer icon-more"></i> |
|
8 | <i class="pointer icon-more"></i> | |
9 | <div class="menu_items_container hidden"> |
|
9 | <div class="menu_items_container hidden"> | |
10 | <ul class="menu_items"> |
|
10 | <ul class="menu_items"> | |
11 | <li> |
|
11 | <li> | |
12 | <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}"> |
|
12 | <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}"> | |
13 | <span>${_('Summary')}</span> |
|
13 | <span>${_('Summary')}</span> | |
14 | </a> |
|
14 | </a> | |
15 | </li> |
|
15 | </li> | |
16 | <li> |
|
16 | <li> | |
17 | <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=repo_name)}"> |
|
17 | <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=repo_name)}"> | |
18 | <span>${_('Changelog')}</span> |
|
18 | <span>${_('Changelog')}</span> | |
19 | </a> |
|
19 | </a> | |
20 | </li> |
|
20 | </li> | |
21 | <li> |
|
21 | <li> | |
22 | <a title="${_('Files')}" href="${h.url('files_home',repo_name=repo_name)}"> |
|
22 | <a title="${_('Files')}" href="${h.url('files_home',repo_name=repo_name)}"> | |
23 | <span>${_('Files')}</span> |
|
23 | <span>${_('Files')}</span> | |
24 | </a> |
|
24 | </a> | |
25 | </li> |
|
25 | </li> | |
26 | <li> |
|
26 | <li> | |
27 | <a title="${_('Fork')}" href="${h.url('repo_fork_home',repo_name=repo_name)}"> |
|
27 | <a title="${_('Fork')}" href="${h.url('repo_fork_home',repo_name=repo_name)}"> | |
28 | <span>${_('Fork')}</span> |
|
28 | <span>${_('Fork')}</span> | |
29 | </a> |
|
29 | </a> | |
30 | </li> |
|
30 | </li> | |
31 | </ul> |
|
31 | </ul> | |
32 | </div> |
|
32 | </div> | |
33 | </%def> |
|
33 | </%def> | |
34 |
|
34 | |||
35 | <%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)"> |
|
35 | <%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)"> | |
36 | <% |
|
36 | <% | |
37 | def get_name(name,short_name=short_name): |
|
37 | def get_name(name,short_name=short_name): | |
38 | if short_name: |
|
38 | if short_name: | |
39 | return name.split('/')[-1] |
|
39 | return name.split('/')[-1] | |
40 | else: |
|
40 | else: | |
41 | return name |
|
41 | return name | |
42 | %> |
|
42 | %> | |
43 | <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate"> |
|
43 | <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate"> | |
44 | ##NAME |
|
44 | ##NAME | |
45 | <a href="${h.route_path('edit_repo',repo_name=name) if admin else h.route_path('repo_summary',repo_name=name)}"> |
|
45 | <a href="${h.route_path('edit_repo',repo_name=name) if admin else h.route_path('repo_summary',repo_name=name)}"> | |
46 |
|
46 | |||
47 | ##TYPE OF REPO |
|
47 | ##TYPE OF REPO | |
48 | %if h.is_hg(rtype): |
|
48 | %if h.is_hg(rtype): | |
49 | <span title="${_('Mercurial repository')}"><i class="icon-hg"></i></span> |
|
49 | <span title="${_('Mercurial repository')}"><i class="icon-hg"></i></span> | |
50 | %elif h.is_git(rtype): |
|
50 | %elif h.is_git(rtype): | |
51 | <span title="${_('Git repository')}"><i class="icon-git"></i></span> |
|
51 | <span title="${_('Git repository')}"><i class="icon-git"></i></span> | |
52 | %elif h.is_svn(rtype): |
|
52 | %elif h.is_svn(rtype): | |
53 | <span title="${_('Subversion repository')}"><i class="icon-svn"></i></span> |
|
53 | <span title="${_('Subversion repository')}"><i class="icon-svn"></i></span> | |
54 | %endif |
|
54 | %endif | |
55 |
|
55 | |||
56 | ##PRIVATE/PUBLIC |
|
56 | ##PRIVATE/PUBLIC | |
57 | %if private and c.visual.show_private_icon: |
|
57 | %if private and c.visual.show_private_icon: | |
58 | <i class="icon-lock" title="${_('Private repository')}"></i> |
|
58 | <i class="icon-lock" title="${_('Private repository')}"></i> | |
59 | %elif not private and c.visual.show_public_icon: |
|
59 | %elif not private and c.visual.show_public_icon: | |
60 | <i class="icon-unlock-alt" title="${_('Public repository')}"></i> |
|
60 | <i class="icon-unlock-alt" title="${_('Public repository')}"></i> | |
61 | %else: |
|
61 | %else: | |
62 | <span></span> |
|
62 | <span></span> | |
63 | %endif |
|
63 | %endif | |
64 | ${get_name(name)} |
|
64 | ${get_name(name)} | |
65 | </a> |
|
65 | </a> | |
66 | %if fork_of: |
|
66 | %if fork_of: | |
67 | <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a> |
|
67 | <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a> | |
68 | %endif |
|
68 | %endif | |
69 | %if rstate == 'repo_state_pending': |
|
69 | %if rstate == 'repo_state_pending': | |
70 | <i class="icon-cogs" title="${_('Repository creating in progress...')}"></i> |
|
70 | <i class="icon-cogs" title="${_('Repository creating in progress...')}"></i> | |
71 | %endif |
|
71 | %endif | |
72 | </div> |
|
72 | </div> | |
73 | </%def> |
|
73 | </%def> | |
74 |
|
74 | |||
75 | <%def name="repo_desc(description)"> |
|
75 | <%def name="repo_desc(description)"> | |
76 | <div class="truncate-wrap">${description}</div> |
|
76 | <div class="truncate-wrap">${description}</div> | |
77 | </%def> |
|
77 | </%def> | |
78 |
|
78 | |||
79 | <%def name="last_change(last_change)"> |
|
79 | <%def name="last_change(last_change)"> | |
80 | ${h.age_component(last_change)} |
|
80 | ${h.age_component(last_change)} | |
81 | </%def> |
|
81 | </%def> | |
82 |
|
82 | |||
83 | <%def name="revision(name,rev,tip,author,last_msg)"> |
|
83 | <%def name="revision(name,rev,tip,author,last_msg)"> | |
84 | <div> |
|
84 | <div> | |
85 | %if rev >= 0: |
|
85 | %if rev >= 0: | |
86 | <code><a title="${h.tooltip('%s:\n\n%s' % (author,last_msg))}" class="tooltip" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></code> |
|
86 | <code><a title="${h.tooltip('%s:\n\n%s' % (author,last_msg))}" class="tooltip" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></code> | |
87 | %else: |
|
87 | %else: | |
88 | ${_('No commits yet')} |
|
88 | ${_('No commits yet')} | |
89 | %endif |
|
89 | %endif | |
90 | </div> |
|
90 | </div> | |
91 | </%def> |
|
91 | </%def> | |
92 |
|
92 | |||
93 | <%def name="rss(name)"> |
|
93 | <%def name="rss(name)"> | |
94 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
94 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
95 | <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name,auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a> |
|
95 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.url('rss_feed_home',repo_name=name,auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a> | |
96 | %else: |
|
96 | %else: | |
97 | <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
97 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.url('rss_feed_home',repo_name=name)}"><i class="icon-rss-sign"></i></a> | |
98 | %endif |
|
98 | %endif | |
99 | </%def> |
|
99 | </%def> | |
100 |
|
100 | |||
101 | <%def name="atom(name)"> |
|
101 | <%def name="atom(name)"> | |
102 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
102 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
103 | <a title="${_('Subscribe to %s atom feed')% name}" href="${h.url('atom_feed_home',repo_name=name,auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a> |
|
103 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.url('atom_feed_home',repo_name=name,auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a> | |
104 | %else: |
|
104 | %else: | |
105 | <a title="${_('Subscribe to %s atom feed')% name}" href="${h.url('atom_feed_home',repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
105 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.url('atom_feed_home',repo_name=name)}"><i class="icon-rss-sign"></i></a> | |
106 | %endif |
|
106 | %endif | |
107 | </%def> |
|
107 | </%def> | |
108 |
|
108 | |||
109 | <%def name="user_gravatar(email, size=16)"> |
|
109 | <%def name="user_gravatar(email, size=16)"> | |
110 | <div class="rc-user tooltip" title="${h.author_string(email)}"> |
|
110 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
111 | ${base.gravatar(email, 16)} |
|
111 | ${base.gravatar(email, 16)} | |
112 | </div> |
|
112 | </div> | |
113 | </%def> |
|
113 | </%def> | |
114 |
|
114 | |||
115 | <%def name="repo_actions(repo_name, super_user=True)"> |
|
115 | <%def name="repo_actions(repo_name, super_user=True)"> | |
116 | <div> |
|
116 | <div> | |
117 | <div class="grid_edit"> |
|
117 | <div class="grid_edit"> | |
118 | <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}"> |
|
118 | <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}"> | |
119 | <i class="icon-pencil"></i>Edit</a> |
|
119 | <i class="icon-pencil"></i>Edit</a> | |
120 | </div> |
|
120 | </div> | |
121 | <div class="grid_delete"> |
|
121 | <div class="grid_delete"> | |
122 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), method='POST')} |
|
122 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), method='POST')} | |
123 | ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger", |
|
123 | ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger", | |
124 | onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} |
|
124 | onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} | |
125 | ${h.end_form()} |
|
125 | ${h.end_form()} | |
126 | </div> |
|
126 | </div> | |
127 | </div> |
|
127 | </div> | |
128 | </%def> |
|
128 | </%def> | |
129 |
|
129 | |||
130 | <%def name="repo_state(repo_state)"> |
|
130 | <%def name="repo_state(repo_state)"> | |
131 | <div> |
|
131 | <div> | |
132 | %if repo_state == 'repo_state_pending': |
|
132 | %if repo_state == 'repo_state_pending': | |
133 | <div class="tag tag4">${_('Creating')}</div> |
|
133 | <div class="tag tag4">${_('Creating')}</div> | |
134 | %elif repo_state == 'repo_state_created': |
|
134 | %elif repo_state == 'repo_state_created': | |
135 | <div class="tag tag1">${_('Created')}</div> |
|
135 | <div class="tag tag1">${_('Created')}</div> | |
136 | %else: |
|
136 | %else: | |
137 | <div class="tag alert2" title="${repo_state}">invalid</div> |
|
137 | <div class="tag alert2" title="${h.tooltip(repo_state)}">invalid</div> | |
138 | %endif |
|
138 | %endif | |
139 | </div> |
|
139 | </div> | |
140 | </%def> |
|
140 | </%def> | |
141 |
|
141 | |||
142 |
|
142 | |||
143 | ## REPO GROUP RENDERERS |
|
143 | ## REPO GROUP RENDERERS | |
144 | <%def name="quick_repo_group_menu(repo_group_name)"> |
|
144 | <%def name="quick_repo_group_menu(repo_group_name)"> | |
145 | <i class="pointer icon-more"></i> |
|
145 | <i class="pointer icon-more"></i> | |
146 | <div class="menu_items_container hidden"> |
|
146 | <div class="menu_items_container hidden"> | |
147 | <ul class="menu_items"> |
|
147 | <ul class="menu_items"> | |
148 | <li> |
|
148 | <li> | |
149 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> |
|
149 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> | |
150 | <span class="icon"> |
|
150 | <span class="icon"> | |
151 | <i class="icon-file-text"></i> |
|
151 | <i class="icon-file-text"></i> | |
152 | </span> |
|
152 | </span> | |
153 | <span>${_('Summary')}</span> |
|
153 | <span>${_('Summary')}</span> | |
154 | </a> |
|
154 | </a> | |
155 | </li> |
|
155 | </li> | |
156 |
|
156 | |||
157 | </ul> |
|
157 | </ul> | |
158 | </div> |
|
158 | </div> | |
159 | </%def> |
|
159 | </%def> | |
160 |
|
160 | |||
161 | <%def name="repo_group_name(repo_group_name, children_groups=None)"> |
|
161 | <%def name="repo_group_name(repo_group_name, children_groups=None)"> | |
162 | <div> |
|
162 | <div> | |
163 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> |
|
163 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> | |
164 | <i class="icon-folder-close" title="${_('Repository group')}"></i> |
|
164 | <i class="icon-folder-close" title="${_('Repository group')}"></i> | |
165 | %if children_groups: |
|
165 | %if children_groups: | |
166 | ${h.literal(' » '.join(children_groups))} |
|
166 | ${h.literal(' » '.join(children_groups))} | |
167 | %else: |
|
167 | %else: | |
168 | ${repo_group_name} |
|
168 | ${repo_group_name} | |
169 | %endif |
|
169 | %endif | |
170 | </a> |
|
170 | </a> | |
171 | </div> |
|
171 | </div> | |
172 | </%def> |
|
172 | </%def> | |
173 |
|
173 | |||
174 | <%def name="repo_group_desc(description)"> |
|
174 | <%def name="repo_group_desc(description)"> | |
175 | <div class="truncate-wrap">${description}</div> |
|
175 | <div class="truncate-wrap">${description}</div> | |
176 | </%def> |
|
176 | </%def> | |
177 |
|
177 | |||
178 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> |
|
178 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> | |
179 | <div class="grid_edit"> |
|
179 | <div class="grid_edit"> | |
180 | <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}">Edit</a> |
|
180 | <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}">Edit</a> | |
181 | </div> |
|
181 | </div> | |
182 | <div class="grid_delete"> |
|
182 | <div class="grid_delete"> | |
183 | ${h.secure_form(h.url('delete_repo_group', group_name=repo_group_name),method='delete')} |
|
183 | ${h.secure_form(h.url('delete_repo_group', group_name=repo_group_name),method='delete')} | |
184 | ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger", |
|
184 | ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger", | |
185 | onclick="return confirm('"+ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")} |
|
185 | onclick="return confirm('"+ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")} | |
186 | ${h.end_form()} |
|
186 | ${h.end_form()} | |
187 | </div> |
|
187 | </div> | |
188 | </%def> |
|
188 | </%def> | |
189 |
|
189 | |||
190 |
|
190 | |||
191 | <%def name="user_actions(user_id, username)"> |
|
191 | <%def name="user_actions(user_id, username)"> | |
192 | <div class="grid_edit"> |
|
192 | <div class="grid_edit"> | |
193 | <a href="${h.url('edit_user',user_id=user_id)}" title="${_('Edit')}"> |
|
193 | <a href="${h.url('edit_user',user_id=user_id)}" title="${_('Edit')}"> | |
194 | <i class="icon-pencil"></i>Edit</a> |
|
194 | <i class="icon-pencil"></i>Edit</a> | |
195 | </div> |
|
195 | </div> | |
196 | <div class="grid_delete"> |
|
196 | <div class="grid_delete"> | |
197 | ${h.secure_form(h.url('delete_user', user_id=user_id),method='delete')} |
|
197 | ${h.secure_form(h.url('delete_user', user_id=user_id),method='delete')} | |
198 | ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger", |
|
198 | ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger", | |
199 | onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} |
|
199 | onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} | |
200 | ${h.end_form()} |
|
200 | ${h.end_form()} | |
201 | </div> |
|
201 | </div> | |
202 | </%def> |
|
202 | </%def> | |
203 |
|
203 | |||
204 | <%def name="user_group_actions(user_group_id, user_group_name)"> |
|
204 | <%def name="user_group_actions(user_group_id, user_group_name)"> | |
205 | <div class="grid_edit"> |
|
205 | <div class="grid_edit"> | |
206 | <a href="${h.url('edit_users_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a> |
|
206 | <a href="${h.url('edit_users_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a> | |
207 | </div> |
|
207 | </div> | |
208 | <div class="grid_delete"> |
|
208 | <div class="grid_delete"> | |
209 | ${h.secure_form(h.url('delete_users_group', user_group_id=user_group_id),method='delete')} |
|
209 | ${h.secure_form(h.url('delete_users_group', user_group_id=user_group_id),method='delete')} | |
210 | ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger", |
|
210 | ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger", | |
211 | onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")} |
|
211 | onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")} | |
212 | ${h.end_form()} |
|
212 | ${h.end_form()} | |
213 | </div> |
|
213 | </div> | |
214 | </%def> |
|
214 | </%def> | |
215 |
|
215 | |||
216 |
|
216 | |||
217 | <%def name="user_name(user_id, username)"> |
|
217 | <%def name="user_name(user_id, username)"> | |
218 | ${h.link_to(h.person(username, 'username_or_name_or_email'), h.url('edit_user', user_id=user_id))} |
|
218 | ${h.link_to(h.person(username, 'username_or_name_or_email'), h.url('edit_user', user_id=user_id))} | |
219 | </%def> |
|
219 | </%def> | |
220 |
|
220 | |||
221 | <%def name="user_profile(username)"> |
|
221 | <%def name="user_profile(username)"> | |
222 | ${base.gravatar_with_user(username, 16)} |
|
222 | ${base.gravatar_with_user(username, 16)} | |
223 | </%def> |
|
223 | </%def> | |
224 |
|
224 | |||
225 | <%def name="user_group_name(user_group_id, user_group_name)"> |
|
225 | <%def name="user_group_name(user_group_id, user_group_name)"> | |
226 | <div> |
|
226 | <div> | |
227 | <a href="${h.url('edit_users_group', user_group_id=user_group_id)}"> |
|
227 | <a href="${h.url('edit_users_group', user_group_id=user_group_id)}"> | |
228 | <i class="icon-group" title="${_('User group')}"></i> ${user_group_name}</a> |
|
228 | <i class="icon-group" title="${_('User group')}"></i> ${user_group_name}</a> | |
229 | </div> |
|
229 | </div> | |
230 | </%def> |
|
230 | </%def> | |
231 |
|
231 | |||
232 |
|
232 | |||
233 | ## GISTS |
|
233 | ## GISTS | |
234 |
|
234 | |||
235 | <%def name="gist_gravatar(full_contact)"> |
|
235 | <%def name="gist_gravatar(full_contact)"> | |
236 | <div class="gist_gravatar"> |
|
236 | <div class="gist_gravatar"> | |
237 | ${base.gravatar(full_contact, 30)} |
|
237 | ${base.gravatar(full_contact, 30)} | |
238 | </div> |
|
238 | </div> | |
239 | </%def> |
|
239 | </%def> | |
240 |
|
240 | |||
241 | <%def name="gist_access_id(gist_access_id, full_contact)"> |
|
241 | <%def name="gist_access_id(gist_access_id, full_contact)"> | |
242 | <div> |
|
242 | <div> | |
243 | <b> |
|
243 | <b> | |
244 | <a href="${h.url('gist',gist_id=gist_access_id)}">gist: ${gist_access_id}</a> |
|
244 | <a href="${h.url('gist',gist_id=gist_access_id)}">gist: ${gist_access_id}</a> | |
245 | </b> |
|
245 | </b> | |
246 | </div> |
|
246 | </div> | |
247 | </%def> |
|
247 | </%def> | |
248 |
|
248 | |||
249 | <%def name="gist_author(full_contact, created_on, expires)"> |
|
249 | <%def name="gist_author(full_contact, created_on, expires)"> | |
250 | ${base.gravatar_with_user(full_contact, 16)} |
|
250 | ${base.gravatar_with_user(full_contact, 16)} | |
251 | </%def> |
|
251 | </%def> | |
252 |
|
252 | |||
253 |
|
253 | |||
254 | <%def name="gist_created(created_on)"> |
|
254 | <%def name="gist_created(created_on)"> | |
255 | <div class="created"> |
|
255 | <div class="created"> | |
256 | ${h.age_component(created_on, time_is_local=True)} |
|
256 | ${h.age_component(created_on, time_is_local=True)} | |
257 | </div> |
|
257 | </div> | |
258 | </%def> |
|
258 | </%def> | |
259 |
|
259 | |||
260 | <%def name="gist_expires(expires)"> |
|
260 | <%def name="gist_expires(expires)"> | |
261 | <div class="created"> |
|
261 | <div class="created"> | |
262 | %if expires == -1: |
|
262 | %if expires == -1: | |
263 | ${_('never')} |
|
263 | ${_('never')} | |
264 | %else: |
|
264 | %else: | |
265 | ${h.age_component(h.time_to_utcdatetime(expires))} |
|
265 | ${h.age_component(h.time_to_utcdatetime(expires))} | |
266 | %endif |
|
266 | %endif | |
267 | </div> |
|
267 | </div> | |
268 | </%def> |
|
268 | </%def> | |
269 |
|
269 | |||
270 | <%def name="gist_type(gist_type)"> |
|
270 | <%def name="gist_type(gist_type)"> | |
271 | %if gist_type != 'public': |
|
271 | %if gist_type != 'public': | |
272 | <div class="tag">${_('Private')}</div> |
|
272 | <div class="tag">${_('Private')}</div> | |
273 | %endif |
|
273 | %endif | |
274 | </%def> |
|
274 | </%def> | |
275 |
|
275 | |||
276 | <%def name="gist_description(gist_description)"> |
|
276 | <%def name="gist_description(gist_description)"> | |
277 | ${gist_description} |
|
277 | ${gist_description} | |
278 | </%def> |
|
278 | </%def> | |
279 |
|
279 | |||
280 |
|
280 | |||
281 | ## PULL REQUESTS GRID RENDERERS |
|
281 | ## PULL REQUESTS GRID RENDERERS | |
282 |
|
282 | |||
283 | <%def name="pullrequest_target_repo(repo_name)"> |
|
283 | <%def name="pullrequest_target_repo(repo_name)"> | |
284 | <div class="truncate"> |
|
284 | <div class="truncate"> | |
285 | ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))} |
|
285 | ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))} | |
286 | </div> |
|
286 | </div> | |
287 | </%def> |
|
287 | </%def> | |
288 | <%def name="pullrequest_status(status)"> |
|
288 | <%def name="pullrequest_status(status)"> | |
289 | <div class="${'flag_status %s' % status} pull-left"></div> |
|
289 | <div class="${'flag_status %s' % status} pull-left"></div> | |
290 | </%def> |
|
290 | </%def> | |
291 |
|
291 | |||
292 | <%def name="pullrequest_title(title, description)"> |
|
292 | <%def name="pullrequest_title(title, description)"> | |
293 | ${title} <br/> |
|
293 | ${title} <br/> | |
294 | ${h.shorter(description, 40)} |
|
294 | ${h.shorter(description, 40)} | |
295 | </%def> |
|
295 | </%def> | |
296 |
|
296 | |||
297 | <%def name="pullrequest_comments(comments_nr)"> |
|
297 | <%def name="pullrequest_comments(comments_nr)"> | |
298 | <i class="icon-comment"></i> ${comments_nr} |
|
298 | <i class="icon-comment"></i> ${comments_nr} | |
299 | </%def> |
|
299 | </%def> | |
300 |
|
300 | |||
301 | <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)"> |
|
301 | <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)"> | |
302 | <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}"> |
|
302 | <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}"> | |
303 | % if short: |
|
303 | % if short: | |
304 | #${pull_request_id} |
|
304 | #${pull_request_id} | |
305 | % else: |
|
305 | % else: | |
306 | ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}} |
|
306 | ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}} | |
307 | % endif |
|
307 | % endif | |
308 | </a> |
|
308 | </a> | |
309 | </%def> |
|
309 | </%def> | |
310 |
|
310 | |||
311 | <%def name="pullrequest_updated_on(updated_on)"> |
|
311 | <%def name="pullrequest_updated_on(updated_on)"> | |
312 | ${h.age_component(h.time_to_utcdatetime(updated_on))} |
|
312 | ${h.age_component(h.time_to_utcdatetime(updated_on))} | |
313 | </%def> |
|
313 | </%def> | |
314 |
|
314 | |||
315 | <%def name="pullrequest_author(full_contact)"> |
|
315 | <%def name="pullrequest_author(full_contact)"> | |
316 | ${base.gravatar_with_user(full_contact, 16)} |
|
316 | ${base.gravatar_with_user(full_contact, 16)} | |
317 | </%def> |
|
317 | </%def> |
@@ -1,28 +1,28 b'' | |||||
1 | <%def name="refs(commit)"> |
|
1 | <%def name="refs(commit)"> | |
2 | %if commit.merge: |
|
2 | %if commit.merge: | |
3 | <span class="mergetag tag"> |
|
3 | <span class="mergetag tag"> | |
4 | <i class="icon-merge">${_('merge')}</i> |
|
4 | <i class="icon-merge">${_('merge')}</i> | |
5 | </span> |
|
5 | </span> | |
6 | %endif |
|
6 | %endif | |
7 |
|
7 | |||
8 | %if h.is_hg(c.rhodecode_repo): |
|
8 | %if h.is_hg(c.rhodecode_repo): | |
9 | %for book in commit.bookmarks: |
|
9 | %for book in commit.bookmarks: | |
10 | <span class="booktag tag" title="${_('Bookmark %s') % book}"> |
|
10 | <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}"> | |
11 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
11 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> | |
12 | </span> |
|
12 | </span> | |
13 | %endfor |
|
13 | %endfor | |
14 | %endif |
|
14 | %endif | |
15 |
|
15 | |||
16 | %for tag in commit.tags: |
|
16 | %for tag in commit.tags: | |
17 | <span class="tagtag tag" title="${_('Tag %s') % tag}"> |
|
17 | <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}"> | |
18 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${tag}</a> |
|
18 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${tag}</a> | |
19 | </span> |
|
19 | </span> | |
20 | %endfor |
|
20 | %endfor | |
21 |
|
21 | |||
22 | %if commit.branch: |
|
22 | %if commit.branch: | |
23 | <span class="branchtag tag" title="${_('Branch %s') % commit.branch}"> |
|
23 | <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % commit.branch)}"> | |
24 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> |
|
24 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> | |
25 | </span> |
|
25 | </span> | |
26 | %endif |
|
26 | %endif | |
27 |
|
27 | |||
28 | </%def> |
|
28 | </%def> |
@@ -1,30 +1,30 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 |
|
2 | |||
3 | <div class="summary-detail-header"> |
|
3 | <div class="summary-detail-header"> | |
4 | <h4 class="item"> |
|
4 | <h4 class="item"> | |
5 | % if c.file_author: |
|
5 | % if c.file_author: | |
6 | ${_('Last Author')} |
|
6 | ${_('Last Author')} | |
7 | % else: |
|
7 | % else: | |
8 | ${h.literal(ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) } |
|
8 | ${h.literal(ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) } | |
9 | % endif |
|
9 | % endif | |
10 | </h4> |
|
10 | </h4> | |
11 | <a href="#" id="show_authors" class="action_link">${_('Show All')}</a> |
|
11 | <a href="#" id="show_authors" class="action_link">${_('Show All')}</a> | |
12 | </div> |
|
12 | </div> | |
13 |
|
13 | |||
14 | % if c.authors: |
|
14 | % if c.authors: | |
15 | <ul class="sidebar-right-content"> |
|
15 | <ul class="sidebar-right-content"> | |
16 | % for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]): |
|
16 | % for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]): | |
17 | <li class="file_author"> |
|
17 | <li class="file_author"> | |
18 | <div class="rc-user tooltip" title="${h.author_string(email)}"> |
|
18 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
19 | ${base.gravatar(email, 16)} |
|
19 | ${base.gravatar(email, 16)} | |
20 | <span class="user">${h.link_to_user(user)}</span> |
|
20 | <span class="user">${h.link_to_user(user)}</span> | |
21 | </div> |
|
21 | </div> | |
22 | % if c.file_author: |
|
22 | % if c.file_author: | |
23 | <div class="user-inline-data">- ${h.age_component(c.file_last_commit.date)}</div> |
|
23 | <div class="user-inline-data">- ${h.age_component(c.file_last_commit.date)}</div> | |
24 | % elif c.file_last_commit.author_email==email: |
|
24 | % elif c.file_last_commit.author_email==email: | |
25 | <div class="user-inline-data"> (${_('last author')})</div> |
|
25 | <div class="user-inline-data"> (${_('last author')})</div> | |
26 | % endif |
|
26 | % endif | |
27 | </li> |
|
27 | </li> | |
28 | % endfor |
|
28 | % endfor | |
29 | </ul> |
|
29 | </ul> | |
30 | % endif |
|
30 | % endif |
@@ -1,82 +1,82 b'' | |||||
1 | <div id="file-tree-wrapper" class="browser-body ${'full-load' if c.full_load else ''}"> |
|
1 | <div id="file-tree-wrapper" class="browser-body ${'full-load' if c.full_load else ''}"> | |
2 | <table class="code-browser rctable"> |
|
2 | <table class="code-browser rctable"> | |
3 | <thead> |
|
3 | <thead> | |
4 | <tr> |
|
4 | <tr> | |
5 | <th>${_('Name')}</th> |
|
5 | <th>${_('Name')}</th> | |
6 | <th>${_('Size')}</th> |
|
6 | <th>${_('Size')}</th> | |
7 | <th>${_('Modified')}</th> |
|
7 | <th>${_('Modified')}</th> | |
8 | <th>${_('Last Commit')}</th> |
|
8 | <th>${_('Last Commit')}</th> | |
9 | <th>${_('Author')}</th> |
|
9 | <th>${_('Author')}</th> | |
10 | </tr> |
|
10 | </tr> | |
11 | </thead> |
|
11 | </thead> | |
12 |
|
12 | |||
13 | <tbody id="tbody"> |
|
13 | <tbody id="tbody"> | |
14 | %if c.file.parent: |
|
14 | %if c.file.parent: | |
15 | <tr class="parity0"> |
|
15 | <tr class="parity0"> | |
16 | <td class="td-componentname"> |
|
16 | <td class="td-componentname"> | |
17 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.file.parent.path)}" class="pjax-link"> |
|
17 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.file.parent.path)}" class="pjax-link"> | |
18 | <i class="icon-folder"></i>.. |
|
18 | <i class="icon-folder"></i>.. | |
19 | </a> |
|
19 | </a> | |
20 | </td> |
|
20 | </td> | |
21 | <td></td> |
|
21 | <td></td> | |
22 | <td></td> |
|
22 | <td></td> | |
23 | <td></td> |
|
23 | <td></td> | |
24 | <td></td> |
|
24 | <td></td> | |
25 | </tr> |
|
25 | </tr> | |
26 | %endif |
|
26 | %endif | |
27 | %for cnt,node in enumerate(c.file): |
|
27 | %for cnt,node in enumerate(c.file): | |
28 | <tr class="parity${cnt%2}"> |
|
28 | <tr class="parity${cnt%2}"> | |
29 | <td class="td-componentname"> |
|
29 | <td class="td-componentname"> | |
30 | % if node.is_submodule(): |
|
30 | % if node.is_submodule(): | |
31 | <span class="submodule-dir"> |
|
31 | <span class="submodule-dir"> | |
32 | % if node.url.startswith('http://') or node.url.startswith('https://'): |
|
32 | % if node.url.startswith('http://') or node.url.startswith('https://'): | |
33 | <a href="${node.url}"> |
|
33 | <a href="${node.url}"> | |
34 | <i class="icon-folder browser-dir"></i>${node.name} |
|
34 | <i class="icon-folder browser-dir"></i>${node.name} | |
35 | </a> |
|
35 | </a> | |
36 | % else: |
|
36 | % else: | |
37 | <i class="icon-folder browser-dir"></i>${node.name} |
|
37 | <i class="icon-folder browser-dir"></i>${node.name} | |
38 | % endif |
|
38 | % endif | |
39 | </span> |
|
39 | </span> | |
40 | % else: |
|
40 | % else: | |
41 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=h.safe_unicode(node.path))}" class="pjax-link"> |
|
41 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=h.safe_unicode(node.path))}" class="pjax-link"> | |
42 | <i class="${'icon-file browser-file' if node.is_file() else 'icon-folder browser-dir'}"></i>${node.name} |
|
42 | <i class="${'icon-file browser-file' if node.is_file() else 'icon-folder browser-dir'}"></i>${node.name} | |
43 | </a> |
|
43 | </a> | |
44 | % endif |
|
44 | % endif | |
45 | </td> |
|
45 | </td> | |
46 | %if node.is_file(): |
|
46 | %if node.is_file(): | |
47 | <td class="td-size" data-attr-name="size"> |
|
47 | <td class="td-size" data-attr-name="size"> | |
48 | % if c.full_load: |
|
48 | % if c.full_load: | |
49 | <span data-size="${node.size}">${h.format_byte_size_binary(node.size)}</span> |
|
49 | <span data-size="${node.size}">${h.format_byte_size_binary(node.size)}</span> | |
50 | % else: |
|
50 | % else: | |
51 | ${_('Loading ...')} |
|
51 | ${_('Loading ...')} | |
52 | % endif |
|
52 | % endif | |
53 | </td> |
|
53 | </td> | |
54 | <td class="td-time" data-attr-name="modified_at"> |
|
54 | <td class="td-time" data-attr-name="modified_at"> | |
55 | % if c.full_load: |
|
55 | % if c.full_load: | |
56 | <span data-date="${node.last_commit.date}">${h.age_component(node.last_commit.date)}</span> |
|
56 | <span data-date="${node.last_commit.date}">${h.age_component(node.last_commit.date)}</span> | |
57 | % endif |
|
57 | % endif | |
58 | </td> |
|
58 | </td> | |
59 | <td class="td-hash" data-attr-name="commit_id"> |
|
59 | <td class="td-hash" data-attr-name="commit_id"> | |
60 | % if c.full_load: |
|
60 | % if c.full_load: | |
61 | <div class="tooltip" title="${node.last_commit.message}"> |
|
61 | <div class="tooltip" title="${h.tooltip(node.last_commit.message)}"> | |
62 | <pre data-commit-id="${node.last_commit.raw_id}">r${node.last_commit.revision}:${node.last_commit.short_id}</pre> |
|
62 | <pre data-commit-id="${node.last_commit.raw_id}">r${node.last_commit.revision}:${node.last_commit.short_id}</pre> | |
63 | </div> |
|
63 | </div> | |
64 | % endif |
|
64 | % endif | |
65 | </td> |
|
65 | </td> | |
66 | <td class="td-user" data-attr-name="author"> |
|
66 | <td class="td-user" data-attr-name="author"> | |
67 | % if c.full_load: |
|
67 | % if c.full_load: | |
68 | <span data-author="${node.last_commit.author}" title="${node.last_commit.author}">${h.gravatar_with_user(node.last_commit.author)|n}</span> |
|
68 | <span data-author="${node.last_commit.author}" title="${h.tooltip(node.last_commit.author)}">${h.gravatar_with_user(node.last_commit.author)|n}</span> | |
69 | % endif |
|
69 | % endif | |
70 | </td> |
|
70 | </td> | |
71 | %else: |
|
71 | %else: | |
72 | <td></td> |
|
72 | <td></td> | |
73 | <td></td> |
|
73 | <td></td> | |
74 | <td></td> |
|
74 | <td></td> | |
75 | <td></td> |
|
75 | <td></td> | |
76 | %endif |
|
76 | %endif | |
77 | </tr> |
|
77 | </tr> | |
78 | %endfor |
|
78 | %endfor | |
79 | </tbody> |
|
79 | </tbody> | |
80 | <tbody id="tbody_filtered"></tbody> |
|
80 | <tbody id="tbody_filtered"></tbody> | |
81 | </table> |
|
81 | </table> | |
82 | </div> |
|
82 | </div> |
@@ -1,47 +1,47 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | <%namespace name="base" file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | % if c.forks_pager: |
|
4 | % if c.forks_pager: | |
5 | <table class="rctable fork_summary"> |
|
5 | <table class="rctable fork_summary"> | |
6 | <tr> |
|
6 | <tr> | |
7 | <th>${_('Owner')}</th> |
|
7 | <th>${_('Owner')}</th> | |
8 | <th>${_('Fork')}</th> |
|
8 | <th>${_('Fork')}</th> | |
9 | <th>${_('Description')}</th> |
|
9 | <th>${_('Description')}</th> | |
10 | <th>${_('Forked')}</th> |
|
10 | <th>${_('Forked')}</th> | |
11 | <th></th> |
|
11 | <th></th> | |
12 | </tr> |
|
12 | </tr> | |
13 | % for f in c.forks_pager: |
|
13 | % for f in c.forks_pager: | |
14 | <tr> |
|
14 | <tr> | |
15 | <td class="td-user fork_user"> |
|
15 | <td class="td-user fork_user"> | |
16 | ${base.gravatar_with_user(f.user.email, 16)} |
|
16 | ${base.gravatar_with_user(f.user.email, 16)} | |
17 | </td> |
|
17 | </td> | |
18 | <td class="td-componentname"> |
|
18 | <td class="td-componentname"> | |
19 | ${h.link_to(f.repo_name,h.route_path('repo_summary',repo_name=f.repo_name))} |
|
19 | ${h.link_to(f.repo_name,h.route_path('repo_summary',repo_name=f.repo_name))} | |
20 | </td> |
|
20 | </td> | |
21 | <td class="td-description"> |
|
21 | <td class="td-description"> | |
22 | <div class="truncate">${f.description}</div> |
|
22 | <div class="truncate">${f.description}</div> | |
23 | </td> |
|
23 | </td> | |
24 | <td class="td-time follower_date"> |
|
24 | <td class="td-time follower_date"> | |
25 | ${h.age_component(f.created_on, time_is_local=True)} |
|
25 | ${h.age_component(f.created_on, time_is_local=True)} | |
26 | </td> |
|
26 | </td> | |
27 | <td class="td-compare"> |
|
27 | <td class="td-compare"> | |
28 | <a title="${_('Compare fork with %s' % c.repo_name)}" |
|
28 | <a title="${h.tooltip(_('Compare fork with %s' % c.repo_name))}" | |
29 | href="${h.url('compare_url',repo_name=c.repo_name, source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1],target_repo=f.repo_name,target_ref_type=c.rhodecode_db_repo.landing_rev[0],target_ref=c.rhodecode_db_repo.landing_rev[1], merge=1)}" |
|
29 | href="${h.url('compare_url',repo_name=c.repo_name, source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1],target_repo=f.repo_name,target_ref_type=c.rhodecode_db_repo.landing_rev[0],target_ref=c.rhodecode_db_repo.landing_rev[1], merge=1)}" | |
30 | class="btn-link"><i class="icon-loop"></i> ${_('Compare fork')}</a> |
|
30 | class="btn-link"><i class="icon-loop"></i> ${_('Compare fork')}</a> | |
31 | </td> |
|
31 | </td> | |
32 | </tr> |
|
32 | </tr> | |
33 | % endfor |
|
33 | % endfor | |
34 | </table> |
|
34 | </table> | |
35 | <div class="pagination-wh pagination-left"> |
|
35 | <div class="pagination-wh pagination-left"> | |
36 | <script type="text/javascript"> |
|
36 | <script type="text/javascript"> | |
37 | $(document).pjax('#forks .pager_link','#forks'); |
|
37 | $(document).pjax('#forks .pager_link','#forks'); | |
38 | $(document).on('pjax:success',function(){ |
|
38 | $(document).on('pjax:success',function(){ | |
39 | show_more_event(); |
|
39 | show_more_event(); | |
40 | timeagoActivate(); |
|
40 | timeagoActivate(); | |
41 | }); |
|
41 | }); | |
42 | </script> |
|
42 | </script> | |
43 | ${c.forks_pager.pager('$link_previous ~2~ $link_next')} |
|
43 | ${c.forks_pager.pager('$link_previous ~2~ $link_next')} | |
44 | </div> |
|
44 | </div> | |
45 | % else: |
|
45 | % else: | |
46 | ${_('There are no forks yet')} |
|
46 | ${_('There are no forks yet')} | |
47 | % endif |
|
47 | % endif |
@@ -1,860 +1,860 b'' | |||||
1 | <%inherit file="/base/base.mako"/> |
|
1 | <%inherit file="/base/base.mako"/> | |
2 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | <%namespace name="base" file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} |
|
5 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <span id="pr-title"> |
|
12 | <span id="pr-title"> | |
13 | ${c.pull_request.title} |
|
13 | ${c.pull_request.title} | |
14 | %if c.pull_request.is_closed(): |
|
14 | %if c.pull_request.is_closed(): | |
15 | (${_('Closed')}) |
|
15 | (${_('Closed')}) | |
16 | %endif |
|
16 | %endif | |
17 | </span> |
|
17 | </span> | |
18 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
18 | <div id="pr-title-edit" class="input" style="display: none;"> | |
19 | ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)} |
|
19 | ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)} | |
20 | </div> |
|
20 | </div> | |
21 | </%def> |
|
21 | </%def> | |
22 |
|
22 | |||
23 | <%def name="menu_bar_nav()"> |
|
23 | <%def name="menu_bar_nav()"> | |
24 | ${self.menu_items(active='repositories')} |
|
24 | ${self.menu_items(active='repositories')} | |
25 | </%def> |
|
25 | </%def> | |
26 |
|
26 | |||
27 | <%def name="menu_bar_subnav()"> |
|
27 | <%def name="menu_bar_subnav()"> | |
28 | ${self.repo_menu(active='showpullrequest')} |
|
28 | ${self.repo_menu(active='showpullrequest')} | |
29 | </%def> |
|
29 | </%def> | |
30 |
|
30 | |||
31 | <%def name="main()"> |
|
31 | <%def name="main()"> | |
32 |
|
32 | |||
33 | <script type="text/javascript"> |
|
33 | <script type="text/javascript"> | |
34 | // TODO: marcink switch this to pyroutes |
|
34 | // TODO: marcink switch this to pyroutes | |
35 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
35 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
36 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
36 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; | |
37 | </script> |
|
37 | </script> | |
38 | <div class="box"> |
|
38 | <div class="box"> | |
39 |
|
39 | |||
40 | <div class="title"> |
|
40 | <div class="title"> | |
41 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
41 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
42 | </div> |
|
42 | </div> | |
43 |
|
43 | |||
44 | ${self.breadcrumbs()} |
|
44 | ${self.breadcrumbs()} | |
45 |
|
45 | |||
46 | <div class="box pr-summary"> |
|
46 | <div class="box pr-summary"> | |
47 |
|
47 | |||
48 | <div class="summary-details block-left"> |
|
48 | <div class="summary-details block-left"> | |
49 | <% summary = lambda n:{False:'summary-short'}.get(n) %> |
|
49 | <% summary = lambda n:{False:'summary-short'}.get(n) %> | |
50 | <div class="pr-details-title"> |
|
50 | <div class="pr-details-title"> | |
51 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
51 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} | |
52 | %if c.allowed_to_update: |
|
52 | %if c.allowed_to_update: | |
53 | <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0"> |
|
53 | <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0"> | |
54 | % if c.allowed_to_delete: |
|
54 | % if c.allowed_to_delete: | |
55 | ${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')} |
|
55 | ${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')} | |
56 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), |
|
56 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), | |
57 | class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} |
|
57 | class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} | |
58 | ${h.end_form()} |
|
58 | ${h.end_form()} | |
59 | % else: |
|
59 | % else: | |
60 | ${_('Delete')} |
|
60 | ${_('Delete')} | |
61 | % endif |
|
61 | % endif | |
62 | </div> |
|
62 | </div> | |
63 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> |
|
63 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> | |
64 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div> |
|
64 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div> | |
65 | %endif |
|
65 | %endif | |
66 | </div> |
|
66 | </div> | |
67 |
|
67 | |||
68 | <div id="summary" class="fields pr-details-content"> |
|
68 | <div id="summary" class="fields pr-details-content"> | |
69 | <div class="field"> |
|
69 | <div class="field"> | |
70 | <div class="label-summary"> |
|
70 | <div class="label-summary"> | |
71 | <label>${_('Source')}:</label> |
|
71 | <label>${_('Source')}:</label> | |
72 | </div> |
|
72 | </div> | |
73 | <div class="input"> |
|
73 | <div class="input"> | |
74 | <div class="pr-origininfo"> |
|
74 | <div class="pr-origininfo"> | |
75 | ## branch link is only valid if it is a branch |
|
75 | ## branch link is only valid if it is a branch | |
76 | <span class="tag"> |
|
76 | <span class="tag"> | |
77 | %if c.pull_request.source_ref_parts.type == 'branch': |
|
77 | %if c.pull_request.source_ref_parts.type == 'branch': | |
78 | <a href="${h.url('changelog_home', repo_name=c.pull_request.source_repo.repo_name, branch=c.pull_request.source_ref_parts.name)}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a> |
|
78 | <a href="${h.url('changelog_home', repo_name=c.pull_request.source_repo.repo_name, branch=c.pull_request.source_ref_parts.name)}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a> | |
79 | %else: |
|
79 | %else: | |
80 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} |
|
80 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} | |
81 | %endif |
|
81 | %endif | |
82 | </span> |
|
82 | </span> | |
83 | <span class="clone-url"> |
|
83 | <span class="clone-url"> | |
84 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
84 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> | |
85 | </span> |
|
85 | </span> | |
86 | <br/> |
|
86 | <br/> | |
87 | % if c.ancestor_commit: |
|
87 | % if c.ancestor_commit: | |
88 | ${_('Common ancestor')}: |
|
88 | ${_('Common ancestor')}: | |
89 | <code><a href="${h.url('changeset_home', repo_name=c.target_repo.repo_name, revision=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> |
|
89 | <code><a href="${h.url('changeset_home', repo_name=c.target_repo.repo_name, revision=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> | |
90 | % endif |
|
90 | % endif | |
91 | </div> |
|
91 | </div> | |
92 | <div class="pr-pullinfo"> |
|
92 | <div class="pr-pullinfo"> | |
93 | %if h.is_hg(c.pull_request.source_repo): |
|
93 | %if h.is_hg(c.pull_request.source_repo): | |
94 | <input type="text" class="input-monospace" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly"> |
|
94 | <input type="text" class="input-monospace" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly"> | |
95 | %elif h.is_git(c.pull_request.source_repo): |
|
95 | %elif h.is_git(c.pull_request.source_repo): | |
96 | <input type="text" class="input-monospace" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly"> |
|
96 | <input type="text" class="input-monospace" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly"> | |
97 | %endif |
|
97 | %endif | |
98 | </div> |
|
98 | </div> | |
99 | </div> |
|
99 | </div> | |
100 | </div> |
|
100 | </div> | |
101 | <div class="field"> |
|
101 | <div class="field"> | |
102 | <div class="label-summary"> |
|
102 | <div class="label-summary"> | |
103 | <label>${_('Target')}:</label> |
|
103 | <label>${_('Target')}:</label> | |
104 | </div> |
|
104 | </div> | |
105 | <div class="input"> |
|
105 | <div class="input"> | |
106 | <div class="pr-targetinfo"> |
|
106 | <div class="pr-targetinfo"> | |
107 | ## branch link is only valid if it is a branch |
|
107 | ## branch link is only valid if it is a branch | |
108 | <span class="tag"> |
|
108 | <span class="tag"> | |
109 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
109 | %if c.pull_request.target_ref_parts.type == 'branch': | |
110 | <a href="${h.url('changelog_home', repo_name=c.pull_request.target_repo.repo_name, branch=c.pull_request.target_ref_parts.name)}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> |
|
110 | <a href="${h.url('changelog_home', repo_name=c.pull_request.target_repo.repo_name, branch=c.pull_request.target_ref_parts.name)}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> | |
111 | %else: |
|
111 | %else: | |
112 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
112 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} | |
113 | %endif |
|
113 | %endif | |
114 | </span> |
|
114 | </span> | |
115 | <span class="clone-url"> |
|
115 | <span class="clone-url"> | |
116 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
116 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> | |
117 | </span> |
|
117 | </span> | |
118 | </div> |
|
118 | </div> | |
119 | </div> |
|
119 | </div> | |
120 | </div> |
|
120 | </div> | |
121 |
|
121 | |||
122 | ## Link to the shadow repository. |
|
122 | ## Link to the shadow repository. | |
123 | <div class="field"> |
|
123 | <div class="field"> | |
124 | <div class="label-summary"> |
|
124 | <div class="label-summary"> | |
125 | <label>${_('Merge')}:</label> |
|
125 | <label>${_('Merge')}:</label> | |
126 | </div> |
|
126 | </div> | |
127 | <div class="input"> |
|
127 | <div class="input"> | |
128 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
128 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: | |
129 | <div class="pr-mergeinfo"> |
|
129 | <div class="pr-mergeinfo"> | |
130 | %if h.is_hg(c.pull_request.target_repo): |
|
130 | %if h.is_hg(c.pull_request.target_repo): | |
131 | <input type="text" class="input-monospace" value="hg clone -u ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly"> |
|
131 | <input type="text" class="input-monospace" value="hg clone -u ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly"> | |
132 | %elif h.is_git(c.pull_request.target_repo): |
|
132 | %elif h.is_git(c.pull_request.target_repo): | |
133 | <input type="text" class="input-monospace" value="git clone --branch ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly"> |
|
133 | <input type="text" class="input-monospace" value="git clone --branch ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly"> | |
134 | %endif |
|
134 | %endif | |
135 | </div> |
|
135 | </div> | |
136 | % else: |
|
136 | % else: | |
137 | <div class=""> |
|
137 | <div class=""> | |
138 | ${_('Shadow repository data not available')}. |
|
138 | ${_('Shadow repository data not available')}. | |
139 | </div> |
|
139 | </div> | |
140 | % endif |
|
140 | % endif | |
141 | </div> |
|
141 | </div> | |
142 | </div> |
|
142 | </div> | |
143 |
|
143 | |||
144 | <div class="field"> |
|
144 | <div class="field"> | |
145 | <div class="label-summary"> |
|
145 | <div class="label-summary"> | |
146 | <label>${_('Review')}:</label> |
|
146 | <label>${_('Review')}:</label> | |
147 | </div> |
|
147 | </div> | |
148 | <div class="input"> |
|
148 | <div class="input"> | |
149 | %if c.pull_request_review_status: |
|
149 | %if c.pull_request_review_status: | |
150 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> |
|
150 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> | |
151 | <span class="changeset-status-lbl tooltip"> |
|
151 | <span class="changeset-status-lbl tooltip"> | |
152 | %if c.pull_request.is_closed(): |
|
152 | %if c.pull_request.is_closed(): | |
153 | ${_('Closed')}, |
|
153 | ${_('Closed')}, | |
154 | %endif |
|
154 | %endif | |
155 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
155 | ${h.commit_status_lbl(c.pull_request_review_status)} | |
156 | </span> |
|
156 | </span> | |
157 | - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
157 | - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} | |
158 | %endif |
|
158 | %endif | |
159 | </div> |
|
159 | </div> | |
160 | </div> |
|
160 | </div> | |
161 | <div class="field"> |
|
161 | <div class="field"> | |
162 | <div class="pr-description-label label-summary"> |
|
162 | <div class="pr-description-label label-summary"> | |
163 | <label>${_('Description')}:</label> |
|
163 | <label>${_('Description')}:</label> | |
164 | </div> |
|
164 | </div> | |
165 | <div id="pr-desc" class="input"> |
|
165 | <div id="pr-desc" class="input"> | |
166 | <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div> |
|
166 | <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div> | |
167 | </div> |
|
167 | </div> | |
168 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
168 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> | |
169 | <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea> |
|
169 | <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea> | |
170 | </div> |
|
170 | </div> | |
171 | </div> |
|
171 | </div> | |
172 |
|
172 | |||
173 | <div class="field"> |
|
173 | <div class="field"> | |
174 | <div class="label-summary"> |
|
174 | <div class="label-summary"> | |
175 | <label>${_('Versions')}:</label> |
|
175 | <label>${_('Versions')}:</label> | |
176 | </div> |
|
176 | </div> | |
177 |
|
177 | |||
178 | <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> |
|
178 | <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> | |
179 | <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %> |
|
179 | <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %> | |
180 |
|
180 | |||
181 | <div class="pr-versions"> |
|
181 | <div class="pr-versions"> | |
182 | % if c.show_version_changes: |
|
182 | % if c.show_version_changes: | |
183 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> |
|
183 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> | |
184 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> |
|
184 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> | |
185 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" |
|
185 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" | |
186 | data-toggle-on="${ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" |
|
186 | data-toggle-on="${ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" | |
187 | data-toggle-off="${_('Hide all versions of this pull request')}"> |
|
187 | data-toggle-off="${_('Hide all versions of this pull request')}"> | |
188 | ${ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} |
|
188 | ${ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} | |
189 | </a> |
|
189 | </a> | |
190 | <table> |
|
190 | <table> | |
191 | ## SHOW ALL VERSIONS OF PR |
|
191 | ## SHOW ALL VERSIONS OF PR | |
192 | <% ver_pr = None %> |
|
192 | <% ver_pr = None %> | |
193 |
|
193 | |||
194 | % for data in reversed(list(enumerate(c.versions, 1))): |
|
194 | % for data in reversed(list(enumerate(c.versions, 1))): | |
195 | <% ver_pos = data[0] %> |
|
195 | <% ver_pos = data[0] %> | |
196 | <% ver = data[1] %> |
|
196 | <% ver = data[1] %> | |
197 | <% ver_pr = ver.pull_request_version_id %> |
|
197 | <% ver_pr = ver.pull_request_version_id %> | |
198 | <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> |
|
198 | <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> | |
199 |
|
199 | |||
200 | <tr class="version-pr" style="display: ${display_row}"> |
|
200 | <tr class="version-pr" style="display: ${display_row}"> | |
201 | <td> |
|
201 | <td> | |
202 | <code> |
|
202 | <code> | |
203 | <a href="${h.url.current(version=ver_pr or 'latest')}">v${ver_pos}</a> |
|
203 | <a href="${h.url.current(version=ver_pr or 'latest')}">v${ver_pos}</a> | |
204 | </code> |
|
204 | </code> | |
205 | </td> |
|
205 | </td> | |
206 | <td> |
|
206 | <td> | |
207 | <input ${'checked="checked"' if c.from_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
207 | <input ${'checked="checked"' if c.from_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> | |
208 | <input ${'checked="checked"' if c.at_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
208 | <input ${'checked="checked"' if c.at_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> | |
209 | </td> |
|
209 | </td> | |
210 | <td> |
|
210 | <td> | |
211 | <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %> |
|
211 | <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %> | |
212 | <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}"> |
|
212 | <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}"> | |
213 | </div> |
|
213 | </div> | |
214 | </td> |
|
214 | </td> | |
215 | <td> |
|
215 | <td> | |
216 | % if c.at_version_num != ver_pr: |
|
216 | % if c.at_version_num != ver_pr: | |
217 | <i class="icon-comment"></i> |
|
217 | <i class="icon-comment"></i> | |
218 | <code class="tooltip" title="${_('Comment from pull request version {0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> |
|
218 | <code class="tooltip" title="${_('Comment from pull request version {0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> | |
219 | G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} |
|
219 | G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} | |
220 | </code> |
|
220 | </code> | |
221 | % endif |
|
221 | % endif | |
222 | </td> |
|
222 | </td> | |
223 | <td> |
|
223 | <td> | |
224 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> |
|
224 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> | |
225 | </td> |
|
225 | </td> | |
226 | <td> |
|
226 | <td> | |
227 | ${h.age_component(ver.updated_on, time_is_local=True)} |
|
227 | ${h.age_component(ver.updated_on, time_is_local=True)} | |
228 | </td> |
|
228 | </td> | |
229 | </tr> |
|
229 | </tr> | |
230 | % endfor |
|
230 | % endfor | |
231 |
|
231 | |||
232 | <tr> |
|
232 | <tr> | |
233 | <td colspan="6"> |
|
233 | <td colspan="6"> | |
234 | <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none" |
|
234 | <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none" | |
235 | data-label-text-locked="${_('select versions to show changes')}" |
|
235 | data-label-text-locked="${_('select versions to show changes')}" | |
236 | data-label-text-diff="${_('show changes between versions')}" |
|
236 | data-label-text-diff="${_('show changes between versions')}" | |
237 | data-label-text-show="${_('show pull request for this version')}" |
|
237 | data-label-text-show="${_('show pull request for this version')}" | |
238 | > |
|
238 | > | |
239 | ${_('select versions to show changes')} |
|
239 | ${_('select versions to show changes')} | |
240 | </button> |
|
240 | </button> | |
241 | </td> |
|
241 | </td> | |
242 | </tr> |
|
242 | </tr> | |
243 |
|
243 | |||
244 | ## show comment/inline comments summary |
|
244 | ## show comment/inline comments summary | |
245 | <%def name="comments_summary()"> |
|
245 | <%def name="comments_summary()"> | |
246 | <tr> |
|
246 | <tr> | |
247 | <td colspan="6" class="comments-summary-td"> |
|
247 | <td colspan="6" class="comments-summary-td"> | |
248 |
|
248 | |||
249 | % if c.at_version: |
|
249 | % if c.at_version: | |
250 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %> |
|
250 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %> | |
251 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %> |
|
251 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %> | |
252 | ${_('Comments at this version')}: |
|
252 | ${_('Comments at this version')}: | |
253 | % else: |
|
253 | % else: | |
254 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %> |
|
254 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %> | |
255 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %> |
|
255 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %> | |
256 | ${_('Comments for this pull request')}: |
|
256 | ${_('Comments for this pull request')}: | |
257 | % endif |
|
257 | % endif | |
258 |
|
258 | |||
259 |
|
259 | |||
260 | %if general_comm_count_ver: |
|
260 | %if general_comm_count_ver: | |
261 | <a href="#comments">${_("%d General ") % general_comm_count_ver}</a> |
|
261 | <a href="#comments">${_("%d General ") % general_comm_count_ver}</a> | |
262 | %else: |
|
262 | %else: | |
263 | ${_("%d General ") % general_comm_count_ver} |
|
263 | ${_("%d General ") % general_comm_count_ver} | |
264 | %endif |
|
264 | %endif | |
265 |
|
265 | |||
266 | %if inline_comm_count_ver: |
|
266 | %if inline_comm_count_ver: | |
267 | , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a> |
|
267 | , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a> | |
268 | %else: |
|
268 | %else: | |
269 | , ${_("%d Inline") % inline_comm_count_ver} |
|
269 | , ${_("%d Inline") % inline_comm_count_ver} | |
270 | %endif |
|
270 | %endif | |
271 |
|
271 | |||
272 | %if outdated_comm_count_ver: |
|
272 | %if outdated_comm_count_ver: | |
273 | , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a> |
|
273 | , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a> | |
274 | <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a> |
|
274 | <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a> | |
275 | <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a> |
|
275 | <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a> | |
276 | %else: |
|
276 | %else: | |
277 | , ${_("%d Outdated") % outdated_comm_count_ver} |
|
277 | , ${_("%d Outdated") % outdated_comm_count_ver} | |
278 | %endif |
|
278 | %endif | |
279 | </td> |
|
279 | </td> | |
280 | </tr> |
|
280 | </tr> | |
281 | </%def> |
|
281 | </%def> | |
282 | ${comments_summary()} |
|
282 | ${comments_summary()} | |
283 | </table> |
|
283 | </table> | |
284 | % else: |
|
284 | % else: | |
285 | <div class="input"> |
|
285 | <div class="input"> | |
286 | ${_('Pull request versions not available')}. |
|
286 | ${_('Pull request versions not available')}. | |
287 | </div> |
|
287 | </div> | |
288 | <div> |
|
288 | <div> | |
289 | <table> |
|
289 | <table> | |
290 | ${comments_summary()} |
|
290 | ${comments_summary()} | |
291 | </table> |
|
291 | </table> | |
292 | </div> |
|
292 | </div> | |
293 | % endif |
|
293 | % endif | |
294 | </div> |
|
294 | </div> | |
295 | </div> |
|
295 | </div> | |
296 |
|
296 | |||
297 | <div id="pr-save" class="field" style="display: none;"> |
|
297 | <div id="pr-save" class="field" style="display: none;"> | |
298 | <div class="label-summary"></div> |
|
298 | <div class="label-summary"></div> | |
299 | <div class="input"> |
|
299 | <div class="input"> | |
300 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> |
|
300 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> | |
301 | </div> |
|
301 | </div> | |
302 | </div> |
|
302 | </div> | |
303 | </div> |
|
303 | </div> | |
304 | </div> |
|
304 | </div> | |
305 | <div> |
|
305 | <div> | |
306 | ## AUTHOR |
|
306 | ## AUTHOR | |
307 | <div class="reviewers-title block-right"> |
|
307 | <div class="reviewers-title block-right"> | |
308 | <div class="pr-details-title"> |
|
308 | <div class="pr-details-title"> | |
309 | ${_('Author of this pull request')} |
|
309 | ${_('Author of this pull request')} | |
310 | </div> |
|
310 | </div> | |
311 | </div> |
|
311 | </div> | |
312 | <div class="block-right pr-details-content reviewers"> |
|
312 | <div class="block-right pr-details-content reviewers"> | |
313 | <ul class="group_members"> |
|
313 | <ul class="group_members"> | |
314 | <li> |
|
314 | <li> | |
315 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} |
|
315 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} | |
316 | </li> |
|
316 | </li> | |
317 | </ul> |
|
317 | </ul> | |
318 | </div> |
|
318 | </div> | |
319 |
|
319 | |||
320 | ## REVIEW RULES |
|
320 | ## REVIEW RULES | |
321 | <div id="review_rules" style="display: none" class="reviewers-title block-right"> |
|
321 | <div id="review_rules" style="display: none" class="reviewers-title block-right"> | |
322 | <div class="pr-details-title"> |
|
322 | <div class="pr-details-title"> | |
323 | ${_('Reviewer rules')} |
|
323 | ${_('Reviewer rules')} | |
324 | %if c.allowed_to_update: |
|
324 | %if c.allowed_to_update: | |
325 | <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span> |
|
325 | <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span> | |
326 | %endif |
|
326 | %endif | |
327 | </div> |
|
327 | </div> | |
328 | <div class="pr-reviewer-rules"> |
|
328 | <div class="pr-reviewer-rules"> | |
329 | ## review rules will be appended here, by default reviewers logic |
|
329 | ## review rules will be appended here, by default reviewers logic | |
330 | </div> |
|
330 | </div> | |
331 | <input id="review_data" type="hidden" name="review_data" value=""> |
|
331 | <input id="review_data" type="hidden" name="review_data" value=""> | |
332 | </div> |
|
332 | </div> | |
333 |
|
333 | |||
334 | ## REVIEWERS |
|
334 | ## REVIEWERS | |
335 | <div class="reviewers-title block-right"> |
|
335 | <div class="reviewers-title block-right"> | |
336 | <div class="pr-details-title"> |
|
336 | <div class="pr-details-title"> | |
337 | ${_('Pull request reviewers')} |
|
337 | ${_('Pull request reviewers')} | |
338 | %if c.allowed_to_update: |
|
338 | %if c.allowed_to_update: | |
339 | <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span> |
|
339 | <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span> | |
340 | %endif |
|
340 | %endif | |
341 | </div> |
|
341 | </div> | |
342 | </div> |
|
342 | </div> | |
343 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
343 | <div id="reviewers" class="block-right pr-details-content reviewers"> | |
344 | ## members goes here ! |
|
344 | ## members goes here ! | |
345 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
345 | <input type="hidden" name="__start__" value="review_members:sequence"> | |
346 | <ul id="review_members" class="group_members"> |
|
346 | <ul id="review_members" class="group_members"> | |
347 | %for member,reasons,mandatory,status in c.pull_request_reviewers: |
|
347 | %for member,reasons,mandatory,status in c.pull_request_reviewers: | |
348 | <li id="reviewer_${member.user_id}" class="reviewer_entry"> |
|
348 | <li id="reviewer_${member.user_id}" class="reviewer_entry"> | |
349 | <div class="reviewers_member"> |
|
349 | <div class="reviewers_member"> | |
350 | <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> |
|
350 | <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> | |
351 | <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div> |
|
351 | <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div> | |
352 | </div> |
|
352 | </div> | |
353 | <div id="reviewer_${member.user_id}_name" class="reviewer_name"> |
|
353 | <div id="reviewer_${member.user_id}_name" class="reviewer_name"> | |
354 | ${self.gravatar_with_user(member.email, 16)} |
|
354 | ${self.gravatar_with_user(member.email, 16)} | |
355 | </div> |
|
355 | </div> | |
356 | <input type="hidden" name="__start__" value="reviewer:mapping"> |
|
356 | <input type="hidden" name="__start__" value="reviewer:mapping"> | |
357 | <input type="hidden" name="__start__" value="reasons:sequence"> |
|
357 | <input type="hidden" name="__start__" value="reasons:sequence"> | |
358 | %for reason in reasons: |
|
358 | %for reason in reasons: | |
359 | <div class="reviewer_reason">- ${reason}</div> |
|
359 | <div class="reviewer_reason">- ${reason}</div> | |
360 | <input type="hidden" name="reason" value="${reason}"> |
|
360 | <input type="hidden" name="reason" value="${reason}"> | |
361 |
|
361 | |||
362 | %endfor |
|
362 | %endfor | |
363 | <input type="hidden" name="__end__" value="reasons:sequence"> |
|
363 | <input type="hidden" name="__end__" value="reasons:sequence"> | |
364 | <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" /> |
|
364 | <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" /> | |
365 | <input type="hidden" name="mandatory" value="${mandatory}"/> |
|
365 | <input type="hidden" name="mandatory" value="${mandatory}"/> | |
366 | <input type="hidden" name="__end__" value="reviewer:mapping"> |
|
366 | <input type="hidden" name="__end__" value="reviewer:mapping"> | |
367 | % if mandatory: |
|
367 | % if mandatory: | |
368 | <div class="reviewer_member_mandatory_remove"> |
|
368 | <div class="reviewer_member_mandatory_remove"> | |
369 | <i class="icon-remove-sign"></i> |
|
369 | <i class="icon-remove-sign"></i> | |
370 | </div> |
|
370 | </div> | |
371 | <div class="reviewer_member_mandatory"> |
|
371 | <div class="reviewer_member_mandatory"> | |
372 | <i class="icon-lock" title="Mandatory reviewer"></i> |
|
372 | <i class="icon-lock" title="${h.tooltip(_('Mandatory reviewer'))}"></i> | |
373 | </div> |
|
373 | </div> | |
374 | % else: |
|
374 | % else: | |
375 | %if c.allowed_to_update: |
|
375 | %if c.allowed_to_update: | |
376 | <div class="reviewer_member_remove action_button" onclick="reviewersController.removeReviewMember(${member.user_id}, true)" style="visibility: hidden;"> |
|
376 | <div class="reviewer_member_remove action_button" onclick="reviewersController.removeReviewMember(${member.user_id}, true)" style="visibility: hidden;"> | |
377 | <i class="icon-remove-sign" ></i> |
|
377 | <i class="icon-remove-sign" ></i> | |
378 | </div> |
|
378 | </div> | |
379 | %endif |
|
379 | %endif | |
380 | % endif |
|
380 | % endif | |
381 | </div> |
|
381 | </div> | |
382 | </li> |
|
382 | </li> | |
383 | %endfor |
|
383 | %endfor | |
384 | </ul> |
|
384 | </ul> | |
385 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
385 | <input type="hidden" name="__end__" value="review_members:sequence"> | |
386 |
|
386 | |||
387 | %if not c.pull_request.is_closed(): |
|
387 | %if not c.pull_request.is_closed(): | |
388 | <div id="add_reviewer" class="ac" style="display: none;"> |
|
388 | <div id="add_reviewer" class="ac" style="display: none;"> | |
389 | %if c.allowed_to_update: |
|
389 | %if c.allowed_to_update: | |
390 | % if not c.forbid_adding_reviewers: |
|
390 | % if not c.forbid_adding_reviewers: | |
391 | <div id="add_reviewer_input" class="reviewer_ac"> |
|
391 | <div id="add_reviewer_input" class="reviewer_ac"> | |
392 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))} |
|
392 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))} | |
393 | <div id="reviewers_container"></div> |
|
393 | <div id="reviewers_container"></div> | |
394 | </div> |
|
394 | </div> | |
395 | % endif |
|
395 | % endif | |
396 | <div class="pull-right"> |
|
396 | <div class="pull-right"> | |
397 | <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button> |
|
397 | <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button> | |
398 | </div> |
|
398 | </div> | |
399 | %endif |
|
399 | %endif | |
400 | </div> |
|
400 | </div> | |
401 | %endif |
|
401 | %endif | |
402 | </div> |
|
402 | </div> | |
403 | </div> |
|
403 | </div> | |
404 | </div> |
|
404 | </div> | |
405 | <div class="box"> |
|
405 | <div class="box"> | |
406 | ##DIFF |
|
406 | ##DIFF | |
407 | <div class="table" > |
|
407 | <div class="table" > | |
408 | <div id="changeset_compare_view_content"> |
|
408 | <div id="changeset_compare_view_content"> | |
409 | ##CS |
|
409 | ##CS | |
410 | % if c.missing_requirements: |
|
410 | % if c.missing_requirements: | |
411 | <div class="box"> |
|
411 | <div class="box"> | |
412 | <div class="alert alert-warning"> |
|
412 | <div class="alert alert-warning"> | |
413 | <div> |
|
413 | <div> | |
414 | <strong>${_('Missing requirements:')}</strong> |
|
414 | <strong>${_('Missing requirements:')}</strong> | |
415 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
415 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} | |
416 | </div> |
|
416 | </div> | |
417 | </div> |
|
417 | </div> | |
418 | </div> |
|
418 | </div> | |
419 | % elif c.missing_commits: |
|
419 | % elif c.missing_commits: | |
420 | <div class="box"> |
|
420 | <div class="box"> | |
421 | <div class="alert alert-warning"> |
|
421 | <div class="alert alert-warning"> | |
422 | <div> |
|
422 | <div> | |
423 | <strong>${_('Missing commits')}:</strong> |
|
423 | <strong>${_('Missing commits')}:</strong> | |
424 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
424 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} | |
425 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
425 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} | |
426 | </div> |
|
426 | </div> | |
427 | </div> |
|
427 | </div> | |
428 | </div> |
|
428 | </div> | |
429 | % endif |
|
429 | % endif | |
430 |
|
430 | |||
431 | <div class="compare_view_commits_title"> |
|
431 | <div class="compare_view_commits_title"> | |
432 | % if not c.compare_mode: |
|
432 | % if not c.compare_mode: | |
433 |
|
433 | |||
434 | % if c.at_version_pos: |
|
434 | % if c.at_version_pos: | |
435 | <h4> |
|
435 | <h4> | |
436 | ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos} |
|
436 | ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos} | |
437 | </h4> |
|
437 | </h4> | |
438 | % endif |
|
438 | % endif | |
439 |
|
439 | |||
440 | <div class="pull-left"> |
|
440 | <div class="pull-left"> | |
441 | <div class="btn-group"> |
|
441 | <div class="btn-group"> | |
442 | <a |
|
442 | <a | |
443 | class="btn" |
|
443 | class="btn" | |
444 | href="#" |
|
444 | href="#" | |
445 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
445 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> | |
446 | ${ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
446 | ${ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} | |
447 | </a> |
|
447 | </a> | |
448 | <a |
|
448 | <a | |
449 | class="btn" |
|
449 | class="btn" | |
450 | href="#" |
|
450 | href="#" | |
451 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
451 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> | |
452 | ${ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
452 | ${ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} | |
453 | </a> |
|
453 | </a> | |
454 | </div> |
|
454 | </div> | |
455 | </div> |
|
455 | </div> | |
456 |
|
456 | |||
457 | <div class="pull-right"> |
|
457 | <div class="pull-right"> | |
458 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
458 | % if c.allowed_to_update and not c.pull_request.is_closed(): | |
459 | <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a> |
|
459 | <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a> | |
460 | % else: |
|
460 | % else: | |
461 | <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a> |
|
461 | <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a> | |
462 | % endif |
|
462 | % endif | |
463 |
|
463 | |||
464 | </div> |
|
464 | </div> | |
465 | % endif |
|
465 | % endif | |
466 | </div> |
|
466 | </div> | |
467 |
|
467 | |||
468 | % if not c.missing_commits: |
|
468 | % if not c.missing_commits: | |
469 | % if c.compare_mode: |
|
469 | % if c.compare_mode: | |
470 | % if c.at_version: |
|
470 | % if c.at_version: | |
471 | <h4> |
|
471 | <h4> | |
472 | ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}: |
|
472 | ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}: | |
473 | </h4> |
|
473 | </h4> | |
474 |
|
474 | |||
475 | <div class="subtitle-compare"> |
|
475 | <div class="subtitle-compare"> | |
476 | ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))} |
|
476 | ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))} | |
477 | </div> |
|
477 | </div> | |
478 |
|
478 | |||
479 | <div class="container"> |
|
479 | <div class="container"> | |
480 | <table class="rctable compare_view_commits"> |
|
480 | <table class="rctable compare_view_commits"> | |
481 | <tr> |
|
481 | <tr> | |
482 | <th></th> |
|
482 | <th></th> | |
483 | <th>${_('Time')}</th> |
|
483 | <th>${_('Time')}</th> | |
484 | <th>${_('Author')}</th> |
|
484 | <th>${_('Author')}</th> | |
485 | <th>${_('Commit')}</th> |
|
485 | <th>${_('Commit')}</th> | |
486 | <th></th> |
|
486 | <th></th> | |
487 | <th>${_('Description')}</th> |
|
487 | <th>${_('Description')}</th> | |
488 | </tr> |
|
488 | </tr> | |
489 |
|
489 | |||
490 | % for c_type, commit in c.commit_changes: |
|
490 | % for c_type, commit in c.commit_changes: | |
491 | % if c_type in ['a', 'r']: |
|
491 | % if c_type in ['a', 'r']: | |
492 | <% |
|
492 | <% | |
493 | if c_type == 'a': |
|
493 | if c_type == 'a': | |
494 | cc_title = _('Commit added in displayed changes') |
|
494 | cc_title = _('Commit added in displayed changes') | |
495 | elif c_type == 'r': |
|
495 | elif c_type == 'r': | |
496 | cc_title = _('Commit removed in displayed changes') |
|
496 | cc_title = _('Commit removed in displayed changes') | |
497 | else: |
|
497 | else: | |
498 | cc_title = '' |
|
498 | cc_title = '' | |
499 | %> |
|
499 | %> | |
500 | <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select"> |
|
500 | <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select"> | |
501 | <td> |
|
501 | <td> | |
502 | <div class="commit-change-indicator color-${c_type}-border"> |
|
502 | <div class="commit-change-indicator color-${c_type}-border"> | |
503 | <div class="commit-change-content color-${c_type} tooltip" title="${cc_title}"> |
|
503 | <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}"> | |
504 | ${c_type.upper()} |
|
504 | ${c_type.upper()} | |
505 | </div> |
|
505 | </div> | |
506 | </div> |
|
506 | </div> | |
507 | </td> |
|
507 | </td> | |
508 | <td class="td-time"> |
|
508 | <td class="td-time"> | |
509 | ${h.age_component(commit.date)} |
|
509 | ${h.age_component(commit.date)} | |
510 | </td> |
|
510 | </td> | |
511 | <td class="td-user"> |
|
511 | <td class="td-user"> | |
512 | ${base.gravatar_with_user(commit.author, 16)} |
|
512 | ${base.gravatar_with_user(commit.author, 16)} | |
513 | </td> |
|
513 | </td> | |
514 | <td class="td-hash"> |
|
514 | <td class="td-hash"> | |
515 | <code> |
|
515 | <code> | |
516 | <a href="${h.url('changeset_home', repo_name=c.target_repo.repo_name, revision=commit.raw_id)}"> |
|
516 | <a href="${h.url('changeset_home', repo_name=c.target_repo.repo_name, revision=commit.raw_id)}"> | |
517 | r${commit.revision}:${h.short_id(commit.raw_id)} |
|
517 | r${commit.revision}:${h.short_id(commit.raw_id)} | |
518 | </a> |
|
518 | </a> | |
519 | ${h.hidden('revisions', commit.raw_id)} |
|
519 | ${h.hidden('revisions', commit.raw_id)} | |
520 | </code> |
|
520 | </code> | |
521 | </td> |
|
521 | </td> | |
522 | <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}"> |
|
522 | <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}"> | |
523 | <div class="show_more_col"> |
|
523 | <div class="show_more_col"> | |
524 | <i class="show_more"></i> |
|
524 | <i class="show_more"></i> | |
525 | </div> |
|
525 | </div> | |
526 | </td> |
|
526 | </td> | |
527 | <td class="mid td-description"> |
|
527 | <td class="mid td-description"> | |
528 | <div class="log-container truncate-wrap"> |
|
528 | <div class="log-container truncate-wrap"> | |
529 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}"> |
|
529 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}"> | |
530 | ${h.urlify_commit_message(commit.message, c.repo_name)} |
|
530 | ${h.urlify_commit_message(commit.message, c.repo_name)} | |
531 | </div> |
|
531 | </div> | |
532 | </div> |
|
532 | </div> | |
533 | </td> |
|
533 | </td> | |
534 | </tr> |
|
534 | </tr> | |
535 | % endif |
|
535 | % endif | |
536 | % endfor |
|
536 | % endfor | |
537 | </table> |
|
537 | </table> | |
538 | </div> |
|
538 | </div> | |
539 |
|
539 | |||
540 | <script> |
|
540 | <script> | |
541 | $('.expand_commit').on('click',function(e){ |
|
541 | $('.expand_commit').on('click',function(e){ | |
542 | var target_expand = $(this); |
|
542 | var target_expand = $(this); | |
543 | var cid = target_expand.data('commitId'); |
|
543 | var cid = target_expand.data('commitId'); | |
544 |
|
544 | |||
545 | if (target_expand.hasClass('open')){ |
|
545 | if (target_expand.hasClass('open')){ | |
546 | $('#c-'+cid).css({ |
|
546 | $('#c-'+cid).css({ | |
547 | 'height': '1.5em', |
|
547 | 'height': '1.5em', | |
548 | 'white-space': 'nowrap', |
|
548 | 'white-space': 'nowrap', | |
549 | 'text-overflow': 'ellipsis', |
|
549 | 'text-overflow': 'ellipsis', | |
550 | 'overflow':'hidden' |
|
550 | 'overflow':'hidden' | |
551 | }); |
|
551 | }); | |
552 | target_expand.removeClass('open'); |
|
552 | target_expand.removeClass('open'); | |
553 | } |
|
553 | } | |
554 | else { |
|
554 | else { | |
555 | $('#c-'+cid).css({ |
|
555 | $('#c-'+cid).css({ | |
556 | 'height': 'auto', |
|
556 | 'height': 'auto', | |
557 | 'white-space': 'pre-line', |
|
557 | 'white-space': 'pre-line', | |
558 | 'text-overflow': 'initial', |
|
558 | 'text-overflow': 'initial', | |
559 | 'overflow':'visible' |
|
559 | 'overflow':'visible' | |
560 | }); |
|
560 | }); | |
561 | target_expand.addClass('open'); |
|
561 | target_expand.addClass('open'); | |
562 | } |
|
562 | } | |
563 | }); |
|
563 | }); | |
564 | </script> |
|
564 | </script> | |
565 |
|
565 | |||
566 | % endif |
|
566 | % endif | |
567 |
|
567 | |||
568 | % else: |
|
568 | % else: | |
569 | <%include file="/compare/compare_commits.mako" /> |
|
569 | <%include file="/compare/compare_commits.mako" /> | |
570 | % endif |
|
570 | % endif | |
571 |
|
571 | |||
572 | <div class="cs_files"> |
|
572 | <div class="cs_files"> | |
573 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
573 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> | |
574 | ${cbdiffs.render_diffset_menu()} |
|
574 | ${cbdiffs.render_diffset_menu()} | |
575 | ${cbdiffs.render_diffset( |
|
575 | ${cbdiffs.render_diffset( | |
576 | c.diffset, use_comments=True, |
|
576 | c.diffset, use_comments=True, | |
577 | collapse_when_files_over=30, |
|
577 | collapse_when_files_over=30, | |
578 | disable_new_comments=not c.allowed_to_comment, |
|
578 | disable_new_comments=not c.allowed_to_comment, | |
579 | deleted_files_comments=c.deleted_files_comments)} |
|
579 | deleted_files_comments=c.deleted_files_comments)} | |
580 | </div> |
|
580 | </div> | |
581 | % else: |
|
581 | % else: | |
582 | ## skipping commits we need to clear the view for missing commits |
|
582 | ## skipping commits we need to clear the view for missing commits | |
583 | <div style="clear:both;"></div> |
|
583 | <div style="clear:both;"></div> | |
584 | % endif |
|
584 | % endif | |
585 |
|
585 | |||
586 | </div> |
|
586 | </div> | |
587 | </div> |
|
587 | </div> | |
588 |
|
588 | |||
589 | ## template for inline comment form |
|
589 | ## template for inline comment form | |
590 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
590 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
591 |
|
591 | |||
592 | ## render general comments |
|
592 | ## render general comments | |
593 |
|
593 | |||
594 | <div id="comment-tr-show"> |
|
594 | <div id="comment-tr-show"> | |
595 | <div class="comment"> |
|
595 | <div class="comment"> | |
596 | % if general_outdated_comm_count_ver: |
|
596 | % if general_outdated_comm_count_ver: | |
597 | <div class="meta"> |
|
597 | <div class="meta"> | |
598 | % if general_outdated_comm_count_ver == 1: |
|
598 | % if general_outdated_comm_count_ver == 1: | |
599 | ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, |
|
599 | ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, | |
600 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a> |
|
600 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a> | |
601 | % else: |
|
601 | % else: | |
602 | ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, |
|
602 | ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, | |
603 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a> |
|
603 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a> | |
604 | % endif |
|
604 | % endif | |
605 | </div> |
|
605 | </div> | |
606 | % endif |
|
606 | % endif | |
607 | </div> |
|
607 | </div> | |
608 | </div> |
|
608 | </div> | |
609 |
|
609 | |||
610 | ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} |
|
610 | ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} | |
611 |
|
611 | |||
612 | % if not c.pull_request.is_closed(): |
|
612 | % if not c.pull_request.is_closed(): | |
613 | ## merge status, and merge action |
|
613 | ## merge status, and merge action | |
614 | <div class="pull-request-merge"> |
|
614 | <div class="pull-request-merge"> | |
615 | <%include file="/pullrequests/pullrequest_merge_checks.mako"/> |
|
615 | <%include file="/pullrequests/pullrequest_merge_checks.mako"/> | |
616 | </div> |
|
616 | </div> | |
617 |
|
617 | |||
618 | ## main comment form and it status |
|
618 | ## main comment form and it status | |
619 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, |
|
619 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, | |
620 | pull_request_id=c.pull_request.pull_request_id), |
|
620 | pull_request_id=c.pull_request.pull_request_id), | |
621 | c.pull_request_review_status, |
|
621 | c.pull_request_review_status, | |
622 | is_pull_request=True, change_status=c.allowed_to_change_status)} |
|
622 | is_pull_request=True, change_status=c.allowed_to_change_status)} | |
623 | %endif |
|
623 | %endif | |
624 |
|
624 | |||
625 | <script type="text/javascript"> |
|
625 | <script type="text/javascript"> | |
626 | if (location.hash) { |
|
626 | if (location.hash) { | |
627 | var result = splitDelimitedHash(location.hash); |
|
627 | var result = splitDelimitedHash(location.hash); | |
628 | var line = $('html').find(result.loc); |
|
628 | var line = $('html').find(result.loc); | |
629 | // show hidden comments if we use location.hash |
|
629 | // show hidden comments if we use location.hash | |
630 | if (line.hasClass('comment-general')) { |
|
630 | if (line.hasClass('comment-general')) { | |
631 | $(line).show(); |
|
631 | $(line).show(); | |
632 | } else if (line.hasClass('comment-inline')) { |
|
632 | } else if (line.hasClass('comment-inline')) { | |
633 | $(line).show(); |
|
633 | $(line).show(); | |
634 | var $cb = $(line).closest('.cb'); |
|
634 | var $cb = $(line).closest('.cb'); | |
635 | $cb.removeClass('cb-collapsed') |
|
635 | $cb.removeClass('cb-collapsed') | |
636 | } |
|
636 | } | |
637 | if (line.length > 0){ |
|
637 | if (line.length > 0){ | |
638 | offsetScroll(line, 70); |
|
638 | offsetScroll(line, 70); | |
639 | } |
|
639 | } | |
640 | } |
|
640 | } | |
641 |
|
641 | |||
642 | versionController = new VersionController(); |
|
642 | versionController = new VersionController(); | |
643 | versionController.init(); |
|
643 | versionController.init(); | |
644 |
|
644 | |||
645 | reviewersController = new ReviewersController(); |
|
645 | reviewersController = new ReviewersController(); | |
646 |
|
646 | |||
647 | $(function(){ |
|
647 | $(function(){ | |
648 |
|
648 | |||
649 | // custom code mirror |
|
649 | // custom code mirror | |
650 | var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input'); |
|
650 | var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input'); | |
651 |
|
651 | |||
652 | var PRDetails = { |
|
652 | var PRDetails = { | |
653 | editButton: $('#open_edit_pullrequest'), |
|
653 | editButton: $('#open_edit_pullrequest'), | |
654 | closeButton: $('#close_edit_pullrequest'), |
|
654 | closeButton: $('#close_edit_pullrequest'), | |
655 | deleteButton: $('#delete_pullrequest'), |
|
655 | deleteButton: $('#delete_pullrequest'), | |
656 | viewFields: $('#pr-desc, #pr-title'), |
|
656 | viewFields: $('#pr-desc, #pr-title'), | |
657 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
657 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), | |
658 |
|
658 | |||
659 | init: function() { |
|
659 | init: function() { | |
660 | var that = this; |
|
660 | var that = this; | |
661 | this.editButton.on('click', function(e) { that.edit(); }); |
|
661 | this.editButton.on('click', function(e) { that.edit(); }); | |
662 | this.closeButton.on('click', function(e) { that.view(); }); |
|
662 | this.closeButton.on('click', function(e) { that.view(); }); | |
663 | }, |
|
663 | }, | |
664 |
|
664 | |||
665 | edit: function(event) { |
|
665 | edit: function(event) { | |
666 | this.viewFields.hide(); |
|
666 | this.viewFields.hide(); | |
667 | this.editButton.hide(); |
|
667 | this.editButton.hide(); | |
668 | this.deleteButton.hide(); |
|
668 | this.deleteButton.hide(); | |
669 | this.closeButton.show(); |
|
669 | this.closeButton.show(); | |
670 | this.editFields.show(); |
|
670 | this.editFields.show(); | |
671 | codeMirrorInstance.refresh(); |
|
671 | codeMirrorInstance.refresh(); | |
672 | }, |
|
672 | }, | |
673 |
|
673 | |||
674 | view: function(event) { |
|
674 | view: function(event) { | |
675 | this.editButton.show(); |
|
675 | this.editButton.show(); | |
676 | this.deleteButton.show(); |
|
676 | this.deleteButton.show(); | |
677 | this.editFields.hide(); |
|
677 | this.editFields.hide(); | |
678 | this.closeButton.hide(); |
|
678 | this.closeButton.hide(); | |
679 | this.viewFields.show(); |
|
679 | this.viewFields.show(); | |
680 | } |
|
680 | } | |
681 | }; |
|
681 | }; | |
682 |
|
682 | |||
683 | var ReviewersPanel = { |
|
683 | var ReviewersPanel = { | |
684 | editButton: $('#open_edit_reviewers'), |
|
684 | editButton: $('#open_edit_reviewers'), | |
685 | closeButton: $('#close_edit_reviewers'), |
|
685 | closeButton: $('#close_edit_reviewers'), | |
686 | addButton: $('#add_reviewer'), |
|
686 | addButton: $('#add_reviewer'), | |
687 | removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove,.reviewer_member_mandatory'), |
|
687 | removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove,.reviewer_member_mandatory'), | |
688 |
|
688 | |||
689 | init: function() { |
|
689 | init: function() { | |
690 | var self = this; |
|
690 | var self = this; | |
691 | this.editButton.on('click', function(e) { self.edit(); }); |
|
691 | this.editButton.on('click', function(e) { self.edit(); }); | |
692 | this.closeButton.on('click', function(e) { self.close(); }); |
|
692 | this.closeButton.on('click', function(e) { self.close(); }); | |
693 | }, |
|
693 | }, | |
694 |
|
694 | |||
695 | edit: function(event) { |
|
695 | edit: function(event) { | |
696 | this.editButton.hide(); |
|
696 | this.editButton.hide(); | |
697 | this.closeButton.show(); |
|
697 | this.closeButton.show(); | |
698 | this.addButton.show(); |
|
698 | this.addButton.show(); | |
699 | this.removeButtons.css('visibility', 'visible'); |
|
699 | this.removeButtons.css('visibility', 'visible'); | |
700 | // review rules |
|
700 | // review rules | |
701 | reviewersController.loadReviewRules( |
|
701 | reviewersController.loadReviewRules( | |
702 | ${c.pull_request.reviewer_data_json | n}); |
|
702 | ${c.pull_request.reviewer_data_json | n}); | |
703 | }, |
|
703 | }, | |
704 |
|
704 | |||
705 | close: function(event) { |
|
705 | close: function(event) { | |
706 | this.editButton.show(); |
|
706 | this.editButton.show(); | |
707 | this.closeButton.hide(); |
|
707 | this.closeButton.hide(); | |
708 | this.addButton.hide(); |
|
708 | this.addButton.hide(); | |
709 | this.removeButtons.css('visibility', 'hidden'); |
|
709 | this.removeButtons.css('visibility', 'hidden'); | |
710 | // hide review rules |
|
710 | // hide review rules | |
711 | reviewersController.hideReviewRules() |
|
711 | reviewersController.hideReviewRules() | |
712 | } |
|
712 | } | |
713 | }; |
|
713 | }; | |
714 |
|
714 | |||
715 | PRDetails.init(); |
|
715 | PRDetails.init(); | |
716 | ReviewersPanel.init(); |
|
716 | ReviewersPanel.init(); | |
717 |
|
717 | |||
718 | showOutdated = function(self){ |
|
718 | showOutdated = function(self){ | |
719 | $('.comment-inline.comment-outdated').show(); |
|
719 | $('.comment-inline.comment-outdated').show(); | |
720 | $('.filediff-outdated').show(); |
|
720 | $('.filediff-outdated').show(); | |
721 | $('.showOutdatedComments').hide(); |
|
721 | $('.showOutdatedComments').hide(); | |
722 | $('.hideOutdatedComments').show(); |
|
722 | $('.hideOutdatedComments').show(); | |
723 | }; |
|
723 | }; | |
724 |
|
724 | |||
725 | hideOutdated = function(self){ |
|
725 | hideOutdated = function(self){ | |
726 | $('.comment-inline.comment-outdated').hide(); |
|
726 | $('.comment-inline.comment-outdated').hide(); | |
727 | $('.filediff-outdated').hide(); |
|
727 | $('.filediff-outdated').hide(); | |
728 | $('.hideOutdatedComments').hide(); |
|
728 | $('.hideOutdatedComments').hide(); | |
729 | $('.showOutdatedComments').show(); |
|
729 | $('.showOutdatedComments').show(); | |
730 | }; |
|
730 | }; | |
731 |
|
731 | |||
732 | refreshMergeChecks = function(){ |
|
732 | refreshMergeChecks = function(){ | |
733 | var loadUrl = "${h.url.current(merge_checks=1)}"; |
|
733 | var loadUrl = "${h.url.current(merge_checks=1)}"; | |
734 | $('.pull-request-merge').css('opacity', 0.3); |
|
734 | $('.pull-request-merge').css('opacity', 0.3); | |
735 | $('.action-buttons-extra').css('opacity', 0.3); |
|
735 | $('.action-buttons-extra').css('opacity', 0.3); | |
736 |
|
736 | |||
737 | $('.pull-request-merge').load( |
|
737 | $('.pull-request-merge').load( | |
738 | loadUrl, function() { |
|
738 | loadUrl, function() { | |
739 | $('.pull-request-merge').css('opacity', 1); |
|
739 | $('.pull-request-merge').css('opacity', 1); | |
740 |
|
740 | |||
741 | $('.action-buttons-extra').css('opacity', 1); |
|
741 | $('.action-buttons-extra').css('opacity', 1); | |
742 | injectCloseAction(); |
|
742 | injectCloseAction(); | |
743 | } |
|
743 | } | |
744 | ); |
|
744 | ); | |
745 | }; |
|
745 | }; | |
746 |
|
746 | |||
747 | injectCloseAction = function() { |
|
747 | injectCloseAction = function() { | |
748 | var closeAction = $('#close-pull-request-action').html(); |
|
748 | var closeAction = $('#close-pull-request-action').html(); | |
749 | var $actionButtons = $('.action-buttons-extra'); |
|
749 | var $actionButtons = $('.action-buttons-extra'); | |
750 | // clear the action before |
|
750 | // clear the action before | |
751 | $actionButtons.html(""); |
|
751 | $actionButtons.html(""); | |
752 | $actionButtons.html(closeAction); |
|
752 | $actionButtons.html(closeAction); | |
753 | }; |
|
753 | }; | |
754 |
|
754 | |||
755 | closePullRequest = function (status) { |
|
755 | closePullRequest = function (status) { | |
756 | // inject closing flag |
|
756 | // inject closing flag | |
757 | $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">'); |
|
757 | $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">'); | |
758 | $(generalCommentForm.statusChange).select2("val", status).trigger('change'); |
|
758 | $(generalCommentForm.statusChange).select2("val", status).trigger('change'); | |
759 | $(generalCommentForm.submitForm).submit(); |
|
759 | $(generalCommentForm.submitForm).submit(); | |
760 | }; |
|
760 | }; | |
761 |
|
761 | |||
762 | $('#show-outdated-comments').on('click', function(e){ |
|
762 | $('#show-outdated-comments').on('click', function(e){ | |
763 | var button = $(this); |
|
763 | var button = $(this); | |
764 | var outdated = $('.comment-outdated'); |
|
764 | var outdated = $('.comment-outdated'); | |
765 |
|
765 | |||
766 | if (button.html() === "(Show)") { |
|
766 | if (button.html() === "(Show)") { | |
767 | button.html("(Hide)"); |
|
767 | button.html("(Hide)"); | |
768 | outdated.show(); |
|
768 | outdated.show(); | |
769 | } else { |
|
769 | } else { | |
770 | button.html("(Show)"); |
|
770 | button.html("(Show)"); | |
771 | outdated.hide(); |
|
771 | outdated.hide(); | |
772 | } |
|
772 | } | |
773 | }); |
|
773 | }); | |
774 |
|
774 | |||
775 | $('.show-inline-comments').on('change', function(e){ |
|
775 | $('.show-inline-comments').on('change', function(e){ | |
776 | var show = 'none'; |
|
776 | var show = 'none'; | |
777 | var target = e.currentTarget; |
|
777 | var target = e.currentTarget; | |
778 | if(target.checked){ |
|
778 | if(target.checked){ | |
779 | show = '' |
|
779 | show = '' | |
780 | } |
|
780 | } | |
781 | var boxid = $(target).attr('id_for'); |
|
781 | var boxid = $(target).attr('id_for'); | |
782 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
782 | var comments = $('#{0} .inline-comments'.format(boxid)); | |
783 | var fn_display = function(idx){ |
|
783 | var fn_display = function(idx){ | |
784 | $(this).css('display', show); |
|
784 | $(this).css('display', show); | |
785 | }; |
|
785 | }; | |
786 | $(comments).each(fn_display); |
|
786 | $(comments).each(fn_display); | |
787 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
787 | var btns = $('#{0} .inline-comments-button'.format(boxid)); | |
788 | $(btns).each(fn_display); |
|
788 | $(btns).each(fn_display); | |
789 | }); |
|
789 | }); | |
790 |
|
790 | |||
791 | $('#merge_pull_request_form').submit(function() { |
|
791 | $('#merge_pull_request_form').submit(function() { | |
792 | if (!$('#merge_pull_request').attr('disabled')) { |
|
792 | if (!$('#merge_pull_request').attr('disabled')) { | |
793 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
793 | $('#merge_pull_request').attr('disabled', 'disabled'); | |
794 | } |
|
794 | } | |
795 | return true; |
|
795 | return true; | |
796 | }); |
|
796 | }); | |
797 |
|
797 | |||
798 | $('#edit_pull_request').on('click', function(e){ |
|
798 | $('#edit_pull_request').on('click', function(e){ | |
799 | var title = $('#pr-title-input').val(); |
|
799 | var title = $('#pr-title-input').val(); | |
800 | var description = codeMirrorInstance.getValue(); |
|
800 | var description = codeMirrorInstance.getValue(); | |
801 | editPullRequest( |
|
801 | editPullRequest( | |
802 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
802 | "${c.repo_name}", "${c.pull_request.pull_request_id}", | |
803 | title, description); |
|
803 | title, description); | |
804 | }); |
|
804 | }); | |
805 |
|
805 | |||
806 | $('#update_pull_request').on('click', function(e){ |
|
806 | $('#update_pull_request').on('click', function(e){ | |
807 | $(this).attr('disabled', 'disabled'); |
|
807 | $(this).attr('disabled', 'disabled'); | |
808 | $(this).addClass('disabled'); |
|
808 | $(this).addClass('disabled'); | |
809 | $(this).html(_gettext('Saving...')); |
|
809 | $(this).html(_gettext('Saving...')); | |
810 | reviewersController.updateReviewers( |
|
810 | reviewersController.updateReviewers( | |
811 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
811 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
812 | }); |
|
812 | }); | |
813 |
|
813 | |||
814 | $('#update_commits').on('click', function(e){ |
|
814 | $('#update_commits').on('click', function(e){ | |
815 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
815 | var isDisabled = !$(e.currentTarget).attr('disabled'); | |
816 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
816 | $(e.currentTarget).attr('disabled', 'disabled'); | |
817 | $(e.currentTarget).addClass('disabled'); |
|
817 | $(e.currentTarget).addClass('disabled'); | |
818 | $(e.currentTarget).removeClass('btn-primary'); |
|
818 | $(e.currentTarget).removeClass('btn-primary'); | |
819 | $(e.currentTarget).text(_gettext('Updating...')); |
|
819 | $(e.currentTarget).text(_gettext('Updating...')); | |
820 | if(isDisabled){ |
|
820 | if(isDisabled){ | |
821 | updateCommits( |
|
821 | updateCommits( | |
822 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
822 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
823 | } |
|
823 | } | |
824 | }); |
|
824 | }); | |
825 | // fixing issue with caches on firefox |
|
825 | // fixing issue with caches on firefox | |
826 | $('#update_commits').removeAttr("disabled"); |
|
826 | $('#update_commits').removeAttr("disabled"); | |
827 |
|
827 | |||
828 | $('.show-inline-comments').on('click', function(e){ |
|
828 | $('.show-inline-comments').on('click', function(e){ | |
829 | var boxid = $(this).attr('data-comment-id'); |
|
829 | var boxid = $(this).attr('data-comment-id'); | |
830 | var button = $(this); |
|
830 | var button = $(this); | |
831 |
|
831 | |||
832 | if(button.hasClass("comments-visible")) { |
|
832 | if(button.hasClass("comments-visible")) { | |
833 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
833 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
834 | $(this).hide(); |
|
834 | $(this).hide(); | |
835 | }); |
|
835 | }); | |
836 | button.removeClass("comments-visible"); |
|
836 | button.removeClass("comments-visible"); | |
837 | } else { |
|
837 | } else { | |
838 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
838 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
839 | $(this).show(); |
|
839 | $(this).show(); | |
840 | }); |
|
840 | }); | |
841 | button.addClass("comments-visible"); |
|
841 | button.addClass("comments-visible"); | |
842 | } |
|
842 | } | |
843 | }); |
|
843 | }); | |
844 |
|
844 | |||
845 | // register submit callback on commentForm form to track TODOs |
|
845 | // register submit callback on commentForm form to track TODOs | |
846 | window.commentFormGlobalSubmitSuccessCallback = function(){ |
|
846 | window.commentFormGlobalSubmitSuccessCallback = function(){ | |
847 | refreshMergeChecks(); |
|
847 | refreshMergeChecks(); | |
848 | }; |
|
848 | }; | |
849 | // initial injection |
|
849 | // initial injection | |
850 | injectCloseAction(); |
|
850 | injectCloseAction(); | |
851 |
|
851 | |||
852 | ReviewerAutoComplete('#user'); |
|
852 | ReviewerAutoComplete('#user'); | |
853 |
|
853 | |||
854 | }) |
|
854 | }) | |
855 | </script> |
|
855 | </script> | |
856 |
|
856 | |||
857 | </div> |
|
857 | </div> | |
858 | </div> |
|
858 | </div> | |
859 |
|
859 | |||
860 | </%def> |
|
860 | </%def> |
@@ -1,29 +1,29 b'' | |||||
1 | <%inherit file="/base/base.mako"/> |
|
1 | <%inherit file="/base/base.mako"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ## represents page title |
|
4 | ## represents page title | |
5 | ${_('%s Summary') % c.repo_name} |
|
5 | ${_('%s Summary') % c.repo_name} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${h.branding(c.rhodecode_name)} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 |
|
11 | |||
12 | <%def name="head_extra()"> |
|
12 | <%def name="head_extra()"> | |
13 | <link href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> |
|
13 | <link href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${h.tooltip(_('%s ATOM feed') % c.repo_name)}" type="application/atom+xml" /> | |
14 | <link href="${h.url('rss_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> |
|
14 | <link href="${h.url('rss_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${h.tooltip(_('%s RSS feed') % c.repo_name)}" type="application/rss+xml" /> | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 |
|
17 | |||
18 | <%def name="menu_bar_nav()"> |
|
18 | <%def name="menu_bar_nav()"> | |
19 | ${self.menu_items(active='repositories')} |
|
19 | ${self.menu_items(active='repositories')} | |
20 | </%def> |
|
20 | </%def> | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | <%def name="breadcrumbs_links()"> |
|
23 | <%def name="breadcrumbs_links()"> | |
24 | </%def> |
|
24 | </%def> | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | <%def name="main()"> |
|
27 | <%def name="main()"> | |
28 | ${next.main()} |
|
28 | ${next.main()} | |
29 | </%def> |
|
29 | </%def> |
@@ -1,128 +1,128 b'' | |||||
1 | <%inherit file="/summary/base.mako"/> |
|
1 | <%inherit file="/summary/base.mako"/> | |
2 |
|
2 | |||
3 | <%namespace name="components" file="/summary/components.mako"/> |
|
3 | <%namespace name="components" file="/summary/components.mako"/> | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | <%def name="menu_bar_subnav()"> |
|
6 | <%def name="menu_bar_subnav()"> | |
7 | ${self.repo_menu(active='summary')} |
|
7 | ${self.repo_menu(active='summary')} | |
8 | </%def> |
|
8 | </%def> | |
9 |
|
9 | |||
10 | <%def name="main()"> |
|
10 | <%def name="main()"> | |
11 |
|
11 | |||
12 | <div class="title"> |
|
12 | <div class="title"> | |
13 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
13 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
14 | <ul class="links icon-only-links block-right"> |
|
14 | <ul class="links icon-only-links block-right"> | |
15 | <li> |
|
15 | <li> | |
16 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
16 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
17 | <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a> |
|
17 | <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a> | |
18 | %else: |
|
18 | %else: | |
19 | <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a> |
|
19 | <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a> | |
20 | %endif |
|
20 | %endif | |
21 | </li> |
|
21 | </li> | |
22 | </ul> |
|
22 | </ul> | |
23 | </div> |
|
23 | </div> | |
24 |
|
24 | |||
25 | <div id="repo-summary" class="summary"> |
|
25 | <div id="repo-summary" class="summary"> | |
26 | ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)} |
|
26 | ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)} | |
27 | ${components.summary_stats(gravatar_function=self.gravatar_with_user)} |
|
27 | ${components.summary_stats(gravatar_function=self.gravatar_with_user)} | |
28 | </div><!--end repo-summary--> |
|
28 | </div><!--end repo-summary--> | |
29 |
|
29 | |||
30 |
|
30 | |||
31 | <div class="box" > |
|
31 | <div class="box" > | |
32 | %if not c.repo_commits: |
|
32 | %if not c.repo_commits: | |
33 | <div class="title"> |
|
33 | <div class="title"> | |
34 | <h3>${_('Quick start')}</h3> |
|
34 | <h3>${_('Quick start')}</h3> | |
35 | </div> |
|
35 | </div> | |
36 | %endif |
|
36 | %endif | |
37 | <div class="table"> |
|
37 | <div class="table"> | |
38 | <div id="shortlog_data"> |
|
38 | <div id="shortlog_data"> | |
39 | <%include file='summary_commits.mako'/> |
|
39 | <%include file='summary_commits.mako'/> | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
41 | </div> | |
42 | </div> |
|
42 | </div> | |
43 |
|
43 | |||
44 | %if c.readme_data: |
|
44 | %if c.readme_data: | |
45 | <div id="readme" class="anchor"> |
|
45 | <div id="readme" class="anchor"> | |
46 | <div class="box" > |
|
46 | <div class="box" > | |
47 | <div class="title" title="${_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1])}"> |
|
47 | <div class="title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}"> | |
48 | <h3 class="breadcrumbs"> |
|
48 | <h3 class="breadcrumbs"> | |
49 | <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a> |
|
49 | <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a> | |
50 | </h3> |
|
50 | </h3> | |
51 | </div> |
|
51 | </div> | |
52 | <div class="readme codeblock"> |
|
52 | <div class="readme codeblock"> | |
53 | <div class="readme_box"> |
|
53 | <div class="readme_box"> | |
54 | ${c.readme_data|n} |
|
54 | ${c.readme_data|n} | |
55 | </div> |
|
55 | </div> | |
56 | </div> |
|
56 | </div> | |
57 | </div> |
|
57 | </div> | |
58 | </div> |
|
58 | </div> | |
59 | %endif |
|
59 | %endif | |
60 |
|
60 | |||
61 | <script type="text/javascript"> |
|
61 | <script type="text/javascript"> | |
62 | $(document).ready(function(){ |
|
62 | $(document).ready(function(){ | |
63 | $('#clone_by_name').on('click',function(e){ |
|
63 | $('#clone_by_name').on('click',function(e){ | |
64 | // show url by name and hide name button |
|
64 | // show url by name and hide name button | |
65 | $('#clone_url').show(); |
|
65 | $('#clone_url').show(); | |
66 | $('#clone_by_name').hide(); |
|
66 | $('#clone_by_name').hide(); | |
67 |
|
67 | |||
68 | // hide url by id and show name button |
|
68 | // hide url by id and show name button | |
69 | $('#clone_by_id').show(); |
|
69 | $('#clone_by_id').show(); | |
70 | $('#clone_url_id').hide(); |
|
70 | $('#clone_url_id').hide(); | |
71 |
|
71 | |||
72 | }); |
|
72 | }); | |
73 | $('#clone_by_id').on('click',function(e){ |
|
73 | $('#clone_by_id').on('click',function(e){ | |
74 |
|
74 | |||
75 | // show url by id and hide id button |
|
75 | // show url by id and hide id button | |
76 | $('#clone_by_id').hide(); |
|
76 | $('#clone_by_id').hide(); | |
77 | $('#clone_url_id').show(); |
|
77 | $('#clone_url_id').show(); | |
78 |
|
78 | |||
79 | // hide url by name and show id button |
|
79 | // hide url by name and show id button | |
80 | $('#clone_by_name').show(); |
|
80 | $('#clone_by_name').show(); | |
81 | $('#clone_url').hide(); |
|
81 | $('#clone_url').hide(); | |
82 | }); |
|
82 | }); | |
83 |
|
83 | |||
84 | var initialCommitData = { |
|
84 | var initialCommitData = { | |
85 | id: null, |
|
85 | id: null, | |
86 | text: 'tip', |
|
86 | text: 'tip', | |
87 | type: 'tag', |
|
87 | type: 'tag', | |
88 | raw_id: null, |
|
88 | raw_id: null, | |
89 | files_url: null |
|
89 | files_url: null | |
90 | }; |
|
90 | }; | |
91 |
|
91 | |||
92 | select2RefSwitcher('#download_options', initialCommitData); |
|
92 | select2RefSwitcher('#download_options', initialCommitData); | |
93 |
|
93 | |||
94 | // on change of download options |
|
94 | // on change of download options | |
95 | $('#download_options').on('change', function(e) { |
|
95 | $('#download_options').on('change', function(e) { | |
96 | // format of Object {text: "v0.0.3", type: "tag", id: "rev"} |
|
96 | // format of Object {text: "v0.0.3", type: "tag", id: "rev"} | |
97 | var selected_cs = e.added; |
|
97 | var selected_cs = e.added; | |
98 | var fname= e.added.raw_id + ".zip"; |
|
98 | var fname= e.added.raw_id + ".zip"; | |
99 | var href = pyroutes.url('files_archive_home', {'repo_name': templateContext.repo_name, 'fname':fname}); |
|
99 | var href = pyroutes.url('files_archive_home', {'repo_name': templateContext.repo_name, 'fname':fname}); | |
100 | // set new label |
|
100 | // set new label | |
101 | $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip"); |
|
101 | $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip"); | |
102 |
|
102 | |||
103 | // set new url to button, |
|
103 | // set new url to button, | |
104 | $('#archive_link').attr('href', href) |
|
104 | $('#archive_link').attr('href', href) | |
105 | }); |
|
105 | }); | |
106 |
|
106 | |||
107 |
|
107 | |||
108 | // load details on summary page expand |
|
108 | // load details on summary page expand | |
109 | $('#summary_details_expand').on('click', function() { |
|
109 | $('#summary_details_expand').on('click', function() { | |
110 |
|
110 | |||
111 | var callback = function (data) { |
|
111 | var callback = function (data) { | |
112 | % if c.show_stats: |
|
112 | % if c.show_stats: | |
113 | showRepoStats('lang_stats', data); |
|
113 | showRepoStats('lang_stats', data); | |
114 | % endif |
|
114 | % endif | |
115 | }; |
|
115 | }; | |
116 |
|
116 | |||
117 | showRepoSize( |
|
117 | showRepoSize( | |
118 | 'repo_size_container', |
|
118 | 'repo_size_container', | |
119 | templateContext.repo_name, |
|
119 | templateContext.repo_name, | |
120 | templateContext.repo_landing_commit, |
|
120 | templateContext.repo_landing_commit, | |
121 | callback); |
|
121 | callback); | |
122 |
|
122 | |||
123 | }) |
|
123 | }) | |
124 |
|
124 | |||
125 | }) |
|
125 | }) | |
126 | </script> |
|
126 | </script> | |
127 |
|
127 | |||
128 | </%def> |
|
128 | </%def> |
@@ -1,136 +1,136 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | <%namespace name="base" file="/base/base.mako"/> | |
3 | %if c.repo_commits: |
|
3 | %if c.repo_commits: | |
4 | <table class="rctable repo_summary table_disp"> |
|
4 | <table class="rctable repo_summary table_disp"> | |
5 | <tr> |
|
5 | <tr> | |
6 |
|
6 | |||
7 | <th class="status" colspan="2"></th> |
|
7 | <th class="status" colspan="2"></th> | |
8 | <th>${_('Commit')}</th> |
|
8 | <th>${_('Commit')}</th> | |
9 | <th>${_('Commit message')}</th> |
|
9 | <th>${_('Commit message')}</th> | |
10 | <th>${_('Age')}</th> |
|
10 | <th>${_('Age')}</th> | |
11 | <th>${_('Author')}</th> |
|
11 | <th>${_('Author')}</th> | |
12 | <th>${_('Refs')}</th> |
|
12 | <th>${_('Refs')}</th> | |
13 | </tr> |
|
13 | </tr> | |
14 | %for cnt,cs in enumerate(c.repo_commits): |
|
14 | %for cnt,cs in enumerate(c.repo_commits): | |
15 | <tr class="parity${cnt%2}"> |
|
15 | <tr class="parity${cnt%2}"> | |
16 |
|
16 | |||
17 | <td class="td-status"> |
|
17 | <td class="td-status"> | |
18 | %if c.statuses.get(cs.raw_id): |
|
18 | %if c.statuses.get(cs.raw_id): | |
19 | <div class="changeset-status-ico shortlog"> |
|
19 | <div class="changeset-status-ico shortlog"> | |
20 | %if c.statuses.get(cs.raw_id)[2]: |
|
20 | %if c.statuses.get(cs.raw_id)[2]: | |
21 | <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])}"> |
|
21 | <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])}"> | |
22 | <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div> |
|
22 | <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div> | |
23 | </a> |
|
23 | </a> | |
24 | %else: |
|
24 | %else: | |
25 | <a class="tooltip" title="${_('Commit status: %s') % h.commit_status_lbl(c.statuses.get(cs.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> |
|
25 | <a class="tooltip" title="${_('Commit status: %s') % h.commit_status_lbl(c.statuses.get(cs.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> | |
26 | <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div> |
|
26 | <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div> | |
27 | </a> |
|
27 | </a> | |
28 | %endif |
|
28 | %endif | |
29 | </div> |
|
29 | </div> | |
30 | %else: |
|
30 | %else: | |
31 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> |
|
31 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> | |
32 | %endif |
|
32 | %endif | |
33 | </td> |
|
33 | </td> | |
34 | <td class="td-comments"> |
|
34 | <td class="td-comments"> | |
35 | %if c.comments.get(cs.raw_id,[]): |
|
35 | %if c.comments.get(cs.raw_id,[]): | |
36 | <a title="${_('Commit has comments')}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> |
|
36 | <a title="${_('Commit has comments')}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> | |
37 | <i class="icon-comment"></i> ${len(c.comments[cs.raw_id])} |
|
37 | <i class="icon-comment"></i> ${len(c.comments[cs.raw_id])} | |
38 | </a> |
|
38 | </a> | |
39 | %endif |
|
39 | %endif | |
40 | </td> |
|
40 | </td> | |
41 | <td class="td-commit"> |
|
41 | <td class="td-commit"> | |
42 | <pre><a href="${h.url('changeset_home', repo_name=c.repo_name, revision=cs.raw_id)}">${h.show_id(cs)}</a></pre> |
|
42 | <pre><a href="${h.url('changeset_home', repo_name=c.repo_name, revision=cs.raw_id)}">${h.show_id(cs)}</a></pre> | |
43 | </td> |
|
43 | </td> | |
44 |
|
44 | |||
45 | <td class="td-description mid"> |
|
45 | <td class="td-description mid"> | |
46 | <div class="log-container truncate-wrap"> |
|
46 | <div class="log-container truncate-wrap"> | |
47 | <div class="message truncate" id="c-${cs.raw_id}">${h.urlify_commit_message(cs.message, c.repo_name)}</div> |
|
47 | <div class="message truncate" id="c-${cs.raw_id}">${h.urlify_commit_message(cs.message, c.repo_name)}</div> | |
48 | </div> |
|
48 | </div> | |
49 | </td> |
|
49 | </td> | |
50 |
|
50 | |||
51 | <td class="td-time"> |
|
51 | <td class="td-time"> | |
52 | ${h.age_component(cs.date)} |
|
52 | ${h.age_component(cs.date)} | |
53 | </td> |
|
53 | </td> | |
54 | <td class="td-user author"> |
|
54 | <td class="td-user author"> | |
55 | ${base.gravatar_with_user(cs.author)} |
|
55 | ${base.gravatar_with_user(cs.author)} | |
56 | </td> |
|
56 | </td> | |
57 |
|
57 | |||
58 | <td class="td-tags"> |
|
58 | <td class="td-tags"> | |
59 | <div class="autoexpand"> |
|
59 | <div class="autoexpand"> | |
60 | %if h.is_hg(c.rhodecode_repo): |
|
60 | %if h.is_hg(c.rhodecode_repo): | |
61 | %for book in cs.bookmarks: |
|
61 | %for book in cs.bookmarks: | |
62 | <span class="booktag tag" title="${_('Bookmark %s') % book}"> |
|
62 | <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}"> | |
63 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
63 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> | |
64 | </span> |
|
64 | </span> | |
65 | %endfor |
|
65 | %endfor | |
66 | %endif |
|
66 | %endif | |
67 | ## tags |
|
67 | ## tags | |
68 | %for tag in cs.tags: |
|
68 | %for tag in cs.tags: | |
69 | <span class="tagtag tag" title="${_('Tag %s') % tag}"> |
|
69 | <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}"> | |
70 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a> |
|
70 | <a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a> | |
71 | </span> |
|
71 | </span> | |
72 | %endfor |
|
72 | %endfor | |
73 |
|
73 | |||
74 | ## branch |
|
74 | ## branch | |
75 | %if cs.branch: |
|
75 | %if cs.branch: | |
76 | <span class="branchtag tag" title="${_('Branch %s') % cs.branch}"> |
|
76 | <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % cs.branch)}"> | |
77 | <a href="${h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch)}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a> |
|
77 | <a href="${h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch)}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a> | |
78 | </span> |
|
78 | </span> | |
79 | %endif |
|
79 | %endif | |
80 | </div> |
|
80 | </div> | |
81 | </td> |
|
81 | </td> | |
82 | </tr> |
|
82 | </tr> | |
83 | %endfor |
|
83 | %endfor | |
84 |
|
84 | |||
85 | </table> |
|
85 | </table> | |
86 |
|
86 | |||
87 | <script type="text/javascript"> |
|
87 | <script type="text/javascript"> | |
88 | $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 2000, scrollTo: false }); |
|
88 | $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 2000, scrollTo: false }); | |
89 | $(document).on('pjax:success', function(){ timeagoActivate(); }); |
|
89 | $(document).on('pjax:success', function(){ timeagoActivate(); }); | |
90 | </script> |
|
90 | </script> | |
91 |
|
91 | |||
92 | <div class="pagination-wh pagination-left"> |
|
92 | <div class="pagination-wh pagination-left"> | |
93 | ${c.repo_commits.pager('$link_previous ~2~ $link_next')} |
|
93 | ${c.repo_commits.pager('$link_previous ~2~ $link_next')} | |
94 | </div> |
|
94 | </div> | |
95 | %else: |
|
95 | %else: | |
96 |
|
96 | |||
97 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): |
|
97 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): | |
98 | <div class="quick_start"> |
|
98 | <div class="quick_start"> | |
99 | <div class="fieldset"> |
|
99 | <div class="fieldset"> | |
100 | <div class="left-label">${_('Add or upload files directly via RhodeCode:')}</div> |
|
100 | <div class="left-label">${_('Add or upload files directly via RhodeCode:')}</div> | |
101 | <div class="right-content"> |
|
101 | <div class="right-content"> | |
102 | <div id="add_node_id" class="add_node"> |
|
102 | <div id="add_node_id" class="add_node"> | |
103 | <a href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='', anchor='edit')}" class="btn btn-default">${_('Add New File')}</a> |
|
103 | <a href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='', anchor='edit')}" class="btn btn-default">${_('Add New File')}</a> | |
104 | </div> |
|
104 | </div> | |
105 | </div> |
|
105 | </div> | |
106 | %endif |
|
106 | %endif | |
107 | </div> |
|
107 | </div> | |
108 |
|
108 | |||
109 | %if not h.is_svn(c.rhodecode_repo): |
|
109 | %if not h.is_svn(c.rhodecode_repo): | |
110 | <div class="fieldset"> |
|
110 | <div class="fieldset"> | |
111 | <div class="left-label">${_('Push new repo:')}</div> |
|
111 | <div class="left-label">${_('Push new repo:')}</div> | |
112 | <div class="right-content"> |
|
112 | <div class="right-content"> | |
113 | <pre> |
|
113 | <pre> | |
114 | ${c.rhodecode_repo.alias} clone ${c.clone_repo_url} |
|
114 | ${c.rhodecode_repo.alias} clone ${c.clone_repo_url} | |
115 | ${c.rhodecode_repo.alias} add README # add first file |
|
115 | ${c.rhodecode_repo.alias} add README # add first file | |
116 | ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message |
|
116 | ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message | |
117 | ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back |
|
117 | ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back | |
118 | </pre> |
|
118 | </pre> | |
119 | </div> |
|
119 | </div> | |
120 | </div> |
|
120 | </div> | |
121 | <div class="fieldset"> |
|
121 | <div class="fieldset"> | |
122 | <div class="left-label">${_('Existing repository?')}</div> |
|
122 | <div class="left-label">${_('Existing repository?')}</div> | |
123 | <div class="right-content"> |
|
123 | <div class="right-content"> | |
124 | <pre> |
|
124 | <pre> | |
125 | %if h.is_git(c.rhodecode_repo): |
|
125 | %if h.is_git(c.rhodecode_repo): | |
126 | git remote add origin ${c.clone_repo_url} |
|
126 | git remote add origin ${c.clone_repo_url} | |
127 | git push -u origin master |
|
127 | git push -u origin master | |
128 | %else: |
|
128 | %else: | |
129 | hg push ${c.clone_repo_url} |
|
129 | hg push ${c.clone_repo_url} | |
130 | %endif |
|
130 | %endif | |
131 | </pre> |
|
131 | </pre> | |
132 | </div> |
|
132 | </div> | |
133 | </div> |
|
133 | </div> | |
134 | %endif |
|
134 | %endif | |
135 | </div> |
|
135 | </div> | |
136 | %endif |
|
136 | %endif |
@@ -1,29 +1,29 b'' | |||||
1 | ## DATA TABLE RE USABLE ELEMENTS FOR TAGS |
|
1 | ## DATA TABLE RE USABLE ELEMENTS FOR TAGS | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="tags" file="/tags/tags_data.mako"/> |
|
3 | ## <%namespace name="tags" file="/tags/tags_data.mako"/> | |
4 | ## tags.<func_name>(arg,arg2) |
|
4 | ## tags.<func_name>(arg,arg2) | |
5 |
|
5 | |||
6 | <%def name="compare(commit_id)"> |
|
6 | <%def name="compare(commit_id)"> | |
7 | <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/> |
|
7 | <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/> | |
8 | <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/> |
|
8 | <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/> | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%def name="name(name, files_url)"> |
|
11 | <%def name="name(name, files_url)"> | |
12 | <span class="tagtag tag" title="${_('Tag %s') % (name,)}"> |
|
12 | <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % (name,))}"> | |
13 | <a href="${files_url}"><i class="icon-tag"></i>${name}</a> |
|
13 | <a href="${files_url}"><i class="icon-tag"></i>${name}</a> | |
14 | </span> |
|
14 | </span> | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="date(date)"> |
|
17 | <%def name="date(date)"> | |
18 | ${h.age_component(date)} |
|
18 | ${h.age_component(date)} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="author(author)"> |
|
21 | <%def name="author(author)"> | |
22 | <span class="tooltip" title="${author}">${h.link_to_user(author)}</span> |
|
22 | <span class="tooltip" title="${h.tooltip(author)}">${h.link_to_user(author)}</span> | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="commit(message, commit_id, commit_idx)"> |
|
25 | <%def name="commit(message, commit_id, commit_idx)"> | |
26 | <div> |
|
26 | <div> | |
27 | <pre><a title="${message}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre> |
|
27 | <pre><a title="${h.tooltip(message)}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre> | |
28 | </div> |
|
28 | </div> | |
29 | </%def> |
|
29 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now