##// END OF EJS Templates
ui: fixed tooltips for headers in files/commits.
marcink -
r4085:9acdcb39 default
parent child Browse files
Show More
@@ -1,302 +1,302 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4 <%namespace name="base" file="/base/base.mako"/>
5 5 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
6 6 <%namespace name="file_base" file="/files/base.mako"/>
7 7
8 8 <%def name="title()">
9 9 ${_('{} Commit').format(c.repo_name)} - ${h.show_id(c.commit)}
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="menu_bar_nav()">
16 16 ${self.menu_items(active='repositories')}
17 17 </%def>
18 18
19 19 <%def name="menu_bar_subnav()">
20 20 ${self.repo_menu(active='commits')}
21 21 </%def>
22 22
23 23 <%def name="main()">
24 24 <script type="text/javascript">
25 25 // TODO: marcink switch this to pyroutes
26 26 AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}";
27 27 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
28 28 </script>
29 29
30 30 <div class="box">
31 31
32 32 <div class="summary">
33 33
34 34 <div class="fieldset">
35 35 <div class="left-content">
36 36 <%
37 37 rc_user = h.discover_user(c.commit.author_email)
38 38 %>
39 39 <div class="left-content-avatar">
40 ${base.gravatar(c.commit.author_email, 30, tooltip=True, user=rc_user)}
40 ${base.gravatar(c.commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)}
41 41 </div>
42 42
43 43 <div class="left-content-message">
44 44 <div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
45 45 <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div>
46 46 </div>
47 47
48 48 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none">
49 49 <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
50 50 </div>
51 51
52 52 <div class="fieldset" data-toggle="summary-details">
53 53 <div class="">
54 54 <table>
55 55 <tr class="file_author">
56 56
57 57 <td>
58 58 <span class="user commit-author">${h.link_to_user(rc_user or c.commit.author)}</span>
59 59 <span class="commit-date">- ${h.age_component(c.commit.date)}</span>
60 60 </td>
61 61
62 62 <td>
63 63 ## second cell for consistency with files
64 64 </td>
65 65 </tr>
66 66 </table>
67 67 </div>
68 68 </div>
69 69
70 70 </div>
71 71 </div>
72 72
73 73 <div class="right-content">
74 74
75 75 <div data-toggle="summary-details">
76 76 <div class="tags tags-main">
77 77 <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a></code>
78 78 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
79 79 ${file_base.refs(c.commit)}
80 80
81 81 ## phase
82 82 % if hasattr(c.commit, 'phase') and getattr(c.commit, 'phase') != 'public':
83 83 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">
84 84 <i class="icon-info"></i>${c.commit.phase}
85 85 </span>
86 86 % endif
87 87
88 88 ## obsolete commits
89 89 % if getattr(c.commit, 'obsolete', False):
90 90 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">
91 91 ${_('obsolete')}
92 92 </span>
93 93 % endif
94 94
95 95 ## hidden commits
96 96 % if getattr(c.commit, 'hidden', False):
97 97 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">
98 98 ${_('hidden')}
99 99 </span>
100 100 % endif
101 101 </div>
102 102
103 103 %if c.statuses:
104 104 <div class="tag status-tag-${c.statuses[0]} pull-right">
105 105 <i class="icon-circle review-status-${c.statuses[0]}"></i>
106 106 <div class="pull-right">${h.commit_status_lbl(c.statuses[0])}</div>
107 107 </div>
108 108 %endif
109 109
110 110 </div>
111 111
112 112 </div>
113 113 </div>
114 114
115 115 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
116 116 <div class="left-label-summary">
117 117 <p>${_('Commit navigation')}:</p>
118 118 <div class="right-label-summary">
119 119 <span id="parent_link" class="tag tagtag">
120 120 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
121 121 </span>
122 122
123 123 <span id="child_link" class="tag tagtag">
124 124 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
125 125 </span>
126 126 </div>
127 127 </div>
128 128 </div>
129 129
130 130 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
131 131 <div class="left-label-summary">
132 132 <p>${_('Diff options')}:</p>
133 133 <div class="right-label-summary">
134 134 <div class="diff-actions">
135 135 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">
136 136 ${_('Raw Diff')}
137 137 </a>
138 138 |
139 139 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">
140 140 ${_('Patch Diff')}
141 141 </a>
142 142 |
143 143 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}">
144 144 ${_('Download Diff')}
145 145 </a>
146 146 </div>
147 147 </div>
148 148 </div>
149 149 </div>
150 150
151 151 <div class="clear-fix"></div>
152 152
153 153 <div class="btn-collapse" data-toggle="summary-details">
154 154 ${_('Show More')}
155 155 </div>
156 156
157 157 </div>
158 158
159 159 <div class="cs_files">
160 160 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
161 161 ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])}
162 162 ${cbdiffs.render_diffset(
163 163 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )}
164 164 </div>
165 165
166 166 ## template for inline comment form
167 167 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
168 168
169 169 ## comments heading with count
170 170 <div class="comments-heading">
171 171 <i class="icon-comment"></i>
172 172 ${_('Comments')} ${len(c.comments)}
173 173 </div>
174 174
175 175 ## render comments
176 176 ${comment.generate_comments(c.comments)}
177 177
178 178 ## main comment form and it status
179 179 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
180 180 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
181 181 </div>
182 182
183 183 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
184 184 <script type="text/javascript">
185 185
186 186 $(document).ready(function() {
187 187
188 188 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
189 189 if($('#trimmed_message_box').height() === boxmax){
190 190 $('#message_expand').show();
191 191 }
192 192
193 193 $('#message_expand').on('click', function(e){
194 194 $('#trimmed_message_box').css('max-height', 'none');
195 195 $(this).hide();
196 196 });
197 197
198 198 $('.show-inline-comments').on('click', function(e){
199 199 var boxid = $(this).attr('data-comment-id');
200 200 var button = $(this);
201 201
202 202 if(button.hasClass("comments-visible")) {
203 203 $('#{0} .inline-comments'.format(boxid)).each(function(index){
204 204 $(this).hide();
205 205 });
206 206 button.removeClass("comments-visible");
207 207 } else {
208 208 $('#{0} .inline-comments'.format(boxid)).each(function(index){
209 209 $(this).show();
210 210 });
211 211 button.addClass("comments-visible");
212 212 }
213 213 });
214 214
215 215 // next links
216 216 $('#child_link').on('click', function(e){
217 217 // fetch via ajax what is going to be the next link, if we have
218 218 // >1 links show them to user to choose
219 219 if(!$('#child_link').hasClass('disabled')){
220 220 $.ajax({
221 221 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
222 222 success: function(data) {
223 223 if(data.results.length === 0){
224 224 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
225 225 }
226 226 if(data.results.length === 1){
227 227 var commit = data.results[0];
228 228 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
229 229 }
230 230 else if(data.results.length === 2){
231 231 $('#child_link').addClass('disabled');
232 232 $('#child_link').addClass('double');
233 233
234 234 var _html = '';
235 235 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
236 236 .replace('__branch__', data.results[0].branch)
237 237 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
238 238 .replace('__title__', data.results[0].message)
239 239 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
240 240 _html +=' | ';
241 241 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
242 242 .replace('__branch__', data.results[1].branch)
243 243 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
244 244 .replace('__title__', data.results[1].message)
245 245 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
246 246 $('#child_link').html(_html);
247 247 }
248 248 }
249 249 });
250 250 e.preventDefault();
251 251 }
252 252 });
253 253
254 254 // prev links
255 255 $('#parent_link').on('click', function(e){
256 256 // fetch via ajax what is going to be the next link, if we have
257 257 // >1 links show them to user to choose
258 258 if(!$('#parent_link').hasClass('disabled')){
259 259 $.ajax({
260 260 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
261 261 success: function(data) {
262 262 if(data.results.length === 0){
263 263 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
264 264 }
265 265 if(data.results.length === 1){
266 266 var commit = data.results[0];
267 267 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
268 268 }
269 269 else if(data.results.length === 2){
270 270 $('#parent_link').addClass('disabled');
271 271 $('#parent_link').addClass('double');
272 272
273 273 var _html = '';
274 274 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
275 275 .replace('__branch__', data.results[0].branch)
276 276 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
277 277 .replace('__title__', data.results[0].message)
278 278 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
279 279 _html +=' | ';
280 280 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
281 281 .replace('__branch__', data.results[1].branch)
282 282 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
283 283 .replace('__title__', data.results[1].message)
284 284 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
285 285 $('#parent_link').html(_html);
286 286 }
287 287 }
288 288 });
289 289 e.preventDefault();
290 290 }
291 291 });
292 292
293 293 // browse tree @ revision
294 294 $('#files_link').on('click', function(e){
295 295 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
296 296 e.preventDefault();
297 297 });
298 298
299 299 })
300 300 </script>
301 301
302 302 </%def>
@@ -1,63 +1,65 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2 <%namespace name="file_base" file="/files/base.mako"/>
3 3
4 4 <div class="summary">
5 5 <div class="fieldset">
6 6 <div class="left-content">
7
7 <%
8 rc_user = h.discover_user(c.commit.author_email)
9 %>
8 10 <div class="left-content-avatar">
9 ${base.gravatar(c.file_last_commit.author_email, 30)}
11 ${base.gravatar(c.file_last_commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)}
10 12 </div>
11 13
12 14 <div class="left-content-message">
13 15 <div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
14 16 <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div>
15 17 </div>
16 18
17 19 <div class="fieldset collapsable-content" data-toggle="summary-details">
18 20 <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
19 21 </div>
20 22
21 23 <div class="fieldset" data-toggle="summary-details">
22 24 <div class="" id="file_authors">
23 25 ## loads single author, or ALL
24 26 <%include file='file_authors_box.mako'/>
25 27 </div>
26 28 </div>
27 29 </div>
28 30
29 31 <div class="fieldset collapsable-content" data-toggle="summary-details">
30 32 <div class="left-label-summary-files">
31 33 <p>${_('File last commit')}:</p>
32 34 <div class="right-label-summary">
33 35 <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.file_last_commit.raw_id)}">${h.show_id(c.file_last_commit)}</a></code>
34 36 ${file_base.refs(c.file_last_commit)}
35 37 </div>
36 38 </div>
37 39 </div>
38 40 </div>
39 41
40 42 <div class="right-content">
41 43 <div data-toggle="summary-details">
42 44 <div class="tags tags-main">
43 45 <code>
44 46 <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a>
45 47 </code>
46 48 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
47 49 ${file_base.refs(c.commit)}
48 50 </div>
49 51 </div>
50 52 </div>
51 53
52 54 <div class="clear-fix"></div>
53 55
54 56 <div class="btn-collapse" data-toggle="summary-details">
55 57 ${_('Show More')}
56 58 </div>
57 59
58 60 </div>
59 61 </div>
60 62
61 63 <script>
62 64 collapsableContent();
63 65 </script>
@@ -1,47 +1,49 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2 <%namespace name="file_base" file="/files/base.mako"/>
3 3
4 4 <div class="summary">
5 5 <div class="fieldset">
6 6 <div class="left-content">
7
7 <%
8 rc_user = h.discover_user(c.commit.author_email)
9 %>
8 10 <div class="left-content-avatar">
9 ${base.gravatar(c.commit.author_email, 30)}
11 ${base.gravatar(c.commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)}
10 12 </div>
11 13
12 14 <div class="left-content-message">
13 15 <div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
14 16 <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div>
15 17 </div>
16 18
17 19 <div class="fieldset collapsable-content" data-toggle="summary-details">
18 20 <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
19 21 </div>
20 22
21 23 <div class="fieldset clear-fix">
22 24 <span class="commit-author">${h.link_to_user(c.commit.author)}</span><span class="commit-date"> - ${h.age_component(c.commit.date)}</span>
23 25 </div>
24 26 </div>
25 27 </div>
26 28
27 29 <div class="right-content">
28 30 <div class="tags">
29 31 <code>
30 32 <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a>
31 33 </code>
32 34
33 35 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
34 36 ${file_base.refs(c.commit)}
35 37 </div>
36 38 </div>
37 39
38 40 <div class="clear-fix"></div>
39 41
40 42 <div class="btn-collapse" data-toggle="summary-details">
41 43 ${_('Show More')}
42 44 </div>
43 45 </div>
44 46 </div>
45 47 <script>
46 48 collapsableContent();
47 49 </script>
General Comments 0
You need to be logged in to leave comments. Login now