##// END OF EJS Templates
ux: icon for merge tags
lisaq -
r931:f30d9411 default
parent child Browse files
Show More
@@ -1,45 +1,45 b''
1 1 <%namespace name="base" file="/base/base.html"/>
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 17
18 18 %if cs.merge:
19 19 <span class="mergetag">
20 ${_('merge')}
20 <i class="icon-merge"></i>${_('merge')}
21 21 </span>
22 22 %endif
23 23 <div class="message_history" title="${cs.message}">
24 24 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
25 25 ${h.shorter(cs.message, 75)}
26 26 </a>
27 27 </div>
28 28 </div>
29 29 </td>
30 30 <td class="td-hash">
31 31 <code>
32 32 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
33 33 <span>${h.show_id(cs)}</span>
34 34 </a>
35 35 </code>
36 36 </td>
37 37 <td class="td-actions">
38 38 <a href="${h.url('files_home',repo_name=c.repo_name,f_path=c.changelog_for_path,revision=cs.raw_id)}">
39 39 ${_('Show File')}
40 40 </a>
41 41 </td>
42 42 </tr>
43 43 %endfor
44 44 </table>
45 45 </div>
@@ -1,395 +1,395 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.html"/>
4 4 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
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 </code>
40 40 </h4>
41 41 </span>
42 42 <span id="parent_link">
43 43 <a href="#" title="${_('Parent Commit')}">${_('Parent')}</a>
44 44 </span>
45 45 |
46 46 <span id="child_link">
47 47 <a href="#" title="${_('Child Commit')}">${_('Child')}</a>
48 48 </span>
49 49 </div>
50 50
51 51 <div class="fieldset">
52 52 <div class="left-label">
53 53 ${_('Description')}:
54 54 </div>
55 55 <div class="right-content">
56 56 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
57 57 <div id="message_expand" style="display:none;">
58 58 ${_('Expand')}
59 59 </div>
60 60 </div>
61 61 </div>
62 62
63 63 %if c.statuses:
64 64 <div class="fieldset">
65 65 <div class="left-label">
66 66 ${_('Commit status')}:
67 67 </div>
68 68 <div class="right-content">
69 69 <div class="changeset-status-ico">
70 70 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
71 71 </div>
72 72 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
73 73 </div>
74 74 </div>
75 75 %endif
76 76
77 77 <div class="fieldset">
78 78 <div class="left-label">
79 79 ${_('References')}:
80 80 </div>
81 81 <div class="right-content">
82 82 <div class="tags">
83 83
84 84 %if c.commit.merge:
85 85 <span class="mergetag tag">
86 ${_('merge')}
86 <i class="icon-merge"></i>${_('merge')}
87 87 </span>
88 88 %endif
89 89
90 90 %if h.is_hg(c.rhodecode_repo):
91 91 %for book in c.commit.bookmarks:
92 92 <span class="booktag tag" title="${_('Bookmark %s') % book}">
93 93 <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>
94 94 </span>
95 95 %endfor
96 96 %endif
97 97
98 98 %for tag in c.commit.tags:
99 99 <span class="tagtag tag" title="${_('Tag %s') % tag}">
100 100 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-tag"></i>${tag}</a>
101 101 </span>
102 102 %endfor
103 103
104 104 %if c.commit.branch:
105 105 <span class="branchtag tag" title="${_('Branch %s') % c.commit.branch}">
106 106 <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>
107 107 </span>
108 108 %endif
109 109 </div>
110 110 </div>
111 111 </div>
112 112
113 113 <div class="fieldset">
114 114 <div class="left-label">
115 115 ${_('Diffs')}:
116 116 </div>
117 117 <div class="right-content">
118 118 <div class="diff-actions">
119 119 <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
120 120 ${_('Raw Diff')}
121 121 </a>
122 122 |
123 123 <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
124 124 ${_('Patch Diff')}
125 125 </a>
126 126 |
127 127 <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'))}">
128 128 ${_('Download Diff')}
129 129 </a>
130 130 |
131 131 ${c.ignorews_url(request.GET)}
132 132 |
133 133 ${c.context_url(request.GET)}
134 134 </div>
135 135 </div>
136 136 </div>
137 137
138 138 <div class="fieldset">
139 139 <div class="left-label">
140 140 ${_('Comments')}:
141 141 </div>
142 142 <div class="right-content">
143 143 <div class="comments-number">
144 144 %if c.comments:
145 145 <a href="#comments">${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
146 146 %else:
147 147 ${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
148 148 %endif
149 149 %if c.inline_cnt:
150 150 ## this is replaced with a proper link to first comment via JS linkifyComments() func
151 151 <a href="#inline-comments" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a>
152 152 %else:
153 153 ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
154 154 %endif
155 155 </div>
156 156 </div>
157 157 </div>
158 158
159 159 </div> <!-- end summary-detail -->
160 160
161 161 <div id="commit-stats" class="sidebar-right">
162 162 <div class="summary-detail-header">
163 163 <h4 class="item">
164 164 ${_('Author')}
165 165 </h4>
166 166 </div>
167 167 <div class="sidebar-right-content">
168 168 ${self.gravatar_with_user(c.commit.author)}
169 169 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
170 170 </div>
171 171 </div><!-- end sidebar -->
172 172 </div> <!-- end summary -->
173 173 <div class="cs_files_title">
174 174 <span class="cs_files_expand">
175 175 <span id="files_link"><a href="#" title="${_('Browse files at current commit')}">${_('Browse files')}</a></span> |
176 176
177 177 <span id="expand_all_files">${_('Expand All')}</span> | <span id="collapse_all_files">${_('Collapse All')}</span>
178 178 </span>
179 179 <h2>
180 180 ${diff_block.diff_summary_text(len(c.files), c.lines_added, c.lines_deleted, c.limited_diff)}
181 181 </h2>
182 182 </div>
183 183 </div>
184 184
185 185 <div class="cs_files">
186 186
187 187 %if not c.files:
188 188 <p class="empty_data">${_('No files')}</p>
189 189 %endif
190 190
191 191 <table class="compare_view_files commit_diff">
192 192 %for FID, (cs1, cs2, change, path, diff, stats, file) in c.changes[c.commit.raw_id].iteritems():
193 193 <tr class="cs_${change} collapse_file" fid="${FID}">
194 194 <td class="cs_icon_td">
195 195 <span class="collapse_file_icon" fid="${FID}"></span>
196 196 </td>
197 197 <td class="cs_icon_td">
198 198 <div class="flag_status not_reviewed hidden"></div>
199 199 </td>
200 200 <td class="cs_${change}" id="a_${FID}">
201 201 <div class="node">
202 202 <a href="#a_${FID}">
203 203 <i class="icon-file-${change.lower()}"></i>
204 204 ${h.safe_unicode(path)}
205 205 </a>
206 206 </div>
207 207 </td>
208 208 <td>
209 209 <div class="changes pull-right">${h.fancy_file_stats(stats)}</div>
210 210 <div class="comment-bubble pull-right" data-path="${path}">
211 211 <i class="icon-comment"></i>
212 212 </div>
213 213 </td>
214 214 </tr>
215 215 <tr fid="${FID}" id="diff_${FID}" class="diff_links">
216 216 <td></td>
217 217 <td></td>
218 218 <td class="cs_${change}">
219 219 ${diff_block.diff_menu(c.repo_name, h.safe_unicode(path), cs1, cs2, change, file)}
220 220 </td>
221 221 <td class="td-actions rc-form">
222 222 ${c.ignorews_url(request.GET, h.FID(cs2,path))} |
223 223 ${c.context_url(request.GET, h.FID(cs2,path))} |
224 224 <div data-comment-id="${h.FID(cs2,path)}" class="btn-link show-inline-comments comments-visible">
225 225 <span class="comments-show">${_('Show comments')}</span>
226 226 <span class="comments-hide">${_('Hide comments')}</span>
227 227 </div>
228 228 </td>
229 229 </tr>
230 230 <tr id="tr_${FID}">
231 231 <td></td>
232 232 <td></td>
233 233 <td class="injected_diff" colspan="2">
234 234 <div class="diff-container" id="${'diff-container-%s' % (id(change))}">
235 235 <div id="${FID}" class="diffblock margined comm">
236 236 <div class="code-body">
237 237 <div class="full_f_path" path="${h.safe_unicode(path)}"></div>
238 238 ${diff|n}
239 239 % if file and file["is_limited_diff"]:
240 240 % if file["exceeds_limit"]:
241 241 ${diff_block.file_message()}
242 242 % else:
243 243 <h5>${_('Diff was truncated. File content available only in full diff.')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a></h5>
244 244 % endif
245 245 % endif
246 246 </div>
247 247 </div>
248 248 </div>
249 249 </td>
250 250 </tr>
251 251 %endfor
252 252 </table>
253 253 </div>
254 254
255 255 % if c.limited_diff:
256 256 ${diff_block.changeset_message()}
257 257 % endif
258 258
259 259 ## template for inline comment form
260 260 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
261 261 ${comment.comment_inline_form()}
262 262
263 263 ## render comments and inlines
264 264 ${comment.generate_comments()}
265 265
266 266 ## main comment form and it status
267 267 ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.commit.raw_id),
268 268 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
269 269
270 270 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
271 271 <script type="text/javascript">
272 272
273 273 $(document).ready(function() {
274 274
275 275 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
276 276 if($('#trimmed_message_box').height() === boxmax){
277 277 $('#message_expand').show();
278 278 }
279 279
280 280 $('#message_expand').on('click', function(e){
281 281 $('#trimmed_message_box').css('max-height', 'none');
282 282 $(this).hide();
283 283 });
284 284
285 285 $('.show-inline-comments').on('click', function(e){
286 286 var boxid = $(this).attr('data-comment-id');
287 287 var button = $(this);
288 288
289 289 if(button.hasClass("comments-visible")) {
290 290 $('#{0} .inline-comments'.format(boxid)).each(function(index){
291 291 $(this).hide();
292 292 })
293 293 button.removeClass("comments-visible");
294 294 } else {
295 295 $('#{0} .inline-comments'.format(boxid)).each(function(index){
296 296 $(this).show();
297 297 })
298 298 button.addClass("comments-visible");
299 299 }
300 300 });
301 301
302 302
303 303 // next links
304 304 $('#child_link').on('click', function(e){
305 305 // fetch via ajax what is going to be the next link, if we have
306 306 // >1 links show them to user to choose
307 307 if(!$('#child_link').hasClass('disabled')){
308 308 $.ajax({
309 309 url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.commit.raw_id)}',
310 310 success: function(data) {
311 311 if(data.results.length === 0){
312 312 $('#child_link').html('${_('No Child Commits')}').addClass('disabled');
313 313 }
314 314 if(data.results.length === 1){
315 315 var commit = data.results[0];
316 316 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
317 317 }
318 318 else if(data.results.length === 2){
319 319 $('#child_link').addClass('disabled');
320 320 $('#child_link').addClass('double');
321 321 var _html = '';
322 322 _html +='<a title="__title__" href="__url__">__rev__</a> '
323 323 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
324 324 .replace('__title__', data.results[0].message)
325 325 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
326 326 _html +=' | '
327 327 _html +='<a title="__title__" href="__url__">__rev__</a> '
328 328 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
329 329 .replace('__title__', data.results[1].message)
330 330 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
331 331 $('#child_link').html(_html);
332 332 }
333 333 }
334 334 });
335 335 e.preventDefault();
336 336 }
337 337 });
338 338
339 339 // prev links
340 340 $('#parent_link').on('click', function(e){
341 341 // fetch via ajax what is going to be the next link, if we have
342 342 // >1 links show them to user to choose
343 343 if(!$('#parent_link').hasClass('disabled')){
344 344 $.ajax({
345 345 url: '${h.url('changeset_parents',repo_name=c.repo_name, revision=c.commit.raw_id)}',
346 346 success: function(data) {
347 347 if(data.results.length === 0){
348 348 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
349 349 }
350 350 if(data.results.length === 1){
351 351 var commit = data.results[0];
352 352 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
353 353 }
354 354 else if(data.results.length === 2){
355 355 $('#parent_link').addClass('disabled');
356 356 $('#parent_link').addClass('double');
357 357 var _html = '';
358 358 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
359 359 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
360 360 .replace('__title__', data.results[0].message)
361 361 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
362 362 _html +=' | '
363 363 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
364 364 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
365 365 .replace('__title__', data.results[1].message)
366 366 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
367 367 $('#parent_link').html(_html);
368 368 }
369 369 }
370 370 });
371 371 e.preventDefault();
372 372 }
373 373 });
374 374
375 375 if (location.hash) {
376 376 var result = splitDelimitedHash(location.hash);
377 377 var line = $('html').find(result.loc);
378 378 if (line.length > 0){
379 379 offsetScroll(line, 70);
380 380 }
381 381 }
382 382
383 383 // browse tree @ revision
384 384 $('#files_link').on('click', function(e){
385 385 window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}';
386 386 e.preventDefault();
387 387 });
388 388
389 389 // inject comments into their proper positions
390 390 var file_comments = $('.inline-comment-placeholder');
391 391 renderInlineComments(file_comments, true);
392 392 })
393 393 </script>
394 394
395 395 </%def>
@@ -1,28 +1,28 b''
1 1 <%def name="refs(commit)">
2 2 %if commit.merge:
3 3 <span class="mergetag tag">
4 ${_('merge')}
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 10 <span class="booktag tag" title="${_('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 17 <span class="tagtag tag" title="${_('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 23 <span class="branchtag tag" title="${_('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>
General Comments 0
You need to be logged in to leave comments. Login now