repo-followers: removed deprecated not used views.
This commit is contained in:
parent
bbc650bed6
commit
cf29ee66a1
5 changed files with 0 additions and 170 deletions
|
|
@ -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}',
|
||||
|
|
|
|||
|
|
@ -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 <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)
|
||||
|
||||
c.followers_data = render('/followers/followers_data.mako')
|
||||
|
||||
if request.environ.get('HTTP_X_PJAX'):
|
||||
return c.followers_data
|
||||
|
||||
return render('/followers/followers.mako')
|
||||
|
|
@ -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>
|
||||
|
||||
<%def name="breadcrumbs_links()">
|
||||
${_('Followers')}
|
||||
</%def>
|
||||
|
||||
<%def name="menu_bar_nav()">
|
||||
${self.menu_items(active='repositories')}
|
||||
</%def>
|
||||
|
||||
<%def name="menu_bar_subnav()">
|
||||
${self.repo_menu(active='summary')}
|
||||
</%def>
|
||||
|
||||
<%def name="main()">
|
||||
<div class="box">
|
||||
<div class="title">
|
||||
<h1>
|
||||
${_('%s Followers') % c.repo_name}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="table">
|
||||
<div id="forks">
|
||||
${c.followers_data}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</%def>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%namespace name="base" file="/base/base.mako"/>
|
||||
<table class="rctable followers_data">
|
||||
<tr>
|
||||
<th>${_('Follower Name')}</th>
|
||||
<th>${_('Following Since')}</th>
|
||||
</tr>
|
||||
% for f in c.followers_pager:
|
||||
<tr>
|
||||
<td class="td-user follower_user">
|
||||
${base.gravatar_with_user(f.user.email, 16)}
|
||||
</td>
|
||||
<td class="td-time follower_date">
|
||||
${h.age_component(f.follows_from, time_is_local=True)}
|
||||
</td>
|
||||
</tr>
|
||||
% endfor
|
||||
</table>
|
||||
|
||||
<div class="pagination-wh pagination-left">
|
||||
<script type="text/javascript">
|
||||
$(document).pjax('#followers.pager_link','#followers');
|
||||
$(document).on('pjax:success',function(){
|
||||
show_more_event();
|
||||
timeagoActivate();
|
||||
});
|
||||
</script>
|
||||
${c.followers_pager.pager('$link_previous ~2~ $link_next')}
|
||||
</div>
|
||||
|
|
@ -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 <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/
|
||||
|
||||
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""")
|
||||
Loading…
Add table
Add a link
Reference in a new issue