You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/02/05 20:12:48 UTC
[1/6] allura git commit: [#7921] ticket:893 Remove deprecated
controller link and twill tests
Repository: allura
Updated Branches:
refs/heads/master ae3ea6aba -> b0371e966
[#7921] ticket:893 Remove deprecated controller link and twill tests
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/95c1c3a2
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/95c1c3a2
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/95c1c3a2
Branch: refs/heads/master
Commit: 95c1c3a2b7a62400c006cf840a462c9c929c2e78
Parents: 3e3fbc6
Author: Denis Kotov <de...@gmail.com>
Authored: Tue Jan 26 20:30:11 2016 +0200
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 13:28:48 2016 -0500
----------------------------------------------------------------------
.../user_profile/templates/sections/tools.html | 6 ---
.../tests/functional/test_neighborhood.py | 1 -
AlluraTest/twill-tests/README | 19 --------
AlluraTest/twill-tests/create_repo.twill | 47 --------------------
AlluraTest/twill-tests/edit_wiki_page.twill | 36 ---------------
AlluraTest/twill-tests/login.twill | 27 -----------
AlluraTest/twill-tests/new_issue.twill | 36 ---------------
AlluraTest/twill-tests/smoke-front-page.twill | 20 ---------
AlluraTest/twill-tests/smoke-project-home.twill | 20 ---------
.../twill-tests/smoke-tracker-search.twill | 20 ---------
AlluraTest/twill-tests/smoke-tracker.twill | 20 ---------
AlluraTest/twill-tests/smoke-user-profile.twill | 20 ---------
AlluraTest/twill-tests/smoke-wiki.twill | 20 ---------
ForgeSVN/forgesvn/templates/svn/index.html | 7 +--
14 files changed, 4 insertions(+), 295 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/Allura/allura/ext/user_profile/templates/sections/tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/tools.html b/Allura/allura/ext/user_profile/templates/sections/tools.html
index da0db03..1a39e91 100644
--- a/Allura/allura/ext/user_profile/templates/sections/tools.html
+++ b/Allura/allura/ext/user_profile/templates/sections/tools.html
@@ -22,12 +22,6 @@
Personal Tools
{% endblock %}
-{% block actions %}
- {% if user == c.user %}
- <a href="{{c.project.url()}}admin/tools">Add Tools</a>
- {% endif %}
-{% endblock %}
-
{% block section_class %}tools{% endblock %}
{% block content %}
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 22c5f91..1119749 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -19,7 +19,6 @@ import json
import os
from cStringIO import StringIO
import urllib2
-import re
import PIL
from mock import patch
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/README
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/README b/AlluraTest/twill-tests/README
deleted file mode 100644
index 59e490e..0000000
--- a/AlluraTest/twill-tests/README
+++ /dev/null
@@ -1,19 +0,0 @@
-Twill Tests
-
-First, you'll need twill-sh:
-
- sudo easy_install twill
-
-
-Files in this directory ending with '.twill' are tests to be run by twill-sh
-
- twill-sh --url=http://url.of.forge.to.test/ twill-tests/*.twill
-
-e.g.,
-
- twill-sh --url=http://re.sourceforge.net/ twill-tests/*.twill
-
-
-If you just want to run the quick "smoke tests":
-
- twill-sh --url=... twill-tests/smoke*.twill
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/create_repo.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/create_repo.twill b/AlluraTest/twill-tests/create_repo.twill
deleted file mode 100644
index 17b9a3a..0000000
--- a/AlluraTest/twill-tests/create_repo.twill
+++ /dev/null
@@ -1,47 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-setlocal username test_admin
-setlocal password foo
-
-clear_extra_headers
-go ./auth/
-formvalue 1 username $username
-formvalue 1 password $password
-submit
-
-code 200
-
-go ./p/test/admin/tools
-
-code 200
-
-formvalue 2 "new.ep_name" "Git"
-formvalue 2 "new.mount_point" "deleteme"
-submit
-
-code 200
-
-go ../deleteme/
-
-code 200
-
-find ready
-
-go ../admin/tools
-
-# Delete the repo :-(
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/edit_wiki_page.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/edit_wiki_page.twill b/AlluraTest/twill-tests/edit_wiki_page.twill
deleted file mode 100644
index 2b659ec..0000000
--- a/AlluraTest/twill-tests/edit_wiki_page.twill
+++ /dev/null
@@ -1,36 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-setlocal username test_admin
-setlocal password foo
-
-clear_extra_headers
-go ./auth/
-formvalue 1 username $username
-formvalue 1 password $password
-submit
-
-code 200
-
-go ./p/test/wiki/TestWikiWord/edit
-
-code 200
-
-formvalue 3 text "This is just a test."
-submit
-
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/login.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/login.twill b/AlluraTest/twill-tests/login.twill
deleted file mode 100644
index fbe6f67..0000000
--- a/AlluraTest/twill-tests/login.twill
+++ /dev/null
@@ -1,27 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-setlocal username test_admin
-setlocal password foo
-
-clear_extra_headers
-go ./auth/
-formvalue 1 username $username
-formvalue 1 password $password
-submit
-
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/new_issue.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/new_issue.twill b/AlluraTest/twill-tests/new_issue.twill
deleted file mode 100644
index 7b05168..0000000
--- a/AlluraTest/twill-tests/new_issue.twill
+++ /dev/null
@@ -1,36 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-setlocal username test_admin
-setlocal password foo
-
-clear_extra_headers
-go ./auth/
-formvalue 1 username $username
-formvalue 1 password $password
-submit
-
-code 200
-
-go ./p/test/bugs/new/
-
-code 200
-
-formvalue 2 "ticket_form.summary" "test create ticket"
-submit
-
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/smoke-front-page.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/smoke-front-page.twill b/AlluraTest/twill-tests/smoke-front-page.twill
deleted file mode 100644
index a0f4852..0000000
--- a/AlluraTest/twill-tests/smoke-front-page.twill
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-clear_extra_headers
-go .
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/smoke-project-home.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/smoke-project-home.twill b/AlluraTest/twill-tests/smoke-project-home.twill
deleted file mode 100644
index 3d1e8bf..0000000
--- a/AlluraTest/twill-tests/smoke-project-home.twill
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-clear_extra_headers
-go ./p/test/home/
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/smoke-tracker-search.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/smoke-tracker-search.twill b/AlluraTest/twill-tests/smoke-tracker-search.twill
deleted file mode 100644
index d8d03a3..0000000
--- a/AlluraTest/twill-tests/smoke-tracker-search.twill
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-clear_extra_headers
-go ./p/test/bugs/search/
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/smoke-tracker.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/smoke-tracker.twill b/AlluraTest/twill-tests/smoke-tracker.twill
deleted file mode 100644
index 1e9e0f7..0000000
--- a/AlluraTest/twill-tests/smoke-tracker.twill
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-clear_extra_headers
-go ./p/test/bugs/
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/smoke-user-profile.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/smoke-user-profile.twill b/AlluraTest/twill-tests/smoke-user-profile.twill
deleted file mode 100644
index 907f17d..0000000
--- a/AlluraTest/twill-tests/smoke-user-profile.twill
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-clear_extra_headers
-go ./u/test_admin/profile/
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/AlluraTest/twill-tests/smoke-wiki.twill
----------------------------------------------------------------------
diff --git a/AlluraTest/twill-tests/smoke-wiki.twill b/AlluraTest/twill-tests/smoke-wiki.twill
deleted file mode 100644
index 03e2c56..0000000
--- a/AlluraTest/twill-tests/smoke-wiki.twill
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-clear_extra_headers
-go ./p/test/wiki/Home/
-code 200
http://git-wip-us.apache.org/repos/asf/allura/blob/95c1c3a2/ForgeSVN/forgesvn/templates/svn/index.html
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/templates/svn/index.html b/ForgeSVN/forgesvn/templates/svn/index.html
index 8625b0b..4849e89 100644
--- a/ForgeSVN/forgesvn/templates/svn/index.html
+++ b/ForgeSVN/forgesvn/templates/svn/index.html
@@ -69,9 +69,10 @@ svn ci -m "Add initial directories"
</pre>
</div>
<p>To make the default checkout url for your repo point to your new
- <code>/trunk</code> directory instead of the root, go to the
- <a href="{{c.project.url() + 'admin/tools'}}">Admin / Tools</a>
- screen, click on 'Checkout URL' under your repo, add 'trunk' to the
+ <code>/trunk</code> directory instead of the root, click the
+ <i class="fa fa-lock"></i> icon above to unlock the project menu.
+ Then click on <i class="fa fa-cog"></i> icon of your SVN tool and on
+ 'Checkout URL' in menu, add 'trunk' to the
end of the url, and click 'Save.'
</p>
[4/6] allura git commit: [#7921] ticket:887 fix tests,
delete deprecated tests
Posted by br...@apache.org.
[#7921] ticket:887 fix tests, delete deprecated tests
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/6e2f4422
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/6e2f4422
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/6e2f4422
Branch: refs/heads/master
Commit: 6e2f4422fff3b8a17a154d574888106828a511ab
Parents: 459003d
Author: Denis Kotov <de...@gmail.com>
Authored: Fri Jan 15 16:40:53 2016 +0200
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 13:28:48 2016 -0500
----------------------------------------------------------------------
Allura/allura/tests/functional/test_admin.py | 69 --------------------
.../tests/functional/test_neighborhood.py | 25 ++++---
2 files changed, 16 insertions(+), 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/6e2f4422/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index cff3c70..0c58545 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -50,11 +50,6 @@ log = logging.getLogger(__name__)
class TestProjectAdmin(TestController):
- def get_available_tools(self):
- r = self.app.get('/admin/tools')
- available_tools = r.html.findAll('a', {'class': 'install_trig'})
- return [' '.join(opt.find('span').string.strip().split()) for opt in available_tools]
-
def test_admin_controller(self):
self.app.get('/admin/')
with audits(
@@ -336,54 +331,6 @@ class TestProjectAdmin(TestController):
tag['name'].endswith('.id'))]
assert len(cards) == len(app.permissions), cards
- def test_tool_list(self):
- r = self.app.get('/admin/tools')
- new_ep_opts = r.html.findAll('a', {'class': "install_trig"})
- tool_strings = [' '.join(opt.find('span').string.strip().split())
- for opt in new_ep_opts]
- expected_tools = [
- 'Wiki',
- 'Tickets',
- 'Discussion',
- 'Blog',
- 'Subproject']
- # check using sets, because their may be more tools installed by default
- # that we don't know about
- assert len(set(expected_tools) - set(tool_strings)) == 0, tool_strings
-
- def test_tool_paging(self):
- r = self.app.get('/admin/tools')
- items = r.html.findAll('ul', {'class': 'deck'})
- # sometimes the activity tool is present, sometimes it isn't - not sure why
- assert_in(len(items), (2, 3))
- r = self.app.get('/admin/tools?limit=1&page=0')
- assert_equals(1, len(r.html.findAll('ul', {'class': 'deck'})))
- r = self.app.get('/admin/tools?limit=1&page=1')
- assert_equals(1, len(r.html.findAll('ul', {'class': 'deck'})))
-
- def test_tool_installation_limit(self):
- with mock.patch.object(ForgeWikiApp, 'max_instances') as mi:
- mi.__get__ = mock.Mock(return_value=1)
-
- available_tools = self.get_available_tools()
- assert_in('Wiki', available_tools)
- r = self.app.post('/admin/update_mounts/', params={
- 'new.install': 'install',
- 'new.ep_name': 'Wiki',
- 'new.ordinal': '1',
- 'new.mount_point': 'wiki',
- 'new.mount_label': 'Wiki'})
- available_tools = self.get_available_tools()
- assert_not_in('Wiki', available_tools)
- r = self.app.post('/admin/update_mounts/', params={
- 'new.install': 'install',
- 'new.ep_name': 'Wiki',
- 'new.ordinal': '1',
- 'new.mount_point': 'wiki2',
- 'new.mount_label': 'Wiki 2'})
- assert 'error' in self.webflash(r)
- assert 'limit exceeded' in self.webflash(r)
-
def test_install_tool_form(self):
r = self.app.get('/admin/install_tool?tool_name=wiki')
assert_in(u'Installing Wiki', r)
@@ -398,22 +345,6 @@ class TestProjectAdmin(TestController):
r = self.app.get('/admin/install_tool?tool_name=subproject')
assert_in(u'Installing Sub Project', r)
- def test_grouping_threshold(self):
- r = self.app.get('/admin/tools')
- grouping_threshold = r.html.find(
- 'input', {'name': 'grouping_threshold'})
- assert_equals(grouping_threshold['value'], '1')
- r = self.app.post('/admin/configure_tool_grouping', params={
- 'grouping_threshold': '2',
- }).follow()
- grouping_threshold = r.html.find(
- 'input', {'name': 'grouping_threshold'})
- assert_equals(grouping_threshold['value'], '2')
- r = self.app.get('/admin/tools')
- grouping_threshold = r.html.find(
- 'input', {'name': 'grouping_threshold'})
- assert_equals(grouping_threshold['value'], '2')
-
def test_project_icon(self):
file_name = 'neo-icon-set-454545-256x350.png'
file_path = os.path.join(
http://git-wip-us.apache.org/repos/asf/allura/blob/6e2f4422/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index a7609df..5441f8c 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -19,6 +19,7 @@ import json
import os
from cStringIO import StringIO
import urllib2
+import re
import PIL
from mock import patch
@@ -126,9 +127,12 @@ class TestNeighborhood(TestController):
r = self.app.get('/p/_admin/overview', extra_environ=dict(username='root'))
assert 'wiki, tickets' in r
- r = self.app.get('/p/test/admin/tools')
- assert ' <span class="tool_title">Wiki</span><br />' not in r
- assert ' <span class="tool_title">Tickets</span><br />' not in r
+ r = self.app.get('/p/test/admin/overview')
+ c = re.compile('var _data = .*;')
+ _data = json.loads(c.search(str(r.html)).group()[12:-1])
+ tools = [tool['name'] for tool in _data['menu']]
+ assert 'Wiki' not in tools
+ assert 'Tickets' not in tools
r = self.app.post('/p/_admin/update',
params=dict(name='Projects',
@@ -171,11 +175,14 @@ class TestNeighborhood(TestController):
assert top_nav.find(href='/p/test/wiki/'), top_nav
assert top_nav.find(href='/p/test/tickets/'), top_nav
- r = self.app.get('/p/test/admin/tools')
- assert '<div class="fleft isnt_sorted">' in r
- delete_tool = [link for link in r.html.findAll('a', {'class': 'admin_modal'})
- if link['href'].endswith('/delete')]
- assert_equal(len(delete_tool), 0) # wiki not deletable
+ r = self.app.get('/p/test/admin/overview')
+ c = re.compile('var _data = .*;')
+ _data = json.loads(c.search(str(r.html)).group()[12:-1])
+ for tool in _data['menu']:
+ if tool['name'].lower() == 'wiki':
+ menu = [name['text'] for name in tool['admin_options']]
+ assert 'Delete' not in menu
+ break
def test_show_title(self):
r = self.app.get('/adobe/_admin/overview',
@@ -809,7 +816,7 @@ class TestNeighborhood(TestController):
private_project='off'),
antispam=True,
extra_environ=dict(username='root'))
- r = self.app.get('/adobe/testtemp/admin/tools')
+ r = self.app.get('/adobe/testtemp/admin/overview')
assert r.html.find('div', id='top_nav').find(
'a', href='/adobe/testtemp/wiki/'), r.html
assert r.html.find('div', id='top_nav').find(
[6/6] allura git commit: [#7921] remove some now-unused controllers
that still redirected to the tools page. clone was very very old
Posted by br...@apache.org.
[#7921] remove some now-unused controllers that still redirected to the tools page. clone was very very old
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b0371e96
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b0371e96
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b0371e96
Branch: refs/heads/master
Commit: b0371e9664a2e2c199d04cc2bdab7e86982dce38
Parents: 95c1c3a
Author: Dave Brondsema <da...@brondsema.net>
Authored: Fri Feb 5 14:11:38 2016 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 14:11:38 2016 -0500
----------------------------------------------------------------------
Allura/allura/ext/admin/admin_main.py | 59 -----------------------
Allura/allura/tests/functional/test_admin.py | 14 ------
2 files changed, 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/b0371e96/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index ecdd76e..c406e97 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -263,21 +263,6 @@ class ProjectAdminController(BaseController):
def tools_moved(self, **kw):
return {}
-
- @expose()
- @require_post()
- def configure_tool_grouping(self, grouping_threshold='1', page=0, limit=200, **kw):
- try:
- grouping_threshold = int(grouping_threshold)
- if grouping_threshold < 1:
- raise ValueError('Invalid threshold')
- c.project.set_tool_data(
- 'allura', grouping_threshold=grouping_threshold)
- g.post_event('project_menu_updated')
- except ValueError:
- flash('Invalid threshold', 'error')
- redirect('tools?limit=%s&page=%s' % (limit, page))
-
@expose()
@require_post()
def update_labels(self, labels=None, **kw):
@@ -287,35 +272,6 @@ class ProjectAdminController(BaseController):
redirect('trove')
@without_trailing_slash
- @expose()
- def clone(self,
- repo_type=None, source_url=None,
- mount_point=None, mount_label=None,
- **kw):
- require_access(c.project, 'admin')
- if repo_type is None:
- return (
- '<form method="get">'
- '<input name="repo_type" value="Git">'
- '<input name="source_url">'
- '<input type="submit">'
- '</form>')
- for ep in h.iter_entry_points('allura', repo_type):
- break
- if ep is None or source_url is None:
- raise exc.HTTPNotFound
- h.log_action(log, 'install tool').info(
- 'clone repo from %s', source_url,
- meta=dict(tool_type=repo_type, mount_point=mount_point, mount_label=mount_label))
- c.project.install_app(
- repo_type,
- mount_point=mount_point,
- mount_label=mount_label,
- init_from_url=source_url)
- M.AuditLog.log('Create repo as clone')
- redirect('tools')
-
- @without_trailing_slash
@expose('jinja:allura.ext.admin:templates/project_install_tool.html')
def install_tool(self, tool_name=None, **kw):
if tool_name == 'subproject':
@@ -620,21 +576,6 @@ class ProjectAdminController(BaseController):
flash('Joined %s' % n.name)
redirect('invitations')
- @h.vardec
- @expose()
- @require_post()
- def update_mount_order(self, subs=None, tools=None, **kw):
- if subs:
- for sp in subs:
- p = M.Project.query.get(shortname=sp['shortname'],
- neighborhood_id=c.project.neighborhood_id)
- p.ordinal = int(sp['ordinal'])
- if tools:
- for p in tools:
- c.project.app_config(p['mount_point']).options.ordinal = int(p['ordinal'])
- g.post_event('project_menu_updated')
- redirect('tools')
-
def _update_mounts(self, subproject=None, tool=None, new=None, **kw):
'''
http://git-wip-us.apache.org/repos/asf/allura/blob/b0371e96/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index b4167b1..97c6d8d 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -377,20 +377,6 @@ class TestProjectAdmin(TestController):
r = self.app.get('/admin/install_tool?tool_name=subproject')
assert_in(u'Installing Sub Project', r)
- def test_grouping_threshold(self):
- c.user = M.User.query.get(username='root')
- c.project = M.Project.query.get(shortname='test')
- data = c.project.nav_data(admin_options=True)
- assert_equals(data['grouping_threshold'], 1)
-
- self.app.post('/admin/configure_tool_grouping', params={
- 'grouping_threshold': '2',
- })
-
- c.project = M.Project.query.get(shortname='test')
- data = c.project.nav_data(admin_options=True)
- assert_equals(data['grouping_threshold'], 2)
-
def test_project_icon(self):
file_name = 'neo-icon-set-454545-256x350.png'
file_path = os.path.join(
[2/6] allura git commit: [#7921] ticket:890 Add
test_grouping_threshold, test_tool_installation_limit
Posted by br...@apache.org.
[#7921] ticket:890 Add test_grouping_threshold, test_tool_installation_limit
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/3e3fbc6d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3e3fbc6d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3e3fbc6d
Branch: refs/heads/master
Commit: 3e3fbc6d4f5c34c26b9aed280e0b62eb43820f5d
Parents: c9d875f
Author: Denis Kotov <de...@gmail.com>
Authored: Wed Jan 20 19:50:36 2016 +0200
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 13:28:48 2016 -0500
----------------------------------------------------------------------
Allura/allura/tests/functional/test_admin.py | 46 +++++++++++++++++++++++
1 file changed, 46 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/3e3fbc6d/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index 0c58545..b4167b1 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -331,6 +331,38 @@ class TestProjectAdmin(TestController):
tag['name'].endswith('.id'))]
assert len(cards) == len(app.permissions), cards
+ def test_tool_installation_limit(self):
+ with mock.patch.object(ForgeWikiApp, 'max_instances') as mi:
+ mi.__get__ = mock.Mock(return_value=1)
+
+ c.user = M.User.query.get(username='root')
+ c.project = M.Project.query.get(shortname='test')
+ data = c.project.nav_data(admin_options=True)
+ menu = [tool['text'] for tool in data['installable_tools']]
+ assert_in('Wiki', menu)
+
+ r = self.app.post('/p/test/admin/update_mounts/', params={
+ 'new.install': 'install',
+ 'new.ep_name': 'Wiki',
+ 'new.ordinal': '1',
+ 'new.mount_point': 'wiki',
+ 'new.mount_label': 'Wiki'})
+
+ c.project = M.Project.query.get(shortname='test')
+ data = c.project.nav_data(admin_options=True)
+ menu = [tool['text'] for tool in data['installable_tools']]
+ assert_not_in('Wiki', menu)
+
+ r = self.app.post('/p/test/admin/update_mounts/', params={
+ 'new.install': 'install',
+ 'new.ep_name': 'Wiki',
+ 'new.ordinal': '1',
+ 'new.mount_point': 'wiki2',
+ 'new.mount_label': 'Wiki 2'})
+
+ assert 'error' in self.webflash(r)
+ assert 'limit exceeded' in self.webflash(r)
+
def test_install_tool_form(self):
r = self.app.get('/admin/install_tool?tool_name=wiki')
assert_in(u'Installing Wiki', r)
@@ -345,6 +377,20 @@ class TestProjectAdmin(TestController):
r = self.app.get('/admin/install_tool?tool_name=subproject')
assert_in(u'Installing Sub Project', r)
+ def test_grouping_threshold(self):
+ c.user = M.User.query.get(username='root')
+ c.project = M.Project.query.get(shortname='test')
+ data = c.project.nav_data(admin_options=True)
+ assert_equals(data['grouping_threshold'], 1)
+
+ self.app.post('/admin/configure_tool_grouping', params={
+ 'grouping_threshold': '2',
+ })
+
+ c.project = M.Project.query.get(shortname='test')
+ data = c.project.nav_data(admin_options=True)
+ assert_equals(data['grouping_threshold'], 2)
+
def test_project_icon(self):
file_name = 'neo-icon-set-454545-256x350.png'
file_path = os.path.join(
[5/6] allura git commit: [#7921] ticket:887 Change tests for tools,
remove redirect to admin/tools
Posted by br...@apache.org.
[#7921] ticket:887 Change tests for tools, remove redirect to admin/tools
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c9d875fb
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c9d875fb
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c9d875fb
Branch: refs/heads/master
Commit: c9d875fb95a25428fd38a307f4ac7e9bdf70e5f1
Parents: 6e2f442
Author: Denis Kotov <de...@gmail.com>
Authored: Tue Jan 19 14:06:13 2016 +0200
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 13:28:48 2016 -0500
----------------------------------------------------------------------
Allura/allura/lib/repository.py | 2 +-
.../tests/functional/test_neighborhood.py | 22 ++++++++++----------
ForgeBlog/forgeblog/main.py | 5 ++---
ForgeChat/forgechat/main.py | 4 ++--
ForgeSVN/forgesvn/svn_main.py | 4 ++--
ForgeShortUrl/forgeshorturl/main.py | 2 +-
ForgeTracker/forgetracker/tracker_main.py | 2 +-
ForgeWiki/forgewiki/wiki_main.py | 2 +-
8 files changed, 21 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/Allura/allura/lib/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index 26a1246..e273bea 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -291,7 +291,7 @@ class RepoAdminController(DefaultAdminController):
flash(message,
'error' if 'Invalid' in message else 'ok')
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
class RepoAdminRestController(BaseController):
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 5441f8c..22c5f91 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -27,7 +27,7 @@ from tg import config
from nose.tools import assert_equal, assert_in, assert_not_equal
from ming.orm.ormsession import ThreadLocalORMSession, session
from paste.httpexceptions import HTTPFound
-from pylons import app_globals as g
+from pylons import app_globals as g, tmpl_context as c
import allura
from allura import model as M
@@ -127,12 +127,12 @@ class TestNeighborhood(TestController):
r = self.app.get('/p/_admin/overview', extra_environ=dict(username='root'))
assert 'wiki, tickets' in r
- r = self.app.get('/p/test/admin/overview')
- c = re.compile('var _data = .*;')
- _data = json.loads(c.search(str(r.html)).group()[12:-1])
- tools = [tool['name'] for tool in _data['menu']]
- assert 'Wiki' not in tools
- assert 'Tickets' not in tools
+ c.user = M.User.query.get(username='root')
+ c.project = M.Project.query.get(shortname='test')
+ data = c.project.nav_data(admin_options=True)
+
+ assert 'Wiki' not in data
+ assert 'Tickets' not in data
r = self.app.post('/p/_admin/update',
params=dict(name='Projects',
@@ -175,10 +175,10 @@ class TestNeighborhood(TestController):
assert top_nav.find(href='/p/test/wiki/'), top_nav
assert top_nav.find(href='/p/test/tickets/'), top_nav
- r = self.app.get('/p/test/admin/overview')
- c = re.compile('var _data = .*;')
- _data = json.loads(c.search(str(r.html)).group()[12:-1])
- for tool in _data['menu']:
+ c.user = M.User.query.get(username='root')
+ c.project = M.Project.query.get(shortname='test')
+ data = c.project.nav_data(admin_options=True)
+ for tool in data['menu']:
if tool['name'].lower() == 'wiki':
menu = [name['text'] for name in tool['admin_options']]
assert 'Delete' not in menu
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/ForgeBlog/forgeblog/main.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/main.py b/ForgeBlog/forgeblog/main.py
index 40145f0..9154a33 100644
--- a/ForgeBlog/forgeblog/main.py
+++ b/ForgeBlog/forgeblog/main.py
@@ -430,8 +430,7 @@ class BlogAdminController(DefaultAdminController):
self.app.config.options[
'AllowEmailPosting'] = allow_email_posting and True or False
flash('Blog options updated')
- redirect(h.really_unicode(c.project.url() + 'admin/tools')
- .encode('utf-8'))
+ redirect(request.referer)
@without_trailing_slash
@expose('jinja:forgeblog:templates/blog/admin_exfeed.html')
@@ -475,7 +474,7 @@ class BlogAdminController(DefaultAdminController):
flash('Invalid link(s): %s' %
','.join(link for link in invalid_list), 'error')
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
class RootRestController(BaseController, AppRestControllerMixin):
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/ForgeChat/forgechat/main.py
----------------------------------------------------------------------
diff --git a/ForgeChat/forgechat/main.py b/ForgeChat/forgechat/main.py
index d8cd841..fb5d8b5 100644
--- a/ForgeChat/forgechat/main.py
+++ b/ForgeChat/forgechat/main.py
@@ -24,7 +24,7 @@ from datetime import date, time, datetime, timedelta
# Non-stdlib imports
from tg import expose, validate, redirect, flash
from tg.decorators import with_trailing_slash
-from pylons import tmpl_context as c
+from pylons import tmpl_context as c, request
from formencode import validators
# Pyforge-specific imports
@@ -120,7 +120,7 @@ class AdminController(DefaultAdminController):
@with_trailing_slash
def index(self, **kw):
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
@expose()
@require_post()
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index 047ad9d..49df6d1 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -17,7 +17,7 @@
#-*- python -*-
import logging
-from pylons import tmpl_context as c
+from pylons import tmpl_context as c, request
# Non-stdlib imports
from ming.utils import LazyProperty
@@ -179,7 +179,7 @@ class SVNImportController(BaseController, AdminControllerMixin):
M.Notification.post_user(
c.user, self.app.repo, 'error',
text="Can't import into non empty repository.")
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
class SVNCommitBrowserController(BaseController):
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/ForgeShortUrl/forgeshorturl/main.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/main.py b/ForgeShortUrl/forgeshorturl/main.py
index 5a42ea1..7316ac4 100644
--- a/ForgeShortUrl/forgeshorturl/main.py
+++ b/ForgeShortUrl/forgeshorturl/main.py
@@ -200,7 +200,7 @@ class ShortURLAdminController(DefaultAdminController):
@expose()
def index(self, **kw):
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
@without_trailing_slash
@expose('json:')
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index a5075db..cbf66b3 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1671,7 +1671,7 @@ class TrackerAdminController(DefaultAdminController):
for k, v in kw.iteritems():
self.app.config.options[k] = v
flash('Options updated')
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
@expose()
@require_post()
http://git-wip-us.apache.org/repos/asf/allura/blob/c9d875fb/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index aa18d58..2e897cd 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -902,4 +902,4 @@ class WikiAdminController(DefaultAdminController):
self.app.show_right_bar = show_right_bar
self.app.allow_email_posting = allow_email_posting
flash('Wiki options updated')
- redirect(c.project.url() + 'admin/tools')
+ redirect(request.referer)
[3/6] allura git commit: [#7921] ticket:887 Remove old code
Posted by br...@apache.org.
[#7921] ticket:887 Remove old code
* deleted templates/project_tools.html, js/projects_tools.js,
* admin_main.ProjectAdminController.tools, admin_main.W.install_modal
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/459003d6
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/459003d6
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/459003d6
Branch: refs/heads/master
Commit: 459003d667e1ee3a0443f10ebe731feedb4046d6
Parents: ae3ea6a
Author: Denis Kotov <de...@gmail.com>
Authored: Thu Jan 14 22:09:18 2016 +0200
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 13:28:48 2016 -0500
----------------------------------------------------------------------
Allura/allura/ext/admin/admin_main.py | 22 ---
.../ext/admin/templates/project_tools.html | 149 -------------------
Allura/allura/public/nf/js/project_tools.js | 71 ---------
3 files changed, 242 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/459003d6/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 45d5cc8..ecdd76e 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -54,8 +54,6 @@ log = logging.getLogger(__name__)
class W:
markdown_editor = ffw.MarkdownEdit()
label_edit = ffw.LabelEdit()
- install_modal = ffw.Lightbox(
- name='install_modal', trigger='a.install_trig')
explain_export_modal = ffw.Lightbox(
name='explain_export', trigger='#why_export')
group_card = aw.GroupCard()
@@ -265,26 +263,6 @@ class ProjectAdminController(BaseController):
def tools_moved(self, **kw):
return {}
- @without_trailing_slash
- @expose('jinja:allura.ext.admin:templates/project_tools.html')
- def tools(self, page=None, limit=200, **kw):
- c.markdown_editor = W.markdown_editor
- c.label_edit = W.label_edit
- c.install_modal = W.install_modal
- c.page_list = W.page_list
- mounts = c.project.ordered_mounts()
- total_mounts = len(mounts)
- limit, page = h.paging_sanitizer(limit, page or total_mounts / int(limit), total_mounts)
- start = page * limit
- return dict(
- page=page,
- limit=limit,
- total_mounts=total_mounts,
- mounts=mounts[start:start + limit],
- installable_tools=AdminApp.installable_tools_for(c.project),
- roles=M.ProjectRole.query.find(
- dict(project_id=c.project.root_project._id)).sort('_id').all(),
- categories=M.ProjectCategory.query.find(dict(parent_id=None)).sort('label').all())
@expose()
@require_post()
http://git-wip-us.apache.org/repos/asf/allura/blob/459003d6/Allura/allura/ext/admin/templates/project_tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_tools.html b/Allura/allura/ext/admin/templates/project_tools.html
deleted file mode 100644
index 7b2bc20..0000000
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ /dev/null
@@ -1,149 +0,0 @@
-{#-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--#}
-{% extends g.theme.master %}
-{% from 'allura:templates/jinja_master/sidebar_menu.html' import sidebar_item with context %}
-
-{% do g.register_forge_css('css/forge/deck.css') %}
-{% do g.register_forge_js('js/project_tools.js', location='body_js_tail') %}
-
-{% block title %}{{c.project.name}} / Tools{% endblock %}
-
-{% block header %}Tools{% endblock %}
-
-{% block content %}
-{% set full_url = h.absurl(c.project.url()) %}
- <h3>Click to install</h3>
- <div class="nested-grid-container">
- {% for tool in installable_tools %}
- <span class="tcenter grid-4 installable_tool">
- <a class="install_trig" data-tool="{{ tool['name'] }}">
- <span class="tool_title">{{ tool['app'].tool_label }}{{' (%s)' % tool.app.status if tool.app.status != 'production' else ''}}</span><br />
- <img src="{{ g.theme.app_icon_url(tool['name'], 32) or 'unk.png' }}" alt="">
- </a>
- </span>
- {% endfor %}
- <span class="tcenter grid-4 installable_tool">
- <a class="install_trig" data-tool="">
- <span class="tool_title">Subproject</span><br />
- <img src="{{ g.theme.app_icon_url('subproject', 32) }}" alt="">
- </a>
- </span>
- </div>
- <form method="post" action="update_mounts?limit={{limit}}&page={{page}}" id="install_form" style="display:none">
- <input type="hidden" name="new.ordinal" value="{{total_mounts}}"/>
- <input type="hidden" name="new.ep_name" class="new_ep_name">
- <label class="grid-13" for="new.mount_label">Label</label>
- <div class="grid-13"><input type="text" name="new.mount_label" class="new_mount_label" title="This will be the name displayed in your project toolbar.">
- </div>
- <label class="grid-13" for="new.mount_point">Url Path</label>
- <div class="grid-13">
- <input id="id_url_input" type="text" name="new.mount_point" title="The url for this tool relative to {{ full_url }} " class="new_mount_point">
- <p><span id="full-url-preview" data-url="{{full_url}}"></span></p>
- </div>
- <div id="install_options">{# js inserts form fields here #}</div>
- <div class="grid-13"> </div>
- <hr>
- <div class="grid-13"> </div>
- <div class="grid-13">
- <input type="submit" value="Save" name="new.install"> <a href="#" class="close btn link">Cancel</a>
- </div>
- {{lib.csrf_token()}}
- </form>
- {{c.install_modal.display(content='<h1>Install <span id="install_tool_label">Tool</span></h1>')}}
-
-<div>
- {{c.page_list.display(page=page, limit=limit, count=total_mounts)}}
-</div>
-<h3>Installed tools</h3>
-<p>
- Sortable - define top menu order by moving tools with your mouse.
-</p>
-<div id="sortable" class="clearfix fourcol">
- {% for mount in mounts %}
- {% if 'ac' in mount %}
- {% set app = mount['ac'].load()(c.project, mount['ac']) %}
- {% set links = app.admin_menu() %}
- {% set label = mount['ac'].options['mount_label'] if mount['ac'].options['mount_label'] != 'Tool Name' else mount['ac'].options['mount_point'] %}
-
- <div class="fleft {%if app.tool_label.lower()=='admin' or (app.tool_label.lower() in app.project.neighborhood.get_anchored_tools().keys())%}isnt_sorted{%endif%}">
- <ul class="deck">
- <li class="tcenter">
- <span class="tool_title">{{ label }}</span><br />
- <img src="{{ g.theme.app_icon_url(app, 48) }}" alt="">
- </li>
- {% for link in links %}
- {{sidebar_item(link)}}
- {% endfor %}
- {{sidebar_item(app.admin_menu_delete_button)}}
- </ul>
- {# for ordering #}
- <input type="hidden" class="mount_point" value="{{mount['ac'].options.mount_point}}"/>
- </div>
- {% endif %}
- {% if 'sub' in mount and not mount['sub'].deleted %}
- <div class="fleft">
- <ul class="deck">
- <li class="tcenter">
- <span class="tool_name">{{ mount['sub'].name }}</span><br />
- <img src="{{ g.theme.app_icon_url('subproject', 48) }}" alt="">
- </li>
- </ul>
- </div>
- {% endif %}
- {% endfor %}
- </div>
-</div>
-<div style="clear:both">
- {{c.page_list.display(page=page, limit=limit, count=total_mounts)}}
-</div>
-<div><!--dummy-->
-
-<h3 style="clear:left">Grouping</h3>
-<form method="POST" action="configure_tool_grouping?limit={{limit}}&page={{page}}" id="configure_grouping_form">
- <label>Threshold for grouping tools by type:
- <input name="grouping_threshold" value="{{c.project.get_tool_data('allura', 'grouping_threshold', 1)}}"/>
- </label>
- <br/><input type="submit" value="Change"/>
- {{lib.csrf_token()}}
-</form>
-{% endblock %}
-
-{% block extra_css %}
-<style type="text/css">
-.pad .fourcol .fleft {
- min-height: 200px;
-}
-div.isnt_sorted > ul.deck {
- cursor: not-allowed;
-}
-#configure_grouping_form {
- padding-left: 10px;
-}
-#configure_grouping_form input[name=grouping_threshold] {
- width: 1.5em;
-}
-#full-url-preview{
- color: white;
- font-size: small;
-}
-#full-url-preview .url-keyword{
- color: orange;
-}
-</style>
-{% endblock %}
http://git-wip-us.apache.org/repos/asf/allura/blob/459003d6/Allura/allura/public/nf/js/project_tools.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/project_tools.js b/Allura/allura/public/nf/js/project_tools.js
deleted file mode 100644
index ce8d28b..0000000
--- a/Allura/allura/public/nf/js/project_tools.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-(function() {
-
- // sorting
- $('#sortable').sortable({items: ".fleft:not(.isnt_sorted)"}).bind( "sortupdate", function (e) {
- var sortables = $('#sortable .fleft');
- var tools = 0;
- var subs = 0;
- var params = {'_session_id':$.cookie('_session_id')};
- var action = $('#install_form').attr('action');
- var limit = action.match(/limit=(\d+)/)[1];
- var page = action.match(/page=(\d+)/)[1];
- var first_tool_ordinal = parseInt(limit) * parseInt(page);
- for (var i = 0, len = sortables.length; i < len; i++) {
- var item = $(sortables[i]);
- var mount_point = item.find('input.mount_point');
- var shortname = item.find('input.shortname');
- if (mount_point.length) {
- params['tools-' + tools + '.mount_point'] = mount_point.val();
- params['tools-' + tools + '.ordinal'] = i + first_tool_ordinal;
- tools++;
- }
- if (shortname.length) {
- params['subs-' + subs + '.shortname'] = shortname.val();
- params['subs-' + subs + '.ordinal'] = i + first_tool_ordinal;
- subs++;
- }
- }
- $.ajax({
- type: 'POST',
- url: 'update_mount_order',
- data: params,
- success: function(xhr, textStatus, errorThrown) {
- $('#messages').notify('Tool order updated, refresh this page to see the updated project navigation.',
- {status: 'confirm'});
- },
- error: function(xhr, textStatus, errorThrown) {
- $('#messages').notify('Error saving tool order.',
- {status: 'error'});
- }
- });
- });
- // fix firefox scroll offset bug
- var userAgent = navigator.userAgent.toLowerCase();
- if(userAgent.match(/firefox/)) {
- $('#sortable').bind( "sortstart", function (event, ui) {
- ui.helper.css('margin-top', $(window).scrollTop() );
- });
- $('#sortable').bind( "sortbeforestop", function (event, ui) {
- ui.helper.css('margin-top', 0 );
- });
- }
-})();