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