Mercurial > kallithea
comparison rhodecode/controllers/home.py @ 1482:a39c0e5fca89 beta
removed obsolete sort code
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 22 Sep 2011 03:08:02 +0300 |
parents | eee3cb592099 |
children | bf263968da47 0069657aaf42 |
comparison
equal
deleted
inserted
replaced
1481:605707b50d7c | 1482:a39c0e5fca89 |
---|---|
41 @LoginRequired() | 41 @LoginRequired() |
42 def __before__(self): | 42 def __before__(self): |
43 super(HomeController, self).__before__() | 43 super(HomeController, self).__before__() |
44 | 44 |
45 def index(self): | 45 def index(self): |
46 sortables = ['name', 'description', 'last_change', 'tip', 'owner'] | |
47 current_sort = request.GET.get('sort', 'name') | |
48 current_sort_slug = current_sort.replace('-', '') | |
49 | 46 |
50 if current_sort_slug not in sortables: | 47 c.repos_list = self.scm_model.get_repos() |
51 c.sort_by = 'name' | |
52 current_sort_slug = c.sort_by | |
53 else: | |
54 c.sort_by = current_sort | |
55 c.sort_slug = current_sort_slug | |
56 | |
57 sort_key = current_sort_slug + '_sort' | |
58 | |
59 c.repos_list = self.scm_model.get_repos(sort_key=sort_key) | |
60 | 48 |
61 c.groups = Group.query().filter(Group.group_parent_id == None).all() | 49 c.groups = Group.query().filter(Group.group_parent_id == None).all() |
62 | 50 |
63 return render('/index.html') | 51 return render('/index.html') |
64 | 52 |