diff --git a/pylons_app/controllers/search.py b/pylons_app/controllers/search.py --- a/pylons_app/controllers/search.py +++ b/pylons_app/controllers/search.py @@ -26,10 +26,11 @@ from pylons import request, response, se from pylons.controllers.util import abort, redirect from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render -from pylons_app.lib.indexers import ANALYZER, IDX_LOCATION, SCHEMA +from pylons_app.lib.indexers import ANALYZER, IDX_LOCATION, SCHEMA, IDX_NAME from webhelpers.html.builder import escape from whoosh.highlight import highlight, SimpleFragmenter, HtmlFormatter, \ ContextFragmenter +from pylons.i18n.translation import _ from whoosh.index import open_dir, EmptyIndexError from whoosh.qparser import QueryParser, QueryParserError from whoosh.query import Phrase @@ -56,7 +57,7 @@ class SearchController(BaseController): if c.cur_query: try: - idx = open_dir(IDX_LOCATION, indexname='HG_INDEX') + idx = open_dir(IDX_LOCATION, indexname=IDX_NAME) searcher = idx.searcher() qp = QueryParser("content", schema=SCHEMA) @@ -99,12 +100,12 @@ class SearchController(BaseController): c.formated_results.append(d) except QueryParserError: - c.runtime = 'Invalid search query. Try quoting it.' + c.runtime = _('Invalid search query. Try quoting it.') except (EmptyIndexError, IOError): log.error(traceback.format_exc()) log.error('Empty Index data') - c.runtime = 'There is no index to search in. Please run whoosh indexer' + c.runtime = _('There is no index to search in. Please run whoosh indexer') diff --git a/pylons_app/controllers/summary.py b/pylons_app/controllers/summary.py --- a/pylons_app/controllers/summary.py +++ b/pylons_app/controllers/summary.py @@ -77,7 +77,8 @@ class SummaryController(BaseController): y = td.year m = td.month d = td.day - c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month, d, 0, 0, 0, 0, 0, 0,)) + c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month, + d, 0, 0, 0, 0, 0, 0,)) c.ts_max = mktime((y, m, d, 0, 0, 0, 0, 0, 0,)) @@ -93,25 +94,44 @@ class SummaryController(BaseController): k = mktime(timetupple) if aggregate.has_key(author_key_cleaner(cs.author)): if aggregate[author_key_cleaner(cs.author)].has_key(k): - aggregate[author_key_cleaner(cs.author)][k] += 1 + aggregate[author_key_cleaner(cs.author)][k]["commits"] += 1 + aggregate[author_key_cleaner(cs.author)][k]["added"] += len(cs.added) + aggregate[author_key_cleaner(cs.author)][k]["changed"] += len(cs.changed) + aggregate[author_key_cleaner(cs.author)][k]["removed"] += len(cs.removed) + else: #aggregate[author_key_cleaner(cs.author)].update(dates_range) if k >= c.ts_min and k <= c.ts_max: - aggregate[author_key_cleaner(cs.author)][k] = 1 + aggregate[author_key_cleaner(cs.author)][k] = {} + aggregate[author_key_cleaner(cs.author)][k]["commits"] = 1 + aggregate[author_key_cleaner(cs.author)][k]["added"] = len(cs.added) + aggregate[author_key_cleaner(cs.author)][k]["changed"] = len(cs.changed) + aggregate[author_key_cleaner(cs.author)][k]["removed"] = len(cs.removed) + else: if k >= c.ts_min and k <= c.ts_max: aggregate[author_key_cleaner(cs.author)] = OrderedDict() #aggregate[author_key_cleaner(cs.author)].update(dates_range) - aggregate[author_key_cleaner(cs.author)][k] = 1 + aggregate[author_key_cleaner(cs.author)][k] = {} + aggregate[author_key_cleaner(cs.author)][k]["commits"] = 1 + aggregate[author_key_cleaner(cs.author)][k]["added"] = len(cs.added) + aggregate[author_key_cleaner(cs.author)][k]["changed"] = len(cs.changed) + aggregate[author_key_cleaner(cs.author)][k]["removed"] = len(cs.removed) d = '' tmpl0 = u""""%s":%s""" - tmpl1 = u"""{label:"%s",data:%s},""" + tmpl1 = u"""{label:"%s",data:%s,schema:["commits"]},""" for author in aggregate: + d += tmpl0 % (author.decode('utf8'), tmpl1 \ % (author.decode('utf8'), - [[x, aggregate[author][x]] for x in aggregate[author]])) + [{"time":x, + "commits":aggregate[author][x]['commits'], + "added":aggregate[author][x]['added'], + "changed":aggregate[author][x]['changed'], + "removed":aggregate[author][x]['removed'], + } for x in aggregate[author]])) if d == '': d = '"%s":{label:"%s",data:[[0,1],]}' \ % (author_key_cleaner(repo.contact), diff --git a/pylons_app/public/css/diff.css b/pylons_app/public/css/diff.css --- a/pylons_app/public/css/diff.css +++ b/pylons_app/public/css/diff.css @@ -67,7 +67,7 @@ table.code-difftable td { padding-left:2px; padding-right:2px; text-align:right; - width:20px; + width:30px; -moz-user-select:none; -webkit-user-select: none; } diff --git a/pylons_app/public/css/style.css b/pylons_app/public/css/style.css --- a/pylons_app/public/css/style.css +++ b/pylons_app/public/css/style.css @@ -185,7 +185,7 @@ div.options a:hover #header { margin: 0; - padding: 0 60px 0 60px; + padding: 0 30px 0 30px; background: #b0b0b0 url("../images/header_background.png") repeat; } diff --git a/pylons_app/public/css/style_full.css b/pylons_app/public/css/style_full.css --- a/pylons_app/public/css/style_full.css +++ b/pylons_app/public/css/style_full.css @@ -2,7 +2,7 @@ GLOBAL WIDTH ----------------------------------------------------------- */ #header,#content,#footer{ - min-width: 1024px; + min-width: 1224px; } /* ----------------------------------------------------------- @@ -11,7 +11,7 @@ #content { - margin: 10px 60px 0 60px; + margin: 10px 30px 0 30px; padding: 0; min-height: 100%; clear: both; diff --git a/pylons_app/templates/files/files_annotate.html b/pylons_app/templates/files/files_annotate.html --- a/pylons_app/templates/files/files_annotate.html +++ b/pylons_app/templates/files/files_annotate.html @@ -26,7 +26,8 @@