##// END OF EJS Templates
merge with sorted tags
marcink -
r1131:461f5acc merge beta
parent child Browse files
Show More
@@ -1,50 +1,54 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 rhodecode.controllers.tags
4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 6 Tags controller for rhodecode
7 7
8 8 :created_on: Apr 21, 2010
9 9 :author: marcink
10 10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
11 11 :license: GPLv3, see COPYING for more details.
12 12 """
13 13 # This program is free software; you can redistribute it and/or
14 14 # modify it under the terms of the GNU General Public License
15 15 # as published by the Free Software Foundation; version 2
16 16 # of the License or (at your opinion) any later version of the license.
17 17 #
18 18 # This program is distributed in the hope that it will be useful,
19 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 21 # GNU General Public License for more details.
22 22 #
23 23 # You should have received a copy of the GNU General Public License
24 24 # along with this program; if not, write to the Free Software
25 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 26 # MA 02110-1301, USA.
27 27 import logging
28 28
29 29 from pylons import tmpl_context as c
30 30
31 31 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
32 32 from rhodecode.lib.base import BaseRepoController, render
33 33 from rhodecode.lib.utils import OrderedDict
34 34
35 35 log = logging.getLogger(__name__)
36 36
37 37 class TagsController(BaseRepoController):
38 38
39 39 @LoginRequired()
40 40 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
41 41 'repository.admin')
42 42 def __before__(self):
43 43 super(TagsController, self).__before__()
44 44
45 45 def index(self):
46 46 c.repo_tags = OrderedDict()
47 for name, hash_ in c.rhodecode_repo.tags.items():
48 c.repo_tags[name] = c.rhodecode_repo.get_changeset(hash_)
47
48 tags = [(name, c.rhodecode_repo.get_changeset(hash_)) for \
49 name, hash_ in c.rhodecode_repo.tags.items()]
50 ordered_tags = sorted(tags, key=lambda x:x[1].date, reverse=True)
51 for name, cs_tag in ordered_tags:
52 c.repo_tags[name] = cs_tag
49 53
50 54 return render('tags/tags.html')
General Comments 0
You need to be logged in to leave comments. Login now