##// END OF EJS Templates
fixes graph y axis problem
marcink -
r1430:9d19456c beta
parent child Browse files
Show More
@@ -1,711 +1,696 b''
1 1 <%inherit file="/base/base.html"/>
2 2
3 3 <%def name="title()">
4 4 ${c.repo_name} ${_('Summary')} - ${c.rhodecode_name}
5 5 </%def>
6 6
7 7 <%def name="breadcrumbs_links()">
8 8 ${h.link_to(u'Home',h.url('/'))}
9 9 &raquo;
10 10 ${h.link_to(c.dbrepo.just_name,h.url('summary_home',repo_name=c.repo_name))}
11 11 &raquo;
12 12 ${_('summary')}
13 13 </%def>
14 14
15 15 <%def name="page_nav()">
16 16 ${self.menu('summary')}
17 17 </%def>
18 18
19 19 <%def name="main()">
20 20 <div class="box box-left">
21 21 <!-- box / title -->
22 22 <div class="title">
23 23 ${self.breadcrumbs()}
24 24 </div>
25 25 <!-- end box / title -->
26 26 <div class="form">
27 27 <div id="summary" class="fields">
28 28
29 29 <div class="field">
30 30 <div class="label">
31 31 <label>${_('Name')}:</label>
32 32 </div>
33 33 <div class="input-short">
34 34 %if c.rhodecode_user.username != 'default':
35 35 %if c.following:
36 36 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
37 37 onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
38 38 </span>
39 39 %else:
40 40 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
41 41 onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
42 42 </span>
43 43 %endif
44 44 %endif:
45 45
46 46 ##REPO TYPE
47 47 %if c.dbrepo.repo_type =='hg':
48 48 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/>
49 49 %endif
50 50 %if c.dbrepo.repo_type =='git':
51 51 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url("/images/icons/giticon.png")}"/>
52 52 %endif
53 53
54 54 ##PUBLIC/PRIVATE
55 55 %if c.dbrepo.private:
56 56 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url("/images/icons/lock.png")}"/>
57 57 %else:
58 58 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/>
59 59 %endif
60 60
61 61 ##REPO NAME
62 62 <span class="repo_name">${h.repo_link(c.dbrepo.groups_and_repo)}</span>
63 63
64 64 ##FORK
65 65 %if c.dbrepo.fork:
66 66 <div style="margin-top:5px;clear:both"">
67 67 <a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}">
68 68 <img class="icon" alt="${_('public')}"
69 69 title="${_('Fork of')} ${c.dbrepo.fork.repo_name}"
70 70 src="${h.url("/images/icons/arrow_divide.png")}"/>
71 71 ${_('Fork of')} ${c.dbrepo.fork.repo_name}
72 72 </a>
73 73 </div>
74 74 %endif
75 75 ##REMOTE
76 76 %if c.dbrepo.clone_uri:
77 77 <div style="margin-top:5px;clear:both">
78 78 <a href="${h.url(str(h.hide_credentials(c.dbrepo.clone_uri)))}">
79 79 <img class="icon" alt="${_('remote clone')}"
80 80 title="${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}"
81 81 src="${h.url("/images/icons/connect.png")}"/>
82 82 ${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}
83 83 </a>
84 84 </div>
85 85 %endif
86 86 </div>
87 87 </div>
88 88
89 89
90 90 <div class="field">
91 91 <div class="label">
92 92 <label>${_('Description')}:</label>
93 93 </div>
94 94 <div class="input-short desc">${c.dbrepo.description}</div>
95 95 </div>
96 96
97 97
98 98 <div class="field">
99 99 <div class="label">
100 100 <label>${_('Contact')}:</label>
101 101 </div>
102 102 <div class="input-short">
103 103 <div class="gravatar">
104 104 <img alt="gravatar" src="${h.gravatar_url(c.dbrepo.user.email)}"/>
105 105 </div>
106 106 ${_('Username')}: ${c.dbrepo.user.username}<br/>
107 107 ${_('Name')}: ${c.dbrepo.user.name} ${c.dbrepo.user.lastname}<br/>
108 108 ${_('Email')}: <a href="mailto:${c.dbrepo.user.email}">${c.dbrepo.user.email}</a>
109 109 </div>
110 110 </div>
111 111
112 112 <div class="field">
113 113 <div class="label">
114 114 <label>${_('Last change')}:</label>
115 115 </div>
116 116 <div class="input-short">
117 117 <b>${'r%s:%s' % (h.get_changeset_safe(c.rhodecode_repo,'tip').revision,
118 118 h.get_changeset_safe(c.rhodecode_repo,'tip').short_id)}</b> -
119 119 <span class="tooltip" title="${c.rhodecode_repo.last_change}">
120 120 ${h.age(c.rhodecode_repo.last_change)}</span><br/>
121 121 ${_('by')} ${h.get_changeset_safe(c.rhodecode_repo,'tip').author}
122 122
123 123 </div>
124 124 </div>
125 125
126 126 <div class="field">
127 127 <div class="label">
128 128 <label>${_('Clone url')}:</label>
129 129 </div>
130 130 <div class="input-short">
131 131 <input type="text" id="clone_url" readonly="readonly" value="${c.rhodecode_repo.alias} clone ${c.clone_repo_url}" size="70"/>
132 132 </div>
133 133 </div>
134 134
135 135 <div class="field">
136 136 <div class="label">
137 137 <label>${_('Trending source files')}:</label>
138 138 </div>
139 139 <div class="input-short">
140 140 <div id="lang_stats"></div>
141 141 </div>
142 142 </div>
143 143
144 144 <div class="field">
145 145 <div class="label">
146 146 <label>${_('Download')}:</label>
147 147 </div>
148 148 <div class="input-short">
149 149 %if len(c.rhodecode_repo.revisions) == 0:
150 150 ${_('There are no downloads yet')}
151 151 %elif c.enable_downloads is False:
152 152 ${_('Downloads are disabled for this repository')}
153 153 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
154 154 [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
155 155 %endif
156 156 %else:
157 157 ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)}
158 158 %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
159 159 %if cnt >=1:
160 160 |
161 161 %endif
162 162 <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}"
163 163 id="${archive['type']+'_link'}">${h.link_to(archive['type'],
164 164 h.url('files_archive_home',repo_name=c.dbrepo.repo_name,
165 165 fname='tip'+archive['extension']),class_="archive_icon")}</span>
166 166 %endfor
167 167 %endif
168 168 </div>
169 169 </div>
170 170
171 171 <div class="field">
172 172 <div class="label">
173 173 <label>${_('Feeds')}:</label>
174 174 </div>
175 175 <div class="input-short">
176 176 %if c.rhodecode_user.username != 'default':
177 177 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='rss_icon')}
178 178 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='atom_icon')}
179 179 %else:
180 180 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name),class_='rss_icon')}
181 181 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name),class_='atom_icon')}
182 182 %endif
183 183 </div>
184 184 </div>
185 185 </div>
186 186 </div>
187 187 <script type="text/javascript">
188 188 YUE.onDOMReady(function(e){
189 189 id = 'clone_url';
190 190 YUE.on(id,'click',function(e){
191 191 if(YUD.hasClass(id,'selected')){
192 192 return
193 193 }
194 194 else{
195 195 YUD.addClass(id,'selected');
196 196 YUD.get(id).select();
197 197 }
198 198
199 199 })
200 200 })
201 201 var data = ${c.trending_languages|n};
202 202 var total = 0;
203 203 var no_data = true;
204 204 for (k in data){
205 205 total += data[k].count;
206 206 no_data = false;
207 207 }
208 208 var tbl = document.createElement('table');
209 209 tbl.setAttribute('class','trending_language_tbl');
210 210 var cnt = 0;
211 211 for (k in data){
212 212 cnt += 1;
213 213 var hide = cnt>2;
214 214 var tr = document.createElement('tr');
215 215 if (hide){
216 216 tr.setAttribute('style','display:none');
217 217 tr.setAttribute('class','stats_hidden');
218 218 }
219 219 var percentage = Math.round((data[k].count/total*100),2);
220 220 var value = data[k].count;
221 221 var td1 = document.createElement('td');
222 222 td1.width = 150;
223 223 var trending_language_label = document.createElement('div');
224 224 trending_language_label.innerHTML = data[k].desc+" ("+k+")";
225 225 td1.appendChild(trending_language_label);
226 226
227 227 var td2 = document.createElement('td');
228 228 td2.setAttribute('style','padding-right:14px !important');
229 229 var trending_language = document.createElement('div');
230 230 var nr_files = value+" ${_('files')}";
231 231
232 232 trending_language.title = k+" "+nr_files;
233 233
234 234 if (percentage>22){
235 235 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
236 236 }
237 237 else{
238 238 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
239 239 }
240 240
241 241 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
242 242 trending_language.style.width=percentage+"%";
243 243 td2.appendChild(trending_language);
244 244
245 245 tr.appendChild(td1);
246 246 tr.appendChild(td2);
247 247 tbl.appendChild(tr);
248 248 if(cnt == 3){
249 249 var show_more = document.createElement('tr');
250 250 var td = document.createElement('td');
251 251 lnk = document.createElement('a');
252 252
253 253 lnk.href='#';
254 254 lnk.innerHTML = "${_('show more')}";
255 255 lnk.id='code_stats_show_more';
256 256 td.appendChild(lnk);
257 257
258 258 show_more.appendChild(td);
259 259 show_more.appendChild(document.createElement('td'));
260 260 tbl.appendChild(show_more);
261 261 }
262 262
263 263 }
264 264 if(no_data){
265 265 var tr = document.createElement('tr');
266 266 var td1 = document.createElement('td');
267 267 td1.innerHTML = "${c.no_data_msg}";
268 268 tr.appendChild(td1);
269 269 tbl.appendChild(tr);
270 270 }
271 271 YUD.get('lang_stats').appendChild(tbl);
272 272 YUE.on('code_stats_show_more','click',function(){
273 273 l = YUD.getElementsByClassName('stats_hidden')
274 274 for (e in l){
275 275 YUD.setStyle(l[e],'display','');
276 276 };
277 277 YUD.setStyle(YUD.get('code_stats_show_more'),
278 278 'display','none');
279 279 })
280 280
281 281
282 282 YUE.on('download_options','change',function(e){
283 283 var new_cs = e.target.options[e.target.selectedIndex];
284 284 var tmpl_links = {}
285 285 %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
286 286 tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'],
287 287 h.url('files_archive_home',repo_name=c.dbrepo.repo_name,
288 288 fname='__CS__'+archive['extension']),class_="archive_icon")}';
289 289 %endfor
290 290
291 291
292 292 for(k in tmpl_links){
293 293 var s = YUD.get(k+'_link')
294 294 title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
295 295 s.title = title_tmpl.replace('__CS_NAME__',new_cs.text);
296 296 s.title = s.title.replace('__CS_EXT__',k);
297 297 s.innerHTML = tmpl_links[k].replace('__CS__',new_cs.value);
298 298 }
299 299
300 300 })
301 301
302 302 </script>
303 303 </div>
304 304
305 305 <div class="box box-right" style="min-height:455px">
306 306 <!-- box / title -->
307 307 <div class="title">
308 308 <h5>${_('Commit activity by day / author')}</h5>
309 309 </div>
310 310
311 311 <div class="graph">
312 312 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">
313 313 %if c.no_data:
314 314 ${c.no_data_msg}
315 315 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
316 316 [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
317 317 %endif
318 318
319 319 %else:
320 320 ${_('Loaded in')} ${c.stats_percentage} %
321 321 %endif
322 322 </div>
323 323 <div id="commit_history" style="width:450px;height:300px;float:left"></div>
324 324 <div style="clear: both;height: 10px"></div>
325 325 <div id="overview" style="width:450px;height:100px;float:left"></div>
326 326
327 327 <div id="legend_data" style="clear:both;margin-top:10px;">
328 328 <div id="legend_container"></div>
329 329 <div id="legend_choices">
330 330 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
331 331 </div>
332 332 </div>
333 333 <script type="text/javascript">
334 334 /**
335 335 * Plots summary graph
336 336 *
337 337 * @class SummaryPlot
338 338 * @param {from} initial from for detailed graph
339 339 * @param {to} initial to for detailed graph
340 340 * @param {dataset}
341 341 * @param {overview_dataset}
342 342 */
343 343 function SummaryPlot(from,to,dataset,overview_dataset) {
344 344 var initial_ranges = {
345 345 "xaxis":{
346 346 "from":from,
347 347 "to":to,
348 348 },
349 349 };
350 350 var dataset = dataset;
351 351 var overview_dataset = [overview_dataset];
352 352 var choiceContainer = YUD.get("legend_choices");
353 353 var choiceContainerTable = YUD.get("legend_choices_tables");
354 354 var plotContainer = YUD.get('commit_history');
355 355 var overviewContainer = YUD.get('overview');
356 356
357 357 var plot_options = {
358 358 bars: {show:true,align:'center',lineWidth:4},
359 359 legend: {show:true, container:"legend_container"},
360 360 points: {show:true,radius:0,fill:false},
361 361 yaxis: {tickDecimals:0,},
362 362 xaxis: {
363 363 mode: "time",
364 364 timeformat: "%d/%m",
365 365 min:from,
366 366 max:to,
367 367 },
368 368 grid: {
369 369 hoverable: true,
370 370 clickable: true,
371 371 autoHighlight:true,
372 372 color: "#999"
373 373 },
374 374 //selection: {mode: "x"}
375 375 };
376 376 var overview_options = {
377 377 legend:{show:false},
378 378 bars: {show:true,barWidth: 2,},
379 379 shadowSize: 0,
380 380 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
381 381 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
382 382 grid: {color: "#999",},
383 383 selection: {mode: "x"}
384 384 };
385 385
386 386 /**
387 387 *get dummy data needed in few places
388 388 */
389 389 function getDummyData(label){
390 390 return {"label":label,
391 391 "data":[{"time":0,
392 392 "commits":0,
393 393 "added":0,
394 394 "changed":0,
395 395 "removed":0,
396 396 }],
397 397 "schema":["commits"],
398 398 "color":'#ffffff',
399 399 }
400 400 }
401 401
402 402 /**
403 403 * generate checkboxes accordindly to data
404 404 * @param keys
405 405 * @returns
406 406 */
407 407 function generateCheckboxes(data) {
408 408 //append checkboxes
409 409 var i = 0;
410 410 choiceContainerTable.innerHTML = '';
411 411 for(var pos in data) {
412 412
413 413 data[pos].color = i;
414 414 i++;
415 415 if(data[pos].label != ''){
416 416 choiceContainerTable.innerHTML += '<tr><td>'+
417 417 '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
418 418 +data[pos].label+
419 419 '</td></tr>';
420 420 }
421 421 }
422 422 }
423 423
424 424 /**
425 425 * ToolTip show
426 426 */
427 427 function showTooltip(x, y, contents) {
428 428 var div=document.getElementById('tooltip');
429 429 if(!div) {
430 430 div = document.createElement('div');
431 431 div.id="tooltip";
432 432 div.style.position="absolute";
433 433 div.style.border='1px solid #fdd';
434 434 div.style.padding='2px';
435 435 div.style.backgroundColor='#fee';
436 436 document.body.appendChild(div);
437 437 }
438 438 YUD.setStyle(div, 'opacity', 0);
439 439 div.innerHTML = contents;
440 440 div.style.top=(y + 5) + "px";
441 441 div.style.left=(x + 5) + "px";
442 442
443 443 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
444 444 anim.animate();
445 445 }
446 446
447 447 /**
448 448 * This function will detect if selected period has some changesets
449 449 for this user if it does this data is then pushed for displaying
450 450 Additionally it will only display users that are selected by the checkbox
451 451 */
452 452 function getDataAccordingToRanges(ranges) {
453 453
454 454 var data = [];
455 var new_dataset = {};
455 456 var keys = [];
457 var max_commits = 0;
456 458 for(var key in dataset){
457 var push = false;
458 459
459 //method1 slow !!
460 //*
461 460 for(var ds in dataset[key].data){
462 461 commit_data = dataset[key].data[ds];
463 462 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
464 push = true;
465 break;
463
464 if(new_dataset[key] === undefined){
465 new_dataset[key] = {data:[],schema:["commits"],label:key};
466 }
467 new_dataset[key].data.push(commit_data);
466 468 }
467 469 }
468 //*/
469
470 /*//method2 sorted commit data !!!
471
472 var first_commit = dataset[key].data[0].time;
473 var last_commit = dataset[key].data[dataset[key].data.length-1].time;
474
475 if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){
476 push = true;
477 }
478 //*/
479
480 if(push){
481 data.push(dataset[key]);
482 }
470 if (new_dataset[key] !== undefined){
471 data.push(new_dataset[key]);
472 }
483 473 }
484 if(data.length >= 1){
485 return data;
486 }
474
475 if (data.length > 0){
476 return data;
477 }
487 478 else{
488 479 //just return dummy data for graph to plot itself
489 480 return [getDummyData('')];
490 481 }
491
492 482 }
493 483
494 484 /**
495 485 * redraw using new checkbox data
496 486 */
497 487 function plotchoiced(e,args){
498 488 var cur_data = args[0];
499 489 var cur_ranges = args[1];
500 490
501 491 var new_data = [];
502 492 var inputs = choiceContainer.getElementsByTagName("input");
503 493
504 494 //show only checked labels
505 495 for(var i=0; i<inputs.length; i++) {
506 496 var checkbox_key = inputs[i].name;
507 497
508 498 if(inputs[i].checked){
509 499 for(var d in cur_data){
510 500 if(cur_data[d].label == checkbox_key){
511 501 new_data.push(cur_data[d]);
512 502 }
513 503 }
514 504 }
515 505 else{
516 506 //push dummy data to not hide the label
517 507 new_data.push(getDummyData(checkbox_key));
518 508 }
519 509 }
520 510
521 511 var new_options = YAHOO.lang.merge(plot_options, {
522 512 xaxis: {
523 513 min: cur_ranges.xaxis.from,
524 514 max: cur_ranges.xaxis.to,
525 515 mode:"time",
526 516 timeformat: "%d/%m",
527 517 },
528 518 });
529 519 if (!new_data){
530 520 new_data = [[0,1]];
531 521 }
532 522 // do the zooming
533 523 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
534 524
535 525 plot.subscribe("plotselected", plotselected);
536 526
537 527 //resubscribe plothover
538 528 plot.subscribe("plothover", plothover);
539 529
540 // don't fire event on the overview to prevent eternal loop
530 // don't fire event on the overview to prevent eternal loop
541 531 overview.setSelection(cur_ranges, true);
542 532
543 533 }
544 534
545 535 /**
546 536 * plot only selected items from overview
547 537 * @param ranges
548 538 * @returns
549 539 */
550 540 function plotselected(ranges,cur_data) {
551 541 //updates the data for new plot
552 data = getDataAccordingToRanges(ranges);
542 var data = getDataAccordingToRanges(ranges);
553 543 generateCheckboxes(data);
554 544
555 545 var new_options = YAHOO.lang.merge(plot_options, {
556 546 xaxis: {
557 547 min: ranges.xaxis.from,
558 548 max: ranges.xaxis.to,
559 549 mode:"time",
560 550 timeformat: "%d/%m",
561 551 },
562 yaxis: {
563 min: ranges.yaxis.from,
564 max: ranges.yaxis.to,
565 },
566
567 552 });
568 // do the zooming
553 // do the zooming
569 554 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
570 555
571 556 plot.subscribe("plotselected", plotselected);
572 557
573 558 //resubscribe plothover
574 559 plot.subscribe("plothover", plothover);
575 560
576 561 // don't fire event on the overview to prevent eternal loop
577 562 overview.setSelection(ranges, true);
578 563
579 //resubscribe choiced
564 //resubscribe choiced
580 565 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
581 566 }
582 567
583 568 var previousPoint = null;
584 569
585 570 function plothover(o) {
586 571 var pos = o.pos;
587 572 var item = o.item;
588 573
589 574 //YUD.get("x").innerHTML = pos.x.toFixed(2);
590 575 //YUD.get("y").innerHTML = pos.y.toFixed(2);
591 576 if (item) {
592 577 if (previousPoint != item.datapoint) {
593 578 previousPoint = item.datapoint;
594 579
595 580 var tooltip = YUD.get("tooltip");
596 581 if(tooltip) {
597 582 tooltip.parentNode.removeChild(tooltip);
598 583 }
599 584 var x = item.datapoint.x.toFixed(2);
600 585 var y = item.datapoint.y.toFixed(2);
601 586
602 587 if (!item.series.label){
603 588 item.series.label = 'commits';
604 589 }
605 590 var d = new Date(x*1000);
606 591 var fd = d.toDateString()
607 592 var nr_commits = parseInt(y);
608 593
609 594 var cur_data = dataset[item.series.label].data[item.dataIndex];
610 595 var added = cur_data.added;
611 596 var changed = cur_data.changed;
612 597 var removed = cur_data.removed;
613 598
614 599 var nr_commits_suffix = " ${_('commits')} ";
615 600 var added_suffix = " ${_('files added')} ";
616 601 var changed_suffix = " ${_('files changed')} ";
617 602 var removed_suffix = " ${_('files removed')} ";
618 603
619 604
620 605 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
621 606 if(added==1){added_suffix=" ${_('file added')} ";}
622 607 if(changed==1){changed_suffix=" ${_('file changed')} ";}
623 608 if(removed==1){removed_suffix=" ${_('file removed')} ";}
624 609
625 610 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
626 611 +'<br/>'+
627 612 nr_commits + nr_commits_suffix+'<br/>'+
628 613 added + added_suffix +'<br/>'+
629 614 changed + changed_suffix + '<br/>'+
630 615 removed + removed_suffix + '<br/>');
631 616 }
632 617 }
633 618 else {
634 619 var tooltip = YUD.get("tooltip");
635 620
636 621 if(tooltip) {
637 622 tooltip.parentNode.removeChild(tooltip);
638 623 }
639 624 previousPoint = null;
640 625 }
641 626 }
642 627
643 628 /**
644 629 * MAIN EXECUTION
645 630 */
646 631
647 var data = getDataAccordingToRanges(initial_ranges);
632 var data = getDataAccordingToRanges(initial_ranges);
648 633 generateCheckboxes(data);
649 634
650 //main plot
635 //main plot
651 636 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
652 637
653 //overview
654 var overview = YAHOO.widget.Flot(overviewContainer, overview_dataset, overview_options);
638 //overview
639 var overview = YAHOO.widget.Flot(overviewContainer,
640 overview_dataset, overview_options);
655 641
656 //show initial selection on overview
642 //show initial selection on overview
657 643 overview.setSelection(initial_ranges);
658 644
659 645 plot.subscribe("plotselected", plotselected);
646 plot.subscribe("plothover", plothover)
660 647
661 648 overview.subscribe("plotselected", function (ranges) {
662 649 plot.setSelection(ranges);
663 650 });
664
665 plot.subscribe("plothover", plothover);
666 651
667 652 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
668 653 }
669 654 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
670 655 </script>
671 656
672 657 </div>
673 658 </div>
674 659
675 660 <div class="box">
676 661 <div class="title">
677 662 <div class="breadcrumbs">${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</div>
678 663 </div>
679 664 <div class="table">
680 665 <div id="shortlog_data">
681 666 <%include file='../shortlog/shortlog_data.html'/>
682 667 </div>
683 668 ##%if c.repo_changesets:
684 669 ## ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
685 670 ##%endif
686 671 </div>
687 672 </div>
688 673 <div class="box">
689 674 <div class="title">
690 675 <div class="breadcrumbs">${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
691 676 </div>
692 677 <div class="table">
693 678 <%include file='../tags/tags_data.html'/>
694 679 %if c.repo_changesets:
695 680 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
696 681 %endif
697 682 </div>
698 683 </div>
699 684 <div class="box">
700 685 <div class="title">
701 686 <div class="breadcrumbs">${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
702 687 </div>
703 688 <div class="table">
704 689 <%include file='../branches/branches_data.html'/>
705 690 %if c.repo_changesets:
706 691 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
707 692 %endif
708 693 </div>
709 694 </div>
710 695
711 696 </%def>
General Comments 0
You need to be logged in to leave comments. Login now