comparison pylons_app/controllers/changelog.py @ 93:aec4c0071cb3

added empty controllers for branches tags files graph, routing and test for them
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 21 Apr 2010 00:26:11 +0200
parents
children 8b06c420491d
comparison
equal deleted inserted replaced
92:2968fb635787 93:aec4c0071cb3
1 import logging
2
3 from pylons import tmpl_context as c, app_globals as g, session, request, config, url
4 from pylons.controllers.util import abort, redirect
5
6 from pylons_app.lib.base import BaseController, render
7 from pylons_app.lib.utils import get_repo_slug
8 from pylons_app.model.hg_model import HgModel
9 from webhelpers.paginate import Page
10
11 log = logging.getLogger(__name__)
12
13 class ChangelogController(BaseController):
14 def __before__(self):
15 c.repos_prefix = config['repos_name']
16 c.staticurl = g.statics
17 c.repo_name = get_repo_slug(request)
18
19
20 def index(self):
21 hg_model = HgModel()
22 p = int(request.params.get('page', 1))
23 repo = hg_model.get_repo(c.repo_name)
24 c.repo_changesets = Page(repo, page=p, items_per_page=20)
25 c.shortlog_data = render('shortlog_data.html')
26 if request.params.get('partial'):
27 return c.shortlog_data
28 r = render('/shortlog.html')
29 return r