##// END OF EJS Templates
comments: enabled resolution for general comments, and finalized how general comment is build
comments: enabled resolution for general comments, and finalized how general comment is build

File last commit:

r1282:90601d74 default
r1326:e70e0f00 default
Show More
followers.py
58 lines | 2.0 KiB | text/x-python | PythonLexer
project: added all source files and assets
r1 # -*- coding: utf-8 -*-
license: updated copyright year to 2017
r1271 # Copyright (C) 2011-2017 RhodeCode GmbH
project: added all source files and assets
r1 #
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3
# (only), as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This program is dual-licensed. If you wish to learn more about the
# RhodeCode Enterprise Edition, including its added features, Support services,
# and proprietary license terms, please see https://rhodecode.com/licenses/
"""
Followers controller for rhodecode
"""
import logging
from pylons import tmpl_context as c, request
from rhodecode.lib.helpers import Page
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
from rhodecode.lib.base import BaseRepoController, render
from rhodecode.model.db import UserFollowing
from rhodecode.lib.utils2 import safe_int
log = logging.getLogger(__name__)
class FollowersController(BaseRepoController):
def __before__(self):
super(FollowersController, self).__before__()
@LoginRequired()
@HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
'repository.admin')
def followers(self, repo_name):
p = safe_int(request.GET.get('page', 1), 1)
repo_id = c.rhodecode_db_repo.repo_id
d = UserFollowing.get_repo_followers(repo_id)\
.order_by(UserFollowing.follows_from)
c.followers_pager = Page(d, page=p, items_per_page=20)
templating: use .mako as extensions for template files.
r1282 c.followers_data = render('/followers/followers_data.mako')
project: added all source files and assets
r1
if request.environ.get('HTTP_X_PJAX'):
return c.followers_data
templating: use .mako as extensions for template files.
r1282 return render('/followers/followers.mako')