##// END OF EJS Templates
fixes translations, style updates....
marcink -
r410:9a7ae16f default
parent child Browse files
Show More
@@ -26,10 +26,11 b' from pylons import request, response, se'
26 26 from pylons.controllers.util import abort, redirect
27 27 from pylons_app.lib.auth import LoginRequired
28 28 from pylons_app.lib.base import BaseController, render
29 from pylons_app.lib.indexers import ANALYZER, IDX_LOCATION, SCHEMA
29 from pylons_app.lib.indexers import ANALYZER, IDX_LOCATION, SCHEMA, IDX_NAME
30 30 from webhelpers.html.builder import escape
31 31 from whoosh.highlight import highlight, SimpleFragmenter, HtmlFormatter, \
32 32 ContextFragmenter
33 from pylons.i18n.translation import _
33 34 from whoosh.index import open_dir, EmptyIndexError
34 35 from whoosh.qparser import QueryParser, QueryParserError
35 36 from whoosh.query import Phrase
@@ -56,7 +57,7 b' class SearchController(BaseController):'
56 57
57 58 if c.cur_query:
58 59 try:
59 idx = open_dir(IDX_LOCATION, indexname='HG_INDEX')
60 idx = open_dir(IDX_LOCATION, indexname=IDX_NAME)
60 61 searcher = idx.searcher()
61 62
62 63 qp = QueryParser("content", schema=SCHEMA)
@@ -99,12 +100,12 b' class SearchController(BaseController):'
99 100 c.formated_results.append(d)
100 101
101 102 except QueryParserError:
102 c.runtime = 'Invalid search query. Try quoting it.'
103 c.runtime = _('Invalid search query. Try quoting it.')
103 104
104 105 except (EmptyIndexError, IOError):
105 106 log.error(traceback.format_exc())
106 107 log.error('Empty Index data')
107 c.runtime = 'There is no index to search in. Please run whoosh indexer'
108 c.runtime = _('There is no index to search in. Please run whoosh indexer')
108 109
109 110
110 111
@@ -77,7 +77,8 b' class SummaryController(BaseController):'
77 77 y = td.year
78 78 m = td.month
79 79 d = td.day
80 c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month, d, 0, 0, 0, 0, 0, 0,))
80 c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month,
81 d, 0, 0, 0, 0, 0, 0,))
81 82 c.ts_max = mktime((y, m, d, 0, 0, 0, 0, 0, 0,))
82 83
83 84
@@ -93,25 +94,44 b' class SummaryController(BaseController):'
93 94 k = mktime(timetupple)
94 95 if aggregate.has_key(author_key_cleaner(cs.author)):
95 96 if aggregate[author_key_cleaner(cs.author)].has_key(k):
96 aggregate[author_key_cleaner(cs.author)][k] += 1
97 aggregate[author_key_cleaner(cs.author)][k]["commits"] += 1
98 aggregate[author_key_cleaner(cs.author)][k]["added"] += len(cs.added)
99 aggregate[author_key_cleaner(cs.author)][k]["changed"] += len(cs.changed)
100 aggregate[author_key_cleaner(cs.author)][k]["removed"] += len(cs.removed)
101
97 102 else:
98 103 #aggregate[author_key_cleaner(cs.author)].update(dates_range)
99 104 if k >= c.ts_min and k <= c.ts_max:
100 aggregate[author_key_cleaner(cs.author)][k] = 1
105 aggregate[author_key_cleaner(cs.author)][k] = {}
106 aggregate[author_key_cleaner(cs.author)][k]["commits"] = 1
107 aggregate[author_key_cleaner(cs.author)][k]["added"] = len(cs.added)
108 aggregate[author_key_cleaner(cs.author)][k]["changed"] = len(cs.changed)
109 aggregate[author_key_cleaner(cs.author)][k]["removed"] = len(cs.removed)
110
101 111 else:
102 112 if k >= c.ts_min and k <= c.ts_max:
103 113 aggregate[author_key_cleaner(cs.author)] = OrderedDict()
104 114 #aggregate[author_key_cleaner(cs.author)].update(dates_range)
105 aggregate[author_key_cleaner(cs.author)][k] = 1
115 aggregate[author_key_cleaner(cs.author)][k] = {}
116 aggregate[author_key_cleaner(cs.author)][k]["commits"] = 1
117 aggregate[author_key_cleaner(cs.author)][k]["added"] = len(cs.added)
118 aggregate[author_key_cleaner(cs.author)][k]["changed"] = len(cs.changed)
119 aggregate[author_key_cleaner(cs.author)][k]["removed"] = len(cs.removed)
106 120
107 121 d = ''
108 122 tmpl0 = u""""%s":%s"""
109 tmpl1 = u"""{label:"%s",data:%s},"""
123 tmpl1 = u"""{label:"%s",data:%s,schema:["commits"]},"""
110 124 for author in aggregate:
125
111 126 d += tmpl0 % (author.decode('utf8'),
112 127 tmpl1 \
113 128 % (author.decode('utf8'),
114 [[x, aggregate[author][x]] for x in aggregate[author]]))
129 [{"time":x,
130 "commits":aggregate[author][x]['commits'],
131 "added":aggregate[author][x]['added'],
132 "changed":aggregate[author][x]['changed'],
133 "removed":aggregate[author][x]['removed'],
134 } for x in aggregate[author]]))
115 135 if d == '':
116 136 d = '"%s":{label:"%s",data:[[0,1],]}' \
117 137 % (author_key_cleaner(repo.contact),
@@ -67,7 +67,7 b' table.code-difftable td {'
67 67 padding-left:2px;
68 68 padding-right:2px;
69 69 text-align:right;
70 width:20px;
70 width:30px;
71 71 -moz-user-select:none;
72 72 -webkit-user-select: none;
73 73 }
@@ -185,7 +185,7 b' div.options a:hover'
185 185 #header
186 186 {
187 187 margin: 0;
188 padding: 0 60px 0 60px;
188 padding: 0 30px 0 30px;
189 189 background: #b0b0b0 url("../images/header_background.png") repeat;
190 190 }
191 191
@@ -2,7 +2,7 b''
2 2 GLOBAL WIDTH
3 3 ----------------------------------------------------------- */
4 4 #header,#content,#footer{
5 min-width: 1024px;
5 min-width: 1224px;
6 6 }
7 7
8 8 /* -----------------------------------------------------------
@@ -11,7 +11,7 b''
11 11
12 12 #content
13 13 {
14 margin: 10px 60px 0 60px;
14 margin: 10px 30px 0 30px;
15 15 padding: 0;
16 16 min-height: 100%;
17 17 clear: both;
@@ -26,7 +26,8 b''
26 26 <h2>${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.file.path)}</h2>
27 27 <dl class="overview">
28 28 <dt>${_('Last revision')}</dt>
29 <dd>r${c.file.last_changeset.revision}:${c.file.last_changeset._short}</dd>
29 <dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset._short),
30 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset._short,f_path=c.f_path))} </dd>
30 31 <dt>${_('Size')}</dt>
31 32 <dd>${h.format_byte_size(c.file.size,binary=True)}</dd>
32 33 <dt>${_('Options')}</dt>
@@ -1,6 +1,9 b''
1 1 <dl>
2 2 <dt>${_('Last revision')}</dt>
3 <dd>r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</dd>
3 <dd>
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset._short),
5 h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset._short,f_path=c.f_path))}
6 </dd>
4 7 <dt>${_('Size')}</dt>
5 8 <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
6 9 <dt>${_('Options')}</dt>
@@ -11,11 +14,13 b''
11 14 </dd>
12 15 <dt>${_('History')}</dt>
13 16 <dd>
14 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='GET')}
17 <div>
18 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
15 19 ${h.hidden('diff2',c.files_list.last_changeset._short)}
16 20 ${h.select('diff1','',c.file_history)}
17 21 ${h.submit('diff','diff',class_="ui-button ui-widget ui-state-default ui-corner-all")}
18 22 ${h.end_form()}
23 </div>
19 24 </dd>
20 25 </dl>
21 26
@@ -118,14 +118,14 b' E.onDOMReady(function(e){'
118 118 </div>
119 119 </div>
120 120
121 <div class="box box-right">
121 <div class="box box-right" style="min-height:455px">
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 <div id="commit_history" style="width:460px;height:370px;float:left"></div>
128 <div id="commit_history" style="width:560px;height:300px;float:left"></div>
129 129 <div id="legend_data">
130 130 <div id="legend_container"></div>
131 131 <div id="legend_choices">
@@ -142,11 +142,10 b' E.onDOMReady(function(e){'
142 142 for(var key in datasets) {
143 143 datasets[key].color = i;
144 144 i++;
145 choiceContainerTable.innerHTML += '<tr>'+
146 '<td>'+
147 '<input type="checkbox" name="' + key +'" checked="checked" />'+datasets[key].label+
148 '</td>'+
149 '</tr>';
145 choiceContainerTable.innerHTML += '<tr><td>'+
146 '<input type="checkbox" name="' + key +'" checked="checked" />'
147 +datasets[key].label+
148 '</td></tr>';
150 149 };
151 150
152 151
@@ -164,6 +163,7 b' E.onDOMReady(function(e){'
164 163 };
165 164
166 165 if (data.length > 0){
166
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 },
@@ -218,11 +218,29 b' E.onDOMReady(function(e){'
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 var suffix = '';
222 if(nr_commits > 1){
223 var suffix = 's';
224 }
225 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd + ": " + nr_commits+" commit" + suffix);
221
222 var cur_data = datasets[item.series.label].data[item.dataIndex];
223 var added = cur_data.added;
224 var changed = cur_data.changed;
225 var removed = cur_data.removed;
226
227 var nr_commits_suffix = " ${_('commits')} ";
228 var added_suffix = " ${_('files added')} ";
229 var changed_suffix = " ${_('files changed')} ";
230 var removed_suffix = " ${_('files removed')} ";
231
232
233 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
234 if(added==1){added_suffix=" ${_('file added')} ";}
235 if(changed==1){changed_suffix=" ${_('file changed')} ";}
236 if(removed==1){removed_suffix=" ${_('file removed')} ";}
237
238 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
239 +'<br/>'+
240 nr_commits + nr_commits_suffix+'<br/>'+
241 added + added_suffix +'<br/>'+
242 changed + changed_suffix + '<br/>'+
243 removed + removed_suffix + '<br/>');
226 244 }
227 245 }
228 246 else {
@@ -253,6 +271,7 b' E.onDOMReady(function(e){'
253 271 </div>
254 272 <div class="table">
255 273 <%include file='../shortlog/shortlog_data.html'/>
274 ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
256 275 </div>
257 276 </div>
258 277 <div class="box">
@@ -261,6 +280,7 b' E.onDOMReady(function(e){'
261 280 </div>
262 281 <div class="table">
263 282 <%include file='../tags/tags_data.html'/>
283 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
264 284 </div>
265 285 </div>
266 286 <div class="box">
@@ -269,6 +289,7 b' E.onDOMReady(function(e){'
269 289 </div>
270 290 <div class="table">
271 291 <%include file='../branches/branches_data.html'/>
292 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
272 293 </div>
273 294 </div>
274 295
General Comments 0
You need to be logged in to leave comments. Login now