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