##// END OF EJS Templates
tooltip: use consistent h.tooltip usage to set tooltips.
dan -
r1843:ae62b3c2 default
parent child Browse files
Show More
@@ -1,108 +1,108 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="robots()">
5 5 %if c.gist.gist_type != 'public':
6 6 <meta name="robots" content="noindex, nofollow">
7 7 %else:
8 8 ${parent.robots()}
9 9 %endif
10 10 </%def>
11 11
12 12 <%def name="title()">
13 13 ${_('Gist')} &middot; ${c.gist.gist_access_id}
14 14 %if c.rhodecode_name:
15 15 &middot; ${h.branding(c.rhodecode_name)}
16 16 %endif
17 17 </%def>
18 18
19 19 <%def name="breadcrumbs_links()">
20 20 ${_('Gist')} &middot; ${c.gist.gist_access_id}
21 21 / ${_('URL')}: ${c.gist.gist_url()}
22 22 </%def>
23 23
24 24 <%def name="menu_bar_nav()">
25 25 ${self.menu_items(active='gists')}
26 26 </%def>
27 27
28 28 <%def name="main()">
29 29 <div class="box">
30 30 <!-- box / title -->
31 31 <div class="title">
32 32 ${self.breadcrumbs()}
33 33 %if c.rhodecode_user.username != h.DEFAULT_USER:
34 34 <ul class="links">
35 35 <li>
36 36 <a href="${h.url('new_gist')}" class="btn btn-primary">${_(u'Create New Gist')}</a>
37 37 </li>
38 38 </ul>
39 39 %endif
40 40 </div>
41 41 <div class="table">
42 42 <div id="files_data">
43 43 <div id="codeblock" class="codeblock">
44 44 <div class="code-header">
45 45 <div class="stats">
46 46 %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
47 47 <div class="remove_gist">
48 48 ${h.secure_form(url('gist', gist_id=c.gist.gist_access_id),method='delete')}
49 49 ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")}
50 50 ${h.end_form()}
51 51 </div>
52 52 %endif
53 53 <div class="buttons">
54 54 ## only owner should see that
55 55 %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
56 56 ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")}
57 57 %endif
58 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 59 </div>
60 60 <div class="left" >
61 61 %if c.gist.gist_type != 'public':
62 62 <span class="tag tag-ok disabled">${_('Private Gist')}</span>
63 63 %endif
64 64 <span> ${c.gist.gist_description}</span>
65 65 <span>${_('Expires')}:
66 66 %if c.gist.gist_expires == -1:
67 67 ${_('never')}
68 68 %else:
69 69 ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))}
70 70 %endif
71 71 </span>
72 72 </div>
73 73 </div>
74 74
75 75 <div class="author">
76 <div title="${c.file_last_commit.author}">
76 <div title="${h.tooltip(c.file_last_commit.author)}">
77 77 ${self.gravatar_with_user(c.file_last_commit.author, 16)} - ${_('created')} ${h.age_component(c.file_last_commit.date)}
78 78 </div>
79 79
80 80 </div>
81 81 <div class="commit">${h.urlify_commit_message(c.file_last_commit.message,c.repo_name)}</div>
82 82 </div>
83 83
84 84 ## iterate over the files
85 85 % for file in c.files:
86 86 <% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%>
87 87 <!-- <div id="${h.FID('G', file.path)}" class="stats" >
88 88 <a href="${c.gist.gist_url()}">¶</a>
89 89 <b >${file.path}</b>
90 90 <div>
91 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 92 </div>
93 93 </div> -->
94 94 <div class="code-body textarea text-area editor">
95 95 %if renderer:
96 96 ${h.render(file.content, renderer=renderer)}
97 97 %else:
98 98 ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
99 99 %endif
100 100 </div>
101 101 %endfor
102 102 </div>
103 103 </div>
104 104 </div>
105 105
106 106
107 107 </div>
108 108 </%def>
@@ -1,123 +1,123 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('Repository Permissions')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), method='POST')}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th class="td-owner">${_('User/User Group')}</th>
16 16 <th></th>
17 17 </tr>
18 18 ## USERS
19 19 %for _user in c.repo_info.permissions():
20 20 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
21 21 <tr class="perm_admin_row">
22 22 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
23 23 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
26 26 <td class="td-user">
27 27 ${base.gravatar(_user.email, 16)}
28 28 ${h.link_to_user(_user.username)}
29 29 %if getattr(_user, 'admin_row', None):
30 30 (${_('super admin')})
31 31 %endif
32 32 %if getattr(_user, 'owner_row', None):
33 33 (${_('owner')})
34 34 %endif
35 35 </td>
36 36 <td></td>
37 37 </tr>
38 38 %elif _user.username == h.DEFAULT_USER and c.repo_info.private:
39 39 <tr>
40 40 <td colspan="4">
41 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 43 </span>
44 44 </td>
45 45 <td class="private_repo_msg">
46 46 ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)}
47 47 ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td>
48 48 <td></td>
49 49 </tr>
50 50 %else:
51 51 <tr>
52 52 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none')}</td>
53 53 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read')}</td>
54 54 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
55 55 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
56 56 <td class="td-user">
57 57 ${base.gravatar(_user.email, 16)}
58 58 <span class="user">
59 59 % if _user.username == h.DEFAULT_USER:
60 60 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
61 61 % else:
62 62 ${h.link_to_user(_user.username)}
63 63 % endif
64 64 </span>
65 65 </td>
66 66 <td class="td-action">
67 67 %if _user.username != h.DEFAULT_USER:
68 68 <span class="btn btn-link btn-danger revoke_perm"
69 69 member="${_user.user_id}" member_type="user">
70 70 <i class="icon-remove"></i> ${_('Revoke')}
71 71 </span>
72 72 %endif
73 73 </td>
74 74 </tr>
75 75 %endif
76 76 %endfor
77 77
78 78 ## USER GROUPS
79 79 %for _user_group in c.repo_info.permission_user_groups():
80 80 <tr>
81 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 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 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 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 85 <td class="td-componentname">
86 86 <i class="icon-group" ></i>
87 87 %if h.HasPermissionAny('hg.admin')():
88 88 <a href="${h.url('edit_users_group',user_group_id=_user_group.users_group_id)}">
89 89 ${_user_group.users_group_name}
90 90 </a>
91 91 %else:
92 92 ${_user_group.users_group_name}
93 93 %endif
94 94 </td>
95 95 <td class="td-action">
96 96 <span class="btn btn-link btn-danger revoke_perm"
97 97 member="${_user_group.users_group_id}" member_type="user_group">
98 98 <i class="icon-remove"></i> ${_('Revoke')}
99 99 </span>
100 100 </td>
101 101 </tr>
102 102 %endfor
103 103 <tr class="new_members" id="add_perm_input"></tr>
104 104 </table>
105 105 <div id="add_perm" class="link">
106 106 ${_('Add new')}
107 107 </div>
108 108 <div class="buttons">
109 109 ${h.submit('save',_('Save'),class_="btn btn-primary")}
110 110 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
111 111 </div>
112 112 ${h.end_form()}
113 113 </div>
114 114 </div>
115 115
116 116 <script type="text/javascript">
117 117 $('#add_perm').on('click', function(e){
118 118 addNewPermInput($(this), 'repository');
119 119 });
120 120 $('.revoke_perm').on('click', function(e){
121 121 markRevokePermInput($(this), 'repository');
122 122 });
123 123 </script>
@@ -1,56 +1,56 b''
1 1 <div class="panel panel-default">
2 2 <div class="panel-heading">
3 3 <h3 class="panel-title">${_('Email Configuration')}</h3>
4 4 </div>
5 5 <div class="panel-body">
6 6 <%
7 7 elems = [
8 8 (_('Email prefix'), c.rhodecode_ini.get('email_prefix'), ''),
9 9 (_('RhodeCode email from'), c.rhodecode_ini.get('app_email_from'), ''),
10 10 (_('Error email from'), c.rhodecode_ini.get('error_email_from'), ''),
11 11 (_('Error email recipients'), c.rhodecode_ini.get('email_to'), ''),
12 12
13 13 (_('SMTP server'), c.rhodecode_ini.get('smtp_server'), ''),
14 14 (_('SMTP username'), c.rhodecode_ini.get('smtp_username'), ''),
15 15 (_('SMTP password'), '%s chars' % len(c.rhodecode_ini.get('smtp_password', '')), ''),
16 16 (_('SMTP port'), c.rhodecode_ini.get('smtp_port'), ''),
17 17
18 18 (_('SMTP use TLS'), c.rhodecode_ini.get('smtp_use_tls'), ''),
19 19 (_('SMTP use SSL'), c.rhodecode_ini.get('smtp_use_ssl'), ''),
20 20 (_('SMTP auth'), c.rhodecode_ini.get('smtp_auth'), ''),
21 21 ]
22 22 %>
23 23 <dl class="dl-horizontal settings">
24 24 %for dt, dd, tt in elems:
25 25 <dt >${dt}:</dt>
26 <dd title="${tt}">${dd}</dd>
26 <dd title="${h.tooltip(tt)}">${dd}</dd>
27 27 %endfor
28 28 </dl>
29 29 </div>
30 30 </div>
31 31
32 32 <div class="panel panel-default">
33 33 <div class="panel-heading">
34 34 <h3 class="panel-title">${_('Test Email')}</h3>
35 35 </div>
36 36 <div class="panel-body">
37 37 ${h.secure_form(url('admin_settings_email'), method='post')}
38 38
39 39 <div class="field input">
40 40 ${h.text('test_email', size=60, placeholder=_('enter valid email'))}
41 41 </div>
42 42 <div class="field">
43 43 <span class="help-block">
44 44 ${_('Send an auto-generated email from this server to above email...')}
45 45 </span>
46 46 </div>
47 47 <div class="buttons">
48 48 ${h.submit('send',_('Send'),class_="btn")}
49 49 </div>
50 50 ${h.end_form()}
51 51 </div>
52 52 </div>
53 53
54 54
55 55
56 56
@@ -1,62 +1,62 b''
1 1 <div class="panel panel-default">
2 2 <div class="panel-heading">
3 3 <h3 class="panel-title">${_('User Sessions Configuration')}</h3>
4 4 </div>
5 5 <div class="panel-body">
6 6 <%
7 7 elems = [
8 8 (_('Session type'), c.session_model.SESSION_TYPE, ''),
9 9 (_('Session expiration period'), '{} seconds'.format(c.session_conf.get('beaker.session.timeout', 0)), ''),
10 10
11 11 (_('Total sessions'), c.session_count, ''),
12 12 (_('Expired sessions ({} days)').format(c.cleanup_older_days ), c.session_expired_count, ''),
13 13
14 14 ]
15 15 %>
16 16 <dl class="dl-horizontal settings">
17 17 %for dt, dd, tt in elems:
18 18 <dt>${dt}:</dt>
19 <dd title="${tt}">${dd}</dd>
19 <dd title="${h.tooltip(tt)}">${dd}</dd>
20 20 %endfor
21 21 </dl>
22 22 </div>
23 23 </div>
24 24
25 25
26 26 <div class="panel panel-warning">
27 27 <div class="panel-heading">
28 28 <h3 class="panel-title">${_('Cleanup Old Sessions')}</h3>
29 29 </div>
30 30 <div class="panel-body">
31 31 ${h.secure_form(h.route_path('admin_settings_sessions_cleanup'), method='post')}
32 32
33 33 <p>
34 34 ${_('Cleanup user sessions that were not active during chosen time frame.')} <br/>
35 35 ${_('After performing this action users whose session will be removed will be required to log in again.')} <br/>
36 36 <strong>${_('Picking `All` will log-out you, and all users in the system.')}</strong>
37 37 </p>
38 38
39 39 <script type="text/javascript">
40 40 $(document).ready(function() {
41 41 $('#expire_days').select2({
42 42 containerCssClass: 'drop-menu',
43 43 dropdownCssClass: 'drop-menu-dropdown',
44 44 dropdownAutoWidth: true,
45 45 minimumResultsForSearch: -1
46 46 });
47 47 });
48 48 </script>
49 49 <select id="expire_days" name="expire_days">
50 50 % for n in [60, 90, 30, 7, 0]:
51 51 <option value="${n}">${'{} days'.format(n) if n != 0 else 'All'}</option>
52 52 % endfor
53 53 </select>
54 54 <button class="btn btn-small" type="submit"
55 55 onclick="return confirm('${_('Confirm to cleanup user sessions')}');">
56 56 ${_('Cleanup sessions')}
57 57 </button>
58 58 ${h.end_form()}
59 59 </div>
60 60 </div>
61 61
62 62
@@ -1,604 +1,604 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="root.mako"/>
3 3
4 4 <div class="outerwrapper">
5 5 <!-- HEADER -->
6 6 <div class="header">
7 7 <div id="header-inner" class="wrapper">
8 8 <div id="logo">
9 9 <div class="logo-wrapper">
10 10 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
11 11 </div>
12 12 %if c.rhodecode_name:
13 13 <div class="branding">- ${h.branding(c.rhodecode_name)}</div>
14 14 %endif
15 15 </div>
16 16 <!-- MENU BAR NAV -->
17 17 ${self.menu_bar_nav()}
18 18 <!-- END MENU BAR NAV -->
19 19 </div>
20 20 </div>
21 21 ${self.menu_bar_subnav()}
22 22 <!-- END HEADER -->
23 23
24 24 <!-- CONTENT -->
25 25 <div id="content" class="wrapper">
26 26
27 27 <rhodecode-toast id="notifications"></rhodecode-toast>
28 28
29 29 <div class="main">
30 30 ${next.main()}
31 31 </div>
32 32 </div>
33 33 <!-- END CONTENT -->
34 34
35 35 </div>
36 36 <!-- FOOTER -->
37 37 <div id="footer">
38 38 <div id="footer-inner" class="title wrapper">
39 39 <div>
40 40 <p class="footer-link-right">
41 41 % if c.visual.show_version:
42 42 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
43 43 % endif
44 44 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
45 45 % if c.visual.rhodecode_support_url:
46 46 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
47 47 % endif
48 48 </p>
49 49 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
50 50 <p class="server-instance" style="display:${sid}">
51 51 ## display hidden instance ID if specially defined
52 52 % if c.rhodecode_instanceid:
53 53 ${_('RhodeCode instance id: %s') % c.rhodecode_instanceid}
54 54 % endif
55 55 </p>
56 56 </div>
57 57 </div>
58 58 </div>
59 59
60 60 <!-- END FOOTER -->
61 61
62 62 ### MAKO DEFS ###
63 63
64 64 <%def name="menu_bar_subnav()">
65 65 </%def>
66 66
67 67 <%def name="breadcrumbs(class_='breadcrumbs')">
68 68 <div class="${class_}">
69 69 ${self.breadcrumbs_links()}
70 70 </div>
71 71 </%def>
72 72
73 73 <%def name="admin_menu()">
74 74 <ul class="admin_menu submenu">
75 75 <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
76 76 <li><a href="${h.url('repos')}">${_('Repositories')}</a></li>
77 77 <li><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li>
78 78 <li><a href="${h.route_path('users')}">${_('Users')}</a></li>
79 79 <li><a href="${h.url('users_groups')}">${_('User groups')}</a></li>
80 80 <li><a href="${h.url('admin_permissions_application')}">${_('Permissions')}</a></li>
81 81 <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
82 82 <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
83 83 <li><a href="${h.url('admin_defaults_repositories')}">${_('Defaults')}</a></li>
84 84 <li class="last"><a href="${h.url('admin_settings')}">${_('Settings')}</a></li>
85 85 </ul>
86 86 </%def>
87 87
88 88
89 89 <%def name="dt_info_panel(elements)">
90 90 <dl class="dl-horizontal">
91 91 %for dt, dd, title, show_items in elements:
92 92 <dt>${dt}:</dt>
93 <dd title="${title}">
93 <dd title="${h.tooltip(title)}">
94 94 %if callable(dd):
95 95 ## allow lazy evaluation of elements
96 96 ${dd()}
97 97 %else:
98 98 ${dd}
99 99 %endif
100 100 %if show_items:
101 101 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
102 102 %endif
103 103 </dd>
104 104
105 105 %if show_items:
106 106 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
107 107 %for item in show_items:
108 108 <dt></dt>
109 109 <dd>${item}</dd>
110 110 %endfor
111 111 </div>
112 112 %endif
113 113
114 114 %endfor
115 115 </dl>
116 116 </%def>
117 117
118 118
119 119 <%def name="gravatar(email, size=16)">
120 120 <%
121 121 if (size > 16):
122 122 gravatar_class = 'gravatar gravatar-large'
123 123 else:
124 124 gravatar_class = 'gravatar'
125 125 %>
126 126 <%doc>
127 127 TODO: johbo: For now we serve double size images to make it smooth
128 128 for retina. This is how it worked until now. Should be replaced
129 129 with a better solution at some point.
130 130 </%doc>
131 131 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
132 132 </%def>
133 133
134 134
135 135 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
136 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 138 ${self.gravatar(email, size)}
139 139 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
140 140 </div>
141 141 </%def>
142 142
143 143
144 144 ## admin menu used for people that have some admin resources
145 145 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
146 146 <ul class="submenu">
147 147 %if repositories:
148 148 <li class="local-admin-repos"><a href="${h.url('repos')}">${_('Repositories')}</a></li>
149 149 %endif
150 150 %if repository_groups:
151 151 <li class="local-admin-repo-groups"><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li>
152 152 %endif
153 153 %if user_groups:
154 154 <li class="local-admin-user-groups"><a href="${h.url('users_groups')}">${_('User groups')}</a></li>
155 155 %endif
156 156 </ul>
157 157 </%def>
158 158
159 159 <%def name="repo_page_title(repo_instance)">
160 160 <div class="title-content">
161 161 <div class="title-main">
162 162 ## SVN/HG/GIT icons
163 163 %if h.is_hg(repo_instance):
164 164 <i class="icon-hg"></i>
165 165 %endif
166 166 %if h.is_git(repo_instance):
167 167 <i class="icon-git"></i>
168 168 %endif
169 169 %if h.is_svn(repo_instance):
170 170 <i class="icon-svn"></i>
171 171 %endif
172 172
173 173 ## public/private
174 174 %if repo_instance.private:
175 175 <i class="icon-repo-private"></i>
176 176 %else:
177 177 <i class="icon-repo-public"></i>
178 178 %endif
179 179
180 180 ## repo name with group name
181 181 ${h.breadcrumb_repo_link(c.rhodecode_db_repo)}
182 182
183 183 </div>
184 184
185 185 ## FORKED
186 186 %if repo_instance.fork:
187 187 <p>
188 188 <i class="icon-code-fork"></i> ${_('Fork of')}
189 189 <a href="${h.route_path('repo_summary',repo_name=repo_instance.fork.repo_name)}">${repo_instance.fork.repo_name}</a>
190 190 </p>
191 191 %endif
192 192
193 193 ## IMPORTED FROM REMOTE
194 194 %if repo_instance.clone_uri:
195 195 <p>
196 196 <i class="icon-code-fork"></i> ${_('Clone from')}
197 197 <a href="${h.url(h.safe_str(h.hide_credentials(repo_instance.clone_uri)))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
198 198 </p>
199 199 %endif
200 200
201 201 ## LOCKING STATUS
202 202 %if repo_instance.locked[0]:
203 203 <p class="locking_locked">
204 204 <i class="icon-repo-lock"></i>
205 205 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
206 206 </p>
207 207 %elif repo_instance.enable_locking:
208 208 <p class="locking_unlocked">
209 209 <i class="icon-repo-unlock"></i>
210 210 ${_('Repository not locked. Pull repository to lock it.')}
211 211 </p>
212 212 %endif
213 213
214 214 </div>
215 215 </%def>
216 216
217 217 <%def name="repo_menu(active=None)">
218 218 <%
219 219 def is_active(selected):
220 220 if selected == active:
221 221 return "active"
222 222 %>
223 223
224 224 <!--- CONTEXT BAR -->
225 225 <div id="context-bar">
226 226 <div class="wrapper">
227 227 <ul id="context-pages" class="horizontal-list navigation">
228 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 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 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 231 <li class="${is_active('compare')}">
232 232 <a class="menulink" href="${h.url('compare_home',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a>
233 233 </li>
234 234 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
235 235 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
236 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 238 %if c.repository_pull_requests:
239 239 <span class="pr_notifications">${c.repository_pull_requests}</span>
240 240 %endif
241 241 <div class="menulabel">${_('Pull Requests')}</div>
242 242 </a>
243 243 </li>
244 244 %endif
245 245 <li class="${is_active('options')}">
246 246 <a class="menulink dropdown">
247 247 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
248 248 </a>
249 249 <ul class="submenu">
250 250 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
251 251 <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Settings')}</a></li>
252 252 %endif
253 253 %if c.rhodecode_db_repo.fork:
254 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 255 ${_('Compare fork')}</a></li>
256 256 %endif
257 257
258 258 <li><a href="${h.route_path('search_repo',repo_name=c.repo_name)}">${_('Search')}</a></li>
259 259
260 260 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
261 261 %if c.rhodecode_db_repo.locked[0]:
262 262 <li><a class="locking_del" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
263 263 %else:
264 264 <li><a class="locking_add" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
265 265 %endif
266 266 %endif
267 267 %if c.rhodecode_user.username != h.DEFAULT_USER:
268 268 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
269 269 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}">${_('Fork')}</a></li>
270 270 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
271 271 %endif
272 272 %endif
273 273 </ul>
274 274 </li>
275 275 </ul>
276 276 </div>
277 277 <div class="clear"></div>
278 278 </div>
279 279 <!--- END CONTEXT BAR -->
280 280
281 281 </%def>
282 282
283 283 <%def name="usermenu(active=False)">
284 284 ## USER MENU
285 285 <li id="quick_login_li" class="${'active' if active else ''}">
286 286 <a id="quick_login_link" class="menulink childs">
287 287 ${gravatar(c.rhodecode_user.email, 20)}
288 288 <span class="user">
289 289 %if c.rhodecode_user.username != h.DEFAULT_USER:
290 290 <span class="menu_link_user">${c.rhodecode_user.username}</span><div class="show_more"></div>
291 291 %else:
292 292 <span>${_('Sign in')}</span>
293 293 %endif
294 294 </span>
295 295 </a>
296 296
297 297 <div class="user-menu submenu">
298 298 <div id="quick_login">
299 299 %if c.rhodecode_user.username == h.DEFAULT_USER:
300 300 <h4>${_('Sign in to your account')}</h4>
301 301 ${h.form(h.route_path('login', _query={'came_from': h.url.current()}), needs_csrf_token=False)}
302 302 <div class="form form-vertical">
303 303 <div class="fields">
304 304 <div class="field">
305 305 <div class="label">
306 306 <label for="username">${_('Username')}:</label>
307 307 </div>
308 308 <div class="input">
309 309 ${h.text('username',class_='focus',tabindex=1)}
310 310 </div>
311 311
312 312 </div>
313 313 <div class="field">
314 314 <div class="label">
315 315 <label for="password">${_('Password')}:</label>
316 316 %if h.HasPermissionAny('hg.password_reset.enabled')():
317 317 <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.route_path('reset_password'), class_='pwd_reset')}</span>
318 318 %endif
319 319 </div>
320 320 <div class="input">
321 321 ${h.password('password',class_='focus',tabindex=2)}
322 322 </div>
323 323 </div>
324 324 <div class="buttons">
325 325 <div class="register">
326 326 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
327 327 ${h.link_to(_("Don't have an account?"),h.route_path('register'))} <br/>
328 328 %endif
329 329 ${h.link_to(_("Using external auth? Sign In here."),h.route_path('login'))}
330 330 </div>
331 331 <div class="submit">
332 332 ${h.submit('sign_in',_('Sign In'),class_="btn btn-small",tabindex=3)}
333 333 </div>
334 334 </div>
335 335 </div>
336 336 </div>
337 337 ${h.end_form()}
338 338 %else:
339 339 <div class="">
340 340 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
341 341 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
342 342 <div class="email">${c.rhodecode_user.email}</div>
343 343 </div>
344 344 <div class="">
345 345 <ol class="links">
346 346 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
347 347 % if c.rhodecode_user.personal_repo_group:
348 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 349 % endif
350 350 <li class="logout">
351 351 ${h.secure_form(h.route_path('logout'))}
352 352 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
353 353 ${h.end_form()}
354 354 </li>
355 355 </ol>
356 356 </div>
357 357 %endif
358 358 </div>
359 359 </div>
360 360 %if c.rhodecode_user.username != h.DEFAULT_USER:
361 361 <div class="pill_container">
362 362 % if c.unread_notifications == 0:
363 363 <a class="menu_link_notifications empty" href="${h.url('notifications')}">${c.unread_notifications}</a>
364 364 % else:
365 365 <a class="menu_link_notifications" href="${h.url('notifications')}">${c.unread_notifications}</a>
366 366 % endif
367 367 </div>
368 368 % endif
369 369 </li>
370 370 </%def>
371 371
372 372 <%def name="menu_items(active=None)">
373 373 <%
374 374 def is_active(selected):
375 375 if selected == active:
376 376 return "active"
377 377 return ""
378 378 %>
379 379 <ul id="quick" class="main_nav navigation horizontal-list">
380 380 <!-- repo switcher -->
381 381 <li class="${is_active('repositories')} repo_switcher_li has_select2">
382 382 <input id="repo_switcher" name="repo_switcher" type="hidden">
383 383 </li>
384 384
385 385 ## ROOT MENU
386 386 %if c.rhodecode_user.username != h.DEFAULT_USER:
387 387 <li class="${is_active('journal')}">
388 388 <a class="menulink" title="${_('Show activity journal')}" href="${h.url('journal')}">
389 389 <div class="menulabel">${_('Journal')}</div>
390 390 </a>
391 391 </li>
392 392 %else:
393 393 <li class="${is_active('journal')}">
394 394 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.url('public_journal')}">
395 395 <div class="menulabel">${_('Public journal')}</div>
396 396 </a>
397 397 </li>
398 398 %endif
399 399 <li class="${is_active('gists')}">
400 400 <a class="menulink childs" title="${_('Show Gists')}" href="${h.url('gists')}">
401 401 <div class="menulabel">${_('Gists')}</div>
402 402 </a>
403 403 </li>
404 404 <li class="${is_active('search')}">
405 405 <a class="menulink" title="${_('Search in repositories you have access to')}" href="${h.route_path('search')}">
406 406 <div class="menulabel">${_('Search')}</div>
407 407 </a>
408 408 </li>
409 409 % if h.HasPermissionAll('hg.admin')('access admin main page'):
410 410 <li class="${is_active('admin')}">
411 411 <a class="menulink childs" title="${_('Admin settings')}" href="#" onclick="return false;">
412 412 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
413 413 </a>
414 414 ${admin_menu()}
415 415 </li>
416 416 % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
417 417 <li class="${is_active('admin')}">
418 418 <a class="menulink childs" title="${_('Delegated Admin settings')}">
419 419 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
420 420 </a>
421 421 ${admin_menu_simple(c.rhodecode_user.repositories_admin,
422 422 c.rhodecode_user.repository_groups_admin,
423 423 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
424 424 </li>
425 425 % endif
426 426 % if c.debug_style:
427 427 <li class="${is_active('debug_style')}">
428 428 <a class="menulink" title="${_('Style')}" href="${h.url('debug_style_home')}">
429 429 <div class="menulabel">${_('Style')}</div>
430 430 </a>
431 431 </li>
432 432 % endif
433 433 ## render extra user menu
434 434 ${usermenu(active=(active=='my_account'))}
435 435 </ul>
436 436
437 437 <script type="text/javascript">
438 438 var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
439 439
440 440 /*format the look of items in the list*/
441 441 var format = function(state, escapeMarkup){
442 442 if (!state.id){
443 443 return state.text; // optgroup
444 444 }
445 445 var obj_dict = state.obj;
446 446 var tmpl = '';
447 447
448 448 if(obj_dict && state.type == 'repo'){
449 449 if(obj_dict['repo_type'] === 'hg'){
450 450 tmpl += '<i class="icon-hg"></i> ';
451 451 }
452 452 else if(obj_dict['repo_type'] === 'git'){
453 453 tmpl += '<i class="icon-git"></i> ';
454 454 }
455 455 else if(obj_dict['repo_type'] === 'svn'){
456 456 tmpl += '<i class="icon-svn"></i> ';
457 457 }
458 458 if(obj_dict['private']){
459 459 tmpl += '<i class="icon-lock" ></i> ';
460 460 }
461 461 else if(visual_show_public_icon){
462 462 tmpl += '<i class="icon-unlock-alt"></i> ';
463 463 }
464 464 }
465 465 if(obj_dict && state.type == 'commit') {
466 466 tmpl += '<i class="icon-tag"></i>';
467 467 }
468 468 if(obj_dict && state.type == 'group'){
469 469 tmpl += '<i class="icon-folder-close"></i> ';
470 470 }
471 471 tmpl += escapeMarkup(state.text);
472 472 return tmpl;
473 473 };
474 474
475 475 var formatResult = function(result, container, query, escapeMarkup) {
476 476 return format(result, escapeMarkup);
477 477 };
478 478
479 479 var formatSelection = function(data, container, escapeMarkup) {
480 480 return format(data, escapeMarkup);
481 481 };
482 482
483 483 $("#repo_switcher").select2({
484 484 cachedDataSource: {},
485 485 minimumInputLength: 2,
486 486 placeholder: '<div class="menulabel">${_('Go to')} <div class="show_more"></div></div>',
487 487 dropdownAutoWidth: true,
488 488 formatResult: formatResult,
489 489 formatSelection: formatSelection,
490 490 containerCssClass: "repo-switcher",
491 491 dropdownCssClass: "repo-switcher-dropdown",
492 492 escapeMarkup: function(m){
493 493 // don't escape our custom placeholder
494 494 if(m.substr(0,23) == '<div class="menulabel">'){
495 495 return m;
496 496 }
497 497
498 498 return Select2.util.escapeMarkup(m);
499 499 },
500 500 query: $.debounce(250, function(query){
501 501 self = this;
502 502 var cacheKey = query.term;
503 503 var cachedData = self.cachedDataSource[cacheKey];
504 504
505 505 if (cachedData) {
506 506 query.callback({results: cachedData.results});
507 507 } else {
508 508 $.ajax({
509 509 url: pyroutes.url('goto_switcher_data'),
510 510 data: {'query': query.term},
511 511 dataType: 'json',
512 512 type: 'GET',
513 513 success: function(data) {
514 514 self.cachedDataSource[cacheKey] = data;
515 515 query.callback({results: data.results});
516 516 },
517 517 error: function(data, textStatus, errorThrown) {
518 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 525 $("#repo_switcher").on('select2-selecting', function(e){
526 526 e.preventDefault();
527 527 window.location = e.choice.url;
528 528 });
529 529
530 530 </script>
531 531 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
532 532 </%def>
533 533
534 534 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
535 535 <div class="modal-dialog">
536 536 <div class="modal-content">
537 537 <div class="modal-header">
538 538 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
539 539 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
540 540 </div>
541 541 <div class="modal-body">
542 542 <div class="block-left">
543 543 <table class="keyboard-mappings">
544 544 <tbody>
545 545 <tr>
546 546 <th></th>
547 547 <th>${_('Site-wide shortcuts')}</th>
548 548 </tr>
549 549 <%
550 550 elems = [
551 551 ('/', 'Open quick search box'),
552 552 ('g h', 'Goto home page'),
553 553 ('g g', 'Goto my private gists page'),
554 554 ('g G', 'Goto my public gists page'),
555 555 ('n r', 'New repository page'),
556 556 ('n g', 'New gist page'),
557 557 ]
558 558 %>
559 559 %for key, desc in elems:
560 560 <tr>
561 561 <td class="keys">
562 562 <span class="key tag">${key}</span>
563 563 </td>
564 564 <td>${desc}</td>
565 565 </tr>
566 566 %endfor
567 567 </tbody>
568 568 </table>
569 569 </div>
570 570 <div class="block-left">
571 571 <table class="keyboard-mappings">
572 572 <tbody>
573 573 <tr>
574 574 <th></th>
575 575 <th>${_('Repositories')}</th>
576 576 </tr>
577 577 <%
578 578 elems = [
579 579 ('g s', 'Goto summary page'),
580 580 ('g c', 'Goto changelog page'),
581 581 ('g f', 'Goto files page'),
582 582 ('g F', 'Goto files page with file search activated'),
583 583 ('g p', 'Goto pull requests page'),
584 584 ('g o', 'Goto repository settings'),
585 585 ('g O', 'Goto repository permissions settings'),
586 586 ]
587 587 %>
588 588 %for key, desc in elems:
589 589 <tr>
590 590 <td class="keys">
591 591 <span class="key tag">${key}</span>
592 592 </td>
593 593 <td>${desc}</td>
594 594 </tr>
595 595 %endfor
596 596 </tbody>
597 597 </table>
598 598 </div>
599 599 </div>
600 600 <div class="modal-footer">
601 601 </div>
602 602 </div><!-- /.modal-content -->
603 603 </div><!-- /.modal-dialog -->
604 604 </div><!-- /.modal -->
@@ -1,33 +1,33 b''
1 1 ## DATA TABLE RE USABLE ELEMENTS FOR BOOKMARKS
2 2 ## usage:
3 3 ## <%namespace name="bookmarks" file="/bookmarks/bookmarks_data.mako"/>
4 4 ## bookmarks.<func_name>(arg,arg2)
5 5
6 6 <%def name="compare(commit_id)">
7 7 <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/>
8 8 <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/>
9 9 </%def>
10 10
11 11
12 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 14 <a href="${files_url}">
15 15 <i class="icon-bookmark"></i>
16 16 ${name}
17 17 </a>
18 18 </span>
19 19 </%def>
20 20
21 21 <%def name="date(date)">
22 22 ${h.age_component(date)}
23 23 </%def>
24 24
25 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 27 </%def>
28 28
29 29 <%def name="commit(message, commit_id, commit_idx)">
30 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 32 </div>
33 33 </%def>
@@ -1,33 +1,33 b''
1 1 ## DATA TABLE RE USABLE ELEMENTS FOR BRANCHES
2 2 ## usage:
3 3 ## <%namespace name="branch" file="/branches/branches_data.mako"/>
4 4 ## branch.<func_name>(arg,arg2)
5 5
6 6 <%def name="compare(commit_id)">
7 7 <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/>
8 8 <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/>
9 9 </%def>
10 10
11 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 13 <a href="${files_url}"><i class="icon-code-fork"></i>${name}
14 14 %if name in c.closed_branches:
15 15 [closed]
16 16 %endif
17 17 </a>
18 18 </span>
19 19 </%def>
20 20
21 21 <%def name="date(date)">
22 22 ${h.age_component(date)}
23 23 </%def>
24 24
25 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 27 </%def>
28 28
29 29 <%def name="commit(message, commit_id, commit_idx)">
30 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 32 </div>
33 33 </%def>
@@ -1,299 +1,299 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4
5 5 <%def name="title()">
6 6 ${_('%s Changelog') % c.repo_name}
7 7 %if c.changelog_for_path:
8 8 /${c.changelog_for_path}
9 9 %endif
10 10 %if c.rhodecode_name:
11 11 &middot; ${h.branding(c.rhodecode_name)}
12 12 %endif
13 13 </%def>
14 14
15 15 <%def name="breadcrumbs_links()">
16 16 %if c.changelog_for_path:
17 17 /${c.changelog_for_path}
18 18 %endif
19 19 </%def>
20 20
21 21 <%def name="menu_bar_nav()">
22 22 ${self.menu_items(active='repositories')}
23 23 </%def>
24 24
25 25 <%def name="menu_bar_subnav()">
26 26 ${self.repo_menu(active='changelog')}
27 27 </%def>
28 28
29 29 <%def name="main()">
30 30
31 31 <div class="box">
32 32 <div class="title">
33 33 ${self.repo_page_title(c.rhodecode_db_repo)}
34 34 <ul class="links">
35 35 <li>
36 36 <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a>
37 37 %if c.rhodecode_db_repo.fork:
38 38 <span>
39 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 41 class="btn btn-small"
42 42 href="${h.url('compare_url',
43 43 repo_name=c.rhodecode_db_repo.fork.repo_name,
44 44 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
45 45 source_ref=c.rhodecode_db_repo.landing_rev[1],
46 46 target_repo=c.repo_name,
47 47 target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
48 48 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
49 49 merge=1)}"
50 50 >
51 51 <i class="icon-loop"></i>
52 52 ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)}
53 53 </a>
54 54 </span>
55 55 %endif
56 56
57 57 ## pr open link
58 58 %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo):
59 59 <span>
60 60 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}">
61 61 ${_('Open new pull request')}
62 62 </a>
63 63 </span>
64 64 %endif
65 65
66 66 ## clear selection
67 67 <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none">
68 68 ${_('Clear selection')}
69 69 </div>
70 70
71 71 </li>
72 72 </ul>
73 73 </div>
74 74
75 75 % if c.pagination:
76 76 <script type="text/javascript" src="${h.asset('js/jquery.commits-graph.js')}"></script>
77 77
78 78 <div class="graph-header">
79 79 <div id="filter_changelog">
80 80 ${h.hidden('branch_filter')}
81 81 %if c.selected_name:
82 82 <div class="btn btn-default" id="clear_filter" >
83 83 ${_('Clear filter')}
84 84 </div>
85 85 %endif
86 86 </div>
87 87 ${self.breadcrumbs('breadcrumbs_light')}
88 88 <div id="commit-counter" data-total=${c.total_cs} class="pull-right">
89 89 ${ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)}
90 90 </div>
91 91 </div>
92 92
93 93 <div id="graph">
94 94 <div class="graph-col-wrapper">
95 95 <div id="graph_nodes">
96 96 <div id="graph_canvas"></div>
97 97 </div>
98 98 <div id="graph_content" class="main-content graph_full_width">
99 99
100 100 <div class="table">
101 101 <table id="changesets" class="rctable">
102 102 <tr>
103 103 ## checkbox
104 104 <th></th>
105 105 <th colspan="2"></th>
106 106
107 107 <th>${_('Commit')}</th>
108 108 ## commit message expand arrow
109 109 <th></th>
110 110 <th>${_('Commit Message')}</th>
111 111
112 112 <th>${_('Age')}</th>
113 113 <th>${_('Author')}</th>
114 114
115 115 <th>${_('Refs')}</th>
116 116 </tr>
117 117
118 118 <tbody class="commits-range">
119 119 <%include file='changelog_elements.mako'/>
120 120 </tbody>
121 121 </table>
122 122 </div>
123 123 </div>
124 124 <div class="pagination-wh pagination-left">
125 125 ${c.pagination.pager('$link_previous ~2~ $link_next')}
126 126 </div>
127 127 </div>
128 128
129 129 <script type="text/javascript">
130 130 var cache = {};
131 131 $(function(){
132 132
133 133 // Create links to commit ranges when range checkboxes are selected
134 134 var $commitCheckboxes = $('.commit-range');
135 135 // cache elements
136 136 var $commitRangeContainer = $('#rev_range_container');
137 137 var $commitRangeClear = $('#rev_range_clear');
138 138
139 139 var checkboxRangeSelector = function(e){
140 140 var selectedCheckboxes = [];
141 141 for (pos in $commitCheckboxes){
142 142 if($commitCheckboxes[pos].checked){
143 143 selectedCheckboxes.push($commitCheckboxes[pos]);
144 144 }
145 145 }
146 146 var open_new_pull_request = $('#open_new_pull_request');
147 147 if(open_new_pull_request){
148 148 var selected_changes = selectedCheckboxes.length;
149 149 if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type != 'hg') {
150 150 open_new_pull_request.hide();
151 151 } else {
152 152 if (selected_changes == 1) {
153 153 open_new_pull_request.html(_gettext('Open new pull request for selected commit'));
154 154 } else if (selected_changes == 0) {
155 155 open_new_pull_request.html(_gettext('Open new pull request'));
156 156 }
157 157 open_new_pull_request.show();
158 158 }
159 159 }
160 160
161 161 if (selectedCheckboxes.length>0){
162 162 var revEnd = selectedCheckboxes[0].name;
163 163 var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name;
164 164 var url = pyroutes.url('changeset_home',
165 165 {'repo_name': '${c.repo_name}',
166 166 'revision': revStart+'...'+revEnd});
167 167
168 168 var link = (revStart == revEnd)
169 169 ? _gettext('Show selected commit __S')
170 170 : _gettext('Show selected commits __S ... __E');
171 171
172 172 link = link.replace('__S', revStart.substr(0,6));
173 173 link = link.replace('__E', revEnd.substr(0,6));
174 174
175 175 $commitRangeContainer
176 176 .attr('href',url)
177 177 .html(link)
178 178 .show();
179 179
180 180 $commitRangeClear.show();
181 181 var _url = pyroutes.url('pullrequest_home',
182 182 {'repo_name': '${c.repo_name}',
183 183 'commit': revEnd});
184 184 open_new_pull_request.attr('href', _url);
185 185 $('#compare_fork_button').hide();
186 186 } else {
187 187 $commitRangeContainer.hide();
188 188 $commitRangeClear.hide();
189 189
190 190 %if c.branch_name:
191 191 var _url = pyroutes.url('pullrequest_home',
192 192 {'repo_name': '${c.repo_name}',
193 193 'branch':'${c.branch_name}'});
194 194 open_new_pull_request.attr('href', _url);
195 195 %else:
196 196 var _url = pyroutes.url('pullrequest_home',
197 197 {'repo_name': '${c.repo_name}'});
198 198 open_new_pull_request.attr('href', _url);
199 199 %endif
200 200 $('#compare_fork_button').show();
201 201 }
202 202 };
203 203
204 204 $commitCheckboxes.on('click', checkboxRangeSelector);
205 205
206 206 $commitRangeClear.on('click',function(e) {
207 207 $commitCheckboxes.attr('checked', false);
208 208 checkboxRangeSelector();
209 209 e.preventDefault();
210 210 });
211 211
212 212 // make sure the buttons are consistent when navigate back and forth
213 213 checkboxRangeSelector();
214 214
215 215 var msgs = $('.message');
216 216 // get first element height
217 217 var el = $('#graph_content .container')[0];
218 218 var row_h = el.clientHeight;
219 219 for (var i=0; i < msgs.length; i++) {
220 220 var m = msgs[i];
221 221
222 222 var h = m.clientHeight;
223 223 var pad = $(m).css('padding');
224 224 if (h > row_h) {
225 225 var offset = row_h - (h+12);
226 226 $(m.nextElementSibling).css('display','block');
227 227 $(m.nextElementSibling).css('margin-top',offset+'px');
228 228 }
229 229 }
230 230
231 231 $("#clear_filter").on("click", function() {
232 232 var filter = {'repo_name': '${c.repo_name}'};
233 233 window.location = pyroutes.url('changelog_home', filter);
234 234 });
235 235
236 236 $("#branch_filter").select2({
237 237 'dropdownAutoWidth': true,
238 238 'width': 'resolve',
239 239 'placeholder': "${c.selected_name or _('Filter changelog')}",
240 240 containerCssClass: "drop-menu",
241 241 dropdownCssClass: "drop-menu-dropdown",
242 242 query: function(query){
243 243 var key = 'cache';
244 244 var cached = cache[key] ;
245 245 if(cached) {
246 246 var data = {results: []};
247 247 //filter results
248 248 $.each(cached.results, function(){
249 249 var section = this.text;
250 250 var children = [];
251 251 $.each(this.children, function(){
252 252 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
253 253 children.push({'id': this.id, 'text': this.text, 'type': this.type})
254 254 }
255 255 });
256 256 data.results.push({'text': section, 'children': children});
257 257 query.callback({results: data.results});
258 258 });
259 259 }else{
260 260 $.ajax({
261 261 url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}),
262 262 data: {},
263 263 dataType: 'json',
264 264 type: 'GET',
265 265 success: function(data) {
266 266 cache[key] = data;
267 267 query.callback({results: data.results});
268 268 }
269 269 })
270 270 }
271 271 }
272 272 });
273 273 $('#branch_filter').on('change', function(e){
274 274 var data = $('#branch_filter').select2('data');
275 275 var selected = data.text;
276 276 var filter = {'repo_name': '${c.repo_name}'};
277 277 if(data.type == 'branch' || data.type == 'branch_closed'){
278 278 filter["branch"] = selected;
279 279 }
280 280 else if (data.type == 'book'){
281 281 filter["bookmark"] = selected;
282 282 }
283 283 window.location = pyroutes.url('changelog_home', filter);
284 284 });
285 285
286 286 commitsController = new CommitsController();
287 287 % if not c.changelog_for_path:
288 288 commitsController.reloadGraph();
289 289 % endif
290 290
291 291 });
292 292
293 293 </script>
294 294 </div>
295 295 % else:
296 296 ${_('There are no changes yet')}
297 297 % endif
298 298 </div>
299 299 </%def>
@@ -1,142 +1,142 b''
1 1 ## small box that displays changed/added/removed details fetched by AJAX
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4 4
5 5 % if c.prev_page:
6 6 <tr>
7 7 <td colspan="9" class="load-more-commits">
8 8 <a class="prev-commits" href="#loadPrevCommits" onclick="commitsController.loadPrev(this, ${c.prev_page}, '${c.branch_name}');return false">
9 9 ${_('load previous')}
10 10 </a>
11 11 </td>
12 12 </tr>
13 13 % endif
14 14
15 15 % for cnt,commit in enumerate(c.pagination):
16 16 <tr id="sha_${commit.raw_id}" class="changelogRow container ${'tablerow%s' % (cnt%2)}">
17 17
18 18 <td class="td-checkbox">
19 19 ${h.checkbox(commit.raw_id,class_="commit-range")}
20 20 </td>
21 21 <td class="td-status">
22 22
23 23 %if c.statuses.get(commit.raw_id):
24 24 <div class="changeset-status-ico">
25 25 %if c.statuses.get(commit.raw_id)[2]:
26 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 27 <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div>
28 28 </a>
29 29 %else:
30 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 31 <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div>
32 32 </a>
33 33 %endif
34 34 </div>
35 35 %else:
36 36 <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div>
37 37 %endif
38 38 </td>
39 39 <td class="td-comments comments-col">
40 40 %if c.comments.get(commit.raw_id):
41 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 42 <i class="icon-comment"></i> ${len(c.comments[commit.raw_id])}
43 43 </a>
44 44 %endif
45 45 </td>
46 46 <td class="td-hash">
47 47 <code>
48 48 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">
49 49 <span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span>
50 50 </a>
51 51 % if hasattr(commit, 'phase'):
52 52 % if commit.phase != 'public':
53 53 <span class="tag phase-${commit.phase} tooltip" title="${_('Commit phase')}">${commit.phase}</span>
54 54 % endif
55 55 % endif
56 56
57 57 ## obsolete commits
58 58 % if hasattr(commit, 'obsolete'):
59 59 % if commit.obsolete:
60 60 <span class="tag obsolete-${commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span>
61 61 % endif
62 62 % endif
63 63
64 64 ## hidden commits
65 65 % if hasattr(commit, 'hidden'):
66 66 % if commit.hidden:
67 67 <span class="tag obsolete-${commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span>
68 68 % endif
69 69 % endif
70 70
71 71 </code>
72 72 </td>
73 73 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false">
74 74 <div class="show_more_col">
75 75 <i class="show_more"></i>&nbsp;
76 76 </div>
77 77 </td>
78 78 <td class="td-description mid">
79 79 <div class="log-container truncate-wrap">
80 80 <div class="message truncate" id="c-${commit.raw_id}">${h.urlify_commit_message(commit.message, c.repo_name)}</div>
81 81 </div>
82 82 </td>
83 83
84 84 <td class="td-time">
85 85 ${h.age_component(commit.date)}
86 86 </td>
87 87 <td class="td-user">
88 88 ${base.gravatar_with_user(commit.author)}
89 89 </td>
90 90
91 91 <td class="td-tags tags-col">
92 92 <div id="t-${commit.raw_id}">
93 93
94 94 ## merge
95 95 %if commit.merge:
96 96 <span class="tag mergetag">
97 97 <i class="icon-merge"></i>${_('merge')}
98 98 </span>
99 99 %endif
100 100
101 101 ## branch
102 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 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 105 </span>
106 106 %endif
107 107
108 108 ## bookmarks
109 109 %if h.is_hg(c.rhodecode_repo):
110 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 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 113 </span>
114 114 %endfor
115 115 %endif
116 116
117 117 ## tags
118 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 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 121 </span>
122 122 %endfor
123 123
124 124 </div>
125 125 </td>
126 126 </tr>
127 127 % endfor
128 128
129 129 % if c.next_page:
130 130 <tr>
131 131 <td colspan="9" class="load-more-commits">
132 132 <a class="next-commits" href="#loadNextCommits" onclick="commitsController.loadNext(this, ${c.next_page}, '${c.branch_name}');return false">
133 133 ${_('load next')}
134 134 </a>
135 135 </td>
136 136 </tr>
137 137 % endif
138 138 <tr class="chunk-graph-data" style="display:none"
139 139 data-graph='${c.graph_data|n}'
140 140 data-node='${c.prev_page}:${c.next_page}'
141 141 data-commits='${c.graph_commits|n}'>
142 142 </tr> No newline at end of file
@@ -1,39 +1,39 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2 <div class="table">
3 3
4 4 <table class="table rctable file_history">
5 5 %for cnt,cs in enumerate(c.pagination):
6 6 <tr id="chg_${cnt+1}" class="${'tablerow%s' % (cnt%2)}">
7 7 <td class="td-user">
8 8 ${base.gravatar_with_user(cs.author, 16)}
9 9 </td>
10 10 <td class="td-time">
11 11 <div class="date">
12 12 ${h.age_component(cs.date)}
13 13 </div>
14 14 </td>
15 15 <td class="td-message">
16 16 <div class="log-container">
17 <div class="message_history" title="${cs.message}">
17 <div class="message_history" title="${h.tooltip(cs.message)}">
18 18 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
19 19 ${h.shorter(cs.message, 75)}
20 20 </a>
21 21 </div>
22 22 </div>
23 23 </td>
24 24 <td class="td-hash">
25 25 <code>
26 26 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
27 27 <span>${h.show_id(cs)}</span>
28 28 </a>
29 29 </code>
30 30 </td>
31 31 <td class="td-actions">
32 32 <a href="${h.url('files_home',repo_name=c.repo_name,f_path=c.changelog_for_path,revision=cs.raw_id)}">
33 33 ${_('Show File')}
34 34 </a>
35 35 </td>
36 36 </tr>
37 37 %endfor
38 38 </table>
39 39 </div>
@@ -1,351 +1,351 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
5 5
6 6 <%def name="title()">
7 7 ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)}
8 8 %if c.rhodecode_name:
9 9 &middot; ${h.branding(c.rhodecode_name)}
10 10 %endif
11 11 </%def>
12 12
13 13 <%def name="menu_bar_nav()">
14 14 ${self.menu_items(active='repositories')}
15 15 </%def>
16 16
17 17 <%def name="menu_bar_subnav()">
18 18 ${self.repo_menu(active='changelog')}
19 19 </%def>
20 20
21 21 <%def name="main()">
22 22 <script>
23 23 // TODO: marcink switch this to pyroutes
24 24 AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
25 25 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
26 26 </script>
27 27 <div class="box">
28 28 <div class="title">
29 29 ${self.repo_page_title(c.rhodecode_db_repo)}
30 30 </div>
31 31
32 32 <div id="changeset_compare_view_content" class="summary changeset">
33 33 <div class="summary-detail">
34 34 <div class="summary-detail-header">
35 35 <span class="breadcrumbs files_location">
36 36 <h4>${_('Commit')}
37 37 <code>
38 38 ${h.show_id(c.commit)}
39 39 % if hasattr(c.commit, 'phase'):
40 40 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
41 41 % endif
42 42
43 43 ## obsolete commits
44 44 % if hasattr(c.commit, 'obsolete'):
45 45 % if c.commit.obsolete:
46 46 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span>
47 47 % endif
48 48 % endif
49 49
50 50 ## hidden commits
51 51 % if hasattr(c.commit, 'hidden'):
52 52 % if c.commit.hidden:
53 53 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span>
54 54 % endif
55 55 % endif
56 56
57 57 </code>
58 58 </h4>
59 59 </span>
60 60 <div class="pull-right">
61 61 <span id="parent_link">
62 62 <a href="#" title="${_('Parent Commit')}">${_('Parent')}</a>
63 63 </span>
64 64 |
65 65 <span id="child_link">
66 66 <a href="#" title="${_('Child Commit')}">${_('Child')}</a>
67 67 </span>
68 68 </div>
69 69 </div>
70 70
71 71 <div class="fieldset">
72 72 <div class="left-label">
73 73 ${_('Description')}:
74 74 </div>
75 75 <div class="right-content">
76 76 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
77 77 <div id="message_expand" style="display:none;">
78 78 ${_('Expand')}
79 79 </div>
80 80 </div>
81 81 </div>
82 82
83 83 %if c.statuses:
84 84 <div class="fieldset">
85 85 <div class="left-label">
86 86 ${_('Commit status')}:
87 87 </div>
88 88 <div class="right-content">
89 89 <div class="changeset-status-ico">
90 90 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
91 91 </div>
92 92 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
93 93 </div>
94 94 </div>
95 95 %endif
96 96
97 97 <div class="fieldset">
98 98 <div class="left-label">
99 99 ${_('References')}:
100 100 </div>
101 101 <div class="right-content">
102 102 <div class="tags">
103 103
104 104 %if c.commit.merge:
105 105 <span class="mergetag tag">
106 106 <i class="icon-merge"></i>${_('merge')}
107 107 </span>
108 108 %endif
109 109
110 110 %if h.is_hg(c.rhodecode_repo):
111 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 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 114 </span>
115 115 %endfor
116 116 %endif
117 117
118 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 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 121 </span>
122 122 %endfor
123 123
124 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 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 127 </span>
128 128 %endif
129 129 </div>
130 130 </div>
131 131 </div>
132 132
133 133 <div class="fieldset">
134 134 <div class="left-label">
135 135 ${_('Diff options')}:
136 136 </div>
137 137 <div class="right-content">
138 138 <div class="diff-actions">
139 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 140 ${_('Raw Diff')}
141 141 </a>
142 142 |
143 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 144 ${_('Patch Diff')}
145 145 </a>
146 146 |
147 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 148 ${_('Download Diff')}
149 149 </a>
150 150 |
151 151 ${c.ignorews_url(request.GET)}
152 152 |
153 153 ${c.context_url(request.GET)}
154 154 </div>
155 155 </div>
156 156 </div>
157 157
158 158 <div class="fieldset">
159 159 <div class="left-label">
160 160 ${_('Comments')}:
161 161 </div>
162 162 <div class="right-content">
163 163 <div class="comments-number">
164 164 %if c.comments:
165 165 <a href="#comments">${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
166 166 %else:
167 167 ${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
168 168 %endif
169 169 %if c.inline_cnt:
170 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 171 %else:
172 172 ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
173 173 %endif
174 174 </div>
175 175 </div>
176 176 </div>
177 177
178 178 <div class="fieldset">
179 179 <div class="left-label">
180 180 ${_('Unresolved TODOs')}:
181 181 </div>
182 182 <div class="right-content">
183 183 <div class="comments-number">
184 184 % if c.unresolved_comments:
185 185 % for co in c.unresolved_comments:
186 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 187 % endfor
188 188 % else:
189 189 ${_('There are no unresolved TODOs')}
190 190 % endif
191 191 </div>
192 192 </div>
193 193 </div>
194 194
195 195 </div> <!-- end summary-detail -->
196 196
197 197 <div id="commit-stats" class="sidebar-right">
198 198 <div class="summary-detail-header">
199 199 <h4 class="item">
200 200 ${_('Author')}
201 201 </h4>
202 202 </div>
203 203 <div class="sidebar-right-content">
204 204 ${self.gravatar_with_user(c.commit.author)}
205 205 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
206 206 </div>
207 207 </div><!-- end sidebar -->
208 208 </div> <!-- end summary -->
209 209 <div class="cs_files">
210 210 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
211 211 ${cbdiffs.render_diffset_menu()}
212 212 ${cbdiffs.render_diffset(
213 213 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True)}
214 214 </div>
215 215
216 216 ## template for inline comment form
217 217 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
218 218
219 219 ## render comments
220 220 ${comment.generate_comments(c.comments)}
221 221
222 222 ## main comment form and it status
223 223 ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.commit.raw_id),
224 224 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
225 225 </div>
226 226
227 227 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
228 228 <script type="text/javascript">
229 229
230 230 $(document).ready(function() {
231 231
232 232 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
233 233 if($('#trimmed_message_box').height() === boxmax){
234 234 $('#message_expand').show();
235 235 }
236 236
237 237 $('#message_expand').on('click', function(e){
238 238 $('#trimmed_message_box').css('max-height', 'none');
239 239 $(this).hide();
240 240 });
241 241
242 242 $('.show-inline-comments').on('click', function(e){
243 243 var boxid = $(this).attr('data-comment-id');
244 244 var button = $(this);
245 245
246 246 if(button.hasClass("comments-visible")) {
247 247 $('#{0} .inline-comments'.format(boxid)).each(function(index){
248 248 $(this).hide();
249 249 });
250 250 button.removeClass("comments-visible");
251 251 } else {
252 252 $('#{0} .inline-comments'.format(boxid)).each(function(index){
253 253 $(this).show();
254 254 });
255 255 button.addClass("comments-visible");
256 256 }
257 257 });
258 258
259 259
260 260 // next links
261 261 $('#child_link').on('click', function(e){
262 262 // fetch via ajax what is going to be the next link, if we have
263 263 // >1 links show them to user to choose
264 264 if(!$('#child_link').hasClass('disabled')){
265 265 $.ajax({
266 266 url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.commit.raw_id)}',
267 267 success: function(data) {
268 268 if(data.results.length === 0){
269 269 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
270 270 }
271 271 if(data.results.length === 1){
272 272 var commit = data.results[0];
273 273 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
274 274 }
275 275 else if(data.results.length === 2){
276 276 $('#child_link').addClass('disabled');
277 277 $('#child_link').addClass('double');
278 278 var _html = '';
279 279 _html +='<a title="__title__" href="__url__">__rev__</a> '
280 280 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
281 281 .replace('__title__', data.results[0].message)
282 282 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
283 283 _html +=' | ';
284 284 _html +='<a title="__title__" href="__url__">__rev__</a> '
285 285 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
286 286 .replace('__title__', data.results[1].message)
287 287 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
288 288 $('#child_link').html(_html);
289 289 }
290 290 }
291 291 });
292 292 e.preventDefault();
293 293 }
294 294 });
295 295
296 296 // prev links
297 297 $('#parent_link').on('click', function(e){
298 298 // fetch via ajax what is going to be the next link, if we have
299 299 // >1 links show them to user to choose
300 300 if(!$('#parent_link').hasClass('disabled')){
301 301 $.ajax({
302 302 url: '${h.url("changeset_parents",repo_name=c.repo_name, revision=c.commit.raw_id)}',
303 303 success: function(data) {
304 304 if(data.results.length === 0){
305 305 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
306 306 }
307 307 if(data.results.length === 1){
308 308 var commit = data.results[0];
309 309 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
310 310 }
311 311 else if(data.results.length === 2){
312 312 $('#parent_link').addClass('disabled');
313 313 $('#parent_link').addClass('double');
314 314 var _html = '';
315 315 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
316 316 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
317 317 .replace('__title__', data.results[0].message)
318 318 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
319 319 _html +=' | ';
320 320 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
321 321 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
322 322 .replace('__title__', data.results[1].message)
323 323 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
324 324 $('#parent_link').html(_html);
325 325 }
326 326 }
327 327 });
328 328 e.preventDefault();
329 329 }
330 330 });
331 331
332 332 if (location.hash) {
333 333 var result = splitDelimitedHash(location.hash);
334 334 var line = $('html').find(result.loc);
335 335 if (line.length > 0){
336 336 offsetScroll(line, 70);
337 337 }
338 338 }
339 339
340 340 // browse tree @ revision
341 341 $('#files_link').on('click', function(e){
342 342 window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}';
343 343 e.preventDefault();
344 344 });
345 345
346 346 // inject comments into their proper positions
347 347 var file_comments = $('.inline-comment-placeholder');
348 348 })
349 349 </script>
350 350
351 351 </%def>
@@ -1,672 +1,672 b''
1 1 <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/>
2 2
3 3 <%def name="diff_line_anchor(filename, line, type)"><%
4 4 return '%s_%s_%i' % (h.safeid(filename), type, line)
5 5 %></%def>
6 6
7 7 <%def name="action_class(action)">
8 8 <%
9 9 return {
10 10 '-': 'cb-deletion',
11 11 '+': 'cb-addition',
12 12 ' ': 'cb-context',
13 13 }.get(action, 'cb-empty')
14 14 %>
15 15 </%def>
16 16
17 17 <%def name="op_class(op_id)">
18 18 <%
19 19 return {
20 20 DEL_FILENODE: 'deletion', # file deleted
21 21 BIN_FILENODE: 'warning' # binary diff hidden
22 22 }.get(op_id, 'addition')
23 23 %>
24 24 </%def>
25 25
26 26 <%def name="link_for(**kw)">
27 27 <%
28 28 new_args = request.GET.mixed()
29 29 new_args.update(kw)
30 30 return h.url('', **new_args)
31 31 %>
32 32 </%def>
33 33
34 34 <%def name="render_diffset(diffset, commit=None,
35 35
36 36 # collapse all file diff entries when there are more than this amount of files in the diff
37 37 collapse_when_files_over=20,
38 38
39 39 # collapse lines in the diff when more than this amount of lines changed in the file diff
40 40 lines_changed_limit=500,
41 41
42 42 # add a ruler at to the output
43 43 ruler_at_chars=0,
44 44
45 45 # show inline comments
46 46 use_comments=False,
47 47
48 48 # disable new comments
49 49 disable_new_comments=False,
50 50
51 51 # special file-comments that were deleted in previous versions
52 52 # it's used for showing outdated comments for deleted files in a PR
53 53 deleted_files_comments=None
54 54
55 55 )">
56 56
57 57 %if use_comments:
58 58 <div id="cb-comments-inline-container-template" class="js-template">
59 59 ${inline_comments_container([])}
60 60 </div>
61 61 <div class="js-template" id="cb-comment-inline-form-template">
62 62 <div class="comment-inline-form ac">
63 63
64 64 %if c.rhodecode_user.username != h.DEFAULT_USER:
65 65 ## render template for inline comments
66 66 ${commentblock.comment_form(form_type='inline')}
67 67 %else:
68 68 ${h.form('', class_='inline-form comment-form-login', method='get')}
69 69 <div class="pull-left">
70 70 <div class="comment-help pull-right">
71 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 72 </div>
73 73 </div>
74 74 <div class="comment-button pull-right">
75 75 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
76 76 ${_('Cancel')}
77 77 </button>
78 78 </div>
79 79 <div class="clearfix"></div>
80 80 ${h.end_form()}
81 81 %endif
82 82 </div>
83 83 </div>
84 84
85 85 %endif
86 86 <%
87 87 collapse_all = len(diffset.files) > collapse_when_files_over
88 88 %>
89 89
90 90 %if c.diffmode == 'sideside':
91 91 <style>
92 92 .wrapper {
93 93 max-width: 1600px !important;
94 94 }
95 95 </style>
96 96 %endif
97 97
98 98 %if ruler_at_chars:
99 99 <style>
100 100 .diff table.cb .cb-content:after {
101 101 content: "";
102 102 border-left: 1px solid blue;
103 103 position: absolute;
104 104 top: 0;
105 105 height: 18px;
106 106 opacity: .2;
107 107 z-index: 10;
108 108 //## +5 to account for diff action (+/-)
109 109 left: ${ruler_at_chars + 5}ch;
110 110 </style>
111 111 %endif
112 112
113 113 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
114 114 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
115 115 %if commit:
116 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 118 ${_('Browse Files')}
119 119 </a>
120 120 </div>
121 121 %endif
122 122 <h2 class="clearinner">
123 123 %if commit:
124 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 125 ${h.age_component(commit.date)} -
126 126 %endif
127 127 %if diffset.limited_diff:
128 128 ${_('The requested commit is too big and content was truncated.')}
129 129
130 130 ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
131 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 132 %else:
133 133 ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
134 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 135 %endif
136 136
137 137 </h2>
138 138 </div>
139 139
140 140 %if not diffset.files:
141 141 <p class="empty_data">${_('No files')}</p>
142 142 %endif
143 143
144 144 <div class="filediffs">
145 145 ## initial value could be marked as False later on
146 146 <% over_lines_changed_limit = False %>
147 147 %for i, filediff in enumerate(diffset.files):
148 148
149 149 <%
150 150 lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
151 151 over_lines_changed_limit = lines_changed > lines_changed_limit
152 152 %>
153 153 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
154 154 <div
155 155 class="filediff"
156 156 data-f-path="${filediff['patch']['filename']}"
157 157 id="a_${h.FID('', filediff['patch']['filename'])}">
158 158 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
159 159 <div class="filediff-collapse-indicator"></div>
160 160 ${diff_ops(filediff)}
161 161 </label>
162 162 ${diff_menu(filediff, use_comments=use_comments)}
163 163 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
164 164 %if not filediff.hunks:
165 165 %for op_id, op_text in filediff['patch']['stats']['ops'].items():
166 166 <tr>
167 167 <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
168 168 %if op_id == DEL_FILENODE:
169 169 ${_('File was deleted')}
170 170 %elif op_id == BIN_FILENODE:
171 171 ${_('Binary file hidden')}
172 172 %else:
173 173 ${op_text}
174 174 %endif
175 175 </td>
176 176 </tr>
177 177 %endfor
178 178 %endif
179 179 %if filediff.patch['is_limited_diff']:
180 180 <tr class="cb-warning cb-collapser">
181 181 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
182 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 183 </td>
184 184 </tr>
185 185 %else:
186 186 %if over_lines_changed_limit:
187 187 <tr class="cb-warning cb-collapser">
188 188 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
189 189 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
190 190 <a href="#" class="cb-expand"
191 191 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
192 192 </a>
193 193 <a href="#" class="cb-collapse"
194 194 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
195 195 </a>
196 196 </td>
197 197 </tr>
198 198 %endif
199 199 %endif
200 200
201 201 %for hunk in filediff.hunks:
202 202 <tr class="cb-hunk">
203 203 <td ${c.diffmode == 'unified' and 'colspan=3' or ''}>
204 204 ## TODO: dan: add ajax loading of more context here
205 205 ## <a href="#">
206 206 <i class="icon-more"></i>
207 207 ## </a>
208 208 </td>
209 209 <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}>
210 210 @@
211 211 -${hunk.source_start},${hunk.source_length}
212 212 +${hunk.target_start},${hunk.target_length}
213 213 ${hunk.section_header}
214 214 </td>
215 215 </tr>
216 216 %if c.diffmode == 'unified':
217 217 ${render_hunk_lines_unified(hunk, use_comments=use_comments)}
218 218 %elif c.diffmode == 'sideside':
219 219 ${render_hunk_lines_sideside(hunk, use_comments=use_comments)}
220 220 %else:
221 221 <tr class="cb-line">
222 222 <td>unknown diff mode</td>
223 223 </tr>
224 224 %endif
225 225 %endfor
226 226
227 227 ## outdated comments that do not fit into currently displayed lines
228 228 % for lineno, comments in filediff.left_comments.items():
229 229
230 230 %if c.diffmode == 'unified':
231 231 <tr class="cb-line">
232 232 <td class="cb-data cb-context"></td>
233 233 <td class="cb-lineno cb-context"></td>
234 234 <td class="cb-lineno cb-context"></td>
235 235 <td class="cb-content cb-context">
236 236 ${inline_comments_container(comments)}
237 237 </td>
238 238 </tr>
239 239 %elif c.diffmode == 'sideside':
240 240 <tr class="cb-line">
241 241 <td class="cb-data cb-context"></td>
242 242 <td class="cb-lineno cb-context"></td>
243 243 <td class="cb-content cb-context"></td>
244 244
245 245 <td class="cb-data cb-context"></td>
246 246 <td class="cb-lineno cb-context"></td>
247 247 <td class="cb-content cb-context">
248 248 ${inline_comments_container(comments)}
249 249 </td>
250 250 </tr>
251 251 %endif
252 252
253 253 % endfor
254 254
255 255 </table>
256 256 </div>
257 257 %endfor
258 258
259 259 ## outdated comments that are made for a file that has been deleted
260 260 % for filename, comments_dict in (deleted_files_comments or {}).items():
261 261
262 262 <div class="filediffs filediff-outdated" style="display: none">
263 263 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
264 264 <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
265 265 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
266 266 <div class="filediff-collapse-indicator"></div>
267 267 <span class="pill">
268 268 ## file was deleted
269 269 <strong>${filename}</strong>
270 270 </span>
271 271 <span class="pill-group" style="float: left">
272 272 ## file op, doesn't need translation
273 273 <span class="pill" op="removed">removed in this version</span>
274 274 </span>
275 275 <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}"></a>
276 276 <span class="pill-group" style="float: right">
277 277 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
278 278 </span>
279 279 </label>
280 280
281 281 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
282 282 <tr>
283 283 % if c.diffmode == 'unified':
284 284 <td></td>
285 285 %endif
286 286
287 287 <td></td>
288 288 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}>
289 289 ${_('File was deleted in this version, and outdated comments were made on it')}
290 290 </td>
291 291 </tr>
292 292 %if c.diffmode == 'unified':
293 293 <tr class="cb-line">
294 294 <td class="cb-data cb-context"></td>
295 295 <td class="cb-lineno cb-context"></td>
296 296 <td class="cb-lineno cb-context"></td>
297 297 <td class="cb-content cb-context">
298 298 ${inline_comments_container(comments_dict['comments'])}
299 299 </td>
300 300 </tr>
301 301 %elif c.diffmode == 'sideside':
302 302 <tr class="cb-line">
303 303 <td class="cb-data cb-context"></td>
304 304 <td class="cb-lineno cb-context"></td>
305 305 <td class="cb-content cb-context"></td>
306 306
307 307 <td class="cb-data cb-context"></td>
308 308 <td class="cb-lineno cb-context"></td>
309 309 <td class="cb-content cb-context">
310 310 ${inline_comments_container(comments_dict['comments'])}
311 311 </td>
312 312 </tr>
313 313 %endif
314 314 </table>
315 315 </div>
316 316 </div>
317 317 % endfor
318 318
319 319 </div>
320 320 </div>
321 321 </%def>
322 322
323 323 <%def name="diff_ops(filediff)">
324 324 <%
325 325 stats = filediff['patch']['stats']
326 326 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
327 327 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
328 328 %>
329 329 <span class="pill">
330 330 %if filediff.source_file_path and filediff.target_file_path:
331 331 %if filediff.source_file_path != filediff.target_file_path:
332 332 ## file was renamed, or copied
333 333 %if RENAMED_FILENODE in stats['ops']:
334 334 <strong>${filediff.target_file_path}</strong><del>${filediff.source_file_path}</del>
335 335 %elif COPIED_FILENODE in stats['ops']:
336 336 <strong>${filediff.target_file_path}</strong>${filediff.source_file_path}
337 337 %endif
338 338 %else:
339 339 ## file was modified
340 340 <strong>${filediff.source_file_path}</strong>
341 341 %endif
342 342 %else:
343 343 %if filediff.source_file_path:
344 344 ## file was deleted
345 345 <strong>${filediff.source_file_path}</strong>
346 346 %else:
347 347 ## file was added
348 348 <strong>${filediff.target_file_path}</strong>
349 349 %endif
350 350 %endif
351 351 </span>
352 352 <span class="pill-group" style="float: left">
353 353 %if filediff.patch['is_limited_diff']:
354 354 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
355 355 %endif
356 356
357 357 %if RENAMED_FILENODE in stats['ops']:
358 358 <span class="pill" op="renamed">renamed</span>
359 359 %endif
360 360
361 361 %if COPIED_FILENODE in stats['ops']:
362 362 <span class="pill" op="copied">copied</span>
363 363 %endif
364 364
365 365 %if NEW_FILENODE in stats['ops']:
366 366 <span class="pill" op="created">created</span>
367 367 %if filediff['target_mode'].startswith('120'):
368 368 <span class="pill" op="symlink">symlink</span>
369 369 %else:
370 370 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
371 371 %endif
372 372 %endif
373 373
374 374 %if DEL_FILENODE in stats['ops']:
375 375 <span class="pill" op="removed">removed</span>
376 376 %endif
377 377
378 378 %if CHMOD_FILENODE in stats['ops']:
379 379 <span class="pill" op="mode">
380 380 ${nice_mode(filediff['source_mode'])}${nice_mode(filediff['target_mode'])}
381 381 </span>
382 382 %endif
383 383 </span>
384 384
385 385 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}"></a>
386 386
387 387 <span class="pill-group" style="float: right">
388 388 %if BIN_FILENODE in stats['ops']:
389 389 <span class="pill" op="binary">binary</span>
390 390 %if MOD_FILENODE in stats['ops']:
391 391 <span class="pill" op="modified">modified</span>
392 392 %endif
393 393 %endif
394 394 %if stats['added']:
395 395 <span class="pill" op="added">+${stats['added']}</span>
396 396 %endif
397 397 %if stats['deleted']:
398 398 <span class="pill" op="deleted">-${stats['deleted']}</span>
399 399 %endif
400 400 </span>
401 401
402 402 </%def>
403 403
404 404 <%def name="nice_mode(filemode)">
405 405 ${filemode.startswith('100') and filemode[3:] or filemode}
406 406 </%def>
407 407
408 408 <%def name="diff_menu(filediff, use_comments=False)">
409 409 <div class="filediff-menu">
410 410 %if filediff.diffset.source_ref:
411 411 %if filediff.patch['operation'] in ['D', 'M']:
412 412 <a
413 413 class="tooltip"
414 414 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
415 415 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
416 416 >
417 417 ${_('Show file before')}
418 418 </a> |
419 419 %else:
420 420 <span
421 421 class="tooltip"
422 422 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
423 423 >
424 424 ${_('Show file before')}
425 425 </span> |
426 426 %endif
427 427 %if filediff.patch['operation'] in ['A', 'M']:
428 428 <a
429 429 class="tooltip"
430 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 431 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
432 432 >
433 433 ${_('Show file after')}
434 434 </a> |
435 435 %else:
436 436 <span
437 437 class="tooltip"
438 438 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
439 439 >
440 440 ${_('Show file after')}
441 441 </span> |
442 442 %endif
443 443 <a
444 444 class="tooltip"
445 445 title="${h.tooltip(_('Raw diff'))}"
446 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 448 ${_('Raw diff')}
449 449 </a> |
450 450 <a
451 451 class="tooltip"
452 452 title="${h.tooltip(_('Download diff'))}"
453 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 455 ${_('Download diff')}
456 456 </a>
457 457 % if use_comments:
458 458 |
459 459 % endif
460 460
461 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 462 %if hasattr(c, 'ignorews_url'):
463 463 ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
464 464 %endif
465 465 %if hasattr(c, 'context_url'):
466 466 ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
467 467 %endif
468 468
469 469 %if use_comments:
470 470 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
471 471 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
472 472 </a>
473 473 %endif
474 474 %endif
475 475 </div>
476 476 </%def>
477 477
478 478
479 479 <%def name="inline_comments_container(comments)">
480 480 <div class="inline-comments">
481 481 %for comment in comments:
482 482 ${commentblock.comment_block(comment, inline=True)}
483 483 %endfor
484 484
485 485 % if comments and comments[-1].outdated:
486 486 <span class="btn btn-secondary cb-comment-add-button comment-outdated}"
487 487 style="display: none;}">
488 488 ${_('Add another comment')}
489 489 </span>
490 490 % else:
491 491 <span onclick="return Rhodecode.comments.createComment(this)"
492 492 class="btn btn-secondary cb-comment-add-button">
493 493 ${_('Add another comment')}
494 494 </span>
495 495 % endif
496 496
497 497 </div>
498 498 </%def>
499 499
500 500
501 501 <%def name="render_hunk_lines_sideside(hunk, use_comments=False)">
502 502 %for i, line in enumerate(hunk.sideside):
503 503 <%
504 504 old_line_anchor, new_line_anchor = None, None
505 505 if line.original.lineno:
506 506 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
507 507 if line.modified.lineno:
508 508 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
509 509 %>
510 510
511 511 <tr class="cb-line">
512 512 <td class="cb-data ${action_class(line.original.action)}"
513 513 data-line-number="${line.original.lineno}"
514 514 >
515 515 <div>
516 516 %if line.original.comments:
517 517 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
518 518 %endif
519 519 </div>
520 520 </td>
521 521 <td class="cb-lineno ${action_class(line.original.action)}"
522 522 data-line-number="${line.original.lineno}"
523 523 %if old_line_anchor:
524 524 id="${old_line_anchor}"
525 525 %endif
526 526 >
527 527 %if line.original.lineno:
528 528 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
529 529 %endif
530 530 </td>
531 531 <td class="cb-content ${action_class(line.original.action)}"
532 532 data-line-number="o${line.original.lineno}"
533 533 >
534 534 %if use_comments and line.original.lineno:
535 535 ${render_add_comment_button()}
536 536 %endif
537 537 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
538 538 %if use_comments and line.original.lineno and line.original.comments:
539 539 ${inline_comments_container(line.original.comments)}
540 540 %endif
541 541 </td>
542 542 <td class="cb-data ${action_class(line.modified.action)}"
543 543 data-line-number="${line.modified.lineno}"
544 544 >
545 545 <div>
546 546 %if line.modified.comments:
547 547 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
548 548 %endif
549 549 </div>
550 550 </td>
551 551 <td class="cb-lineno ${action_class(line.modified.action)}"
552 552 data-line-number="${line.modified.lineno}"
553 553 %if new_line_anchor:
554 554 id="${new_line_anchor}"
555 555 %endif
556 556 >
557 557 %if line.modified.lineno:
558 558 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
559 559 %endif
560 560 </td>
561 561 <td class="cb-content ${action_class(line.modified.action)}"
562 562 data-line-number="n${line.modified.lineno}"
563 563 >
564 564 %if use_comments and line.modified.lineno:
565 565 ${render_add_comment_button()}
566 566 %endif
567 567 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
568 568 %if use_comments and line.modified.lineno and line.modified.comments:
569 569 ${inline_comments_container(line.modified.comments)}
570 570 %endif
571 571 </td>
572 572 </tr>
573 573 %endfor
574 574 </%def>
575 575
576 576
577 577 <%def name="render_hunk_lines_unified(hunk, use_comments=False)">
578 578 %for old_line_no, new_line_no, action, content, comments in hunk.unified:
579 579 <%
580 580 old_line_anchor, new_line_anchor = None, None
581 581 if old_line_no:
582 582 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
583 583 if new_line_no:
584 584 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
585 585 %>
586 586 <tr class="cb-line">
587 587 <td class="cb-data ${action_class(action)}">
588 588 <div>
589 589 %if comments:
590 590 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
591 591 %endif
592 592 </div>
593 593 </td>
594 594 <td class="cb-lineno ${action_class(action)}"
595 595 data-line-number="${old_line_no}"
596 596 %if old_line_anchor:
597 597 id="${old_line_anchor}"
598 598 %endif
599 599 >
600 600 %if old_line_anchor:
601 601 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
602 602 %endif
603 603 </td>
604 604 <td class="cb-lineno ${action_class(action)}"
605 605 data-line-number="${new_line_no}"
606 606 %if new_line_anchor:
607 607 id="${new_line_anchor}"
608 608 %endif
609 609 >
610 610 %if new_line_anchor:
611 611 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
612 612 %endif
613 613 </td>
614 614 <td class="cb-content ${action_class(action)}"
615 615 data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
616 616 >
617 617 %if use_comments:
618 618 ${render_add_comment_button()}
619 619 %endif
620 620 <span class="cb-code">${action} ${content or '' | n}</span>
621 621 %if use_comments and comments:
622 622 ${inline_comments_container(comments)}
623 623 %endif
624 624 </td>
625 625 </tr>
626 626 %endfor
627 627 </%def>
628 628
629 629 <%def name="render_add_comment_button()">
630 630 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
631 631 <span><i class="icon-comment"></i></span>
632 632 </button>
633 633 </%def>
634 634
635 635 <%def name="render_diffset_menu()">
636 636
637 637 <div class="diffset-menu clearinner">
638 638 <div class="pull-right">
639 639 <div class="btn-group">
640 640
641 641 <a
642 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 644 href="${h.url_replace(diffmode='sideside')}">
645 645 <span>${_('Side by Side')}</span>
646 646 </a>
647 647 <a
648 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 650 <span>${_('Unified')}</span>
651 651 </a>
652 652 </div>
653 653 </div>
654 654
655 655 <div class="pull-left">
656 656 <div class="btn-group">
657 657 <a
658 658 class="btn"
659 659 href="#"
660 660 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
661 661 <a
662 662 class="btn"
663 663 href="#"
664 664 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
665 665 <a
666 666 class="btn"
667 667 href="#"
668 668 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
669 669 </div>
670 670 </div>
671 671 </div>
672 672 </%def>
@@ -1,90 +1,91 b''
1 1 <%def name="render_line(line_num, tokens,
2 2 annotation=None,
3 3 bgcolor=None, show_annotation=None)">
4 4 <%
5 5 from rhodecode.lib.codeblocks import render_tokenstream
6 6 # avoid module lookup for performance
7 7 html_escape = h.html_escape
8 tooltip = h.tooltip
8 9 %>
9 10 <tr class="cb-line cb-line-fresh ${'cb-annotate' if show_annotation else ''}"
10 11 %if annotation:
11 12 data-revision="${annotation.revision}"
12 13 %endif
13 14 >
14 15
15 16 % if annotation:
16 17 % if show_annotation:
17 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 21 ${h.gravatar_with_user(annotation.author, 16) | n}
21 22 <div class="cb-annotate-message truncate-wrap">${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}</div>
22 23 </td>
23 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 26 <i class="icon-left"></i>
26 27 </a>
27 28 </td>
28 29 <td
29 30 class="cb-annotate-revision"
30 31 data-revision="${annotation.revision}"
31 32 onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')"
32 33 style="background: ${bgcolor}">
33 34 <a class="cb-annotate" href="${h.url('changeset_home',repo_name=c.repo_name,revision=annotation.raw_id)}">
34 35 r${annotation.revision}
35 36 </a>
36 37 </td>
37 38 % else:
38 39 <td></td>
39 40 <td class="cb-annotate-message-spacer"></td>
40 41 <td
41 42 class="cb-annotate-revision"
42 43 data-revision="${annotation.revision}"
43 44 onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')"
44 45 style="background: ${bgcolor}">
45 46 </td>
46 47 % endif
47 48 % else:
48 49 <td colspan="3"></td>
49 50 % endif
50 51
51 52
52 53 <td class="cb-lineno" id="L${line_num}">
53 54 <a data-line-no="${line_num}" href="#L${line_num}"></a>
54 55 </td>
55 56 <td class="cb-content cb-content-fresh"
56 57 %if bgcolor:
57 58 style="background: ${bgcolor}"
58 59 %endif
59 60 >
60 61 ## newline at end is necessary for highlight to work when line is empty
61 62 ## and for copy pasting code to work as expected
62 63 <span class="cb-code">${render_tokenstream(tokens)|n}${'\n'}</span>
63 64 </td>
64 65 </tr>
65 66 </%def>
66 67
67 68 <%def name="render_annotation_lines(annotation, lines, color_hasher)">
68 69 % for line_num, tokens in lines:
69 70 ${render_line(line_num, tokens,
70 71 bgcolor=color_hasher(annotation and annotation.raw_id or ''),
71 72 annotation=annotation, show_annotation=loop.first
72 73 )}
73 74 % endfor
74 75 <script>
75 76 var AnnotationController = function() {
76 77 var self = this;
77 78
78 79 this.previousAnnotation = function(commitId, fPath) {
79 80 var params = {
80 81 'repo_name': templateContext.repo_name,
81 82 'revision': commitId,
82 83 'f_path': fPath
83 84 };
84 85 window.location = pyroutes.url('files_annotate_previous', params);
85 86 return false;
86 87 };
87 88 };
88 89 var annotationController = new AnnotationController();
89 90 </script>
90 91 </%def>
@@ -1,317 +1,317 b''
1 1 ## DATA TABLE RE USABLE ELEMENTS
2 2 ## usage:
3 3 ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
4 4 <%namespace name="base" file="/base/base.mako"/>
5 5
6 6 ## REPOSITORY RENDERERS
7 7 <%def name="quick_menu(repo_name)">
8 8 <i class="pointer icon-more"></i>
9 9 <div class="menu_items_container hidden">
10 10 <ul class="menu_items">
11 11 <li>
12 12 <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}">
13 13 <span>${_('Summary')}</span>
14 14 </a>
15 15 </li>
16 16 <li>
17 17 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=repo_name)}">
18 18 <span>${_('Changelog')}</span>
19 19 </a>
20 20 </li>
21 21 <li>
22 22 <a title="${_('Files')}" href="${h.url('files_home',repo_name=repo_name)}">
23 23 <span>${_('Files')}</span>
24 24 </a>
25 25 </li>
26 26 <li>
27 27 <a title="${_('Fork')}" href="${h.url('repo_fork_home',repo_name=repo_name)}">
28 28 <span>${_('Fork')}</span>
29 29 </a>
30 30 </li>
31 31 </ul>
32 32 </div>
33 33 </%def>
34 34
35 35 <%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)">
36 36 <%
37 37 def get_name(name,short_name=short_name):
38 38 if short_name:
39 39 return name.split('/')[-1]
40 40 else:
41 41 return name
42 42 %>
43 43 <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate">
44 44 ##NAME
45 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 47 ##TYPE OF REPO
48 48 %if h.is_hg(rtype):
49 49 <span title="${_('Mercurial repository')}"><i class="icon-hg"></i></span>
50 50 %elif h.is_git(rtype):
51 51 <span title="${_('Git repository')}"><i class="icon-git"></i></span>
52 52 %elif h.is_svn(rtype):
53 53 <span title="${_('Subversion repository')}"><i class="icon-svn"></i></span>
54 54 %endif
55 55
56 56 ##PRIVATE/PUBLIC
57 57 %if private and c.visual.show_private_icon:
58 58 <i class="icon-lock" title="${_('Private repository')}"></i>
59 59 %elif not private and c.visual.show_public_icon:
60 60 <i class="icon-unlock-alt" title="${_('Public repository')}"></i>
61 61 %else:
62 62 <span></span>
63 63 %endif
64 64 ${get_name(name)}
65 65 </a>
66 66 %if fork_of:
67 67 <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a>
68 68 %endif
69 69 %if rstate == 'repo_state_pending':
70 70 <i class="icon-cogs" title="${_('Repository creating in progress...')}"></i>
71 71 %endif
72 72 </div>
73 73 </%def>
74 74
75 75 <%def name="repo_desc(description)">
76 76 <div class="truncate-wrap">${description}</div>
77 77 </%def>
78 78
79 79 <%def name="last_change(last_change)">
80 80 ${h.age_component(last_change)}
81 81 </%def>
82 82
83 83 <%def name="revision(name,rev,tip,author,last_msg)">
84 84 <div>
85 85 %if rev >= 0:
86 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 87 %else:
88 88 ${_('No commits yet')}
89 89 %endif
90 90 </div>
91 91 </%def>
92 92
93 93 <%def name="rss(name)">
94 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 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 98 %endif
99 99 </%def>
100 100
101 101 <%def name="atom(name)">
102 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 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 106 %endif
107 107 </%def>
108 108
109 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 111 ${base.gravatar(email, 16)}
112 112 </div>
113 113 </%def>
114 114
115 115 <%def name="repo_actions(repo_name, super_user=True)">
116 116 <div>
117 117 <div class="grid_edit">
118 118 <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}">
119 119 <i class="icon-pencil"></i>Edit</a>
120 120 </div>
121 121 <div class="grid_delete">
122 122 ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), method='POST')}
123 123 ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger",
124 124 onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")}
125 125 ${h.end_form()}
126 126 </div>
127 127 </div>
128 128 </%def>
129 129
130 130 <%def name="repo_state(repo_state)">
131 131 <div>
132 132 %if repo_state == 'repo_state_pending':
133 133 <div class="tag tag4">${_('Creating')}</div>
134 134 %elif repo_state == 'repo_state_created':
135 135 <div class="tag tag1">${_('Created')}</div>
136 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 138 %endif
139 139 </div>
140 140 </%def>
141 141
142 142
143 143 ## REPO GROUP RENDERERS
144 144 <%def name="quick_repo_group_menu(repo_group_name)">
145 145 <i class="pointer icon-more"></i>
146 146 <div class="menu_items_container hidden">
147 147 <ul class="menu_items">
148 148 <li>
149 149 <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}">
150 150 <span class="icon">
151 151 <i class="icon-file-text"></i>
152 152 </span>
153 153 <span>${_('Summary')}</span>
154 154 </a>
155 155 </li>
156 156
157 157 </ul>
158 158 </div>
159 159 </%def>
160 160
161 161 <%def name="repo_group_name(repo_group_name, children_groups=None)">
162 162 <div>
163 163 <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}">
164 164 <i class="icon-folder-close" title="${_('Repository group')}"></i>
165 165 %if children_groups:
166 166 ${h.literal(' &raquo; '.join(children_groups))}
167 167 %else:
168 168 ${repo_group_name}
169 169 %endif
170 170 </a>
171 171 </div>
172 172 </%def>
173 173
174 174 <%def name="repo_group_desc(description)">
175 175 <div class="truncate-wrap">${description}</div>
176 176 </%def>
177 177
178 178 <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)">
179 179 <div class="grid_edit">
180 180 <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}">Edit</a>
181 181 </div>
182 182 <div class="grid_delete">
183 183 ${h.secure_form(h.url('delete_repo_group', group_name=repo_group_name),method='delete')}
184 184 ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger",
185 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 186 ${h.end_form()}
187 187 </div>
188 188 </%def>
189 189
190 190
191 191 <%def name="user_actions(user_id, username)">
192 192 <div class="grid_edit">
193 193 <a href="${h.url('edit_user',user_id=user_id)}" title="${_('Edit')}">
194 194 <i class="icon-pencil"></i>Edit</a>
195 195 </div>
196 196 <div class="grid_delete">
197 197 ${h.secure_form(h.url('delete_user', user_id=user_id),method='delete')}
198 198 ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger",
199 199 onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")}
200 200 ${h.end_form()}
201 201 </div>
202 202 </%def>
203 203
204 204 <%def name="user_group_actions(user_group_id, user_group_name)">
205 205 <div class="grid_edit">
206 206 <a href="${h.url('edit_users_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a>
207 207 </div>
208 208 <div class="grid_delete">
209 209 ${h.secure_form(h.url('delete_users_group', user_group_id=user_group_id),method='delete')}
210 210 ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger",
211 211 onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")}
212 212 ${h.end_form()}
213 213 </div>
214 214 </%def>
215 215
216 216
217 217 <%def name="user_name(user_id, username)">
218 218 ${h.link_to(h.person(username, 'username_or_name_or_email'), h.url('edit_user', user_id=user_id))}
219 219 </%def>
220 220
221 221 <%def name="user_profile(username)">
222 222 ${base.gravatar_with_user(username, 16)}
223 223 </%def>
224 224
225 225 <%def name="user_group_name(user_group_id, user_group_name)">
226 226 <div>
227 227 <a href="${h.url('edit_users_group', user_group_id=user_group_id)}">
228 228 <i class="icon-group" title="${_('User group')}"></i> ${user_group_name}</a>
229 229 </div>
230 230 </%def>
231 231
232 232
233 233 ## GISTS
234 234
235 235 <%def name="gist_gravatar(full_contact)">
236 236 <div class="gist_gravatar">
237 237 ${base.gravatar(full_contact, 30)}
238 238 </div>
239 239 </%def>
240 240
241 241 <%def name="gist_access_id(gist_access_id, full_contact)">
242 242 <div>
243 243 <b>
244 244 <a href="${h.url('gist',gist_id=gist_access_id)}">gist: ${gist_access_id}</a>
245 245 </b>
246 246 </div>
247 247 </%def>
248 248
249 249 <%def name="gist_author(full_contact, created_on, expires)">
250 250 ${base.gravatar_with_user(full_contact, 16)}
251 251 </%def>
252 252
253 253
254 254 <%def name="gist_created(created_on)">
255 255 <div class="created">
256 256 ${h.age_component(created_on, time_is_local=True)}
257 257 </div>
258 258 </%def>
259 259
260 260 <%def name="gist_expires(expires)">
261 261 <div class="created">
262 262 %if expires == -1:
263 263 ${_('never')}
264 264 %else:
265 265 ${h.age_component(h.time_to_utcdatetime(expires))}
266 266 %endif
267 267 </div>
268 268 </%def>
269 269
270 270 <%def name="gist_type(gist_type)">
271 271 %if gist_type != 'public':
272 272 <div class="tag">${_('Private')}</div>
273 273 %endif
274 274 </%def>
275 275
276 276 <%def name="gist_description(gist_description)">
277 277 ${gist_description}
278 278 </%def>
279 279
280 280
281 281 ## PULL REQUESTS GRID RENDERERS
282 282
283 283 <%def name="pullrequest_target_repo(repo_name)">
284 284 <div class="truncate">
285 285 ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))}
286 286 </div>
287 287 </%def>
288 288 <%def name="pullrequest_status(status)">
289 289 <div class="${'flag_status %s' % status} pull-left"></div>
290 290 </%def>
291 291
292 292 <%def name="pullrequest_title(title, description)">
293 293 ${title} <br/>
294 294 ${h.shorter(description, 40)}
295 295 </%def>
296 296
297 297 <%def name="pullrequest_comments(comments_nr)">
298 298 <i class="icon-comment"></i> ${comments_nr}
299 299 </%def>
300 300
301 301 <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)">
302 302 <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}">
303 303 % if short:
304 304 #${pull_request_id}
305 305 % else:
306 306 ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}}
307 307 % endif
308 308 </a>
309 309 </%def>
310 310
311 311 <%def name="pullrequest_updated_on(updated_on)">
312 312 ${h.age_component(h.time_to_utcdatetime(updated_on))}
313 313 </%def>
314 314
315 315 <%def name="pullrequest_author(full_contact)">
316 316 ${base.gravatar_with_user(full_contact, 16)}
317 317 </%def>
@@ -1,28 +1,28 b''
1 1 <%def name="refs(commit)">
2 2 %if commit.merge:
3 3 <span class="mergetag tag">
4 4 <i class="icon-merge">${_('merge')}</i>
5 5 </span>
6 6 %endif
7 7
8 8 %if h.is_hg(c.rhodecode_repo):
9 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 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 12 </span>
13 13 %endfor
14 14 %endif
15 15
16 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 18 <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${tag}</a>
19 19 </span>
20 20 %endfor
21 21
22 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 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 25 </span>
26 26 %endif
27 27
28 28 </%def>
@@ -1,30 +1,30 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="summary-detail-header">
4 4 <h4 class="item">
5 5 % if c.file_author:
6 6 ${_('Last Author')}
7 7 % else:
8 8 ${h.literal(ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) }
9 9 % endif
10 10 </h4>
11 11 <a href="#" id="show_authors" class="action_link">${_('Show All')}</a>
12 12 </div>
13 13
14 14 % if c.authors:
15 15 <ul class="sidebar-right-content">
16 16 % for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):
17 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 19 ${base.gravatar(email, 16)}
20 20 <span class="user">${h.link_to_user(user)}</span>
21 21 </div>
22 22 % if c.file_author:
23 23 <div class="user-inline-data">- ${h.age_component(c.file_last_commit.date)}</div>
24 24 % elif c.file_last_commit.author_email==email:
25 25 <div class="user-inline-data"> (${_('last author')})</div>
26 26 % endif
27 27 </li>
28 28 % endfor
29 29 </ul>
30 30 % endif
@@ -1,82 +1,82 b''
1 1 <div id="file-tree-wrapper" class="browser-body ${'full-load' if c.full_load else ''}">
2 2 <table class="code-browser rctable">
3 3 <thead>
4 4 <tr>
5 5 <th>${_('Name')}</th>
6 6 <th>${_('Size')}</th>
7 7 <th>${_('Modified')}</th>
8 8 <th>${_('Last Commit')}</th>
9 9 <th>${_('Author')}</th>
10 10 </tr>
11 11 </thead>
12 12
13 13 <tbody id="tbody">
14 14 %if c.file.parent:
15 15 <tr class="parity0">
16 16 <td class="td-componentname">
17 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 18 <i class="icon-folder"></i>..
19 19 </a>
20 20 </td>
21 21 <td></td>
22 22 <td></td>
23 23 <td></td>
24 24 <td></td>
25 25 </tr>
26 26 %endif
27 27 %for cnt,node in enumerate(c.file):
28 28 <tr class="parity${cnt%2}">
29 29 <td class="td-componentname">
30 30 % if node.is_submodule():
31 31 <span class="submodule-dir">
32 32 % if node.url.startswith('http://') or node.url.startswith('https://'):
33 33 <a href="${node.url}">
34 34 <i class="icon-folder browser-dir"></i>${node.name}
35 35 </a>
36 36 % else:
37 37 <i class="icon-folder browser-dir"></i>${node.name}
38 38 % endif
39 39 </span>
40 40 % else:
41 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 42 <i class="${'icon-file browser-file' if node.is_file() else 'icon-folder browser-dir'}"></i>${node.name}
43 43 </a>
44 44 % endif
45 45 </td>
46 46 %if node.is_file():
47 47 <td class="td-size" data-attr-name="size">
48 48 % if c.full_load:
49 49 <span data-size="${node.size}">${h.format_byte_size_binary(node.size)}</span>
50 50 % else:
51 51 ${_('Loading ...')}
52 52 % endif
53 53 </td>
54 54 <td class="td-time" data-attr-name="modified_at">
55 55 % if c.full_load:
56 56 <span data-date="${node.last_commit.date}">${h.age_component(node.last_commit.date)}</span>
57 57 % endif
58 58 </td>
59 59 <td class="td-hash" data-attr-name="commit_id">
60 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 62 <pre data-commit-id="${node.last_commit.raw_id}">r${node.last_commit.revision}:${node.last_commit.short_id}</pre>
63 63 </div>
64 64 % endif
65 65 </td>
66 66 <td class="td-user" data-attr-name="author">
67 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 69 % endif
70 70 </td>
71 71 %else:
72 72 <td></td>
73 73 <td></td>
74 74 <td></td>
75 75 <td></td>
76 76 %endif
77 77 </tr>
78 78 %endfor
79 79 </tbody>
80 80 <tbody id="tbody_filtered"></tbody>
81 81 </table>
82 82 </div>
@@ -1,47 +1,47 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4 4 % if c.forks_pager:
5 5 <table class="rctable fork_summary">
6 6 <tr>
7 7 <th>${_('Owner')}</th>
8 8 <th>${_('Fork')}</th>
9 9 <th>${_('Description')}</th>
10 10 <th>${_('Forked')}</th>
11 11 <th></th>
12 12 </tr>
13 13 % for f in c.forks_pager:
14 14 <tr>
15 15 <td class="td-user fork_user">
16 16 ${base.gravatar_with_user(f.user.email, 16)}
17 17 </td>
18 18 <td class="td-componentname">
19 19 ${h.link_to(f.repo_name,h.route_path('repo_summary',repo_name=f.repo_name))}
20 20 </td>
21 21 <td class="td-description">
22 22 <div class="truncate">${f.description}</div>
23 23 </td>
24 24 <td class="td-time follower_date">
25 25 ${h.age_component(f.created_on, time_is_local=True)}
26 26 </td>
27 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 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 30 class="btn-link"><i class="icon-loop"></i> ${_('Compare fork')}</a>
31 31 </td>
32 32 </tr>
33 33 % endfor
34 34 </table>
35 35 <div class="pagination-wh pagination-left">
36 36 <script type="text/javascript">
37 37 $(document).pjax('#forks .pager_link','#forks');
38 38 $(document).on('pjax:success',function(){
39 39 show_more_event();
40 40 timeagoActivate();
41 41 });
42 42 </script>
43 43 ${c.forks_pager.pager('$link_previous ~2~ $link_next')}
44 44 </div>
45 45 % else:
46 46 ${_('There are no forks yet')}
47 47 % endif
@@ -1,860 +1,860 b''
1 1 <%inherit file="/base/base.mako"/>
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <span id="pr-title">
13 13 ${c.pull_request.title}
14 14 %if c.pull_request.is_closed():
15 15 (${_('Closed')})
16 16 %endif
17 17 </span>
18 18 <div id="pr-title-edit" class="input" style="display: none;">
19 19 ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)}
20 20 </div>
21 21 </%def>
22 22
23 23 <%def name="menu_bar_nav()">
24 24 ${self.menu_items(active='repositories')}
25 25 </%def>
26 26
27 27 <%def name="menu_bar_subnav()">
28 28 ${self.repo_menu(active='showpullrequest')}
29 29 </%def>
30 30
31 31 <%def name="main()">
32 32
33 33 <script type="text/javascript">
34 34 // TODO: marcink switch this to pyroutes
35 35 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
36 36 templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
37 37 </script>
38 38 <div class="box">
39 39
40 40 <div class="title">
41 41 ${self.repo_page_title(c.rhodecode_db_repo)}
42 42 </div>
43 43
44 44 ${self.breadcrumbs()}
45 45
46 46 <div class="box pr-summary">
47 47
48 48 <div class="summary-details block-left">
49 49 <% summary = lambda n:{False:'summary-short'}.get(n) %>
50 50 <div class="pr-details-title">
51 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 52 %if c.allowed_to_update:
53 53 <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
54 54 % if c.allowed_to_delete:
55 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 56 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
57 57 class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
58 58 ${h.end_form()}
59 59 % else:
60 60 ${_('Delete')}
61 61 % endif
62 62 </div>
63 63 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
64 64 <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
65 65 %endif
66 66 </div>
67 67
68 68 <div id="summary" class="fields pr-details-content">
69 69 <div class="field">
70 70 <div class="label-summary">
71 71 <label>${_('Source')}:</label>
72 72 </div>
73 73 <div class="input">
74 74 <div class="pr-origininfo">
75 75 ## branch link is only valid if it is a branch
76 76 <span class="tag">
77 77 %if c.pull_request.source_ref_parts.type == 'branch':
78 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 79 %else:
80 80 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
81 81 %endif
82 82 </span>
83 83 <span class="clone-url">
84 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 85 </span>
86 86 <br/>
87 87 % if c.ancestor_commit:
88 88 ${_('Common ancestor')}:
89 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 90 % endif
91 91 </div>
92 92 <div class="pr-pullinfo">
93 93 %if h.is_hg(c.pull_request.source_repo):
94 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 95 %elif h.is_git(c.pull_request.source_repo):
96 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 97 %endif
98 98 </div>
99 99 </div>
100 100 </div>
101 101 <div class="field">
102 102 <div class="label-summary">
103 103 <label>${_('Target')}:</label>
104 104 </div>
105 105 <div class="input">
106 106 <div class="pr-targetinfo">
107 107 ## branch link is only valid if it is a branch
108 108 <span class="tag">
109 109 %if c.pull_request.target_ref_parts.type == 'branch':
110 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 111 %else:
112 112 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
113 113 %endif
114 114 </span>
115 115 <span class="clone-url">
116 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 117 </span>
118 118 </div>
119 119 </div>
120 120 </div>
121 121
122 122 ## Link to the shadow repository.
123 123 <div class="field">
124 124 <div class="label-summary">
125 125 <label>${_('Merge')}:</label>
126 126 </div>
127 127 <div class="input">
128 128 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
129 129 <div class="pr-mergeinfo">
130 130 %if h.is_hg(c.pull_request.target_repo):
131 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 132 %elif h.is_git(c.pull_request.target_repo):
133 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 134 %endif
135 135 </div>
136 136 % else:
137 137 <div class="">
138 138 ${_('Shadow repository data not available')}.
139 139 </div>
140 140 % endif
141 141 </div>
142 142 </div>
143 143
144 144 <div class="field">
145 145 <div class="label-summary">
146 146 <label>${_('Review')}:</label>
147 147 </div>
148 148 <div class="input">
149 149 %if c.pull_request_review_status:
150 150 <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div>
151 151 <span class="changeset-status-lbl tooltip">
152 152 %if c.pull_request.is_closed():
153 153 ${_('Closed')},
154 154 %endif
155 155 ${h.commit_status_lbl(c.pull_request_review_status)}
156 156 </span>
157 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 158 %endif
159 159 </div>
160 160 </div>
161 161 <div class="field">
162 162 <div class="pr-description-label label-summary">
163 163 <label>${_('Description')}:</label>
164 164 </div>
165 165 <div id="pr-desc" class="input">
166 166 <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div>
167 167 </div>
168 168 <div id="pr-desc-edit" class="input textarea editor" style="display: none;">
169 169 <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea>
170 170 </div>
171 171 </div>
172 172
173 173 <div class="field">
174 174 <div class="label-summary">
175 175 <label>${_('Versions')}:</label>
176 176 </div>
177 177
178 178 <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
179 179 <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
180 180
181 181 <div class="pr-versions">
182 182 % if c.show_version_changes:
183 183 <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
184 184 <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %>
185 185 <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions"
186 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 187 data-toggle-off="${_('Hide all versions of this pull request')}">
188 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 189 </a>
190 190 <table>
191 191 ## SHOW ALL VERSIONS OF PR
192 192 <% ver_pr = None %>
193 193
194 194 % for data in reversed(list(enumerate(c.versions, 1))):
195 195 <% ver_pos = data[0] %>
196 196 <% ver = data[1] %>
197 197 <% ver_pr = ver.pull_request_version_id %>
198 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 200 <tr class="version-pr" style="display: ${display_row}">
201 201 <td>
202 202 <code>
203 203 <a href="${h.url.current(version=ver_pr or 'latest')}">v${ver_pos}</a>
204 204 </code>
205 205 </td>
206 206 <td>
207 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 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 209 </td>
210 210 <td>
211 211 <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
212 212 <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}">
213 213 </div>
214 214 </td>
215 215 <td>
216 216 % if c.at_version_num != ver_pr:
217 217 <i class="icon-comment"></i>
218 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 219 G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])}
220 220 </code>
221 221 % endif
222 222 </td>
223 223 <td>
224 224 ##<code>${ver.source_ref_parts.commit_id[:6]}</code>
225 225 </td>
226 226 <td>
227 227 ${h.age_component(ver.updated_on, time_is_local=True)}
228 228 </td>
229 229 </tr>
230 230 % endfor
231 231
232 232 <tr>
233 233 <td colspan="6">
234 234 <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
235 235 data-label-text-locked="${_('select versions to show changes')}"
236 236 data-label-text-diff="${_('show changes between versions')}"
237 237 data-label-text-show="${_('show pull request for this version')}"
238 238 >
239 239 ${_('select versions to show changes')}
240 240 </button>
241 241 </td>
242 242 </tr>
243 243
244 244 ## show comment/inline comments summary
245 245 <%def name="comments_summary()">
246 246 <tr>
247 247 <td colspan="6" class="comments-summary-td">
248 248
249 249 % if c.at_version:
250 250 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %>
251 251 <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %>
252 252 ${_('Comments at this version')}:
253 253 % else:
254 254 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %>
255 255 <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %>
256 256 ${_('Comments for this pull request')}:
257 257 % endif
258 258
259 259
260 260 %if general_comm_count_ver:
261 261 <a href="#comments">${_("%d General ") % general_comm_count_ver}</a>
262 262 %else:
263 263 ${_("%d General ") % general_comm_count_ver}
264 264 %endif
265 265
266 266 %if inline_comm_count_ver:
267 267 , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a>
268 268 %else:
269 269 , ${_("%d Inline") % inline_comm_count_ver}
270 270 %endif
271 271
272 272 %if outdated_comm_count_ver:
273 273 , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a>
274 274 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a>
275 275 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a>
276 276 %else:
277 277 , ${_("%d Outdated") % outdated_comm_count_ver}
278 278 %endif
279 279 </td>
280 280 </tr>
281 281 </%def>
282 282 ${comments_summary()}
283 283 </table>
284 284 % else:
285 285 <div class="input">
286 286 ${_('Pull request versions not available')}.
287 287 </div>
288 288 <div>
289 289 <table>
290 290 ${comments_summary()}
291 291 </table>
292 292 </div>
293 293 % endif
294 294 </div>
295 295 </div>
296 296
297 297 <div id="pr-save" class="field" style="display: none;">
298 298 <div class="label-summary"></div>
299 299 <div class="input">
300 300 <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span>
301 301 </div>
302 302 </div>
303 303 </div>
304 304 </div>
305 305 <div>
306 306 ## AUTHOR
307 307 <div class="reviewers-title block-right">
308 308 <div class="pr-details-title">
309 309 ${_('Author of this pull request')}
310 310 </div>
311 311 </div>
312 312 <div class="block-right pr-details-content reviewers">
313 313 <ul class="group_members">
314 314 <li>
315 315 ${self.gravatar_with_user(c.pull_request.author.email, 16)}
316 316 </li>
317 317 </ul>
318 318 </div>
319 319
320 320 ## REVIEW RULES
321 321 <div id="review_rules" style="display: none" class="reviewers-title block-right">
322 322 <div class="pr-details-title">
323 323 ${_('Reviewer rules')}
324 324 %if c.allowed_to_update:
325 325 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
326 326 %endif
327 327 </div>
328 328 <div class="pr-reviewer-rules">
329 329 ## review rules will be appended here, by default reviewers logic
330 330 </div>
331 331 <input id="review_data" type="hidden" name="review_data" value="">
332 332 </div>
333 333
334 334 ## REVIEWERS
335 335 <div class="reviewers-title block-right">
336 336 <div class="pr-details-title">
337 337 ${_('Pull request reviewers')}
338 338 %if c.allowed_to_update:
339 339 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
340 340 %endif
341 341 </div>
342 342 </div>
343 343 <div id="reviewers" class="block-right pr-details-content reviewers">
344 344 ## members goes here !
345 345 <input type="hidden" name="__start__" value="review_members:sequence">
346 346 <ul id="review_members" class="group_members">
347 347 %for member,reasons,mandatory,status in c.pull_request_reviewers:
348 348 <li id="reviewer_${member.user_id}" class="reviewer_entry">
349 349 <div class="reviewers_member">
350 350 <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
351 351 <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div>
352 352 </div>
353 353 <div id="reviewer_${member.user_id}_name" class="reviewer_name">
354 354 ${self.gravatar_with_user(member.email, 16)}
355 355 </div>
356 356 <input type="hidden" name="__start__" value="reviewer:mapping">
357 357 <input type="hidden" name="__start__" value="reasons:sequence">
358 358 %for reason in reasons:
359 359 <div class="reviewer_reason">- ${reason}</div>
360 360 <input type="hidden" name="reason" value="${reason}">
361 361
362 362 %endfor
363 363 <input type="hidden" name="__end__" value="reasons:sequence">
364 364 <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" />
365 365 <input type="hidden" name="mandatory" value="${mandatory}"/>
366 366 <input type="hidden" name="__end__" value="reviewer:mapping">
367 367 % if mandatory:
368 368 <div class="reviewer_member_mandatory_remove">
369 369 <i class="icon-remove-sign"></i>
370 370 </div>
371 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 373 </div>
374 374 % else:
375 375 %if c.allowed_to_update:
376 376 <div class="reviewer_member_remove action_button" onclick="reviewersController.removeReviewMember(${member.user_id}, true)" style="visibility: hidden;">
377 377 <i class="icon-remove-sign" ></i>
378 378 </div>
379 379 %endif
380 380 % endif
381 381 </div>
382 382 </li>
383 383 %endfor
384 384 </ul>
385 385 <input type="hidden" name="__end__" value="review_members:sequence">
386 386
387 387 %if not c.pull_request.is_closed():
388 388 <div id="add_reviewer" class="ac" style="display: none;">
389 389 %if c.allowed_to_update:
390 390 % if not c.forbid_adding_reviewers:
391 391 <div id="add_reviewer_input" class="reviewer_ac">
392 392 ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))}
393 393 <div id="reviewers_container"></div>
394 394 </div>
395 395 % endif
396 396 <div class="pull-right">
397 397 <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button>
398 398 </div>
399 399 %endif
400 400 </div>
401 401 %endif
402 402 </div>
403 403 </div>
404 404 </div>
405 405 <div class="box">
406 406 ##DIFF
407 407 <div class="table" >
408 408 <div id="changeset_compare_view_content">
409 409 ##CS
410 410 % if c.missing_requirements:
411 411 <div class="box">
412 412 <div class="alert alert-warning">
413 413 <div>
414 414 <strong>${_('Missing requirements:')}</strong>
415 415 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
416 416 </div>
417 417 </div>
418 418 </div>
419 419 % elif c.missing_commits:
420 420 <div class="box">
421 421 <div class="alert alert-warning">
422 422 <div>
423 423 <strong>${_('Missing commits')}:</strong>
424 424 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
425 425 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
426 426 </div>
427 427 </div>
428 428 </div>
429 429 % endif
430 430
431 431 <div class="compare_view_commits_title">
432 432 % if not c.compare_mode:
433 433
434 434 % if c.at_version_pos:
435 435 <h4>
436 436 ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos}
437 437 </h4>
438 438 % endif
439 439
440 440 <div class="pull-left">
441 441 <div class="btn-group">
442 442 <a
443 443 class="btn"
444 444 href="#"
445 445 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
446 446 ${ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
447 447 </a>
448 448 <a
449 449 class="btn"
450 450 href="#"
451 451 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
452 452 ${ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
453 453 </a>
454 454 </div>
455 455 </div>
456 456
457 457 <div class="pull-right">
458 458 % if c.allowed_to_update and not c.pull_request.is_closed():
459 459 <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a>
460 460 % else:
461 461 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
462 462 % endif
463 463
464 464 </div>
465 465 % endif
466 466 </div>
467 467
468 468 % if not c.missing_commits:
469 469 % if c.compare_mode:
470 470 % if c.at_version:
471 471 <h4>
472 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 473 </h4>
474 474
475 475 <div class="subtitle-compare">
476 476 ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))}
477 477 </div>
478 478
479 479 <div class="container">
480 480 <table class="rctable compare_view_commits">
481 481 <tr>
482 482 <th></th>
483 483 <th>${_('Time')}</th>
484 484 <th>${_('Author')}</th>
485 485 <th>${_('Commit')}</th>
486 486 <th></th>
487 487 <th>${_('Description')}</th>
488 488 </tr>
489 489
490 490 % for c_type, commit in c.commit_changes:
491 491 % if c_type in ['a', 'r']:
492 492 <%
493 493 if c_type == 'a':
494 494 cc_title = _('Commit added in displayed changes')
495 495 elif c_type == 'r':
496 496 cc_title = _('Commit removed in displayed changes')
497 497 else:
498 498 cc_title = ''
499 499 %>
500 500 <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select">
501 501 <td>
502 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 504 ${c_type.upper()}
505 505 </div>
506 506 </div>
507 507 </td>
508 508 <td class="td-time">
509 509 ${h.age_component(commit.date)}
510 510 </td>
511 511 <td class="td-user">
512 512 ${base.gravatar_with_user(commit.author, 16)}
513 513 </td>
514 514 <td class="td-hash">
515 515 <code>
516 516 <a href="${h.url('changeset_home', repo_name=c.target_repo.repo_name, revision=commit.raw_id)}">
517 517 r${commit.revision}:${h.short_id(commit.raw_id)}
518 518 </a>
519 519 ${h.hidden('revisions', commit.raw_id)}
520 520 </code>
521 521 </td>
522 522 <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}">
523 523 <div class="show_more_col">
524 524 <i class="show_more"></i>
525 525 </div>
526 526 </td>
527 527 <td class="mid td-description">
528 528 <div class="log-container truncate-wrap">
529 529 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">
530 530 ${h.urlify_commit_message(commit.message, c.repo_name)}
531 531 </div>
532 532 </div>
533 533 </td>
534 534 </tr>
535 535 % endif
536 536 % endfor
537 537 </table>
538 538 </div>
539 539
540 540 <script>
541 541 $('.expand_commit').on('click',function(e){
542 542 var target_expand = $(this);
543 543 var cid = target_expand.data('commitId');
544 544
545 545 if (target_expand.hasClass('open')){
546 546 $('#c-'+cid).css({
547 547 'height': '1.5em',
548 548 'white-space': 'nowrap',
549 549 'text-overflow': 'ellipsis',
550 550 'overflow':'hidden'
551 551 });
552 552 target_expand.removeClass('open');
553 553 }
554 554 else {
555 555 $('#c-'+cid).css({
556 556 'height': 'auto',
557 557 'white-space': 'pre-line',
558 558 'text-overflow': 'initial',
559 559 'overflow':'visible'
560 560 });
561 561 target_expand.addClass('open');
562 562 }
563 563 });
564 564 </script>
565 565
566 566 % endif
567 567
568 568 % else:
569 569 <%include file="/compare/compare_commits.mako" />
570 570 % endif
571 571
572 572 <div class="cs_files">
573 573 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
574 574 ${cbdiffs.render_diffset_menu()}
575 575 ${cbdiffs.render_diffset(
576 576 c.diffset, use_comments=True,
577 577 collapse_when_files_over=30,
578 578 disable_new_comments=not c.allowed_to_comment,
579 579 deleted_files_comments=c.deleted_files_comments)}
580 580 </div>
581 581 % else:
582 582 ## skipping commits we need to clear the view for missing commits
583 583 <div style="clear:both;"></div>
584 584 % endif
585 585
586 586 </div>
587 587 </div>
588 588
589 589 ## template for inline comment form
590 590 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
591 591
592 592 ## render general comments
593 593
594 594 <div id="comment-tr-show">
595 595 <div class="comment">
596 596 % if general_outdated_comm_count_ver:
597 597 <div class="meta">
598 598 % if general_outdated_comm_count_ver == 1:
599 599 ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)},
600 600 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a>
601 601 % else:
602 602 ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)},
603 603 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a>
604 604 % endif
605 605 </div>
606 606 % endif
607 607 </div>
608 608 </div>
609 609
610 610 ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)}
611 611
612 612 % if not c.pull_request.is_closed():
613 613 ## merge status, and merge action
614 614 <div class="pull-request-merge">
615 615 <%include file="/pullrequests/pullrequest_merge_checks.mako"/>
616 616 </div>
617 617
618 618 ## main comment form and it status
619 619 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
620 620 pull_request_id=c.pull_request.pull_request_id),
621 621 c.pull_request_review_status,
622 622 is_pull_request=True, change_status=c.allowed_to_change_status)}
623 623 %endif
624 624
625 625 <script type="text/javascript">
626 626 if (location.hash) {
627 627 var result = splitDelimitedHash(location.hash);
628 628 var line = $('html').find(result.loc);
629 629 // show hidden comments if we use location.hash
630 630 if (line.hasClass('comment-general')) {
631 631 $(line).show();
632 632 } else if (line.hasClass('comment-inline')) {
633 633 $(line).show();
634 634 var $cb = $(line).closest('.cb');
635 635 $cb.removeClass('cb-collapsed')
636 636 }
637 637 if (line.length > 0){
638 638 offsetScroll(line, 70);
639 639 }
640 640 }
641 641
642 642 versionController = new VersionController();
643 643 versionController.init();
644 644
645 645 reviewersController = new ReviewersController();
646 646
647 647 $(function(){
648 648
649 649 // custom code mirror
650 650 var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input');
651 651
652 652 var PRDetails = {
653 653 editButton: $('#open_edit_pullrequest'),
654 654 closeButton: $('#close_edit_pullrequest'),
655 655 deleteButton: $('#delete_pullrequest'),
656 656 viewFields: $('#pr-desc, #pr-title'),
657 657 editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'),
658 658
659 659 init: function() {
660 660 var that = this;
661 661 this.editButton.on('click', function(e) { that.edit(); });
662 662 this.closeButton.on('click', function(e) { that.view(); });
663 663 },
664 664
665 665 edit: function(event) {
666 666 this.viewFields.hide();
667 667 this.editButton.hide();
668 668 this.deleteButton.hide();
669 669 this.closeButton.show();
670 670 this.editFields.show();
671 671 codeMirrorInstance.refresh();
672 672 },
673 673
674 674 view: function(event) {
675 675 this.editButton.show();
676 676 this.deleteButton.show();
677 677 this.editFields.hide();
678 678 this.closeButton.hide();
679 679 this.viewFields.show();
680 680 }
681 681 };
682 682
683 683 var ReviewersPanel = {
684 684 editButton: $('#open_edit_reviewers'),
685 685 closeButton: $('#close_edit_reviewers'),
686 686 addButton: $('#add_reviewer'),
687 687 removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove,.reviewer_member_mandatory'),
688 688
689 689 init: function() {
690 690 var self = this;
691 691 this.editButton.on('click', function(e) { self.edit(); });
692 692 this.closeButton.on('click', function(e) { self.close(); });
693 693 },
694 694
695 695 edit: function(event) {
696 696 this.editButton.hide();
697 697 this.closeButton.show();
698 698 this.addButton.show();
699 699 this.removeButtons.css('visibility', 'visible');
700 700 // review rules
701 701 reviewersController.loadReviewRules(
702 702 ${c.pull_request.reviewer_data_json | n});
703 703 },
704 704
705 705 close: function(event) {
706 706 this.editButton.show();
707 707 this.closeButton.hide();
708 708 this.addButton.hide();
709 709 this.removeButtons.css('visibility', 'hidden');
710 710 // hide review rules
711 711 reviewersController.hideReviewRules()
712 712 }
713 713 };
714 714
715 715 PRDetails.init();
716 716 ReviewersPanel.init();
717 717
718 718 showOutdated = function(self){
719 719 $('.comment-inline.comment-outdated').show();
720 720 $('.filediff-outdated').show();
721 721 $('.showOutdatedComments').hide();
722 722 $('.hideOutdatedComments').show();
723 723 };
724 724
725 725 hideOutdated = function(self){
726 726 $('.comment-inline.comment-outdated').hide();
727 727 $('.filediff-outdated').hide();
728 728 $('.hideOutdatedComments').hide();
729 729 $('.showOutdatedComments').show();
730 730 };
731 731
732 732 refreshMergeChecks = function(){
733 733 var loadUrl = "${h.url.current(merge_checks=1)}";
734 734 $('.pull-request-merge').css('opacity', 0.3);
735 735 $('.action-buttons-extra').css('opacity', 0.3);
736 736
737 737 $('.pull-request-merge').load(
738 738 loadUrl, function() {
739 739 $('.pull-request-merge').css('opacity', 1);
740 740
741 741 $('.action-buttons-extra').css('opacity', 1);
742 742 injectCloseAction();
743 743 }
744 744 );
745 745 };
746 746
747 747 injectCloseAction = function() {
748 748 var closeAction = $('#close-pull-request-action').html();
749 749 var $actionButtons = $('.action-buttons-extra');
750 750 // clear the action before
751 751 $actionButtons.html("");
752 752 $actionButtons.html(closeAction);
753 753 };
754 754
755 755 closePullRequest = function (status) {
756 756 // inject closing flag
757 757 $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
758 758 $(generalCommentForm.statusChange).select2("val", status).trigger('change');
759 759 $(generalCommentForm.submitForm).submit();
760 760 };
761 761
762 762 $('#show-outdated-comments').on('click', function(e){
763 763 var button = $(this);
764 764 var outdated = $('.comment-outdated');
765 765
766 766 if (button.html() === "(Show)") {
767 767 button.html("(Hide)");
768 768 outdated.show();
769 769 } else {
770 770 button.html("(Show)");
771 771 outdated.hide();
772 772 }
773 773 });
774 774
775 775 $('.show-inline-comments').on('change', function(e){
776 776 var show = 'none';
777 777 var target = e.currentTarget;
778 778 if(target.checked){
779 779 show = ''
780 780 }
781 781 var boxid = $(target).attr('id_for');
782 782 var comments = $('#{0} .inline-comments'.format(boxid));
783 783 var fn_display = function(idx){
784 784 $(this).css('display', show);
785 785 };
786 786 $(comments).each(fn_display);
787 787 var btns = $('#{0} .inline-comments-button'.format(boxid));
788 788 $(btns).each(fn_display);
789 789 });
790 790
791 791 $('#merge_pull_request_form').submit(function() {
792 792 if (!$('#merge_pull_request').attr('disabled')) {
793 793 $('#merge_pull_request').attr('disabled', 'disabled');
794 794 }
795 795 return true;
796 796 });
797 797
798 798 $('#edit_pull_request').on('click', function(e){
799 799 var title = $('#pr-title-input').val();
800 800 var description = codeMirrorInstance.getValue();
801 801 editPullRequest(
802 802 "${c.repo_name}", "${c.pull_request.pull_request_id}",
803 803 title, description);
804 804 });
805 805
806 806 $('#update_pull_request').on('click', function(e){
807 807 $(this).attr('disabled', 'disabled');
808 808 $(this).addClass('disabled');
809 809 $(this).html(_gettext('Saving...'));
810 810 reviewersController.updateReviewers(
811 811 "${c.repo_name}", "${c.pull_request.pull_request_id}");
812 812 });
813 813
814 814 $('#update_commits').on('click', function(e){
815 815 var isDisabled = !$(e.currentTarget).attr('disabled');
816 816 $(e.currentTarget).attr('disabled', 'disabled');
817 817 $(e.currentTarget).addClass('disabled');
818 818 $(e.currentTarget).removeClass('btn-primary');
819 819 $(e.currentTarget).text(_gettext('Updating...'));
820 820 if(isDisabled){
821 821 updateCommits(
822 822 "${c.repo_name}", "${c.pull_request.pull_request_id}");
823 823 }
824 824 });
825 825 // fixing issue with caches on firefox
826 826 $('#update_commits').removeAttr("disabled");
827 827
828 828 $('.show-inline-comments').on('click', function(e){
829 829 var boxid = $(this).attr('data-comment-id');
830 830 var button = $(this);
831 831
832 832 if(button.hasClass("comments-visible")) {
833 833 $('#{0} .inline-comments'.format(boxid)).each(function(index){
834 834 $(this).hide();
835 835 });
836 836 button.removeClass("comments-visible");
837 837 } else {
838 838 $('#{0} .inline-comments'.format(boxid)).each(function(index){
839 839 $(this).show();
840 840 });
841 841 button.addClass("comments-visible");
842 842 }
843 843 });
844 844
845 845 // register submit callback on commentForm form to track TODOs
846 846 window.commentFormGlobalSubmitSuccessCallback = function(){
847 847 refreshMergeChecks();
848 848 };
849 849 // initial injection
850 850 injectCloseAction();
851 851
852 852 ReviewerAutoComplete('#user');
853 853
854 854 })
855 855 </script>
856 856
857 857 </div>
858 858 </div>
859 859
860 860 </%def>
@@ -1,29 +1,29 b''
1 1 <%inherit file="/base/base.mako"/>
2 2
3 3 <%def name="title()">
4 4 ## represents page title
5 5 ${_('%s Summary') % c.repo_name}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11
12 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" />
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" />
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="${h.tooltip(_('%s RSS feed') % c.repo_name)}" type="application/rss+xml" />
15 15 </%def>
16 16
17 17
18 18 <%def name="menu_bar_nav()">
19 19 ${self.menu_items(active='repositories')}
20 20 </%def>
21 21
22 22
23 23 <%def name="breadcrumbs_links()">
24 24 </%def>
25 25
26 26
27 27 <%def name="main()">
28 28 ${next.main()}
29 29 </%def>
@@ -1,128 +1,128 b''
1 1 <%inherit file="/summary/base.mako"/>
2 2
3 3 <%namespace name="components" file="/summary/components.mako"/>
4 4
5 5
6 6 <%def name="menu_bar_subnav()">
7 7 ${self.repo_menu(active='summary')}
8 8 </%def>
9 9
10 10 <%def name="main()">
11 11
12 12 <div class="title">
13 13 ${self.repo_page_title(c.rhodecode_db_repo)}
14 14 <ul class="links icon-only-links block-right">
15 15 <li>
16 16 %if c.rhodecode_user.username != h.DEFAULT_USER:
17 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 18 %else:
19 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 20 %endif
21 21 </li>
22 22 </ul>
23 23 </div>
24 24
25 25 <div id="repo-summary" class="summary">
26 26 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)}
27 27 ${components.summary_stats(gravatar_function=self.gravatar_with_user)}
28 28 </div><!--end repo-summary-->
29 29
30 30
31 31 <div class="box" >
32 32 %if not c.repo_commits:
33 33 <div class="title">
34 34 <h3>${_('Quick start')}</h3>
35 35 </div>
36 36 %endif
37 37 <div class="table">
38 38 <div id="shortlog_data">
39 39 <%include file='summary_commits.mako'/>
40 40 </div>
41 41 </div>
42 42 </div>
43 43
44 44 %if c.readme_data:
45 45 <div id="readme" class="anchor">
46 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 48 <h3 class="breadcrumbs">
49 49 <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a>
50 50 </h3>
51 51 </div>
52 52 <div class="readme codeblock">
53 53 <div class="readme_box">
54 54 ${c.readme_data|n}
55 55 </div>
56 56 </div>
57 57 </div>
58 58 </div>
59 59 %endif
60 60
61 61 <script type="text/javascript">
62 62 $(document).ready(function(){
63 63 $('#clone_by_name').on('click',function(e){
64 64 // show url by name and hide name button
65 65 $('#clone_url').show();
66 66 $('#clone_by_name').hide();
67 67
68 68 // hide url by id and show name button
69 69 $('#clone_by_id').show();
70 70 $('#clone_url_id').hide();
71 71
72 72 });
73 73 $('#clone_by_id').on('click',function(e){
74 74
75 75 // show url by id and hide id button
76 76 $('#clone_by_id').hide();
77 77 $('#clone_url_id').show();
78 78
79 79 // hide url by name and show id button
80 80 $('#clone_by_name').show();
81 81 $('#clone_url').hide();
82 82 });
83 83
84 84 var initialCommitData = {
85 85 id: null,
86 86 text: 'tip',
87 87 type: 'tag',
88 88 raw_id: null,
89 89 files_url: null
90 90 };
91 91
92 92 select2RefSwitcher('#download_options', initialCommitData);
93 93
94 94 // on change of download options
95 95 $('#download_options').on('change', function(e) {
96 96 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
97 97 var selected_cs = e.added;
98 98 var fname= e.added.raw_id + ".zip";
99 99 var href = pyroutes.url('files_archive_home', {'repo_name': templateContext.repo_name, 'fname':fname});
100 100 // set new label
101 101 $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip");
102 102
103 103 // set new url to button,
104 104 $('#archive_link').attr('href', href)
105 105 });
106 106
107 107
108 108 // load details on summary page expand
109 109 $('#summary_details_expand').on('click', function() {
110 110
111 111 var callback = function (data) {
112 112 % if c.show_stats:
113 113 showRepoStats('lang_stats', data);
114 114 % endif
115 115 };
116 116
117 117 showRepoSize(
118 118 'repo_size_container',
119 119 templateContext.repo_name,
120 120 templateContext.repo_landing_commit,
121 121 callback);
122 122
123 123 })
124 124
125 125 })
126 126 </script>
127 127
128 128 </%def>
@@ -1,136 +1,136 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3 %if c.repo_commits:
4 4 <table class="rctable repo_summary table_disp">
5 5 <tr>
6 6
7 7 <th class="status" colspan="2"></th>
8 8 <th>${_('Commit')}</th>
9 9 <th>${_('Commit message')}</th>
10 10 <th>${_('Age')}</th>
11 11 <th>${_('Author')}</th>
12 12 <th>${_('Refs')}</th>
13 13 </tr>
14 14 %for cnt,cs in enumerate(c.repo_commits):
15 15 <tr class="parity${cnt%2}">
16 16
17 17 <td class="td-status">
18 18 %if c.statuses.get(cs.raw_id):
19 19 <div class="changeset-status-ico shortlog">
20 20 %if c.statuses.get(cs.raw_id)[2]:
21 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 22 <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div>
23 23 </a>
24 24 %else:
25 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 26 <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div>
27 27 </a>
28 28 %endif
29 29 </div>
30 30 %else:
31 31 <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div>
32 32 %endif
33 33 </td>
34 34 <td class="td-comments">
35 35 %if c.comments.get(cs.raw_id,[]):
36 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 37 <i class="icon-comment"></i> ${len(c.comments[cs.raw_id])}
38 38 </a>
39 39 %endif
40 40 </td>
41 41 <td class="td-commit">
42 42 <pre><a href="${h.url('changeset_home', repo_name=c.repo_name, revision=cs.raw_id)}">${h.show_id(cs)}</a></pre>
43 43 </td>
44 44
45 45 <td class="td-description mid">
46 46 <div class="log-container truncate-wrap">
47 47 <div class="message truncate" id="c-${cs.raw_id}">${h.urlify_commit_message(cs.message, c.repo_name)}</div>
48 48 </div>
49 49 </td>
50 50
51 51 <td class="td-time">
52 52 ${h.age_component(cs.date)}
53 53 </td>
54 54 <td class="td-user author">
55 55 ${base.gravatar_with_user(cs.author)}
56 56 </td>
57 57
58 58 <td class="td-tags">
59 59 <div class="autoexpand">
60 60 %if h.is_hg(c.rhodecode_repo):
61 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 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 64 </span>
65 65 %endfor
66 66 %endif
67 67 ## tags
68 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 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 71 </span>
72 72 %endfor
73 73
74 74 ## branch
75 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 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 78 </span>
79 79 %endif
80 80 </div>
81 81 </td>
82 82 </tr>
83 83 %endfor
84 84
85 85 </table>
86 86
87 87 <script type="text/javascript">
88 88 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 2000, scrollTo: false });
89 89 $(document).on('pjax:success', function(){ timeagoActivate(); });
90 90 </script>
91 91
92 92 <div class="pagination-wh pagination-left">
93 93 ${c.repo_commits.pager('$link_previous ~2~ $link_next')}
94 94 </div>
95 95 %else:
96 96
97 97 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
98 98 <div class="quick_start">
99 99 <div class="fieldset">
100 100 <div class="left-label">${_('Add or upload files directly via RhodeCode:')}</div>
101 101 <div class="right-content">
102 102 <div id="add_node_id" class="add_node">
103 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 104 </div>
105 105 </div>
106 106 %endif
107 107 </div>
108 108
109 109 %if not h.is_svn(c.rhodecode_repo):
110 110 <div class="fieldset">
111 111 <div class="left-label">${_('Push new repo:')}</div>
112 112 <div class="right-content">
113 113 <pre>
114 114 ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
115 115 ${c.rhodecode_repo.alias} add README # add first file
116 116 ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
117 117 ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
118 118 </pre>
119 119 </div>
120 120 </div>
121 121 <div class="fieldset">
122 122 <div class="left-label">${_('Existing repository?')}</div>
123 123 <div class="right-content">
124 124 <pre>
125 125 %if h.is_git(c.rhodecode_repo):
126 126 git remote add origin ${c.clone_repo_url}
127 127 git push -u origin master
128 128 %else:
129 129 hg push ${c.clone_repo_url}
130 130 %endif
131 131 </pre>
132 132 </div>
133 133 </div>
134 134 %endif
135 135 </div>
136 136 %endif
@@ -1,29 +1,29 b''
1 1 ## DATA TABLE RE USABLE ELEMENTS FOR TAGS
2 2 ## usage:
3 3 ## <%namespace name="tags" file="/tags/tags_data.mako"/>
4 4 ## tags.<func_name>(arg,arg2)
5 5
6 6 <%def name="compare(commit_id)">
7 7 <input class="compare-radio-button" type="radio" name="compare_source" value="${commit_id}"/>
8 8 <input class="compare-radio-button" type="radio" name="compare_target" value="${commit_id}"/>
9 9 </%def>
10 10
11 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 13 <a href="${files_url}"><i class="icon-tag"></i>${name}</a>
14 14 </span>
15 15 </%def>
16 16
17 17 <%def name="date(date)">
18 18 ${h.age_component(date)}
19 19 </%def>
20 20
21 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 23 </%def>
24 24
25 25 <%def name="commit(message, commit_id, commit_idx)">
26 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 28 </div>
29 29 </%def>
General Comments 0
You need to be logged in to leave comments. Login now