Mercurial > kallithea
comparison pylons_app/controllers/hg.py @ 74:cdf4fda66dd9
Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
author | Marcin Kuzminski <marcin@python-blog.com> |
---|---|
date | Mon, 12 Apr 2010 10:29:18 +0200 |
parents | 8fb1abd4178a |
children | 71401840ed86 |
comparison
equal
deleted
inserted
replaced
73:55d7f2502dfb | 74:cdf4fda66dd9 |
---|---|
37 | 37 |
38 return render('/index.html') | 38 return render('/index.html') |
39 | 39 |
40 def view(self, *args, **kwargs): | 40 def view(self, *args, **kwargs): |
41 #TODO: reimplement this not tu use hgwebdir | 41 #TODO: reimplement this not tu use hgwebdir |
42 | |
43 vcs_impl = self._get_vcs_impl(request.environ) | |
44 if vcs_impl: | |
45 return vcs_impl | |
42 response = g.hgapp(request.environ, self.start_response) | 46 response = g.hgapp(request.environ, self.start_response) |
43 | 47 |
44 http_accept = request.environ.get('HTTP_ACCEPT', False) | 48 http_accept = request.environ.get('HTTP_ACCEPT', False) |
45 if not http_accept: | 49 if not http_accept: |
46 return abort(status_code=400, detail='no http accept in header') | 50 return abort(status_code=400, detail='no http accept in header') |
61 template = Template(tmpl, lookup=request.environ['pylons.pylons']\ | 65 template = Template(tmpl, lookup=request.environ['pylons.pylons']\ |
62 .config['pylons.app_globals'].mako_lookup, disable_unicode=True) | 66 .config['pylons.app_globals'].mako_lookup, disable_unicode=True) |
63 | 67 |
64 | 68 |
65 return template.render(g=g, c=c, session=session, h=h) | 69 return template.render(g=g, c=c, session=session, h=h) |
70 | |
71 | |
72 | |
73 | |
74 def _get_vcs_impl(self, environ): | |
75 path_info = environ['PATH_INFO'] | |
76 c.repo_name = path_info.split('/')[-2] | |
77 action = path_info.split('/')[-1] | |
78 if not action.startswith('_'): | |
79 return False | |
80 else: | |
81 hg_model = HgModel() | |
82 c.repo_info = hg_model.get_repo(c.repo_name) | |
83 c.repo_changesets = c.repo_info.get_changesets(10) | |
84 return render('/summary.html') |