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