##// END OF EJS Templates
small fix for summary graph
marcink -
r480:aab23dae celery
parent child Browse files
Show More
@@ -1,301 +1,301 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${_('Mercurial Repository Overview')}
4 ${_('Mercurial Repository Overview')}
5 </%def>
5 </%def>
6
6
7 <%def name="breadcrumbs_links()">
7 <%def name="breadcrumbs_links()">
8 ${h.link_to(u'Home',h.url('/'))}
8 ${h.link_to(u'Home',h.url('/'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
11 &raquo;
11 &raquo;
12 ${_('summary')}
12 ${_('summary')}
13 </%def>
13 </%def>
14
14
15 <%def name="page_nav()">
15 <%def name="page_nav()">
16 ${self.menu('summary')}
16 ${self.menu('summary')}
17 </%def>
17 </%def>
18
18
19 <%def name="main()">
19 <%def name="main()">
20 <script type="text/javascript">
20 <script type="text/javascript">
21 var E = YAHOO.util.Event;
21 var E = YAHOO.util.Event;
22 var D = YAHOO.util.Dom;
22 var D = YAHOO.util.Dom;
23
23
24 E.onDOMReady(function(e){
24 E.onDOMReady(function(e){
25 id = 'clone_url';
25 id = 'clone_url';
26 E.addListener(id,'click',function(e){
26 E.addListener(id,'click',function(e){
27 D.get('clone_url').select();
27 D.get('clone_url').select();
28 })
28 })
29 })
29 })
30 </script>
30 </script>
31 <div class="box box-left">
31 <div class="box box-left">
32 <!-- box / title -->
32 <!-- box / title -->
33 <div class="title">
33 <div class="title">
34 ${self.breadcrumbs()}
34 ${self.breadcrumbs()}
35 </div>
35 </div>
36 <!-- end box / title -->
36 <!-- end box / title -->
37 <div class="form">
37 <div class="form">
38 <div class="fields">
38 <div class="fields">
39
39
40 <div class="field">
40 <div class="field">
41 <div class="label">
41 <div class="label">
42 <label>${_('Name')}:</label>
42 <label>${_('Name')}:</label>
43 </div>
43 </div>
44 <div class="input-short">
44 <div class="input-short">
45 <span style="font-size: 1.6em;font-weight: bold">${c.repo_info.name}</span>
45 <span style="font-size: 1.6em;font-weight: bold">${c.repo_info.name}</span>
46 </div>
46 </div>
47 </div>
47 </div>
48
48
49
49
50 <div class="field">
50 <div class="field">
51 <div class="label">
51 <div class="label">
52 <label>${_('Description')}:</label>
52 <label>${_('Description')}:</label>
53 </div>
53 </div>
54 <div class="input-short">
54 <div class="input-short">
55 ${c.repo_info.description}
55 ${c.repo_info.description}
56 </div>
56 </div>
57 </div>
57 </div>
58
58
59
59
60 <div class="field">
60 <div class="field">
61 <div class="label">
61 <div class="label">
62 <label>${_('Contact')}:</label>
62 <label>${_('Contact')}:</label>
63 </div>
63 </div>
64 <div class="input-short">
64 <div class="input-short">
65 <div class="gravatar">
65 <div class="gravatar">
66 <img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
66 <img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
67 </div>
67 </div>
68 ${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
68 ${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
69 ${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
69 ${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
70 ${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
70 ${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
71 </div>
71 </div>
72 </div>
72 </div>
73
73
74 <div class="field">
74 <div class="field">
75 <div class="label">
75 <div class="label">
76 <label>${_('Last change')}:</label>
76 <label>${_('Last change')}:</label>
77 </div>
77 </div>
78 <div class="input-short">
78 <div class="input-short">
79 ${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}
79 ${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}
80 </div>
80 </div>
81 </div>
81 </div>
82
82
83 <div class="field">
83 <div class="field">
84 <div class="label">
84 <div class="label">
85 <label>${_('Clone url')}:</label>
85 <label>${_('Clone url')}:</label>
86 </div>
86 </div>
87 <div class="input-short">
87 <div class="input-short">
88 <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
88 <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
89 </div>
89 </div>
90 </div>
90 </div>
91
91
92 <div class="field">
92 <div class="field">
93 <div class="label">
93 <div class="label">
94 <label>${_('Download')}:</label>
94 <label>${_('Download')}:</label>
95 </div>
95 </div>
96 <div class="input-short">
96 <div class="input-short">
97 %for cnt,archive in enumerate(c.repo_info._get_archives()):
97 %for cnt,archive in enumerate(c.repo_info._get_archives()):
98 %if cnt >=1:
98 %if cnt >=1:
99 |
99 |
100 %endif
100 %endif
101 ${h.link_to(c.repo_info.name+'.'+archive['type'],
101 ${h.link_to(c.repo_info.name+'.'+archive['type'],
102 h.url('files_archive_home',repo_name=c.repo_info.name,
102 h.url('files_archive_home',repo_name=c.repo_info.name,
103 revision='tip',fileformat=archive['extension']),class_="archive_icon")}
103 revision='tip',fileformat=archive['extension']),class_="archive_icon")}
104 %endfor
104 %endfor
105 </div>
105 </div>
106 </div>
106 </div>
107
107
108 <div class="field">
108 <div class="field">
109 <div class="label">
109 <div class="label">
110 <label>${_('Feeds')}:</label>
110 <label>${_('Feeds')}:</label>
111 </div>
111 </div>
112 <div class="input-short">
112 <div class="input-short">
113 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_icon')}
113 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_icon')}
114 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_icon')}
114 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_icon')}
115 </div>
115 </div>
116 </div>
116 </div>
117 </div>
117 </div>
118 </div>
118 </div>
119 </div>
119 </div>
120
120
121 <div class="box box-right" style="min-height:455px">
121 <div class="box box-right" style="min-height:455px">
122 <!-- box / title -->
122 <!-- box / title -->
123 <div class="title">
123 <div class="title">
124 <h5>${_('Last month commit activity')}</h5>
124 <h5>${_('Last month commit activity')}</h5>
125 </div>
125 </div>
126
126
127 <div class="table">
127 <div class="table">
128 <div id="commit_history" style="width:560px;height:300px;float:left"></div>
128 <div id="commit_history" style="width:560px;height:300px;float:left"></div>
129 <div id="legend_data">
129 <div id="legend_data" style="clear:both;margin-top:10px">
130 <div id="legend_container"></div>
130 <div id="legend_container"></div>
131 <div id="legend_choices">
131 <div id="legend_choices">
132 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
132 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
133 </div>
133 </div>
134 </div>
134 </div>
135 <script type="text/javascript">
135 <script type="text/javascript">
136
136
137 (function () {
137 (function () {
138 var datasets = {${c.commit_data|n}};
138 var datasets = {${c.commit_data|n}};
139 var i = 0;
139 var i = 0;
140 var choiceContainer = YAHOO.util.Dom.get("legend_choices");
140 var choiceContainer = YAHOO.util.Dom.get("legend_choices");
141 var choiceContainerTable = YAHOO.util.Dom.get("legend_choices_tables");
141 var choiceContainerTable = YAHOO.util.Dom.get("legend_choices_tables");
142 for(var key in datasets) {
142 for(var key in datasets) {
143 datasets[key].color = i;
143 datasets[key].color = i;
144 i++;
144 i++;
145 choiceContainerTable.innerHTML += '<tr><td>'+
145 choiceContainerTable.innerHTML += '<tr><td>'+
146 '<input type="checkbox" name="' + key +'" checked="checked" />'
146 '<input type="checkbox" name="' + key +'" checked="checked" />'
147 +datasets[key].label+
147 +datasets[key].label+
148 '</td></tr>';
148 '</td></tr>';
149 };
149 };
150
150
151
151
152 function plotAccordingToChoices() {
152 function plotAccordingToChoices() {
153 var data = [];
153 var data = [];
154
154
155 var inputs = choiceContainer.getElementsByTagName("input");
155 var inputs = choiceContainer.getElementsByTagName("input");
156 for(var i=0; i<inputs.length; i++) {
156 for(var i=0; i<inputs.length; i++) {
157 var key = inputs[i].name;
157 var key = inputs[i].name;
158 if (key && datasets[key]){
158 if (key && datasets[key]){
159 if(!inputs[i].checked){
159 if(!inputs[i].checked){
160 data.push({label:key,data:[[0,1],]});
160 data.push({label:key,data:[[0,1],]});
161 }
161 }
162 else{
162 else{
163 data.push(datasets[key]);
163 data.push(datasets[key]);
164 }
164 }
165
165
166 }
166 }
167
167
168 };
168 };
169
169
170 if (data.length > 0){
170 if (data.length > 0){
171
171
172 var plot = YAHOO.widget.Flot("commit_history", data,
172 var plot = YAHOO.widget.Flot("commit_history", data,
173 { bars: { show: true, align:'center',lineWidth:4 },
173 { bars: { show: true, align:'center',lineWidth:4 },
174 points: { show: true, radius:0,fill:true },
174 points: { show: true, radius:0,fill:true },
175 legend:{show:true, container:"legend_container"},
175 legend:{show:true, container:"legend_container"},
176 selection: { mode: "xy" },
176 selection: { mode: "xy" },
177 yaxis: {tickDecimals:0},
177 yaxis: {tickDecimals:0},
178 xaxis: { mode: "time", timeformat: "%d",tickSize:[1, "day"],min:${c.ts_min},max:${c.ts_max} },
178 xaxis: { mode: "time", timeformat: "%d",tickSize:[1, "day"],min:${c.ts_min},max:${c.ts_max} },
179 grid: { hoverable: true, clickable: true,autoHighlight:true },
179 grid: { hoverable: true, clickable: true,autoHighlight:true },
180 });
180 });
181
181
182 function showTooltip(x, y, contents) {
182 function showTooltip(x, y, contents) {
183 var div=document.getElementById('tooltip');
183 var div=document.getElementById('tooltip');
184 if(!div) {
184 if(!div) {
185 div = document.createElement('div');
185 div = document.createElement('div');
186 div.id="tooltip";
186 div.id="tooltip";
187 div.style.position="absolute";
187 div.style.position="absolute";
188 div.style.border='1px solid #fdd';
188 div.style.border='1px solid #fdd';
189 div.style.padding='2px';
189 div.style.padding='2px';
190 div.style.backgroundColor='#fee';
190 div.style.backgroundColor='#fee';
191 document.body.appendChild(div);
191 document.body.appendChild(div);
192 }
192 }
193 YAHOO.util.Dom.setStyle(div, 'opacity', 0);
193 YAHOO.util.Dom.setStyle(div, 'opacity', 0);
194 div.innerHTML = contents;
194 div.innerHTML = contents;
195 div.style.top=(y + 5) + "px";
195 div.style.top=(y + 5) + "px";
196 div.style.left=(x + 5) + "px";
196 div.style.left=(x + 5) + "px";
197
197
198 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
198 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
199 anim.animate();
199 anim.animate();
200 }
200 }
201
201
202 var previousPoint = null;
202 var previousPoint = null;
203 plot.subscribe("plothover", function (o) {
203 plot.subscribe("plothover", function (o) {
204 var pos = o.pos;
204 var pos = o.pos;
205 var item = o.item;
205 var item = o.item;
206
206
207 //YAHOO.util.Dom.get("x").innerHTML = pos.x.toFixed(2);
207 //YAHOO.util.Dom.get("x").innerHTML = pos.x.toFixed(2);
208 //YAHOO.util.Dom.get("y").innerHTML = pos.y.toFixed(2);
208 //YAHOO.util.Dom.get("y").innerHTML = pos.y.toFixed(2);
209 if (item) {
209 if (item) {
210 if (previousPoint != item.datapoint) {
210 if (previousPoint != item.datapoint) {
211 previousPoint = item.datapoint;
211 previousPoint = item.datapoint;
212
212
213 var tooltip = YAHOO.util.Dom.get("tooltip");
213 var tooltip = YAHOO.util.Dom.get("tooltip");
214 if(tooltip) {
214 if(tooltip) {
215 tooltip.parentNode.removeChild(tooltip);
215 tooltip.parentNode.removeChild(tooltip);
216 }
216 }
217 var x = item.datapoint.x.toFixed(2);
217 var x = item.datapoint.x.toFixed(2);
218 var y = item.datapoint.y.toFixed(2);
218 var y = item.datapoint.y.toFixed(2);
219
219
220 if (!item.series.label){
220 if (!item.series.label){
221 item.series.label = 'commits';
221 item.series.label = 'commits';
222 }
222 }
223 var d = new Date(x*1000);
223 var d = new Date(x*1000);
224 var fd = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate();
224 var fd = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate();
225 var nr_commits = parseInt(y);
225 var nr_commits = parseInt(y);
226
226
227 var cur_data = datasets[item.series.label].data[item.dataIndex];
227 var cur_data = datasets[item.series.label].data[item.dataIndex];
228 var added = cur_data.added;
228 var added = cur_data.added;
229 var changed = cur_data.changed;
229 var changed = cur_data.changed;
230 var removed = cur_data.removed;
230 var removed = cur_data.removed;
231
231
232 var nr_commits_suffix = " ${_('commits')} ";
232 var nr_commits_suffix = " ${_('commits')} ";
233 var added_suffix = " ${_('files added')} ";
233 var added_suffix = " ${_('files added')} ";
234 var changed_suffix = " ${_('files changed')} ";
234 var changed_suffix = " ${_('files changed')} ";
235 var removed_suffix = " ${_('files removed')} ";
235 var removed_suffix = " ${_('files removed')} ";
236
236
237
237
238 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
238 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
239 if(added==1){added_suffix=" ${_('file added')} ";}
239 if(added==1){added_suffix=" ${_('file added')} ";}
240 if(changed==1){changed_suffix=" ${_('file changed')} ";}
240 if(changed==1){changed_suffix=" ${_('file changed')} ";}
241 if(removed==1){removed_suffix=" ${_('file removed')} ";}
241 if(removed==1){removed_suffix=" ${_('file removed')} ";}
242
242
243 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
243 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
244 +'<br/>'+
244 +'<br/>'+
245 nr_commits + nr_commits_suffix+'<br/>'+
245 nr_commits + nr_commits_suffix+'<br/>'+
246 added + added_suffix +'<br/>'+
246 added + added_suffix +'<br/>'+
247 changed + changed_suffix + '<br/>'+
247 changed + changed_suffix + '<br/>'+
248 removed + removed_suffix + '<br/>');
248 removed + removed_suffix + '<br/>');
249 }
249 }
250 }
250 }
251 else {
251 else {
252 var tooltip = YAHOO.util.Dom.get("tooltip");
252 var tooltip = YAHOO.util.Dom.get("tooltip");
253
253
254 if(tooltip) {
254 if(tooltip) {
255 tooltip.parentNode.removeChild(tooltip);
255 tooltip.parentNode.removeChild(tooltip);
256 }
256 }
257 previousPoint = null;
257 previousPoint = null;
258 }
258 }
259 });
259 });
260
260
261 }
261 }
262 }
262 }
263
263
264 YAHOO.util.Event.on(choiceContainer.getElementsByTagName("input"), "click", plotAccordingToChoices);
264 YAHOO.util.Event.on(choiceContainer.getElementsByTagName("input"), "click", plotAccordingToChoices);
265
265
266 plotAccordingToChoices();
266 plotAccordingToChoices();
267 })();
267 })();
268 </script>
268 </script>
269
269
270 </div>
270 </div>
271 </div>
271 </div>
272
272
273 <div class="box">
273 <div class="box">
274 <div class="title">
274 <div class="title">
275 <div class="breadcrumbs">${h.link_to(_('Last ten changes'),h.url('changelog_home',repo_name=c.repo_name))}</div>
275 <div class="breadcrumbs">${h.link_to(_('Last ten changes'),h.url('changelog_home',repo_name=c.repo_name))}</div>
276 </div>
276 </div>
277 <div class="table">
277 <div class="table">
278 <%include file='../shortlog/shortlog_data.html'/>
278 <%include file='../shortlog/shortlog_data.html'/>
279 ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
279 ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
280 </div>
280 </div>
281 </div>
281 </div>
282 <div class="box">
282 <div class="box">
283 <div class="title">
283 <div class="title">
284 <div class="breadcrumbs">${h.link_to(_('Last ten tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
284 <div class="breadcrumbs">${h.link_to(_('Last ten tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
285 </div>
285 </div>
286 <div class="table">
286 <div class="table">
287 <%include file='../tags/tags_data.html'/>
287 <%include file='../tags/tags_data.html'/>
288 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
288 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
289 </div>
289 </div>
290 </div>
290 </div>
291 <div class="box">
291 <div class="box">
292 <div class="title">
292 <div class="title">
293 <div class="breadcrumbs">${h.link_to(_('Last ten branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
293 <div class="breadcrumbs">${h.link_to(_('Last ten branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
294 </div>
294 </div>
295 <div class="table">
295 <div class="table">
296 <%include file='../branches/branches_data.html'/>
296 <%include file='../branches/branches_data.html'/>
297 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
297 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
298 </div>
298 </div>
299 </div>
299 </div>
300
300
301 </%def> No newline at end of file
301 </%def>
General Comments 0
You need to be logged in to leave comments. Login now