%else:
- ##forbid revoking permission from yourself, except if you're an super admin
+ ##forbid revoking permission from yourself, except if you're an super admin
%if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
-
- ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
+ ${c.form['repo_group_description'].render(css_class='medium', oid='repo_group_description')|n}
+ ${c.form.render_error(request, c.form['repo_group_description'])|n}
+
<% metatags_url = h.literal('''meta-tags''') %>
${_('Plain text format with support of {metatags}').format(metatags=metatags_url)|n}
@@ -53,22 +68,17 @@
- ${h.checkbox('enable_locking',value="True")}
+ ${c.form['repo_group_enable_locking'].render(css_class='medium', oid='repo_group_enable_locking')|n}
+ ${c.form.render_error(request, c.form['repo_group_enable_locking'])|n}
+
${_('Repository locking will be enabled on all subgroups and repositories inside this repository group. Pulling from a repository locks it, and it is unlocked by pushing back by the same user.')}
- ${h.secure_form(h.url('delete_repo_group', group_name=repo_group_name),method='delete', request=request)}
+ ${h.secure_form(h.route_path('edit_repo_group_advanced_delete', repo_group_name=repo_group_name), request=request)}
${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger",
onclick="return confirm('"+_ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")}
${h.end_form()}
diff --git a/rhodecode/templates/index_base.mako b/rhodecode/templates/index_base.mako
--- a/rhodecode/templates/index_base.mako
+++ b/rhodecode/templates/index_base.mako
@@ -31,7 +31,7 @@
%endif
%if is_admin or create_repo_group:
- ${_(u'Add Repository Group')}
+ ${_(u'Add Repository Group')}
%endif
%else:
##we're inside other repository group other terms apply
@@ -39,10 +39,10 @@
${_('Add Repository')}
%endif
%if is_admin or group_admin:
- ${_(u'Add Repository Group')}
+ ${_(u'Add Repository Group')}
%endif
%if is_admin or group_admin:
- ${_('Edit Repository Group')}
+ ${_('Edit Repository Group')}
%endif
%endif
diff --git a/rhodecode/tests/controllers/test_repo_groups.py b/rhodecode/tests/controllers/test_repo_groups.py
deleted file mode 100644
--- a/rhodecode/tests/controllers/test_repo_groups.py
+++ /dev/null
@@ -1,79 +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/
-
-import mock
-import pylons
-import pytest
-from pylons import tmpl_context as c
-
-
-@pytest.fixture
-def current_user(request, user_util):
- user = user_util.create_user()
-
- request_mock = mock.Mock(user=user)
- pylons.request._push_object(request_mock)
-
- @request.addfinalizer
- def cleanup():
- pylons.request._pop_object()
- return user
-
-
-@pytest.fixture
-def personal_group_with_parent(user_util, current_user):
- group_read_only = user_util.create_repo_group()
- user_util.grant_user_permission_to_repo_group(
- group_read_only, current_user, 'group.read')
-
- # TODO: johbo: This should go into the business models
- group_as_admin = user_util.create_repo_group(
- owner=current_user)
- group_as_admin.parent_group = group_read_only
- group_as_admin.group_name = group_as_admin.get_new_name(
- group_as_admin.group_name)
-
- return group_as_admin
-
-
-@pytest.fixture
-def controller():
- from rhodecode.controllers.admin import repo_groups
- return repo_groups.RepoGroupsController()
-
-
-def test_repo_groups_load_defaults(
- current_user, personal_group_with_parent, controller):
- personal_group = personal_group_with_parent
- controller._RepoGroupsController__load_defaults(True, personal_group)
-
- expected_list = [-1, personal_group.parent_group.group_id]
- returned_group_ids = [group[0] for group in c.repo_groups]
- assert returned_group_ids == expected_list
-
-
-def test_repo_groups_load_defaults_with_missing_group(
- current_user, personal_group_with_parent, controller):
- personal_group = personal_group_with_parent
- controller._RepoGroupsController__load_defaults(True)
-
- expected_list = sorted([-1, personal_group.group_id])
- returned_group_ids = sorted([group[0] for group in c.repo_groups])
- assert returned_group_ids == expected_list
diff --git a/rhodecode/tests/functional/test_admin_repo_groups.py b/rhodecode/tests/functional/test_admin_repo_groups.py
deleted file mode 100644
--- a/rhodecode/tests/functional/test_admin_repo_groups.py
+++ /dev/null
@@ -1,227 +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/
-
-import os
-
-from rhodecode.lib import helpers as h
-from rhodecode.model.meta import Session
-from rhodecode.model.repo_group import RepoGroupModel
-from rhodecode.tests import (
- url, TestController, assert_session_flash, GIT_REPO, HG_REPO,
- TESTS_TMP_PATH, TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS)
-from rhodecode.tests.fixture import Fixture
-
-fixture = Fixture()
-
-
-
-def test_update(app, csrf_token, autologin_user, user_util):
- repo_group = user_util.create_repo_group()
- description = 'description for newly created repo group'
- Session().commit()
- response = app.post(
- url('update_repo_group', group_name=repo_group.group_name),
- fixture._get_group_create_params(
- group_name=repo_group.group_name,
- group_description=description,
- csrf_token=csrf_token,
- _method='PUT')
- )
- # TODO: anderson: johbo: we believe that this update should return
- # a redirect instead of rendering the template.
- assert response.status_code == 200
-
-
-def test_edit(app, user_util, autologin_user):
- repo_group = user_util.create_repo_group()
- Session().commit()
- response = app.get(
- url('edit_repo_group', group_name=repo_group.group_name))
- assert response.status_code == 200
-
-
-def test_edit_repo_group_perms(app, user_util, autologin_user):
- repo_group = user_util.create_repo_group()
- Session().commit()
- response = app.get(
- url('edit_repo_group_perms', group_name=repo_group.group_name))
- assert response.status_code == 200
-
-
-def test_update_fails_when_parent_pointing_to_self(
- app, csrf_token, user_util, autologin_user):
- group = user_util.create_repo_group()
- response = app.post(
- url('update_repo_group', group_name=group.group_name),
- fixture._get_group_create_params(
- group_parent_id=group.group_id,
- csrf_token=csrf_token,
- _method='PUT')
- )
- response.mustcontain(
- '