Mercurial > kallithea
diff rhodecode/controllers/journal.py @ 995:d14723711d17 beta
fixes for journal, added paging now it's possible to view whole journal
fixed tooltip events for shortlog and journal paging. Moved journal to it's own templates
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 04 Feb 2011 17:36:41 +0100 |
parents | 7f9d23f6a526 |
children | 229437211bef |
line wrap: on
line diff
--- a/rhodecode/controllers/journal.py Fri Feb 04 13:40:38 2011 +0100 +++ b/rhodecode/controllers/journal.py Fri Feb 04 17:36:41 2011 +0100 @@ -30,10 +30,11 @@ from pylons import request, response, session, tmpl_context as c, url +from webhelpers.paginate import Page + from rhodecode.lib.auth import LoginRequired, NotAnonymous from rhodecode.lib.base import BaseController, render from rhodecode.lib.helpers import get_token -from rhodecode.lib.utils import OrderedDict from rhodecode.model.db import UserLog, UserFollowing from rhodecode.model.scm import ScmModel @@ -65,13 +66,17 @@ UserLog.repository_id.in_(repo_ids), UserLog.user_id.in_(user_ids), ))\ - .order_by(UserLog.action_date.desc())\ - .limit(30)\ - .all() + .order_by(UserLog.action_date.desc()) + - c.journal_day_aggreagate = self._get_daily_aggregate(journal) + p = int(request.params.get('page', 1)) + c.journal_pager = Page(journal, page=p, items_per_page=10) + c.journal_day_aggreagate = self._get_daily_aggregate(c.journal_pager) + c.journal_data = render('journal/journal_data.html') + if request.params.get('partial'): + return c.journal_data - return render('/journal.html') + return render('journal/journal.html') def _get_daily_aggregate(self, journal):