Show More
@@ -1,9 +1,10 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """ |
|
3 |
|
|
|
4 | ~~~~~~~~~~~~~~ | |
|
3 | rhodecode.controllers.admin.ldap_settings | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | 5 | |
|
6 | 6 | ldap controller for RhodeCode |
|
7 | ||
|
7 | 8 | :created_on: Nov 26, 2010 |
|
8 | 9 | :author: marcink |
|
9 | 10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # branches controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.branches | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | branches controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Apr 21, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,31 +24,31 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on April 21, 2010 | |
|
22 | branches controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | ||
|
28 | import logging | |
|
29 | ||
|
25 | 30 | from pylons import tmpl_context as c |
|
31 | ||
|
26 | 32 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
|
27 | 33 | from rhodecode.lib.base import BaseController, render |
|
28 | 34 | from rhodecode.lib.utils import OrderedDict |
|
29 | 35 | from rhodecode.model.scm import ScmModel |
|
30 | import logging | |
|
36 | ||
|
31 | 37 | log = logging.getLogger(__name__) |
|
32 | 38 | |
|
33 | 39 | class BranchesController(BaseController): |
|
34 | ||
|
40 | ||
|
35 | 41 | @LoginRequired() |
|
36 |
@HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
|
|
42 | @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', | |
|
43 | 'repository.admin') | |
|
37 | 44 | def __before__(self): |
|
38 | 45 | super(BranchesController, self).__before__() |
|
39 | ||
|
46 | ||
|
40 | 47 | def index(self): |
|
41 | 48 | hg_model = ScmModel() |
|
42 | 49 | c.repo_info = hg_model.get_repo(c.repo_name) |
|
43 | 50 | c.repo_branches = OrderedDict() |
|
44 | 51 | for name, hash_ in c.repo_info.branches.items(): |
|
45 | 52 | c.repo_branches[name] = c.repo_info.get_changeset(hash_) |
|
46 | ||
|
53 | ||
|
47 | 54 | return render('branches/branches.html') |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # changelog controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.changelog | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | changelog controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Apr 21, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,24 +24,24 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on April 21, 2010 | |
|
22 | changelog controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | ||
|
28 | import logging | |
|
25 | 29 | |
|
26 | 30 | try: |
|
27 | 31 | import json |
|
28 | 32 | except ImportError: |
|
29 | 33 | #python 2.5 compatibility |
|
30 | 34 | import simplejson as json |
|
35 | ||
|
31 | 36 | from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev |
|
32 | 37 | from pylons import request, session, tmpl_context as c |
|
38 | ||
|
33 | 39 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
|
34 | 40 | from rhodecode.lib.base import BaseController, render |
|
35 | 41 | from rhodecode.model.scm import ScmModel |
|
42 | ||
|
36 | 43 | from webhelpers.paginate import Page |
|
37 | import logging | |
|
44 | ||
|
38 | 45 | log = logging.getLogger(__name__) |
|
39 | 46 | |
|
40 | 47 | class ChangelogController(BaseController): |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # feed controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | ||
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.feed | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Feed controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Apr 23, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,20 +24,19 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on April 23, 2010 | |
|
22 | feed controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
25 | from pylons import tmpl_context as c, url, response | |
|
26 | from rhodecode.lib.base import BaseController, render | |
|
27 | ||
|
28 | ||
|
29 | import logging | |
|
30 | ||
|
31 | from pylons import url, response | |
|
32 | from rhodecode.lib.base import BaseController | |
|
27 | 33 | from rhodecode.model.scm import ScmModel |
|
28 | 34 | from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed |
|
29 | import logging | |
|
35 | ||
|
30 | 36 | log = logging.getLogger(__name__) |
|
31 | 37 | |
|
32 | 38 | class FeedController(BaseController): |
|
33 | ||
|
39 | ||
|
34 | 40 | #secure it or not ? |
|
35 | 41 | def __before__(self): |
|
36 | 42 | super(FeedController, self).__before__() |
@@ -48,7 +54,7 b' class FeedController(BaseController):' | |||
|
48 | 54 | description=self.description % repo_name, |
|
49 | 55 | language=self.language, |
|
50 | 56 | ttl=self.ttl) |
|
51 | ||
|
57 | ||
|
52 | 58 | changesets = ScmModel().get_repo(repo_name) |
|
53 | 59 | |
|
54 | 60 | for cs in changesets[:self.feed_nr]: |
@@ -56,11 +62,11 b' class FeedController(BaseController):' | |||
|
56 | 62 | link=url('changeset_home', repo_name=repo_name, |
|
57 | 63 | revision=cs.raw_id, qualified=True), |
|
58 | 64 | description=str(cs.date)) |
|
59 | ||
|
65 | ||
|
60 | 66 | response.content_type = feed.mime_type |
|
61 | 67 | return feed.writeString('utf-8') |
|
62 | 68 | |
|
63 | ||
|
69 | ||
|
64 | 70 | def rss(self, repo_name): |
|
65 | 71 | """Produce an rss2 feed via feedgenerator module""" |
|
66 | 72 | feed = Rss201rev2Feed(title=self.title % repo_name, |
@@ -68,13 +74,13 b' class FeedController(BaseController):' | |||
|
68 | 74 | description=self.description % repo_name, |
|
69 | 75 | language=self.language, |
|
70 | 76 | ttl=self.ttl) |
|
71 | ||
|
77 | ||
|
72 | 78 | changesets = ScmModel().get_repo(repo_name) |
|
73 | 79 | for cs in changesets[:self.feed_nr]: |
|
74 | 80 | feed.add_item(title=cs.message, |
|
75 | 81 | link=url('changeset_home', repo_name=repo_name, |
|
76 | 82 | revision=cs.raw_id, qualified=True), |
|
77 | 83 | description=str(cs.date)) |
|
78 | ||
|
84 | ||
|
79 | 85 | response.content_type = feed.mime_type |
|
80 | 86 | return feed.writeString('utf-8') |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # hg controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.home | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Home controller for Rhodecode | |
|
7 | ||
|
8 | :created_on: Feb 18, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,17 +24,16 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on February 18, 2010 | |
|
22 | hg controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | ||
|
28 | import logging | |
|
25 | 29 | from operator import itemgetter |
|
30 | ||
|
26 | 31 | from pylons import tmpl_context as c, request |
|
32 | ||
|
27 | 33 | from rhodecode.lib.auth import LoginRequired |
|
28 | 34 | from rhodecode.lib.base import BaseController, render |
|
29 | 35 | from rhodecode.model.scm import ScmModel |
|
30 | import logging | |
|
36 | ||
|
31 | 37 | log = logging.getLogger(__name__) |
|
32 | 38 | |
|
33 | 39 | class HomeController(BaseController): |
@@ -51,8 +57,10 b' class HomeController(BaseController):' | |||
|
51 | 57 | |
|
52 | 58 | sort_key = current_sort_slug + '_sort' |
|
53 | 59 | if c.sort_by.startswith('-'): |
|
54 |
c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), |
|
|
60 | c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), | |
|
61 | reverse=True) | |
|
55 | 62 | else: |
|
56 |
c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), |
|
|
63 | c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), | |
|
64 | reverse=False) | |
|
57 | 65 | |
|
58 | 66 | return render('/index.html') |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # journal controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.journal | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Journal controller for pylons | |
|
7 | ||
|
8 | :created_on: Nov 21, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,22 +24,19 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on November 21, 2010 | |
|
22 | journal controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | ||
|
28 | import logging | |
|
29 | from sqlalchemy import or_ | |
|
25 | 30 | |
|
26 | 31 | from pylons import request, response, session, tmpl_context as c, url |
|
27 | from pylons.controllers.util import abort, redirect | |
|
32 | ||
|
28 | 33 | from rhodecode.lib.auth import LoginRequired, NotAnonymous |
|
29 | 34 | from rhodecode.lib.base import BaseController, render |
|
30 | 35 | from rhodecode.lib.helpers import get_token |
|
31 | 36 | from rhodecode.model.db import UserLog, UserFollowing |
|
32 | 37 | from rhodecode.model.scm import ScmModel |
|
33 | from sqlalchemy import or_ | |
|
34 | import logging | |
|
35 | from paste.httpexceptions import HTTPInternalServerError, HTTPNotFound | |
|
38 | ||
|
39 | from paste.httpexceptions import HTTPInternalServerError | |
|
36 | 40 | |
|
37 | 41 | log = logging.getLogger(__name__) |
|
38 | 42 |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # login controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.login | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Login controller for rhodeocode | |
|
7 | ||
|
8 | :created_on: Apr 22, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -18,22 +25,21 b'' | |||
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | 27 | |
|
21 | """ | |
|
22 | Created on April 22, 2010 | |
|
23 | login controller for pylons | |
|
24 | @author: marcink | |
|
25 | """ | |
|
28 | import logging | |
|
29 | import formencode | |
|
30 | ||
|
26 | 31 | from formencode import htmlfill |
|
32 | ||
|
33 | from pylons.i18n.translation import _ | |
|
34 | from pylons.controllers.util import abort, redirect | |
|
27 | 35 | from pylons import request, response, session, tmpl_context as c, url |
|
28 | from pylons.controllers.util import abort, redirect | |
|
36 | ||
|
37 | import rhodecode.lib.helpers as h | |
|
29 | 38 | from rhodecode.lib.auth import AuthUser, HasPermissionAnyDecorator |
|
30 | 39 | from rhodecode.lib.base import BaseController, render |
|
31 | import rhodecode.lib.helpers as h | |
|
32 | from pylons.i18n.translation import _ | |
|
33 | 40 | from rhodecode.model.forms import LoginForm, RegisterForm, PasswordResetForm |
|
34 | 41 | from rhodecode.model.user import UserModel |
|
35 | import formencode | |
|
36 | import logging | |
|
42 | ||
|
37 | 43 | |
|
38 | 44 | log = logging.getLogger(__name__) |
|
39 | 45 |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # search controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.search | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Search controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Aug 7, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,24 +24,23 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on Aug 7, 2010 | |
|
22 | search controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | import logging | |
|
28 | import traceback | |
|
29 | ||
|
30 | from pylons.i18n.translation import _ | |
|
25 | 31 | from pylons import request, response, config, session, tmpl_context as c, url |
|
26 | 32 | from pylons.controllers.util import abort, redirect |
|
33 | ||
|
27 | 34 | from rhodecode.lib.auth import LoginRequired |
|
28 | 35 | from rhodecode.lib.base import BaseController, render |
|
29 | 36 | from rhodecode.lib.indexers import SCHEMA, IDX_NAME, ResultWrapper |
|
37 | ||
|
30 | 38 | from webhelpers.paginate import Page |
|
31 | 39 | from webhelpers.util import update_params |
|
32 | from pylons.i18n.translation import _ | |
|
40 | ||
|
33 | 41 | from whoosh.index import open_dir, EmptyIndexError |
|
34 | 42 | from whoosh.qparser import QueryParser, QueryParserError |
|
35 | 43 | from whoosh.query import Phrase |
|
36 | import logging | |
|
37 | import traceback | |
|
38 | 44 | |
|
39 | 45 | log = logging.getLogger(__name__) |
|
40 | 46 | |
@@ -107,7 +113,8 b' class SearchController(BaseController):' | |||
|
107 | 113 | except (EmptyIndexError, IOError): |
|
108 | 114 | log.error(traceback.format_exc()) |
|
109 | 115 | log.error('Empty Index data') |
|
110 |
c.runtime = _('There is no index to search in. |
|
|
116 | c.runtime = _('There is no index to search in. ' | |
|
117 | 'Please run whoosh indexer') | |
|
111 | 118 | |
|
112 | 119 | # Return a rendered template |
|
113 | 120 | return render('/search/search.html') |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # settings controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.settings | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Settings controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Jun 30, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,24 +24,23 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on June 30, 2010 | |
|
22 | settings controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | ||
|
28 | import logging | |
|
29 | import traceback | |
|
30 | ||
|
31 | import formencode | |
|
25 | 32 | from formencode import htmlfill |
|
33 | ||
|
26 | 34 | from pylons import tmpl_context as c, request, url |
|
27 | 35 | from pylons.controllers.util import redirect |
|
28 | 36 | from pylons.i18n.translation import _ |
|
37 | ||
|
38 | import rhodecode.lib.helpers as h | |
|
29 | 39 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAllDecorator |
|
30 | 40 | from rhodecode.lib.base import BaseController, render |
|
31 | 41 | from rhodecode.lib.utils import invalidate_cache, action_logger |
|
32 | 42 | from rhodecode.model.forms import RepoSettingsForm, RepoForkForm |
|
33 | 43 | from rhodecode.model.repo import RepoModel |
|
34 | import formencode | |
|
35 | import logging | |
|
36 | import rhodecode.lib.helpers as h | |
|
37 | import traceback | |
|
38 | 44 | |
|
39 | 45 | log = logging.getLogger(__name__) |
|
40 | 46 |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # shortlog controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | ||
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.shortlog | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Shortlog controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Apr 18, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,27 +24,27 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on April 18, 2010 | |
|
22 | shortlog controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | ||
|
28 | import logging | |
|
29 | ||
|
25 | 30 | from pylons import tmpl_context as c, request |
|
31 | ||
|
32 | from webhelpers.paginate import Page | |
|
33 | ||
|
26 | 34 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
|
27 | 35 | from rhodecode.lib.base import BaseController, render |
|
28 | 36 | from rhodecode.model.scm import ScmModel |
|
29 | from webhelpers.paginate import Page | |
|
30 | import logging | |
|
37 | ||
|
31 | 38 | log = logging.getLogger(__name__) |
|
32 | 39 | |
|
33 | 40 | class ShortlogController(BaseController): |
|
34 | ||
|
41 | ||
|
35 | 42 | @LoginRequired() |
|
36 | 43 | @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
|
37 |
'repository.admin') |
|
|
44 | 'repository.admin') | |
|
38 | 45 | def __before__(self): |
|
39 | 46 | super(ShortlogController, self).__before__() |
|
40 | ||
|
47 | ||
|
41 | 48 | def index(self): |
|
42 | 49 | p = int(request.params.get('page', 1)) |
|
43 | 50 | repo = ScmModel().get_repo(c.repo_name) |
@@ -1,8 +1,15 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | # tags controller for pylons | |
|
4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
5 | # | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """ | |
|
3 | rhodecode.controllers.tags | |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
|
5 | ||
|
6 | Tags controller for rhodecode | |
|
7 | ||
|
8 | :created_on: Apr 21, 2010 | |
|
9 | :author: marcink | |
|
10 | :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
|
11 | :license: GPLv3, see COPYING for more details. | |
|
12 | """ | |
|
6 | 13 | # This program is free software; you can redistribute it and/or |
|
7 | 14 | # modify it under the terms of the GNU General Public License |
|
8 | 15 | # as published by the Free Software Foundation; version 2 |
@@ -17,31 +24,30 b'' | |||
|
17 | 24 | # along with this program; if not, write to the Free Software |
|
18 | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 26 | # MA 02110-1301, USA. |
|
20 | """ | |
|
21 | Created on April 21, 2010 | |
|
22 | tags controller for pylons | |
|
23 | @author: marcink | |
|
24 | """ | |
|
27 | import logging | |
|
28 | ||
|
25 | 29 | from pylons import tmpl_context as c |
|
30 | ||
|
26 | 31 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
|
27 | 32 | from rhodecode.lib.base import BaseController, render |
|
28 | 33 | from rhodecode.lib.utils import OrderedDict |
|
29 | 34 | from rhodecode.model.scm import ScmModel |
|
30 | import logging | |
|
35 | ||
|
31 | 36 | log = logging.getLogger(__name__) |
|
32 | 37 | |
|
33 | 38 | class TagsController(BaseController): |
|
34 | ||
|
39 | ||
|
35 | 40 | @LoginRequired() |
|
36 |
@HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
|
|
41 | @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', | |
|
42 | 'repository.admin') | |
|
37 | 43 | def __before__(self): |
|
38 | 44 | super(TagsController, self).__before__() |
|
39 | ||
|
45 | ||
|
40 | 46 | def index(self): |
|
41 | 47 | hg_model = ScmModel() |
|
42 | 48 | c.repo_info = hg_model.get_repo(c.repo_name) |
|
43 | 49 | c.repo_tags = OrderedDict() |
|
44 | 50 | for name, hash_ in c.repo_info.tags.items(): |
|
45 | 51 | c.repo_tags[name] = c.repo_info.get_changeset(hash_) |
|
46 | ||
|
52 | ||
|
47 | 53 | return render('tags/tags.html') |
General Comments 0
You need to be logged in to leave comments.
Login now