diff --git a/rhodecode/config/routing.py b/rhodecode/config/routing.py --- a/rhodecode/config/routing.py +++ b/rhodecode/config/routing.py @@ -1124,11 +1124,6 @@ def make_map(config): conditions={'function': check_repo}, requirements=URL_NAME_REQUIREMENTS) - rmap.connect('repo_followers_home', '/{repo_name}/followers', - controller='followers', action='followers', - conditions={'function': check_repo}, - requirements=URL_NAME_REQUIREMENTS) - # must be here for proper group/repo catching pattern _connect_with_slash( rmap, 'repo_group_home', '/{group_name}', diff --git a/rhodecode/controllers/followers.py b/rhodecode/controllers/followers.py deleted file mode 100644 --- a/rhodecode/controllers/followers.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (C) 2011-2017 RhodeCode GmbH -# -# 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 . -# -# 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) - - c.followers_data = render('/followers/followers_data.mako') - - if request.environ.get('HTTP_X_PJAX'): - return c.followers_data - - return render('/followers/followers.mako') diff --git a/rhodecode/templates/followers/followers.mako b/rhodecode/templates/followers/followers.mako deleted file mode 100644 --- a/rhodecode/templates/followers/followers.mako +++ /dev/null @@ -1,36 +0,0 @@ -## -*- coding: utf-8 -*- -<%inherit file="/base/base.mako"/> - -<%def name="title()"> - ${_('%s Followers') % c.repo_name} - %if c.rhodecode_name: - · ${h.branding(c.rhodecode_name)} - %endif - - -<%def name="breadcrumbs_links()"> - ${_('Followers')} - - -<%def name="menu_bar_nav()"> - ${self.menu_items(active='repositories')} - - -<%def name="menu_bar_subnav()"> - ${self.repo_menu(active='summary')} - - -<%def name="main()"> -
-
-

- ${_('%s Followers') % c.repo_name} -

-
-
-
- ${c.followers_data} -
-
-
- diff --git a/rhodecode/templates/followers/followers_data.mako b/rhodecode/templates/followers/followers_data.mako deleted file mode 100644 --- a/rhodecode/templates/followers/followers_data.mako +++ /dev/null @@ -1,29 +0,0 @@ -## -*- coding: utf-8 -*- -<%namespace name="base" file="/base/base.mako"/> - - - - - - % for f in c.followers_pager: - - - - - % endfor -
${_('Follower Name')}${_('Following Since')}
- ${base.gravatar_with_user(f.user.email, 16)} - - ${h.age_component(f.follows_from, time_is_local=True)} -
- -
- -${c.followers_pager.pager('$link_previous ~2~ $link_next')} -
diff --git a/rhodecode/tests/functional/test_followers.py b/rhodecode/tests/functional/test_followers.py deleted file mode 100644 --- a/rhodecode/tests/functional/test_followers.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (C) 2010-2017 RhodeCode GmbH -# -# 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 . -# -# 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/ - -from rhodecode.tests import * - - -class TestFollowersController(TestController): - - def test_index_hg(self): - self.log_user() - repo_name = HG_REPO - response = self.app.get(url(controller='followers', - action='followers', - repo_name=repo_name)) - - response.mustcontain("""test_admin""") - - def test_index_git(self): - self.log_user() - repo_name = GIT_REPO - response = self.app.get(url(controller='followers', - action='followers', - repo_name=repo_name)) - - response.mustcontain("""test_admin""")