##// END OF EJS Templates
summary: use the same method to trim the messages as in changelog....
marcink -
r494:5c3d69c7 default
parent child Browse files
Show More
@@ -1,418 +1,418 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.html"/>
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 ${ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)}
20 20 </%def>
21 21
22 22 <%def name="menu_bar_nav()">
23 23 ${self.menu_items(active='repositories')}
24 24 </%def>
25 25
26 26 <%def name="menu_bar_subnav()">
27 27 ${self.repo_menu(active='changelog')}
28 28 </%def>
29 29
30 30 <%def name="main()">
31 31
32 32 <div class="box">
33 33 <div class="title">
34 34 ${self.repo_page_title(c.rhodecode_db_repo)}
35 35 <ul class="links">
36 36 <li>
37 37 <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a>
38 38 %if c.rhodecode_db_repo.fork:
39 39 <span>
40 40 <a id="compare_fork_button"
41 41 title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}"
42 42 class="btn btn-small"
43 43 href="${h.url('compare_url',
44 44 repo_name=c.rhodecode_db_repo.fork.repo_name,
45 45 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
46 46 source_ref=c.rhodecode_db_repo.landing_rev[1],
47 47 target_repo=c.repo_name,
48 48 target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
49 49 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
50 50 merge=1)
51 51 }">
52 52 <i class="icon-loop"></i>
53 53 ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)}
54 54 </a>
55 55 </span>
56 56 %endif
57 57
58 58 ## pr open link
59 59 %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo):
60 60 <span>
61 61 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}">
62 62 ${_('Open new pull request')}
63 63 </a>
64 64 </span>
65 65 %endif
66 66
67 67 ## clear selection
68 68 <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none">
69 69 ${_('Clear selection')}
70 70 </div>
71 71
72 72 </li>
73 73 </ul>
74 74 </div>
75 75
76 76 % if c.pagination:
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>
89 89
90 90 <div id="graph">
91 91 <div class="graph-col-wrapper">
92 92 <div id="graph_nodes">
93 93 <div id="graph_canvas" data-graph='${c.jsdata|n}'></div>
94 94 </div>
95 95 <div id="graph_content" class="main-content graph_full_width">
96 96
97 97 <div class="table">
98 98 <table id="changesets" class="rctable">
99 99 <tr>
100 100 ## checkbox
101 101 <th></th>
102 102 <th colspan="2"></th>
103 103
104 104 <th>${_('Commit')}</th>
105 105 ## commit message expand arrow
106 106 <th></th>
107 107 <th>${_('Commit Message')}</th>
108 108
109 109 <th>${_('Age')}</th>
110 110 <th>${_('Author')}</th>
111 111
112 112 <th>${_('Refs')}</th>
113 113 </tr>
114 114 <tbody>
115 115 %for cnt,commit in enumerate(c.pagination):
116 116 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
117 117
118 118 <td class="td-checkbox">
119 119 ${h.checkbox(commit.raw_id,class_="commit-range")}
120 120 </td>
121 121 <td class="td-status">
122 122
123 123 %if c.statuses.get(commit.raw_id):
124 124 <div class="changeset-status-ico">
125 125 %if c.statuses.get(commit.raw_id)[2]:
126 126 <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.url('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}">
127 127 <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div>
128 128 </a>
129 129 %else:
130 130 <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)}">
131 131 <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div>
132 132 </a>
133 133 %endif
134 134 </div>
135 135 %else:
136 136 <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div>
137 137 %endif
138 138 </td>
139 139 <td class="td-comments comments-col">
140 140 %if c.comments.get(commit.raw_id):
141 141 <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)}">
142 142 <i class="icon-comment icon-comment-colored"></i> ${len(c.comments[commit.raw_id])}
143 143 </a>
144 144 %endif
145 145 </td>
146 146 <td class="td-hash">
147 147 <code>
148 148 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">
149 149 <span class="commit_hash">${h.show_id(commit)}</span>
150 150 </a>
151 151 </code>
152 152 </td>
153 153 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}">
154 154 <div class="show_more_col">
155 155 <i class="show_more"></i>&nbsp;
156 156 </div>
157 157 </td>
158 158 <td class="td-description mid">
159 159 <div class="log-container truncate-wrap">
160 160 <div class="message truncate" id="c-${commit.raw_id}">${h.urlify_commit_message(commit.message, c.repo_name)}</div>
161 161 </div>
162 </td>
162 </td>
163 163
164 164 <td class="td-time">
165 165 ${h.age_component(commit.date)}
166 166 </td>
167 167 <td class="td-user">
168 168 ${self.gravatar_with_user(commit.author)}
169 169 </td>
170 170
171 171 <td class="td-tags tags-col truncate-wrap">
172 172 <div class="truncate tags-truncate" id="t-${commit.raw_id}">
173 173 ## branch
174 174 %if commit.branch:
175 175 <span class="branchtag tag" title="${_('Branch %s') % commit.branch}">
176 176 <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>
177 177 </span>
178 178 %endif
179 179
180 180 ## bookmarks
181 181 %if h.is_hg(c.rhodecode_repo):
182 182 %for book in commit.bookmarks:
183 183 <span class="tag booktag" title="${_('Bookmark %s') % book}">
184 184 <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
185 185 </span>
186 186 %endfor
187 187 %endif
188 188
189 189 ## tags
190 190 %for tag in commit.tags:
191 191 <span class="tagtag tag" title="${_('Tag %s') % tag}">
192 192 <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
193 193 </span>
194 194 %endfor
195 195
196 196 </div>
197 197 </td>
198 198 </tr>
199 199 %endfor
200 200 </tbody>
201 201 </table>
202 202 </div>
203 203 </div>
204 204 </div>
205 205 <div class="pagination-wh pagination-left">
206 206 ${c.pagination.pager('$link_previous ~2~ $link_next')}
207 207 </div>
208 208
209 209 <script type="text/javascript" src="${h.asset('js/jquery.commits-graph.js')}"></script>
210 210 <script type="text/javascript">
211 211 var cache = {};
212 212 $(function(){
213 213
214 214 // Create links to commit ranges when range checkboxes are selected
215 215 var $commitCheckboxes = $('.commit-range');
216 216 // cache elements
217 217 var $commitRangeContainer = $('#rev_range_container');
218 218 var $commitRangeClear = $('#rev_range_clear');
219 219
220 220 var checkboxRangeSelector = function(e){
221 221 var selectedCheckboxes = [];
222 222 for (pos in $commitCheckboxes){
223 223 if($commitCheckboxes[pos].checked){
224 224 selectedCheckboxes.push($commitCheckboxes[pos]);
225 225 }
226 226 }
227 227 var open_new_pull_request = $('#open_new_pull_request');
228 228 if(open_new_pull_request){
229 229 var selected_changes = selectedCheckboxes.length;
230 230 if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type != 'hg') {
231 231 open_new_pull_request.hide();
232 232 } else {
233 233 if (selected_changes == 1) {
234 234 open_new_pull_request.html(_gettext('Open new pull request for selected commit'));
235 235 } else if (selected_changes == 0) {
236 236 open_new_pull_request.html(_gettext('Open new pull request'));
237 237 }
238 238 open_new_pull_request.show();
239 239 }
240 240 }
241 241
242 242 if (selectedCheckboxes.length>0){
243 243 var revEnd = selectedCheckboxes[0].name;
244 244 var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name;
245 245 var url = pyroutes.url('changeset_home',
246 246 {'repo_name': '${c.repo_name}',
247 247 'revision': revStart+'...'+revEnd});
248 248
249 249 var link = (revStart == revEnd)
250 250 ? _gettext('Show selected commit __S')
251 251 : _gettext('Show selected commits __S ... __E');
252 252
253 253 link = link.replace('__S', revStart.substr(0,6));
254 254 link = link.replace('__E', revEnd.substr(0,6));
255 255
256 256 $commitRangeContainer
257 257 .attr('href',url)
258 258 .html(link)
259 259 .show();
260 260
261 261 $commitRangeClear.show();
262 262 var _url = pyroutes.url('pullrequest_home',
263 263 {'repo_name': '${c.repo_name}',
264 264 'commit': revEnd});
265 265 open_new_pull_request.attr('href', _url);
266 266 $('#compare_fork_button').hide();
267 267 } else {
268 268 $commitRangeContainer.hide();
269 269 $commitRangeClear.hide();
270 270
271 271 %if c.branch_name:
272 272 var _url = pyroutes.url('pullrequest_home',
273 273 {'repo_name': '${c.repo_name}',
274 274 'branch':'${c.branch_name}'});
275 275 open_new_pull_request.attr('href', _url);
276 276 %else:
277 277 var _url = pyroutes.url('pullrequest_home',
278 278 {'repo_name': '${c.repo_name}'});
279 279 open_new_pull_request.attr('href', _url);
280 280 %endif
281 281 $('#compare_fork_button').show();
282 282 }
283 283 };
284 284
285 285 $commitCheckboxes.on('click', checkboxRangeSelector);
286 286
287 287 $commitRangeClear.on('click',function(e) {
288 288 $commitCheckboxes.attr('checked', false)
289 289 checkboxRangeSelector();
290 290 e.preventDefault();
291 291 });
292 292
293 293 // make sure the buttons are consistent when navigate back and forth
294 294 checkboxRangeSelector();
295 295
296 296
297 297 var msgs = $('.message');
298 298 // get first element height
299 299 var el = $('#graph_content .container')[0];
300 300 var row_h = el.clientHeight;
301 301 for (var i=0; i < msgs.length; i++) {
302 302 var m = msgs[i];
303 303
304 304 var h = m.clientHeight;
305 305 var pad = $(m).css('padding');
306 306 if (h > row_h) {
307 307 var offset = row_h - (h+12);
308 308 $(m.nextElementSibling).css('display','block');
309 309 $(m.nextElementSibling).css('margin-top',offset+'px');
310 310 }
311 311 }
312 312
313 313 $('.expand_commit').on('click',function(e){
314 314 var target_expand = $(this);
315 315 var cid = target_expand.data('commitId');
316 316
317 317 if (target_expand.hasClass('open')){
318 318 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
319 319 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden', 'white-space':'nowrap'});
320 320 target_expand.removeClass('open');
321 321 }
322 322 else {
323 323 $('#c-'+cid).css({'height': 'auto', 'white-space': 'pre-line', 'text-overflow': 'initial', 'overflow':'visible'});
324 324 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible', 'white-space':'normal'});
325 325 target_expand.addClass('open');
326 326 }
327 327 // redraw the graph
328 328 graph_options.height = $("#changesets").height();
329 329 $("canvas").remove();
330 330 $("[data-graph]").commits(graph_options);
331 331 });
332 332
333 333 $("#clear_filter").on("click", function() {
334 334 var filter = {'repo_name': '${c.repo_name}'};
335 335 window.location = pyroutes.url('changelog_home', filter);
336 336 });
337 337
338 338 $("#branch_filter").select2({
339 339 'dropdownAutoWidth': true,
340 340 'width': 'resolve',
341 341 'placeholder': "${c.selected_name or _('Filter changelog')}",
342 342 containerCssClass: "drop-menu",
343 343 dropdownCssClass: "drop-menu-dropdown",
344 344 query: function(query){
345 345 var key = 'cache';
346 346 var cached = cache[key] ;
347 347 if(cached) {
348 348 var data = {results: []};
349 349 //filter results
350 350 $.each(cached.results, function(){
351 351 var section = this.text;
352 352 var children = [];
353 353 $.each(this.children, function(){
354 354 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
355 355 children.push({'id': this.id, 'text': this.text, 'type': this.type})
356 356 }
357 357 });
358 358 data.results.push({'text': section, 'children': children});
359 359 query.callback({results: data.results});
360 360 });
361 361 }else{
362 362 $.ajax({
363 363 url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}),
364 364 data: {},
365 365 dataType: 'json',
366 366 type: 'GET',
367 367 success: function(data) {
368 368 cache[key] = data;
369 369 query.callback({results: data.results});
370 370 }
371 371 })
372 372 }
373 373 }
374 374 });
375 375
376 376 $('#branch_filter').on('change', function(e){
377 377 var data = $('#branch_filter').select2('data');
378 378 var selected = data.text;
379 379 var filter = {'repo_name': '${c.repo_name}'};
380 380 if(data.type == 'branch' || data.type == 'branch_closed'){
381 381 filter["branch"] = selected;
382 382 }
383 383 else if (data.type == 'book'){
384 384 filter["bookmark"] = selected;
385 385 }
386 386 window.location = pyroutes.url('changelog_home', filter);
387 387 });
388 388
389 389 // Determine max number of edges per row in graph
390 390 var jsdata = $.parseJSON($("[data-graph]").attr('data-graph'));
391 391 var edgeCount = 1;
392 392 $.each(jsdata, function(i, item){
393 393 $.each(item[2], function(key, value) {
394 394 if (value[1] > edgeCount){
395 395 edgeCount = value[1];
396 396 }
397 397 });
398 398 });
399 399 var x_step = Math.min(18, Math.floor(86 / edgeCount));
400 400 var graph_options = {
401 401 width: 100,
402 402 height: $("#changesets").height(),
403 403 x_step: x_step,
404 404 y_step: 42,
405 405 dotRadius: 3.5,
406 406 lineWidth: 2.5
407 407 };
408 408 $("[data-graph]").commits(graph_options);
409 409
410 410 });
411 411
412 412 </script>
413 413 %else:
414 414 ${_('There are no changes yet')}
415 415 %endif
416 416 </div>
417 417 </div>
418 418 </%def>
@@ -1,133 +1,136 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.html"/>
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.url('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 icon-comment-colored"></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 <td class="td-message">
45 ${h.urlify_commit_message(h.truncate(cs.message, 50), c.repo_name)}
44
45 <td class="td-description mid">
46 <div class="log-container truncate-wrap">
47 <div class="message truncate" id="c-${cs.raw_id}">${h.urlify_commit_message(cs.message, c.repo_name)}</div>
48 </div>
46 49 </td>
47 50
48 51 <td class="td-time">
49 52 ${h.age_component(cs.date)}
50 53 </td>
51 54 <td class="td-user author">
52 55 ${base.gravatar_with_user(cs.author)}
53 56 </td>
54 57
55 58 <td class="td-tags truncate-wrap">
56 59 <div class="truncate tags-truncate"><div class="autoexpand">
57 60 %if h.is_hg(c.rhodecode_repo):
58 61 %for book in cs.bookmarks:
59 62 <span class="booktag tag" title="${_('Bookmark %s') % book}">
60 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>
61 64 </span>
62 65 %endfor
63 66 %endif
64 67 ## tags
65 68 %for tag in cs.tags:
66 69 <span class="tagtag tag" title="${_('Tag %s') % tag}">
67 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>
68 71 </span>
69 72 %endfor
70 73
71 74 ## branch
72 75 %if cs.branch:
73 76 <span class="branchtag tag" title="${_('Branch %s') % cs.branch}">
74 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>
75 78 </span>
76 79 %endif
77 80 </div>
78 81 </td>
79 82 </tr>
80 83 %endfor
81 84
82 85 </table>
83 86
84 87 <script type="text/javascript">
85 88 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 2000, scrollTo: false });
86 89 $(document).on('pjax:success', function(){ timeagoActivate(); });
87 90 </script>
88 91
89 92 <div class="pagination-wh pagination-left">
90 93 ${c.repo_commits.pager('$link_previous ~2~ $link_next')}
91 94 </div>
92 95 %else:
93 96
94 97 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
95 98 <div class="quick_start">
96 99 <div class="fieldset">
97 100 <div class="left-label">${_('Add or upload files directly via RhodeCode:')}</div>
98 101 <div class="right-content">
99 102 <div id="add_node_id" class="add_node">
100 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>
101 104 </div>
102 105 </div>
103 106 %endif
104 107 </div>
105 108
106 109 %if not h.is_svn(c.rhodecode_repo):
107 110 <div class="fieldset">
108 111 <div class="left-label">${_('Push new repo:')}</div>
109 112 <div class="right-content">
110 113 <pre>
111 114 ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
112 115 ${c.rhodecode_repo.alias} add README # add first file
113 116 ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
114 117 ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
115 118 </pre>
116 119 </div>
117 120 </div>
118 121 <div class="fieldset">
119 122 <div class="left-label">${_('Existing repository?')}</div>
120 123 <div class="right-content">
121 124 <pre>
122 125 %if h.is_git(c.rhodecode_repo):
123 126 git remote add origin ${c.clone_repo_url}
124 127 git push -u origin master
125 128 %else:
126 129 hg push ${c.clone_repo_url}
127 130 %endif
128 131 </pre>
129 132 </div>
130 133 </div>
131 134 %endif
132 135 </div>
133 136 %endif
General Comments 0
You need to be logged in to leave comments. Login now