##// END OF EJS Templates
implemented rawdiff and diff download into diff view....
implemented rawdiff and diff download into diff view. Few css changes

File last commit:

r135:28f28d42 default
r160:0f7f93df default
Show More
hg.py
39 lines | 1.3 KiB | text/x-python | PythonLexer
Marcin Kuzminski
initial commit.
r0 #!/usr/bin/python
# -*- coding: utf-8 -*-
removed ununsed imports
r135 import logging
added empty controllers for branches tags files graph, routing and test for them
r93 from operator import itemgetter
removed ununsed imports
r135 from pylons import tmpl_context as c, request, config
Marcin Kuzminski
refactoring update
r76 from pylons_app.lib.base import BaseController, render
Marcin Kuzminski
Moved summary to seperate controller,...
r82 from pylons_app.lib.utils import get_repo_slug
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 from pylons_app.model.hg_model import HgModel
added empty controllers for branches tags files graph, routing and test for them
r93 from beaker.cache import cache_region
Marcin Kuzminski
major app speedup moved the wsgi creation to app globals, in order to make it run only once....
r10 log = logging.getLogger(__name__)
Marcin Kuzminski
initial commit.
r0
class HgController(BaseController):
Marcin Kuzminski
Wrapped into mako templates,...
r21
def __before__(self):
Marcin Kuzminski
Added app basic auth....
r41 c.repos_prefix = config['repos_name']
Marcin Kuzminski
Moved summary to seperate controller,...
r82 c.repo_name = get_repo_slug(request)
Marcin Kuzminski
Implemented index page using vcs
r55 def index(self):
added empty controllers for branches tags files graph, routing and test for them
r93
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 hg_model = HgModel()
added empty controllers for branches tags files graph, routing and test for them
r93 @cache_region('short_term', 'repo_list')
def _list():
return list(hg_model.get_repos())
c.repos_list = _list()
Marcin Kuzminski
Implemented main page sorting
r57 c.current_sort = request.GET.get('sort', 'name')
Marcin Kuzminski
Implemented index page using vcs
r55
Marcin Kuzminski
Implemented main page sorting
r57 cs = c.current_sort
c.cs_slug = cs.replace('-', '')
sortables = ['name', 'description', 'last_change', 'tip', 'contact']
if cs and c.cs_slug in sortables:
sort_key = c.cs_slug + '_sort'
if cs.startswith('-'):
c.repos_list.sort(key=itemgetter(sort_key), reverse=True)
else:
c.repos_list.sort(key=itemgetter(sort_key), reverse=False)
Marcin Kuzminski
Implemented index page using vcs
r55 return render('/index.html')