You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/10/03 19:14:06 UTC
[01/50] git commit: [#6392] ticket:432 Fix bug with saving
permissions when there are blocked users
Updated Branches:
refs/heads/cj/6422 05ff83e59 -> 21a2113b9 (forced update)
[#6392] ticket:432 Fix bug with saving permissions when there are blocked users
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/52b70435
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/52b70435
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/52b70435
Branch: refs/heads/cj/6422
Commit: 52b70435c67873c3cecd94b95dbdcf4003898131
Parents: 19327f4
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Sep 13 13:29:48 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 29 ++++++++++++++++++++---
Allura/allura/tests/functional/test_admin.py | 22 +++++++++++++++++
2 files changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/52b70435/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index a9a8816..74d9c4d 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -730,18 +730,41 @@ class DefaultAdminController(BaseController):
if isinstance(group_ids, basestring):
group_ids = [ group_ids ]
+ # ACE.deny() entries for blocked users will end up in del_group_ids after the following
for acl in old_acl:
if (acl['permission']==perm) and (str(acl['role_id']) not in group_ids):
del_group_ids.append(str(acl['role_id']))
- if new_group_ids or del_group_ids:
+ get_role = lambda _id: model.ProjectRole.query.get(_id=ObjectId(_id))
+ groups = map(get_role, group_ids)
+ new_groups = map(get_role, new_group_ids)
+ del_groups = map(get_role, del_group_ids)
+
+ def split_group_user_roles(roles):
+ group_roles = []
+ user_roles = []
+ for role in roles:
+ if role.user_id and not role.name:
+ user_roles.append(role)
+ else:
+ group_roles.append(role)
+ return group_roles, user_roles
+
+ del_groups, user_roles = split_group_user_roles(del_groups)
+
+ if new_groups or del_groups:
model.AuditLog.log('updated "%s" permission: "%s" => "%s" for %s' % (
perm,
- ', '.join(map(lambda id: model.ProjectRole.query.get(_id=ObjectId(id)).name, group_ids+del_group_ids)),
- ', '.join(map(lambda id: model.ProjectRole.query.get(_id=ObjectId(id)).name, group_ids+new_group_ids)),
+ ', '.join(map(lambda role: role.name, groups+del_groups)),
+ ', '.join(map(lambda role: role.name, groups+new_groups)),
self.app.config.options['mount_point']))
role_ids = map(ObjectId, group_ids + new_group_ids)
self.app.config.acl += [
model.ACE.allow(r, perm) for r in role_ids]
+
+ # Add all ACEs for user roles back
+ user_roles_ids = map(lambda role: role._id, user_roles)
+ user_aces = filter(lambda ace: ace.permission == perm and ace.role_id in user_roles_ids, old_acl)
+ self.app.config.acl += user_aces
redirect(request.referer)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/52b70435/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 a0378e1..b5a3569 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -229,6 +229,28 @@ class TestProjectAdmin(TestController):
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-list">' not in r
+ @td.with_wiki
+ def test_blocked_users_remains_after_saving_all_permissions(self):
+ self.app.post('/admin/wiki/block_user', params={'username': 'test-user', 'perm': 'read', 'reason': 'Comment'})
+ self.app.post('/admin/wiki/block_user', params={'username': 'test-user', 'perm': 'post', 'reason': 'Comment'})
+ user = M.User.by_username('test-user')
+ user_role = user.project_role()
+ app = M.Project.query.get(shortname='test').app_instance('wiki')
+ assert M.ACL.contains(M.ACE.deny(user_role._id, 'read'), app.acl)
+ assert M.ACL.contains(M.ACE.deny(user_role._id, 'post'), app.acl)
+ old_acl = app.acl
+
+ permissions_page = self.app.get('/admin/wiki/permissions')
+ permissions_page.forms[0].submit()
+
+ # deny ACEs for user still should be there
+ app = M.Project.query.get(shortname='test').app_instance('wiki')
+ assert M.ACL.contains(M.ACE.deny(user_role._id, 'read'), app.acl)
+ assert M.ACL.contains(M.ACE.deny(user_role._id, 'post'), app.acl)
+ # ...and all old ACEs also
+ for ace in old_acl:
+ assert_in(ace, app.acl)
+
def test_tool_permissions(self):
BUILTIN_APPS = ['activity', 'blog', 'discussion', 'git', 'link',
'shorturl', 'svn', 'tickets', 'userstats', 'wiki']
[27/50] git commit: [#6612] fail faster if an import fails
Posted by jo...@apache.org.
[#6612] fail faster if an import fails
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/7fc8966d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/7fc8966d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/7fc8966d
Branch: refs/heads/cj/6422
Commit: 7fc8966d35d4a995d8525f5c9f12f13db6814c4a
Parents: acfb7b5
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Sep 27 16:18:17 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Sep 27 16:18:17 2013 +0000
----------------------------------------------------------------------
.../forgetracker/tests/functional/test_import.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7fc8966d/ForgeTracker/forgetracker/tests/functional/test_import.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_import.py b/ForgeTracker/forgetracker/tests/functional/test_import.py
index 9a36db6..b352f0f 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_import.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_import.py
@@ -117,8 +117,9 @@ class TestImportController(TestRestApiBase):
doc_text = open(here_dir + '/data/sf.json').read()
doc_json = json.loads(doc_text)
ticket_json = doc_json['trackers']['default']['artifacts'][0]
- self.api_post('/rest/p/test/bugs/perform_import',
+ r = self.api_post('/rest/p/test/bugs/perform_import',
doc=doc_text, options='{"user_map": {"hinojosa4": "test-admin", "ma_boehm": "test-user"}}')
+ assert r.json['status'], r.json
ming.orm.ThreadLocalORMSession.flush_all()
M.MonQTask.run_ready()
@@ -183,8 +184,9 @@ class TestImportController(TestRestApiBase):
self.set_api_token(api_ticket)
doc_text = open(here_dir + '/data/milestone-tickets.json').read()
- self.api_post('/rest/p/test/bugs/perform_import', doc=doc_text,
+ r = self.api_post('/rest/p/test/bugs/perform_import', doc=doc_text,
options='{"user_map": {"hinojosa4": "test-admin", "ma_boehm": "test-user"}}')
+ assert r.json['status'], r.json
ming.orm.ThreadLocalORMSession.flush_all()
M.MonQTask.run_ready()
@@ -224,8 +226,9 @@ class TestImportController(TestRestApiBase):
self.set_api_token(api_ticket)
doc_text = open(os.path.dirname(__file__) + '/data/sf.json').read()
- self.api_post('/rest/p/test/bugs/perform_import',
+ r = self.api_post('/rest/p/test/bugs/perform_import',
doc=doc_text, options='{"user_map": {"hinojosa4": "test-admin", "ma_boehm": "test-user"}}')
+ assert r.json['status'], r.json
r = self.app.get('/p/test/bugs/204/')
ticket = TM.Ticket.query.get(app_config_id=c.app.config._id,
@@ -247,8 +250,9 @@ class TestImportController(TestRestApiBase):
self.set_api_token(api_ticket)
doc_text = open(os.path.dirname(__file__) + '/data/sf.json').read()
- self.api_post('/rest/p/test/bugs/perform_import',
+ r = self.api_post('/rest/p/test/bugs/perform_import',
doc=doc_text, options='{"user_map": {"hinojosa4": "test-admin", "ma_boehm": "test-user"}}')
+ assert r.json['status'], r.json
ticket = TM.Ticket.query.get(app_config_id=c.app.config._id,
ticket_num=204)
comments = ticket.discussion_thread.post_class().query.find(dict(
[47/50] git commit: [#6422] Bubbled up LICENSE items from
Allura/LICENSE and condensed to pointers
Posted by jo...@apache.org.
[#6422] Bubbled up LICENSE items from Allura/LICENSE and condensed to pointers
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/8574e372
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8574e372
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8574e372
Branch: refs/heads/cj/6422
Commit: 8574e372396b13bf5f9740c0464582aedf80a44c
Parents: 32204be
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 17 21:25:48 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 19:01:26 2013 +0000
----------------------------------------------------------------------
Allura/LICENSE | 401 ++--------------------------
Allura/allura/public/nf/js/spin.min.js | 25 +-
LICENSE | 25 +-
3 files changed, 71 insertions(+), 380 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8574e372/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index b38e207..de4eeac 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -208,380 +208,27 @@ separate copyright notices and license terms. Your use of the source code
for the these subcomponents is subject to the terms and conditions of the
following licenses.
-For jQueryUI, in files
-allura/lib/widgets/resources/css/autocomplete.css
-allura/lib/widgets/resources/css/jquery.ui.datepicker.css
-allura/public/nf/css/forge/accordion.css
-allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
-allura/public/nf/js/jquery-base.js
-
- Copyright 2010 jQuery Foundation and other contributors,
- http://jqueryui.com/
-
- This software consists of voluntary contributions made by many
- individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
- contribution history, see the revision history and logs, available
- at http://jquery-ui.googlecode.com/svn/
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery Font selector plugin, in file
-allura/lib/widgets/resources/js/jqfontselector.js
-
- Copyright (c) 2012 James Carmichael
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
-For Autosize, in file
-allura/lib/widgets/resources/js/jquery.autosize-min.js
-
- Copyright (c) 2012 Jack Moore - jacklmoore.com
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
-For Really Simple Color Picker in jQuery, in file
-allura/lib/widgets/resources/js/jquery.colorPicker.js
-
- Copyright (c) 2008 Lakshan Perera (www.laktek.com)
- Daniel Lacy (daniellacy.com)
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to
- deal in the Software without restriction, including without limitation the
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- sell copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- IN THE SOFTWARE.
-
-For Tabby jQuery plugin, in file
-allura/lib/widgets/resources/js/jquery.textarea.js
-
- Copyright (c) 2009 Ted Devito
-
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
- conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
- in the documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-For jquery.tools, in file
-allura/lib/widgets/resources/js/jquery.tools.min.js
-
- Copyright (c) 2009 Tero Piirainen
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to
- deal in the Software without restriction, including without limitation the
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- sell copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- IN THE SOFTWARE.
-
-For Blueprint CSS Framework, in directory
-allura/public/nf/css/blueprint/
-
- Copyright (c) 2007 - 2010 blueprintcss.org
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery, in file
-allura/public/nf/js/jquery-base.js
-
- Copyright 2013 jQuery Foundation and other contributors
- http://jquery.com/
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For Cookie plugin, in file
-allura/public/nf/js/jquery-base.js
-
- Copyright (c) 2006 Klaus Hartl (stilbuero.de)
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery Tooltip plugin, in file
-allura/public/nf/js/jquery-base.js
-
- Copyright (c) 2006 - 2008 Jörn Zaefferer
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery-Plugin "daterangepicker.jQuery.js", in file
-allura/public/nf/js/jquery.daterangepicker.js
-
- The MIT License
-
- Copyright (c) 2008, Filament Group, Inc
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-
- The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by Filament Group, Inc (http://www.filamentgroup.com/) and its
- contributors", in the same place and form as other third-party acknowledgments.
- Alternately, this acknowledgment may appear in the software itself, in the same
- form and location as other such third-party acknowledgments.
-
-For Javascript plotting library for jQuery, in file
-allura/public/nf/js/jquery.flot.js
-
- Copyright (c) 2007-2009 IOLA and Ole Laursen
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
-For Textarea Max Length for jQuery v1.1.0, in file
-allura/public/nf/js/jquery.maxlength.js
-
- Copyright 2012 jQuery Foundation and other contributors
- http://jquery.com/
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For spin.js, in file
-allura/public/nf/js/spin.min.js
-
- The MIT License
-
- Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-
-For Vector and Matrix mathematics modules for JavaScript, in file
-allura/public/nf/js/sylvester.js
-
- Copyright (c) 2007 James Coglan
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
+Blueprint, which is available under the MIT license.
+For details, see Allura/allura/public/nf/css/blueprint/
+
+Spin.js, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/spin.min.js
+
+Sylvester, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/sylvester.js
+
+jQuery, jQueryUI, and various related plugins, which are available
+under the MIT license. For details, see the individual files:
+ Allura/allura/public/nf/js/jquery-base.js
+ Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+ Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+ Allura/allura/lib/widgets/resources/css/autocomplete.css
+ Allura/allura/public/nf/css/forge/accordion.css
+ Allura/allura/lib/widgets/resources/js/jqfontselector.js
+ Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
+ Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
+ Allura/allura/lib/widgets/resources/js/jquery.textarea.js
+ Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
+ Allura/allura/public/nf/js/jquery.daterangepicker.js
+ Allura/allura/public/nf/js/jquery.flot.js
+ Allura/allura/public/nf/js/jquery.maxlength.min.js
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8574e372/Allura/allura/public/nf/js/spin.min.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/spin.min.js b/Allura/allura/public/nf/js/spin.min.js
index c38b40e..21af822 100644
--- a/Allura/allura/public/nf/js/spin.min.js
+++ b/Allura/allura/public/nf/js/spin.min.js
@@ -1,2 +1,25 @@
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
//fgnass.github.com/spin.js#v1.2.5
-(function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b<c;b++)a.appendChild(arguments[b]);return a}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";return e[g]||(i.insertRule("@"+l+"keyframes "+g+"{"+"0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}"+"100%{opacity:"+j+"}"+"}",0),e[g]=1),g}function k(a,b){var e=a.style,f,g;if(e[b]!==c)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c)return f}}function l(a,b){for(var c in b)a.style[k(a,c)||c]=b[c];return a}function m(a){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var e in d)a[e]===c&&(a[e]=d[e])}return a}function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent)b.x+=a.offsetLeft,b.y+=a.offsetTop;return
b}var d=["webkit","Moz","ms","O"],e={},f,i=function(){var a=g("style");return h(b.getElementsByTagName("head")[0],a),a.sheet||a.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},p=function q(a){if(!this.spin)return new q(a);this.opts=m(a||{},q.defaults,o)};p.defaults={},m(p.prototype,{spin:function(a){this.stop();var b=this,c=b.opts,d=b.el=l(g(0,{className:c.className}),{position:"relative",zIndex:c.zIndex}),e=c.radius+c.length+c.width,h,i;a&&(a.insertBefore(d,a.firstChild||null),i=n(a),h=n(d),l(d,{left:(c.left=="auto"?i.x-h.x+(a.offsetWidth>>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)
}b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++)d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:b.hwaccel?"translate3d(0,0,0)":"",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")));return a},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),!function(){function a(a,b){return g("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',b)}var b=l(
g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}):f=k(b,"animation")}(),a.Spinner=p})(window,docume
nt);
\ No newline at end of file
+(function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b<c;b++)a.appendChild(arguments[b]);return a}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";return e[g]||(i.insertRule("@"+l+"keyframes "+g+"{"+"0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}"+"100%{opacity:"+j+"}"+"}",0),e[g]=1),g}function k(a,b){var e=a.style,f,g;if(e[b]!==c)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c)return f}}function l(a,b){for(var c in b)a.style[k(a,c)||c]=b[c];return a}function m(a){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var e in d)a[e]===c&&(a[e]=d[e])}return a}function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent)b.x+=a.offsetLeft,b.y+=a.offsetTop;return
b}var d=["webkit","Moz","ms","O"],e={},f,i=function(){var a=g("style");return h(b.getElementsByTagName("head")[0],a),a.sheet||a.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},p=function q(a){if(!this.spin)return new q(a);this.opts=m(a||{},q.defaults,o)};p.defaults={},m(p.prototype,{spin:function(a){this.stop();var b=this,c=b.opts,d=b.el=l(g(0,{className:c.className}),{position:"relative",zIndex:c.zIndex}),e=c.radius+c.length+c.width,h,i;a&&(a.insertBefore(d,a.firstChild||null),i=n(a),h=n(d),l(d,{left:(c.left=="auto"?i.x-h.x+(a.offsetWidth>>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)
}b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++)d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:b.hwaccel?"translate3d(0,0,0)":"",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")));return a},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),!function(){function a(a,b){return g("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',b)}var b=l(
g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}):f=k(b,"animation")}(),a.Spinner=p})(window,docume
nt);
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8574e372/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 5202aaa..b7967a4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -209,6 +209,27 @@ notices and license terms. Your use of the source code for the these
subcomponents is subject to the terms and conditions of the following
licenses.
-
Blueprint, which is available under the MIT license.
-For details, see Allura/allura/public/nf/css/blueprint/.
+For details, see Allura/allura/public/nf/css/blueprint/
+
+Spin.js, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/spin.min.js
+
+Sylvester, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/sylvester.js
+
+jQuery, jQueryUI, and various related plugins, which are available
+under the MIT license. For details, see the individual files:
+ Allura/allura/public/nf/js/jquery-base.js
+ Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+ Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+ Allura/allura/lib/widgets/resources/css/autocomplete.css
+ Allura/allura/public/nf/css/forge/accordion.css
+ Allura/allura/lib/widgets/resources/js/jqfontselector.js
+ Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
+ Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
+ Allura/allura/lib/widgets/resources/js/jquery.textarea.js
+ Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
+ Allura/allura/public/nf/js/jquery.daterangepicker.js
+ Allura/allura/public/nf/js/jquery.flot.js
+ Allura/allura/public/nf/js/jquery.maxlength.min.js
[24/50] git commit: [#6612] Preserve original ticket owner if
username lookup fails
Posted by jo...@apache.org.
[#6612] Preserve original ticket owner if username lookup fails
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a580f3ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a580f3ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a580f3ec
Branch: refs/heads/cj/6422
Commit: a580f3ecb7b3bf68833300fec9a301bf2a4b984f
Parents: 2b52897
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu Sep 26 18:28:29 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Sep 27 15:20:52 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/import_support.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a580f3ec/ForgeTracker/forgetracker/import_support.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/import_support.py b/ForgeTracker/forgetracker/import_support.py
index c6a33cb..ef649dc 100644
--- a/ForgeTracker/forgetracker/import_support.py
+++ b/ForgeTracker/forgetracker/import_support.py
@@ -205,10 +205,15 @@ class ImportSupport(object):
remapped[new_f] = conv(v)
description = h.really_unicode(self.link_processing(remapped['description']))
+ creator = owner = ''
if ticket_dict['submitter'] and not remapped['reported_by_id']:
- description = u'Originally created by: {0}\n\n{1}'.format(
- h.really_unicode(ticket_dict['submitter']), description)
- remapped['description'] = description
+ creator = u'*Originally created by:* {0}\n'.format(
+ h.really_unicode(ticket_dict['submitter']))
+ if ticket_dict['assigned_to'] and not remapped['assigned_to_id']:
+ owner = u'*Originally owned by:* {0}\n'.format(
+ h.really_unicode(ticket_dict['assigned_to']))
+ remapped['description'] = u'{0}{1}{2}{3}'.format(creator, owner,
+ '\n' if creator or owner else '', description)
ticket_num = ticket_dict['id']
existing_ticket = TM.Ticket.query.get(app_config_id=c.app.config._id,
[48/50] git commit: [#6422] Added missed 3rd-party lib to LICENSE and
changed verbiage
Posted by jo...@apache.org.
[#6422] Added missed 3rd-party lib to LICENSE and changed verbiage
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/bd3b07ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/bd3b07ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/bd3b07ff
Branch: refs/heads/cj/6422
Commit: bd3b07ff678ccc57c2787db3c7c20a1c1e96c953
Parents: 41fe4a6
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Sep 18 19:30:24 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 19:01:26 2013 +0000
----------------------------------------------------------------------
Allura/LICENSE | 4 ++++
LICENSE | 14 +++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd3b07ff/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index 973fd44..ffb5ecb 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -208,6 +208,10 @@ separate copyright notices and license terms. Your use of the source code
for the these subcomponents is subject to the terms and conditions of the
following licenses.
+HTML5 Canvas for Internet Explorer, which is available under the
+Apache License, Version 2.0.
+For details, see Allura/allura/public/nf/js/excanvas.compiled.js
+
The file allura/etc/mime.types from the mime-support package,
which is in the public domain. For details, see
http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd3b07ff/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 8f47b97..e558325 100644
--- a/LICENSE
+++ b/LICENSE
@@ -202,12 +202,16 @@
limitations under the License.
-ALLURA SUBCOMPONENTS:
+THIRD-PARTY DEPENDENCIES:
-Apache Allura includes a number of subcomponents with separate copyright
-notices and license terms. Your use of the source code for the these
-subcomponents is subject to the terms and conditions of the following
-licenses.
+Apache Allura includes a number of third-party dependencies with
+separate copyright notices and license terms. Your use of the source code
+for the these dependencies is subject to the terms and conditions of the
+following licenses.
+
+HTML5 Canvas for Internet Explorer, which is available under the
+Apache License, Version 2.0.
+For details, see Allura/allura/public/nf/js/excanvas.compiled.js
The file Allura/allura/etc/mime.types from the mime-support package,
which is in the public domain. For details, see
[45/50] git commit: [#6422] Added LICENSE file for Blueprint and
pointer in base LICENSE
Posted by jo...@apache.org.
[#6422] Added LICENSE file for Blueprint and pointer in base LICENSE
License file obtained from:
https://raw.github.com/joshuaclayton/blueprint-css/master/LICENSE
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/32204be2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/32204be2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/32204be2
Branch: refs/heads/cj/6422
Commit: 32204be232b0922c533999f73407e4227ba58bf5
Parents: 73a767d
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 17 20:54:31 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 19:01:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/public/nf/css/blueprint/LICENSE | 22 ++++++++++++++++++++++
LICENSE | 12 ++++++++++++
2 files changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/32204be2/Allura/allura/public/nf/css/blueprint/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/css/blueprint/LICENSE b/Allura/allura/public/nf/css/blueprint/LICENSE
new file mode 100644
index 0000000..13076fb
--- /dev/null
+++ b/Allura/allura/public/nf/css/blueprint/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2007 - 2010 blueprintcss.org
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/32204be2/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index d645695..5202aaa 100644
--- a/LICENSE
+++ b/LICENSE
@@ -200,3 +200,15 @@
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.
+
+
+ALLURA SUBCOMPONENTS:
+
+Apache Allura includes a number of subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+
+Blueprint, which is available under the MIT license.
+For details, see Allura/allura/public/nf/css/blueprint/.
[33/50] git commit: [#6431] bump ming version to get aggregate()
method
Posted by jo...@apache.org.
[#6431] bump ming version to get aggregate() method
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f76bf432
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f76bf432
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f76bf432
Branch: refs/heads/cj/6422
Commit: f76bf432df6034fe537a8b0bf1aa20abdafa8ecd
Parents: 128a4dd
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Sep 27 15:18:55 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Oct 1 20:40:42 2013 +0000
----------------------------------------------------------------------
requirements-common.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f76bf432/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index 51c7636..e99b5e9 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -21,7 +21,7 @@ httplib2==0.7.4
iso8601==0.1.4
Jinja2==2.6
Markdown==2.2.0
-Ming==0.4.1
+Ming==0.4.2
oauth2==1.5.170
# tg2 dep PasteDeploy must specified before TurboGears2, to avoid a version/allow-hosts problem
Paste==1.7.5.1
[16/50] git commit: [#6392] ticket:444 added ajax to unblock user
Posted by jo...@apache.org.
[#6392] ticket:444 added ajax to unblock user
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2a570132
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2a570132
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2a570132
Branch: refs/heads/cj/6422
Commit: 2a570132fac1dc851b036befbf89fc0846e3f3ef
Parents: 83903bb
Author: coldmind <so...@yandex.ru>
Authored: Thu Sep 19 14:18:29 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 6 +++---
Allura/allura/templates/app_admin_permissions.html | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a570132/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index b88f23a..d172a65 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -600,7 +600,8 @@ class DefaultAdminController(BaseController):
@validate(dict(user_id=V.Set(),
perm=V.UnicodeString()))
- @expose()
+ @expose('json:')
+ @require_post()
def unblock_user(self, user_id=None, perm=None):
try:
user_id = map(ObjectId, user_id)
@@ -608,8 +609,7 @@ class DefaultAdminController(BaseController):
user_id = []
users = model.User.query.find({'_id': {'$in': user_id}}).all()
if not users:
- flash('Select user to unblock', 'error')
- redirect(request.referer)
+ return dict(error='Select user to unblock')
for user in users:
ace = model.ACE.deny(user.project_role()._id, perm)
ace = model.ACL.contains(ace, self.app.acl)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a570132/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index 96471d4..fb5aa61 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -78,7 +78,7 @@
$('input.block_user_role').val(role);
$('div.model-block-list').html(userlist.html());
});
- $('form[action="block_user"]').submit(function() {
+ $('form[action="block_user"], form[action="unblock_user"]').submit(function() {
var form = $(this);
if($(this).is(':visible')) {
$.ajax({
[34/50] git commit: [#6431] Fix places that were still expecting a
cursor
Posted by jo...@apache.org.
[#6431] Fix places that were still expecting a cursor
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/128a4ddf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/128a4ddf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/128a4ddf
Branch: refs/heads/cj/6422
Commit: 128a4ddf57a697616bea150f38596d99f28ac29a
Parents: 44963d1
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu Sep 26 16:46:20 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Oct 1 20:40:42 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/auth.py | 2 +-
ForgeTracker/forgetracker/tests/unit/test_ticket_model.py | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/128a4ddf/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 6562d6e..ae08146 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -266,7 +266,7 @@ class AuthController(BaseController):
repos = []
for p in user.my_projects():
- for p in [p] + p.direct_subprojects.all():
+ for p in [p] + p.direct_subprojects:
for app in p.app_configs:
if not issubclass(g.entry_points["tool"][app.tool_name], RepositoryApp):
continue
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/128a4ddf/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 93450d1..90eba99 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -20,6 +20,7 @@ from datetime import datetime
import urllib2
from ming.orm.ormsession import ThreadLocalORMSession
+from ming.orm import session
from ming import schema
from nose.tools import raises, assert_raises, assert_equal, assert_in
@@ -275,8 +276,11 @@ class TestTicketModel(TrackerTestWithModel):
TicketAttachment.save_attachment('test_ticket_model.py', ResettableStream(f),
artifact_id=ticket._id)
ThreadLocalORMSession.flush_all()
- assert_equal(ticket.attachments.count(), 1)
- assert_equal(ticket.attachments.first().filename, 'test_ticket_model.py')
+ # need to refetch since attachments are cached
+ session(ticket).expunge(ticket)
+ ticket = Ticket.query.get(_id=ticket._id)
+ assert_equal(len(ticket.attachments), 1)
+ assert_equal(ticket.attachments[0].filename, 'test_ticket_model.py')
def test_json_parents(self):
ticket = Ticket.new()
[49/50] git commit: [#6422] Cleaned up LICENSE and NOTICE files and
fixed license issues
Posted by jo...@apache.org.
[#6422] Cleaned up LICENSE and NOTICE files and fixed license issues
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/41fe4a69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/41fe4a69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/41fe4a69
Branch: refs/heads/cj/6422
Commit: 41fe4a69eab98d7fb58339205fe04c0d7197ae6e
Parents: 8574e37
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Sep 18 19:14:49 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 19:01:26 2013 +0000
----------------------------------------------------------------------
Allura/LICENSE | 47 ++++++++++++---------
Allura/NOTICE | 21 ++-------
Allura/allura/controllers/controller.template | 16 +++++++
Allura/allura/public/nf/images/beta_sf.psd | Bin 2027421 -> 0 bytes
AlluraTest/LICENSE | 26 +-----------
AlluraTest/jslint/LICENSE | 21 +++++++++
ForgeDiscussion/NOTICE | 8 ++--
ForgeGit/NOTICE | 8 ++--
ForgeLink/NOTICE | 8 ++--
ForgeSVN/NOTICE | 8 ++--
ForgeTracker/NOTICE | 8 ++--
ForgeWiki/NOTICE | 8 ++--
LICENSE | 28 ++++++++----
NoWarnings/NOTICE | 8 ++--
rat-excludes.txt | 21 ++++-----
15 files changed, 127 insertions(+), 109 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index de4eeac..973fd44 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -208,27 +208,36 @@ separate copyright notices and license terms. Your use of the source code
for the these subcomponents is subject to the terms and conditions of the
following licenses.
+The file allura/etc/mime.types from the mime-support package,
+which is in the public domain. For details, see
+http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
+
+ASCII, Dammit, which is in the public domain.
+For details, see allura/lib/AsciiDammit.py
+
+jQuery, jQueryUI, and various related plugins, which are available
+under the MIT license. For details, see the individual files:
+ allura/public/nf/js/jquery-base.js
+ allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+ allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+ allura/public/nf/js/jquery.daterangepicker.js
+ allura/public/nf/css/forge/ui.daterangepicker.css
+ allura/lib/widgets/resources/css/autocomplete.css
+ allura/public/nf/css/forge/accordion.css
+ allura/lib/widgets/resources/js/jqfontselector.js
+ allura/lib/widgets/resources/js/jquery.autosize-min.js
+ allura/lib/widgets/resources/js/jquery.colorPicker.js
+ allura/lib/widgets/resources/js/jquery.tagsinput.js
+ allura/lib/widgets/resources/js/jquery.textarea.js
+ allura/lib/widgets/resources/js/jquery.tools.min.js
+ allura/public/nf/js/jquery.flot.js
+ allura/public/nf/js/jquery.maxlength.min.js
+
Blueprint, which is available under the MIT license.
-For details, see Allura/allura/public/nf/css/blueprint/
+For details, see allura/public/nf/css/blueprint/
Spin.js, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/spin.min.js
+For details, see allura/public/nf/js/spin.min.js
Sylvester, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/sylvester.js
-
-jQuery, jQueryUI, and various related plugins, which are available
-under the MIT license. For details, see the individual files:
- Allura/allura/public/nf/js/jquery-base.js
- Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
- Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
- Allura/allura/lib/widgets/resources/css/autocomplete.css
- Allura/allura/public/nf/css/forge/accordion.css
- Allura/allura/lib/widgets/resources/js/jqfontselector.js
- Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
- Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
- Allura/allura/lib/widgets/resources/js/jquery.textarea.js
- Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
- Allura/allura/public/nf/js/jquery.daterangepicker.js
- Allura/allura/public/nf/js/jquery.flot.js
- Allura/allura/public/nf/js/jquery.maxlength.min.js
+For details, see allura/public/nf/js/sylvester.js
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/Allura/NOTICE
----------------------------------------------------------------------
diff --git a/Allura/NOTICE b/Allura/NOTICE
index 8157ed8..40b6969 100644
--- a/Allura/NOTICE
+++ b/Allura/NOTICE
@@ -1,18 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
-
- This software contains library for converting various
- characters to ASCII encoding, written by Leonard Richardson
- and placed into public domain.
-
- This software contains library for checking maximum length
- of text area's content, written by Keith Wood.
-
- This software contains lightbox plugin for jQuery, written by
- Buck Wilson.
-
- Canvas functionality in Internet Explorer(r) is provided
- by code developed at Google Inc.
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/Allura/allura/controllers/controller.template
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/controller.template b/Allura/allura/controllers/controller.template
index d7fd65b..f565369 100644
--- a/Allura/allura/controllers/controller.template
+++ b/Allura/allura/controllers/controller.template
@@ -1,4 +1,20 @@
# -*- coding: utf-8 -*-
+# 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.
"""Sample controller module"""
# turbogears imports
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/Allura/allura/public/nf/images/beta_sf.psd
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/images/beta_sf.psd b/Allura/allura/public/nf/images/beta_sf.psd
deleted file mode 100644
index 9e74297..0000000
Binary files a/Allura/allura/public/nf/images/beta_sf.psd and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/AlluraTest/LICENSE
----------------------------------------------------------------------
diff --git a/AlluraTest/LICENSE b/AlluraTest/LICENSE
index 15f71ee..8da34a3 100644
--- a/AlluraTest/LICENSE
+++ b/AlluraTest/LICENSE
@@ -208,27 +208,5 @@ separate copyright notices and license terms. Your use of the source code
for the these subcomponents is subject to the terms and conditions of the
following licenses.
-For jslint.js, in directory
-jslint/
-
- Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- The Software shall be used for Good, not Evil.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+JSLint, which is available under the MIT license.
+For details, see jslint/
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/AlluraTest/jslint/LICENSE
----------------------------------------------------------------------
diff --git a/AlluraTest/jslint/LICENSE b/AlluraTest/jslint/LICENSE
new file mode 100644
index 0000000..9532d4e
--- /dev/null
+++ b/AlluraTest/jslint/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/ForgeDiscussion/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/NOTICE b/ForgeDiscussion/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeDiscussion/NOTICE
+++ b/ForgeDiscussion/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/ForgeGit/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeGit/NOTICE b/ForgeGit/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeGit/NOTICE
+++ b/ForgeGit/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/ForgeLink/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeLink/NOTICE b/ForgeLink/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeLink/NOTICE
+++ b/ForgeLink/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/ForgeSVN/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeSVN/NOTICE b/ForgeSVN/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeSVN/NOTICE
+++ b/ForgeSVN/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/ForgeTracker/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeTracker/NOTICE b/ForgeTracker/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeTracker/NOTICE
+++ b/ForgeTracker/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/ForgeWiki/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeWiki/NOTICE b/ForgeWiki/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeWiki/NOTICE
+++ b/ForgeWiki/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index b7967a4..8f47b97 100644
--- a/LICENSE
+++ b/LICENSE
@@ -209,27 +209,39 @@ notices and license terms. Your use of the source code for the these
subcomponents is subject to the terms and conditions of the following
licenses.
-Blueprint, which is available under the MIT license.
-For details, see Allura/allura/public/nf/css/blueprint/
-
-Spin.js, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/spin.min.js
+The file Allura/allura/etc/mime.types from the mime-support package,
+which is in the public domain. For details, see
+http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
-Sylvester, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/sylvester.js
+ASCII, Dammit, which is in the public domain.
+For details, see Allura/allura/lib/AsciiDammit.py
jQuery, jQueryUI, and various related plugins, which are available
under the MIT license. For details, see the individual files:
Allura/allura/public/nf/js/jquery-base.js
Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+ Allura/allura/public/nf/js/jquery.daterangepicker.js
+ Allura/allura/public/nf/css/forge/ui.daterangepicker.css
Allura/allura/lib/widgets/resources/css/autocomplete.css
Allura/allura/public/nf/css/forge/accordion.css
Allura/allura/lib/widgets/resources/js/jqfontselector.js
Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
+ Allura/allura/lib/widgets/resources/js/jquery.tagsinput.js
Allura/allura/lib/widgets/resources/js/jquery.textarea.js
Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
- Allura/allura/public/nf/js/jquery.daterangepicker.js
Allura/allura/public/nf/js/jquery.flot.js
Allura/allura/public/nf/js/jquery.maxlength.min.js
+
+Blueprint, which is available under the MIT license.
+For details, see Allura/allura/public/nf/css/blueprint/
+
+Spin.js, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/spin.min.js
+
+Sylvester, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/sylvester.js
+
+JSLint, which is available under the MIT license.
+For details, see AlluraTest/jslint/
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/NoWarnings/NOTICE
----------------------------------------------------------------------
diff --git a/NoWarnings/NOTICE b/NoWarnings/NOTICE
index e8ad3bb..40b6969 100644
--- a/NoWarnings/NOTICE
+++ b/NoWarnings/NOTICE
@@ -1,5 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/41fe4a69/rat-excludes.txt
----------------------------------------------------------------------
diff --git a/rat-excludes.txt b/rat-excludes.txt
index 30ded2a..968c66f 100644
--- a/rat-excludes.txt
+++ b/rat-excludes.txt
@@ -8,38 +8,33 @@ requirements*
**/*.log
**/.coverage
**/nosetests.xml
-Allura/allura/controllers/controller.template
Allura/docs/_build/
Allura/allura/etc/mime.types
Allura/allura/lib/AsciiDammit.py
-Allura/allura/lib/widgets/resources/css/autocomplete.css
+Allura/allura/public/nf/js/jquery-base.js
+Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+Allura/allura/public/nf/js/jquery.daterangepicker.js
+Allura/allura/public/nf/css/forge/ui.daterangepicker.css
+Allura/allura/lib/widgets/resources/css/autocomplete.css
+Allura/allura/public/nf/css/forge/accordion.css
Allura/allura/lib/widgets/resources/js/jqfontselector.js
Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
Allura/allura/lib/widgets/resources/js/jquery.tagsinput.js
Allura/allura/lib/widgets/resources/js/jquery.textarea.js
Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
-Allura/allura/public/nf/css/blueprint/
-Allura/allura/public/nf/css/forge/accordion.css
-Allura/allura/public/nf/css/forge/ui.daterangepicker.css
-Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
-Allura/allura/public/nf/images/beta_sf.psd
-Allura/allura/public/nf/js/jquery-base.js
-Allura/allura/public/nf/js/jquery.daterangepicker.js
Allura/allura/public/nf/js/jquery.flot.js
Allura/allura/public/nf/js/jquery.maxlength.min.js
+Allura/allura/public/nf/css/blueprint/
Allura/allura/public/nf/js/spin.min.js
Allura/allura/public/nf/js/sylvester.js
Allura/allura/tests/data/genshi_hello_tmpl
Allura/allura/tests/data/test_mime/text_file.txt
-Allura/run/dummy.txt
AlluraTest/jslint/
CHANGES
+Allura/run/dummy.txt
ForgeGit/forgegit/data/post-receive_tmpl
ForgeSVN/forgesvn/tests/data/
ForgeImporters/forgeimporters/tests/data/google/empty-issue.html
ForgeImporters/forgeimporters/tests/data/google/test-issue.html
-solr_config/core0/conf/spellings.txt
-solr_config/core1/conf/spellings.txt
-solr_config/solr.xml
[11/50] git commit: [#6392] ticket:444 Fix tests
Posted by jo...@apache.org.
[#6392] ticket:444 Fix tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4957e128
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4957e128
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4957e128
Branch: refs/heads/cj/6422
Commit: 4957e128b63cacacabbf6e06f3ee2a84bdc6d51f
Parents: 70e1a8d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 24 14:31:49 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/tests/functional/test_admin.py | 29 +++++++++++++----------
1 file changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4957e128/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 38a7272..66cffba 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -168,42 +168,46 @@ class TestProjectAdmin(TestController):
@td.with_wiki
def test_block_user_empty_data(self):
- # shouldn't fail
- self.app.post('/admin/wiki/block_user', params={'username': '', 'perm': '', 'reason': ''})
+ r = self.app.post('/admin/wiki/block_user', params={'username': '', 'perm': '', 'reason': ''})
+ assert_equals(r.json, dict(error='Enter username'))
@td.with_wiki
def test_unblock_user_empty_data(self):
- # shouldn't fail
- self.app.post('/admin/wiki/unblock_user', params={'user_id': '', 'perm': ''})
+ r = self.app.post('/admin/wiki/unblock_user', params={'user_id': '', 'perm': ''})
+ assert_equals(r.json, dict(error='Select user to unblock'))
@td.with_wiki
def test_block_user(self):
r = self.app.get('/admin/wiki/permissions')
- assert '<a href="#" class="block-user">' in r
- assert '<a href="#" class="block-list">' not in r
+ assert '<input type="checkbox" name="user_id"' not in r
- self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read', 'reason': 'Comment'})
+ user = M.User.by_username('test-admin')
+ r = self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read', 'reason': 'Comment'})
+ assert_equals(r.json, dict(user_id=str(user._id), username='test-admin', reason='Comment'))
user = M.User.by_username('test-admin')
admin_role = user.project_role()
app = M.Project.query.get(shortname='test').app_instance('wiki')
ace = M.ACL.contains(M.ACE.deny(admin_role._id, 'read'), app.acl)
assert_equals(ace.reason, 'Comment')
r = self.app.get('/admin/wiki/permissions')
- assert '<a href="#" class="block-list">' in r
assert '<input type="checkbox" name="user_id" value="%s">test-admin (Comment)' % user._id in r
@td.with_wiki
def test_unblock_user(self):
- self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read'})
+ r = self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read'})
user = M.User.by_username('test-admin')
admin_role = user.project_role()
app = M.Project.query.get(shortname='test').app_instance('wiki')
ace = M.ACE.deny(admin_role._id, 'read')
+ r = self.app.get('/admin/wiki/permissions')
+ assert '<input type="checkbox" name="user_id" value="%s">test-admin' % user._id in r
+ app = M.Project.query.get(shortname='test').app_instance('wiki')
assert M.ACL.contains(ace, app.acl) is not None
- self.app.post('/admin/wiki/unblock_user', params={'user_id': str(user._id), 'perm': 'read'})
+ r = self.app.post('/admin/wiki/unblock_user', params={'user_id': str(user._id), 'perm': 'read'})
+ assert_equals(r.json, dict(unblocked=[str(user._id)]))
assert M.ACL.contains(ace, app.acl) is None
r = self.app.get('/admin/wiki/permissions')
- assert '<a href="#" class="block-list">' not in r
+ assert '<input type="checkbox" name="user_id"' not in r
@td.with_wiki
def test_block_unblock_multiple_users(self):
@@ -219,7 +223,6 @@ class TestProjectAdmin(TestController):
assert M.ACL.contains(deny_admin, app.acl) is not None
assert M.ACL.contains(deny_user, app.acl) is not None
r = self.app.get('/admin/wiki/permissions')
- assert '<a href="#" class="block-list">' in r
assert '<input type="checkbox" name="user_id" value="%s">test-admin (Spammer)' % admin._id in r
assert '<input type="checkbox" name="user_id" value="%s">test-user' % user._id in r
@@ -229,7 +232,7 @@ class TestProjectAdmin(TestController):
assert M.ACL.contains(deny_admin, app.acl) is None
assert M.ACL.contains(deny_user, app.acl) is None
r = self.app.get('/admin/wiki/permissions')
- assert '<a href="#" class="block-list">' not in r
+ assert '<input type="checkbox" name="user_id"' not in r
@td.with_wiki
def test_blocked_users_remains_after_saving_all_permissions(self):
[05/50] git commit: [#6392] ticket:432 Move widgets from
Posted by jo...@apache.org.
[#6392] ticket:432 Move widgets from <script>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/19327f4e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/19327f4e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/19327f4e
Branch: refs/heads/cj/6422
Commit: 19327f4e38ad5cd888d1debbcc849e64a6fd8e6d
Parents: ee7532b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Sep 13 12:12:26 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/app_admin_permissions.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/19327f4e/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index 69000f8..7de150e 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -60,11 +60,11 @@
<a href="{{c.app.url}}" class="btn link cancel">Cancel</a>
</p>
</form>
+ {{c.block_user.display()}}
+ {{c.block_list.display()}}
{%endif%}
{% endblock %}
{% block extra_js %}
- {{c.block_user.display()}}
- {{c.block_list.display()}}
<script type="text/javascript">
$('a.block-user').click(function(){
var deck = $(this).closest('ul.deck');
[44/50] git commit: [#6422] Removed unncessary info from NOTICE file
Posted by jo...@apache.org.
[#6422] Removed unncessary info from NOTICE file
All of the removed items are appropriately licensed and do not include
NOTICE files that need to be included.
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/73a767d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/73a767d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/73a767d9
Branch: refs/heads/cj/6422
Commit: 73a767d912940e68cf31e03ceb99344f8f014429
Parents: c14b91a
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 17 20:40:44 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 19:01:25 2013 +0000
----------------------------------------------------------------------
NOTICE | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/73a767d9/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 8157ed8..40b6969 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,18 +1,5 @@
- Apache Allura (incubating)
- Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
- This product includes software developed at
- The Apache Software Foundation (http://www.apache.org/).
-
- This software contains library for converting various
- characters to ASCII encoding, written by Leonard Richardson
- and placed into public domain.
-
- This software contains library for checking maximum length
- of text area's content, written by Keith Wood.
-
- This software contains lightbox plugin for jQuery, written by
- Buck Wilson.
-
- Canvas functionality in Internet Explorer(r) is provided
- by code developed at Google Inc.
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
[06/50] git commit: [#6392] ticket:432 s/Delete/Unblock
Posted by jo...@apache.org.
[#6392] ticket:432 s/Delete/Unblock
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ee7532b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ee7532b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ee7532b9
Branch: refs/heads/cj/6422
Commit: ee7532b9eaff14419d1a54e1a4635d21997dd263
Parents: 4220cb2
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Sep 13 11:37:46 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/ext/admin/templates/widgets/block_list.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ee7532b9/Allura/allura/ext/admin/templates/widgets/block_list.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/widgets/block_list.html b/Allura/allura/ext/admin/templates/widgets/block_list.html
index 85ff03a..c3db3ba 100644
--- a/Allura/allura/ext/admin/templates/widgets/block_list.html
+++ b/Allura/allura/ext/admin/templates/widgets/block_list.html
@@ -23,5 +23,5 @@
<div class="grid-13"> </div>
<hr>
<div class="grid-13"> </div>
-<input type="submit" value="Delete">
+<input type="submit" value="Unblock">
</form>
[23/50] git commit: [#6712] Don't balloon ProjectRoles when checking
for blocked users
Posted by jo...@apache.org.
[#6712] Don't balloon ProjectRoles when checking for blocked users
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9012935a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9012935a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9012935a
Branch: refs/heads/cj/6422
Commit: 9012935a33b62cddcf8a75ce4a651118b128afda
Parents: 46fffb6
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Sep 26 19:03:30 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu Sep 26 19:03:30 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/security.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9012935a/Allura/allura/lib/security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/security.py b/Allura/allura/lib/security.py
index a211ae2..4e917b6 100644
--- a/Allura/allura/lib/security.py
+++ b/Allura/allura/lib/security.py
@@ -299,10 +299,11 @@ def has_access(obj, permission, user=None, project=None):
project = project.root_project
roles = cred.user_roles(user_id=user._id, project_id=project._id).reaching_ids
if user != M.User.anonymous():
- user_role = user.project_role(project=project)
- deny_user = M.ACE.deny(user_role._id, permission)
- if M.ACL.contains(deny_user, obj.acl):
- return False
+ user_role = M.ProjectRole.by_user(user, project)
+ if user_role:
+ deny_user = M.ACE.deny(user_role._id, permission)
+ if M.ACL.contains(deny_user, obj.acl):
+ return False
chainable_roles = []
for rid in roles:
for ace in obj.acl:
[32/50] git commit: [#6431] bump timermiddleware for compatibility
with new ming (when debug logging)
Posted by jo...@apache.org.
[#6431] bump timermiddleware for compatibility with new ming (when debug logging)
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/30f5d75f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/30f5d75f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/30f5d75f
Branch: refs/heads/cj/6422
Commit: 30f5d75fe4664c28c590ed8b559d2536a4465c34
Parents: f76bf43
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Sep 27 15:44:47 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Oct 1 20:40:42 2013 +0000
----------------------------------------------------------------------
requirements-common.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/30f5d75f/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index e99b5e9..1b1d2f6 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -45,7 +45,7 @@ setproctitle==1.1.7
textile==2.1.5
# dep of colander
translationstring==0.4
-TimerMiddleware==0.4.3
+TimerMiddleware==0.4.4
TurboGears2==2.1.5
WebOb==1.0.8
# part of the stdlib, but with a version number. see http://guide.python-distribute.org/pip.html#listing-installed-packages
[21/50] git commit: [#6711] refactor few tests out of
TestRestUpdateTicket and into TestRestIndex
Posted by jo...@apache.org.
[#6711] refactor few tests out of TestRestUpdateTicket and into TestRestIndex
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/55a4588e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/55a4588e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/55a4588e
Branch: refs/heads/cj/6422
Commit: 55a4588e81ae434c59cca2a78105b8989ebb5a8f
Parents: a17ae4a
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Sep 26 15:20:55 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 26 15:20:55 2013 +0000
----------------------------------------------------------------------
.../forgetracker/tests/functional/test_rest.py | 66 ++++++++++----------
1 file changed, 34 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/55a4588e/ForgeTracker/forgetracker/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_rest.py b/ForgeTracker/forgetracker/tests/functional/test_rest.py
index b687efb..0025613 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -39,6 +39,18 @@ class TestTrackerApiBase(TestRestApiBase):
h.set_context('test', 'bugs', neighborhood='Projects')
self.tracker_globals = c.app.globals
+ def create_ticket(self):
+ return self.api_post(
+ '/rest/p/test/bugs/new',
+ wrap_args='ticket_form',
+ summary='test new ticket',
+ status=self.tracker_globals.open_status_names.split()[0],
+ labels='',
+ description='',
+ assigned_to='',
+ **{'custom_fields._milestone':''})
+
+
class TestRestNewTicket(TestTrackerApiBase):
def test_new_ticket(self):
@@ -67,18 +79,29 @@ class TestRestUpdateTicket(TestTrackerApiBase):
def setUp(self):
super(TestRestUpdateTicket, self).setUp()
- summary = 'test new ticket'
- ticket_view = self.api_post(
- '/rest/p/test/bugs/new',
- wrap_args='ticket_form',
- summary=summary,
- status=self.tracker_globals.open_status_names.split()[0],
- labels='',
- description='',
- assigned_to='',
- **{'custom_fields._milestone':''})
+ ticket_view = self.create_ticket()
self.ticket_args = ticket_view.json['ticket']
+ def test_update_ticket(self):
+ args = dict(self.ticket_args, summary='test update ticket', labels='',
+ assigned_to=self.ticket_args['assigned_to_id'] or '')
+ for bad_key in ('ticket_num', 'assigned_to_id', 'created_date',
+ 'reported_by', 'reported_by_id', '_id', 'votes_up', 'votes_down'):
+ del args[bad_key]
+ args['private'] = str(args['private'])
+ ticket_view = self.api_post('/rest/p/test/bugs/1/save', wrap_args='ticket_form', **h.encode_keys(args))
+ assert ticket_view.status_int == 200, ticket_view.showbrowser()
+ json = ticket_view.json['ticket']
+ assert int(json['ticket_num']) == 1
+ assert json['summary'] == 'test update ticket', json
+
+
+class TestRestIndex(TestTrackerApiBase):
+
+ def setUp(self):
+ super(TestRestIndex, self).setUp()
+ self.create_ticket()
+
def test_ticket_index(self):
tickets = self.api_get('/rest/p/test/bugs/')
assert len(tickets.json['tickets']) == 1, tickets.json
@@ -100,33 +123,12 @@ class TestRestUpdateTicket(TestTrackerApiBase):
tickets = self.api_get('/rest/p/test/bugs', user='*anonymous')
assert 'TicketMonitoringEmail' not in tickets.json['tracker_config']['options']
- def test_update_ticket(self):
- args = dict(self.ticket_args, summary='test update ticket', labels='',
- assigned_to=self.ticket_args['assigned_to_id'] or '')
- for bad_key in ('ticket_num', 'assigned_to_id', 'created_date',
- 'reported_by', 'reported_by_id', '_id', 'votes_up', 'votes_down'):
- del args[bad_key]
- args['private'] = str(args['private'])
- ticket_view = self.api_post('/rest/p/test/bugs/1/save', wrap_args='ticket_form', **h.encode_keys(args))
- assert ticket_view.status_int == 200, ticket_view.showbrowser()
- json = ticket_view.json['ticket']
- assert int(json['ticket_num']) == 1
- assert json['summary'] == 'test update ticket', json
class TestRestDiscussion(TestTrackerApiBase):
def setUp(self):
super(TestRestDiscussion, self).setUp()
- summary = 'test new ticket'
- ticket_view = self.api_post(
- '/rest/p/test/bugs/new',
- wrap_args='ticket_form',
- summary=summary,
- status=self.tracker_globals.open_status_names.split()[0],
- labels='',
- description='',
- milestone='',
- assigned_to='')
+ ticket_view = self.create_ticket()
self.ticket_args = ticket_view.json['ticket']
def test_index(self):
[37/50] git commit: [#5775] ticket:433 set the old rev for copied
from link
Posted by jo...@apache.org.
[#5775] ticket:433 set the old rev for copied from link
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/7ed43a97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/7ed43a97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/7ed43a97
Branch: refs/heads/cj/6422
Commit: 7ed43a970c6455f20c24d0103e64c1c1350749ab
Parents: b96a011
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Tue Oct 1 03:33:23 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:40:30 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/widgets/repo/log.html | 8 ++++++--
ForgeGit/forgegit/model/git_repo.py | 6 ++----
ForgeGit/forgegit/tests/model/test_repository.py | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ed43a97/Allura/allura/templates/widgets/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/log.html b/Allura/allura/templates/widgets/repo/log.html
index ec6b048..f526a07 100644
--- a/Allura/allura/templates/widgets/repo/log.html
+++ b/Allura/allura/templates/widgets/repo/log.html
@@ -18,6 +18,7 @@
-#}
{% from 'allura:templates/jinja_master/lib.html' import user_link, abbr_date with context %}
{% set app = app or c.app %}
+{% set path = request.params.get('path', '')%}
<div>
{%if is_file%}
<div class="grid-19"><input type="button" value="Compare" class="compare_revision"></div>
@@ -68,13 +69,16 @@
{% if commit.committed.date %}{{commit.committed.date|datetimeformat}}{% endif %}
</td>
<td style="text-align: left; vertical-align: text-top">
- <a class="browse" href="{{app.repo.url_for_commit(commit.id)}}tree{{request.params.get('path', '')}}">
+ <a class="browse" href="{{app.repo.url_for_commit(commit.id)}}tree{{path}}">
{{ 'View' if is_file else 'Tree' }}
</a>
{%if is_file%}
<br/>
- <a class="download" href="{{app.repo.url_for_commit(commit.id)}}tree{{request.params.get('path', '')}}?format=raw">Download</a>
+ <a class="download" href="{{app.repo.url_for_commit(commit.id)}}tree{{path}}?format=raw">Download</a>
{%endif%}
+ {% if commit.rename_details %}
+ {%set path=commit.rename_details['path']%}
+ {% endif %}
</td>
</tr>
{% endfor %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ed43a97/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 955c9b3..cb16763 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -313,8 +313,9 @@ class GitImplementation(M.RepositoryImplementation):
if path:
if renamed and renamed['to'] == path:
rename_details['path'] = '/' + renamed['from']
+ revisions = [revision for revision in self._git.iter_commits(revs, renamed['from'])]
rename_details['commit_url'] = self._repo.url_for_commit(
- ci.hexsha
+ revisions[1].hexsha
)
try:
@@ -340,9 +341,6 @@ class GitImplementation(M.RepositoryImplementation):
'size': size,
'rename_details': rename_details,
}
- if rename_details:
- # we do not need to show commits before rename
- break
def _iter_commits_with_refs(self, *args, **kwargs):
"""
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ed43a97/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 575ccba..365060d 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -568,12 +568,12 @@ class TestGitRename(unittest.TestCase):
def test_renamed_file(self):
# There was a file f.txt, then it was renamed to f2.txt.
commits = list(self.repo.log(id_only=False, path='/f2.txt'))
- self.assertEqual(len(commits), 2)
+ self.assertEqual(len(commits), 4)
rename_commit = commits[1]
self.assertEqual(rename_commit['rename_details']['path'], '/f.txt')
self.assertEqual(
rename_commit['rename_details']['commit_url'],
- self.repo.url_for_commit(rename_commit['id'])
+ '/p/test/src-git/ci/fbb0644603bb6ecee3ebb62efe8c86efc9b84ee6/'
)
def test_merge_commit(self):
[40/50] git commit: [#5775] ticket:433 fixed "size" in test_log_file
Posted by jo...@apache.org.
[#5775] ticket:433 fixed "size" in test_log_file
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4478bf39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4478bf39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4478bf39
Branch: refs/heads/cj/6422
Commit: 4478bf39844e383eee5e35eb11f4c9d54b1f7416
Parents: b1dd28a
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Tue Oct 1 16:45:22 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:40:31 2013 +0000
----------------------------------------------------------------------
ForgeSVN/forgesvn/tests/model/test_repository.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4478bf39/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 2a69339..e7864e5 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -314,7 +314,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Create readme',
'parents': [],
'refs': [],
- 'size': 28,
+ 'size': 15,
'rename_details': {}},
])
[08/50] git commit: [#6392] ticket:432 Update tests
Posted by jo...@apache.org.
[#6392] ticket:432 Update tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/12420f5a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/12420f5a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/12420f5a
Branch: refs/heads/cj/6422
Commit: 12420f5afbd356c37fe3a3b06581a5460679c6bf
Parents: 394ccc3
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 11 16:30:00 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
.../templates/admin_widgets/card_field.html | 5 +-
Allura/allura/tests/functional/test_admin.py | 56 +++++++++++++-------
Allura/allura/tests/test_security.py | 8 +++
3 files changed, 47 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/12420f5a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
index 24533c7..19988d5 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
@@ -72,7 +72,7 @@
</a>
</li>
- {% if block_list.get(name) %}
+ {% if block_list and block_list.get(name) %}
<li>
<a href="#" class="block-list">Block List</a>
<div class="block-list grid-13" style="display: none">
@@ -80,8 +80,7 @@
{% for u, reason in block_list[name] %}
<li>
<label>
- <input type="checkbox" name="user_id" value="{{ u._id }}">
- {{ u.username }} {{ '(' + reason + ')' if reason else '' }}
+ <input type="checkbox" name="user_id" value="{{ u._id }}">{{ u.username }} {{ '(' + reason + ')' if reason else '' }}
</label>
</li>
{% endfor %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/12420f5a/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 007746a..556eade 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -167,39 +167,57 @@ class TestProjectAdmin(TestController):
assert "uninstall tool test-tool" in r.body, r.body
@td.with_wiki
- def test_add_user_to_block_list(self):
+ def test_block_user(self):
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-user">' in r
assert '<a href="#" class="block-list">' not in r
- self.app.post('/admin/wiki/block_user', params={'user_name': 'test-admin', 'perm': 'read', 'reason': 'Comment'})
- user_id = M.User.by_username('test-admin')._id
-
+ self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read', 'reason': 'Comment'})
+ user = M.User.by_username('test-admin')
+ admin_role = user.project_role()
app = M.Project.query.get(shortname='test').app_instance('wiki')
- assert_equals(app.config.block_user['read'], {str(user_id): 'Comment'})
+ ace = M.ACL.contains(M.ACE.deny(admin_role._id, 'read'), app.acl)
+ assert_equals(ace.reason, 'Comment')
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-list">' in r
- assert '<input type="checkbox" name="user_id" value="%s">test-admin (Comment)' % user_id in r
+ assert '<input type="checkbox" name="user_id" value="%s">test-admin (Comment)' % user._id in r
@td.with_wiki
- def test_remove_user_from_block_list(self):
- self.app.post('/admin/wiki/block_user', params={'user_name': 'test-admin', 'perm': 'read'})
+ def test_unblock_user(self):
+ self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read'})
+ user = M.User.by_username('test-admin')
+ admin_role = user.project_role()
app = M.Project.query.get(shortname='test').app_instance('wiki')
- user_id = M.User.by_username('test-admin')._id
- assert_equals(app.config.block_user['read'], {str(user_id): ''})
- self.app.post('/admin/wiki/unblock_user', params={'user_id': str(user_id), 'perm': 'read'})
- assert_equals(app.config.block_user['read'], dict())
+ ace = M.ACE.deny(admin_role._id, 'read')
+ assert M.ACL.contains(ace, app.acl) is not None
+ self.app.post('/admin/wiki/unblock_user', params={'user_id': str(user._id), 'perm': 'read'})
+ assert M.ACL.contains(ace, app.acl) is None
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-list">' not in r
@td.with_wiki
- def test_has_access_with_block_users(self):
- wiki = M.Project.query.get(shortname='test').app_instance('wiki')
- page = Page.query.get(app_config_id=wiki.config._id)
- test_user = M.User.by_username('test-user')
- assert has_access(page, 'read', user=test_user)()
- self.app.post('/admin/wiki/block_user', params={'user_name': 'test-user', 'perm': 'read'})
- assert not has_access(page, 'read', user=test_user)()
+ def test_block_unblock_multiple_users(self):
+ self.app.post('/admin/wiki/block_user', params={'username': 'test-admin', 'perm': 'read', 'reason': 'Spammer'})
+ self.app.post('/admin/wiki/block_user', params={'username': 'test-user', 'perm': 'read'})
+ admin = M.User.by_username('test-admin')
+ user = M.User.by_username('test-user')
+ admin_role = admin.project_role()
+ user_role = user.project_role()
+ app = M.Project.query.get(shortname='test').app_instance('wiki')
+ deny_admin = M.ACE.deny(admin_role._id, 'read')
+ deny_user = M.ACE.deny(user_role._id, 'read')
+ assert M.ACL.contains(deny_admin, app.acl) is not None
+ assert M.ACL.contains(deny_user, app.acl) is not None
+ r = self.app.get('/admin/wiki/permissions')
+ assert '<a href="#" class="block-list">' in r
+ assert '<input type="checkbox" name="user_id" value="%s">test-admin (Spammer)' % admin._id in r
+ assert '<input type="checkbox" name="user_id" value="%s">test-user' % user._id in r
+
+ self.app.post('/admin/wiki/unblock_user', params={'user_id': [str(user._id), str(admin._id)], 'perm': 'read'})
+ assert M.ACL.contains(deny_admin, app.acl) is None
+ assert M.ACL.contains(deny_user, app.acl) is None
+ r = self.app.get('/admin/wiki/permissions')
+ assert '<a href="#" class="block-list">' not in r
def test_tool_permissions(self):
BUILTIN_APPS = ['activity', 'blog', 'discussion', 'git', 'link',
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/12420f5a/Allura/allura/tests/test_security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_security.py b/Allura/allura/tests/test_security.py
index 10ae614..3cc3a16 100644
--- a/Allura/allura/tests/test_security.py
+++ b/Allura/allura/tests/test_security.py
@@ -157,3 +157,11 @@ class TestSecurity(TestController):
assert has_access(page, 'read', test_user)()
c.project = project2
assert has_access(page, 'read', test_user)()
+
+ @td.with_wiki
+ def test_deny_access_for_single_user(self):
+ wiki = c.project.app_instance('wiki')
+ user = M.User.by_username('test-user')
+ assert has_access(wiki, 'read', user)()
+ wiki.acl.append(M.ACE.deny(user.project_role()._id, 'read', 'Spammer'))
+ assert not has_access(wiki, 'read', user)()
[02/50] git commit: [#6392] ticket:432 Add label for checkbox
Posted by jo...@apache.org.
[#6392] ticket:432 Add label for checkbox
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f47df1cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f47df1cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f47df1cd
Branch: refs/heads/cj/6422
Commit: f47df1cd21c98f53b5c0d58d5d68f4d5d9089be1
Parents: 991f8bc
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 11 14:56:00 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
.../allura/ext/admin/templates/admin_widgets/card_field.html | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f47df1cd/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
index 964ea65..24533c7 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
@@ -78,7 +78,12 @@
<div class="block-list grid-13" style="display: none">
<ul>
{% for u, reason in block_list[name] %}
- <li><input type="checkbox" name="user_id" value="{{ u._id }}">{{ u.username }} {{ '(' + reason + ')' if reason else '' }}</li>
+ <li>
+ <label>
+ <input type="checkbox" name="user_id" value="{{ u._id }}">
+ {{ u.username }} {{ '(' + reason + ')' if reason else '' }}
+ </label>
+ </li>
{% endfor %}
</ul>
</div>
[19/50] git commit: [#6695] Fixed LCD timeout being off by factor of
1000
Posted by jo...@apache.org.
[#6695] Fixed LCD timeout being off by factor of 1000
time.time() is fractional seconds, not milliseconds
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2d5a6ab9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2d5a6ab9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2d5a6ab9
Branch: refs/heads/cj/6422
Commit: 2d5a6ab98bdc4f7cbad5275dfa648fde7f849fab
Parents: 4957e12
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 24 19:37:14 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 20:11:00 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/repository.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2d5a6ab9/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index f02f122..04c4063 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -146,7 +146,7 @@ class RepositoryImplementation(object):
commit to touch each path, starting from the given commit.
'''
orig_commit = commit
- timeout = asint(config.get('lcd_timeout', 60)) * 1000
+ timeout = float(config.get('lcd_timeout', 60))
start_time = time()
paths = set(paths)
result = {}
[41/50] git commit: [#5775] ticket:433 fixed filesize for svn repo
after copied from link
Posted by jo...@apache.org.
[#5775] ticket:433 fixed filesize for svn repo after copied from link
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b1dd28a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b1dd28a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b1dd28a6
Branch: refs/heads/cj/6422
Commit: b1dd28a6f33d0d5b5325f0cc404880d78f4198ea
Parents: 7b9db7b
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Tue Oct 1 16:07:44 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:40:31 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/tests/functional/test_controllers.py | 11 +++++++++++
ForgeSVN/forgesvn/model/svn.py | 7 +++++--
2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b1dd28a6/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 919e97b..9a78579 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -590,3 +590,14 @@ class TestGitRename(TestController):
resp = self.app.get('/src-git/ci/259c77dd6ee0e6091d11e429b56c44ccbf1e64a3/log/?path=/f2.txt')
assert '<b>renamed from</b>' in resp
assert '/f.txt' in resp
+ assert '(27 Bytes)' in resp
+ assert '(19 Bytes)' in resp
+
+ resp = self.app.get('/src-git/ci/fbb0644603bb6ecee3ebb62efe8c86efc9b84ee6/log/?path=/f.txt')
+ assert '(19 Bytes)' in resp
+ assert '(10 Bytes)' in resp
+
+ resp = self.app.get('/src-git/ci/7c09182e61af959e4f1fb0e354bab49f14ef810d/tree/f.txt')
+ assert "2 lines (1 with data), 10 Bytes" in resp
+
+
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b1dd28a6/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index ec8d991..24e8bdd 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -565,8 +565,9 @@ class SVNImplementation(M.RepositoryImplementation):
def _map_log(self, ci, url, path=None):
revno = ci.revision.number
+ rev = pysvn.Revision(pysvn.opt_revision_kind.number, revno)
try:
- size = int(self._svn.list(url)[0][0].size)
+ size = int(self._svn.list(url, revision=rev, peg_revision=rev)[0][0].size)
except pysvn.ClientError:
size = None
rename_details = {}
@@ -606,9 +607,11 @@ class SVNImplementation(M.RepositoryImplementation):
def blob_size(self, blob):
try:
+ rev = self._revision(blob.commit._id)
data = self._svn.list(
self._url + blob.path(),
- revision=self._revision(blob.commit._id),
+ revision=rev,
+ peg_revision=rev,
dirent_fields=pysvn.SVN_DIRENT_SIZE)
except pysvn.ClientError:
log.info('ClientError getting filesize %r %r, returning 0', blob.path(), self._repo, exc_info=True)
[39/50] git commit: [#5775] ticket:433 fixed filesize after copied
from link
Posted by jo...@apache.org.
[#5775] ticket:433 fixed filesize after copied from link
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/7b9db7ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/7b9db7ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/7b9db7ba
Branch: refs/heads/cj/6422
Commit: 7b9db7ba20bc48d90bb32886c200628f33d9589e
Parents: baed285
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Tue Oct 1 13:59:04 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:40:30 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 2 ++
ForgeGit/forgegit/tests/model/test_repository.py | 2 ++
2 files changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7b9db7ba/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index fa62c23..b1c621b 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -326,6 +326,8 @@ class GitImplementation(M.RepositoryImplementation):
size = node.size if node.type == 'blob' else None
except KeyError as e:
size = None
+ if rename_details:
+ path = rename_details['path'].strip('/')
yield {
'id': ci.hexsha,
'message': h.really_unicode(ci.message or '--none--'),
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7b9db7ba/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 365060d..a494886 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -575,6 +575,8 @@ class TestGitRename(unittest.TestCase):
rename_commit['rename_details']['commit_url'],
'/p/test/src-git/ci/fbb0644603bb6ecee3ebb62efe8c86efc9b84ee6/'
)
+ self.assertEqual(rename_commit['size'], 19)
+ self.assertEqual(commits[2]['size'], 19)
def test_merge_commit(self):
merge_sha = '13951944969cf45a701bf90f83647b309815e6d5'
[26/50] git commit: [#6612] Handle missing fields in imported json
Posted by jo...@apache.org.
[#6612] Handle missing fields in imported json
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/acfb7b50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/acfb7b50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/acfb7b50
Branch: refs/heads/cj/6422
Commit: acfb7b50a11cdd6fb35604f1c899e75e669dd24b
Parents: a580f3e
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Fri Sep 27 16:09:01 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Sep 27 16:09:54 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/import_support.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/acfb7b50/ForgeTracker/forgetracker/import_support.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/import_support.py b/ForgeTracker/forgetracker/import_support.py
index ef649dc..381e711 100644
--- a/ForgeTracker/forgetracker/import_support.py
+++ b/ForgeTracker/forgetracker/import_support.py
@@ -206,10 +206,10 @@ class ImportSupport(object):
description = h.really_unicode(self.link_processing(remapped['description']))
creator = owner = ''
- if ticket_dict['submitter'] and not remapped['reported_by_id']:
+ if ticket_dict.get('submitter') and not remapped.get('reported_by_id'):
creator = u'*Originally created by:* {0}\n'.format(
h.really_unicode(ticket_dict['submitter']))
- if ticket_dict['assigned_to'] and not remapped['assigned_to_id']:
+ if ticket_dict.get('assigned_to') and not remapped.get('assigned_to_id'):
owner = u'*Originally owned by:* {0}\n'.format(
h.really_unicode(ticket_dict['assigned_to']))
remapped['description'] = u'{0}{1}{2}{3}'.format(creator, owner,
[35/50] git commit: [#6665] ticket:446 add MovedTicket redirects to
Tracker REST API
Posted by jo...@apache.org.
[#6665] ticket:446 add MovedTicket redirects to Tracker REST API
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2080faea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2080faea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2080faea
Branch: refs/heads/cj/6422
Commit: 2080faea451351d59b495365ffad404fd850f300
Parents: 30f5d75
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Sat Sep 28 14:31:39 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:33:48 2013 +0000
----------------------------------------------------------------------
AlluraTest/alluratest/controller.py | 4 ++--
ForgeTracker/forgetracker/tests/functional/test_rest.py | 11 +++++++++++
ForgeTracker/forgetracker/tracker_main.py | 6 ++++++
3 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2080faea/AlluraTest/alluratest/controller.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/controller.py b/AlluraTest/alluratest/controller.py
index 577088d..07f9cff 100644
--- a/AlluraTest/alluratest/controller.py
+++ b/AlluraTest/alluratest/controller.py
@@ -180,8 +180,8 @@ class TestRestApiBase(TestController):
response = fn(
str(path),
params=params,
- status=[200, 201, 302, 400, 403, 404])
- if response.status_int == 302:
+ status=[200, 201, 301, 302, 400, 403, 404])
+ if response.status_int in [301, 302]:
return response.follow()
else:
return response
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2080faea/ForgeTracker/forgetracker/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_rest.py b/ForgeTracker/forgetracker/tests/functional/test_rest.py
index 6d9a457..87e2d44 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -127,6 +127,17 @@ class TestRestIndex(TestTrackerApiBase):
ticket_config = M.AppConfig.query.get(project_id=c.project._id, tool_name='tickets')
assert_equal(ticket_config.options.get('TicketMonitoringEmail'), 'test@localhost')
+ @td.with_tool('test', 'Tickets', 'dummy')
+ def test_move_ticket_redirect(self):
+ p = M.Project.query.get(shortname='test')
+ dummy_tracker = p.app_instance('dummy')
+ r = self.app.post(
+ '/p/test/bugs/1/move',
+ params={'tracker': str(dummy_tracker.config._id)}).follow()
+
+ ticket = self.api_get('/rest/p/test/bugs/1/')
+ assert_equal(ticket.request.path, '/rest/p/test/dummy/1/')
+
class TestRestDiscussion(TestTrackerApiBase):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2080faea/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index ea075af..370be90 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1666,6 +1666,12 @@ class TicketRestController(BaseController):
self.ticket = TM.Ticket.query.get(app_config_id=c.app.config._id,
ticket_num=self.ticket_num)
if self.ticket is None:
+ moved_ticket = TM.MovedTicket.query.get(
+ app_config_id=c.app.config._id,
+ ticket_num=self.ticket_num)
+ if moved_ticket:
+ utils.permanent_redirect('/rest' + moved_ticket.moved_to_url)
+
raise exc.HTTPNotFound()
def _check_security(self):
[18/50] git commit: [#6392] ticket:444 dynamic add/remove blocked
user in list
Posted by jo...@apache.org.
[#6392] ticket:444 dynamic add/remove blocked user in list
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/170205b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/170205b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/170205b5
Branch: refs/heads/cj/6422
Commit: 170205b54fae9a278f73b6ef8aa2cad7b2e38b03
Parents: 2a57013
Author: coldmind <so...@yandex.ru>
Authored: Thu Sep 19 16:45:36 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 2 +-
.../allura/templates/app_admin_permissions.html | 44 ++++++++++++++++----
2 files changed, 37 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/170205b5/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index d172a65..e51b70a 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -596,7 +596,7 @@ class DefaultAdminController(BaseController):
ace = model.ACE.deny(user.project_role()._id, perm, reason)
if not model.ACL.contains(ace, self.app.acl):
self.app.acl.append(ace)
- redirect(request.referer)
+ return dict(user_id=str(user._id))
@validate(dict(user_id=V.Set(),
perm=V.UnicodeString()))
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/170205b5/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index fb5aa61..f14860a 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -66,12 +66,15 @@
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
+ var current_block_list;
$('a.block-user').click(function(){
+ current_block_list = $(this).parent().parent().find('div.block-list')
var deck = $(this).closest('ul.deck');
var role = deck.find('li.tcenter h3').text();
$('input.block_user_role').val(role);
});
$('a.block-list').click(function(){
+ current_block_list = $(this).siblings('div.block-list')
var userlist = $(this).siblings('div.block-list').clone();
var deck = $(this).closest('ul.deck');
var role = deck.find('li.tcenter h3').text();
@@ -79,19 +82,44 @@
$('div.model-block-list').html(userlist.html());
});
$('form[action="block_user"], form[action="unblock_user"]').submit(function() {
- var form = $(this);
- if($(this).is(':visible')) {
+ var form = $(this),
+ username = form.find('#block_user'),
+ reason = form.find("textarea[name='reason']")
+
+ if(form.is(':visible')) {
$.ajax({
- data: $(this).serialize(),
- type: $(this).attr('method'),
- url: $(this).attr('action'),
+ data: form.serialize(),
+ type: form.attr('method'),
+ url: form.attr('action'),
success: function(data) {
if(data.error){
- flash(data.error, 'error');
+ flash(data.error, 'error');
}
else {
- form.parent().slideUp('fast');
- $('.lb_overlay').hide();
+ form.parent().slideUp('fast');
+ $('.lb_overlay').hide();
+
+ if(form.attr('action') == 'block_user') {
+ if(username.val().length != 0) {
+ current_block_list
+ .find('ul')
+ .append('<li><label>' +
+ '<input type="checkbox" value="' + data.user_id + '"name="user_id">' +
+ username.val() + ' (' +
+ reason.val() + ')' +
+ '</label></li>');
+ }
+ }
+ else {
+ var checked = form.find('input:checked');
+ checked.each(function(i, e) {
+ current_block_list
+ .find('label:contains("'+$(e).parent().text()+'")')
+ .parent()
+ .remove()
+ });
+ }
+ form.find("input[type=text], textarea").val("");
}
}
});
[14/50] git commit: [#6392] ticket:444 Simplify update() controller
Posted by jo...@apache.org.
[#6392] ticket:444 Simplify update() controller
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/009fc6e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/009fc6e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/009fc6e3
Branch: refs/heads/cj/6422
Commit: 009fc6e3cb96d4886c180c7ff080fdf51f1b0620
Parents: 82be4a4
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 24 13:50:00 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/009fc6e3/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index efa61a6..0135969 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -733,9 +733,8 @@ class DefaultAdminController(BaseController):
if isinstance(group_ids, basestring):
group_ids = [ group_ids ]
- # ACE.deny() entries for blocked users will end up in del_group_ids after the following
for acl in old_acl:
- if (acl['permission']==perm) and (str(acl['role_id']) not in group_ids):
+ if (acl['permission'] == perm) and (str(acl['role_id']) not in group_ids) and acl['access'] != model.ACE.DENY:
del_group_ids.append(str(acl['role_id']))
get_role = lambda _id: model.ProjectRole.query.get(_id=ObjectId(_id))
@@ -743,18 +742,6 @@ class DefaultAdminController(BaseController):
new_groups = map(get_role, new_group_ids)
del_groups = map(get_role, del_group_ids)
- def split_group_user_roles(roles):
- group_roles = []
- user_roles = []
- for role in roles:
- if role.user_id and not role.name:
- user_roles.append(role)
- else:
- group_roles.append(role)
- return group_roles, user_roles
-
- del_groups, user_roles = split_group_user_roles(del_groups)
-
if new_groups or del_groups:
model.AuditLog.log('updated "%s" permission: "%s" => "%s" for %s' % (
perm,
@@ -767,7 +754,7 @@ class DefaultAdminController(BaseController):
model.ACE.allow(r, perm) for r in role_ids]
# Add all ACEs for user roles back
- user_roles_ids = map(lambda role: role._id, user_roles)
- user_aces = filter(lambda ace: ace.permission == perm and ace.role_id in user_roles_ids, old_acl)
- self.app.config.acl += user_aces
+ for ace in old_acl:
+ if (ace.permission == perm) and (ace.access == model.ACE.DENY):
+ self.app.config.acl.append(ace)
redirect(request.referer)
[15/50] git commit: [#6392] ticket:444 Refactored js and removed
redirects from ajax controllers
Posted by jo...@apache.org.
[#6392] ticket:444 Refactored js and removed redirects from ajax controllers
Also bugfixes in js code.
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/82be4a42
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/82be4a42
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/82be4a42
Branch: refs/heads/cj/6422
Commit: 82be4a42ea8056633eb77da205a656e687ea0fbf
Parents: 170205b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 24 13:39:16 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 9 +-
.../templates/admin_widgets/card_field.html | 18 ++--
.../allura/templates/app_admin_permissions.html | 91 +++++++++++---------
3 files changed, 64 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/82be4a42/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index e51b70a..efa61a6 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -589,14 +589,15 @@ class DefaultAdminController(BaseController):
@require_post()
def block_user(self, username, perm, reason=None):
if not username or not perm:
- redirect(request.referer)
+ return dict(error='Enter username')
user = model.User.by_username(username)
if not user:
return dict(error='User "%s" not found' % username)
ace = model.ACE.deny(user.project_role()._id, perm, reason)
if not model.ACL.contains(ace, self.app.acl):
self.app.acl.append(ace)
- return dict(user_id=str(user._id))
+ return dict(user_id=str(user._id), username=user.username, reason=reason)
+ return dict(error='User "%s" already blocked' % user.username)
@validate(dict(user_id=V.Set(),
perm=V.UnicodeString()))
@@ -610,12 +611,14 @@ class DefaultAdminController(BaseController):
users = model.User.query.find({'_id': {'$in': user_id}}).all()
if not users:
return dict(error='Select user to unblock')
+ unblocked = []
for user in users:
ace = model.ACE.deny(user.project_role()._id, perm)
ace = model.ACL.contains(ace, self.app.acl)
if ace:
self.app.acl.remove(ace)
- redirect(request.referer)
+ unblocked.append(str(user._id))
+ return dict(unblocked=unblocked)
@expose('jinja:allura:templates/app_admin_permissions.html')
@without_trailing_slash
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/82be4a42/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
index 19988d5..e731290 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
@@ -72,11 +72,11 @@
</a>
</li>
- {% if block_list and block_list.get(name) %}
- <li>
- <a href="#" class="block-list">Block List</a>
- <div class="block-list grid-13" style="display: none">
- <ul>
+ <li{% if not block_list or not block_list.get(name) %} style="display:none;"{% endif %}>
+ <a href="#" class="block-list">Block List</a>
+ <div class="block-list grid-13" style="display: none">
+ <ul>
+ {% if block_list and block_list.get(name) %}
{% for u, reason in block_list[name] %}
<li>
<label>
@@ -84,9 +84,9 @@
</label>
</li>
{% endfor %}
- </ul>
- </div>
- </li>
- {% endif %}
+ {% endif %}
+ </ul>
+ </div>
+ </li>
</ul>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/82be4a42/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index f14860a..6fa5246 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -68,7 +68,7 @@
<script type="text/javascript">
var current_block_list;
$('a.block-user').click(function(){
- current_block_list = $(this).parent().parent().find('div.block-list')
+ current_block_list = $(this).parent().parent().find('div.block-list')
var deck = $(this).closest('ul.deck');
var role = deck.find('li.tcenter h3').text();
$('input.block_user_role').val(role);
@@ -81,50 +81,57 @@
$('input.block_user_role').val(role);
$('div.model-block-list').html(userlist.html());
});
- $('form[action="block_user"], form[action="unblock_user"]').submit(function() {
- var form = $(this),
- username = form.find('#block_user'),
- reason = form.find("textarea[name='reason']")
- if(form.is(':visible')) {
- $.ajax({
- data: form.serialize(),
- type: form.attr('method'),
- url: form.attr('action'),
- success: function(data) {
- if(data.error){
- flash(data.error, 'error');
- }
- else {
- form.parent().slideUp('fast');
- $('.lb_overlay').hide();
- if(form.attr('action') == 'block_user') {
- if(username.val().length != 0) {
- current_block_list
- .find('ul')
- .append('<li><label>' +
- '<input type="checkbox" value="' + data.user_id + '"name="user_id">' +
- username.val() + ' (' +
- reason.val() + ')' +
- '</label></li>');
- }
- }
- else {
- var checked = form.find('input:checked');
- checked.each(function(i, e) {
- current_block_list
- .find('label:contains("'+$(e).parent().text()+'")')
- .parent()
- .remove()
- });
- }
- form.find("input[type=text], textarea").val("");
- }
- }
- });
- return false;
+ $('form[action="block_user"], form[action="unblock_user"').submit(function() {
+ var form = $(this);
+
+ function display_error(data) {
+ if (data.error) {
+ flash(data.error, 'error');
+ return true;
+ }
+ return false;
+ }
+ function after() {
+ form.parent().slideUp('fast');
+ $('.lb_overlay').hide();
+ }
+ function on_block_user_success(data) {
+ if (display_error(data)) { return; }
+
+ current_block_list.find('ul').append(
+ '<li><label><input type="checkbox" value="' + data.user_id + '"name="user_id">'
+ + data.username + (data.reason ? ' (' + data.reason + ')' : '') + '</label></li>'
+ );
+ // show 'Block List' button
+ current_block_list.parent('li').show();
+ form.find('input[type="text"], textarea').val('');
+ after();
}
+ function on_unblock_user_success(data) {
+ if (display_error(data)) { return; }
+
+ for (var i in data.unblocked) {
+ var uid = data.unblocked[i];
+ current_block_list.find(':checkbox[name="user_id"][value="' + uid + '"]').parent().parent().remove();
+ }
+ if (current_block_list.find(':checkbox[name="user_id"]').length == 0) {
+ // hide 'Block List' button
+ current_block_list.parent('li').hide();
+ }
+ after();
+ }
+
+ var callback = form.attr('action') == 'block_user' ? on_block_user_success : on_unblock_user_success;
+
+ $.ajax({
+ data: form.serialize(),
+ type: form.attr('method'),
+ url: form.attr('action'),
+ success: callback
+ });
+ return false;
});
</script>
{% endblock %}
[25/50] git commit: [#6612] Allow direct user-mapping for SF Trac
imports
Posted by jo...@apache.org.
[#6612] Allow direct user-mapping for SF Trac imports
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2b528970
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2b528970
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2b528970
Branch: refs/heads/cj/6422
Commit: 2b5289706de4eb41316be81f9cdc85385b8d7d19
Parents: 9012935
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Sep 17 13:48:57 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Sep 27 15:20:52 2013 +0000
----------------------------------------------------------------------
.../forgeimporters/trac/tests/test_tickets.py | 19 ++++++++------
ForgeImporters/forgeimporters/trac/tickets.py | 27 ++++++++++++++++----
ForgeTracker/forgetracker/import_support.py | 21 ++++++++++-----
3 files changed, 47 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b528970/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index 770ae72..298b09e 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -78,8 +78,10 @@ class TestTracTicketImporter(TestCase):
expires=now + timedelta(minutes=60))
api_client = ApiClient.return_value
import_tracker.assert_called_once_with(
- api_client, 'myproject', 'bugs',
- {"user_map": user_map}, '[]',
+ api_client, 'myproject', 'bugs', {
+ "user_map": user_map,
+ "usernames_match": False,
+ }, '[]',
validate=False)
AuditLog.log.assert_called_once_with(
'import tool bugs from http://example.com/trac/url/',
@@ -108,11 +110,12 @@ class TestTracTicketImporter(TestCase):
class TestTracTicketImportController(TestController, TestCase):
- def setUp(self):
+ @patch('forgeimporters.trac.tickets.import_tool')
+ def setUp(self, import_tool):
"""Mount Trac import controller on the Tracker admin controller"""
super(TestTracTicketImportController, self).setUp()
from forgetracker.tracker_main import TrackerAdminController
- TrackerAdminController._importer = TracTicketImportController()
+ self.importer = TrackerAdminController._importer = TracTicketImportController()
@with_tracker
def test_index(self):
@@ -122,8 +125,8 @@ class TestTracTicketImportController(TestController, TestCase):
self.assertIsNotNone(r.html.find(attrs=dict(name="mount_point")))
@with_tracker
- @patch('forgeimporters.trac.tickets.import_tool')
- def test_create(self, import_tool):
+ def test_create(self):
+ import_tool = self.importer.task
params = dict(trac_url='http://example.com/trac/url',
mount_label='mylabel',
mount_point='mymount',
@@ -138,8 +141,8 @@ class TestTracTicketImportController(TestController, TestCase):
self.assertEqual(u'http://example.com/trac/url', import_tool.post.call_args[1]['trac_url'])
@with_tracker
- @patch('forgeimporters.trac.tickets.import_tool')
- def test_create_limit(self, import_tool):
+ def test_create_limit(self):
+ import_tool = self.importer.task
project = M.Project.query.get(shortname='test')
project.set_tool_data('TracTicketImporter', pending=1)
ThreadLocalORMSession.flush_all()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b528970/ForgeImporters/forgeimporters/trac/tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tickets.py b/ForgeImporters/forgeimporters/trac/tickets.py
index 9b222b9..6b2600a 100644
--- a/ForgeImporters/forgeimporters/trac/tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tickets.py
@@ -73,6 +73,7 @@ class TracTicketImportForm(ToolImportForm):
class TracTicketImportController(BaseController):
def __init__(self):
self.importer = TracTicketImporter()
+ self.task = import_tool
@property
def target_app(self):
@@ -89,8 +90,8 @@ class TracTicketImportController(BaseController):
@require_post()
@validate(TracTicketImportForm(ForgeTrackerApp), error_handler=index)
def create(self, trac_url, mount_point, mount_label, user_map=None, **kw):
- if TracTicketImporter().enforce_limit(c.project):
- import_tool.post(
+ if self.importer.enforce_limit(c.project):
+ self.task.post(
mount_point=mount_point,
mount_label=mount_label,
trac_url=trac_url,
@@ -138,8 +139,10 @@ class TracTicketImporter(ToolImporter):
session(api_ticket).flush(api_ticket)
cli = AlluraImportApiClient(config['base_url'], api_ticket.api_key,
api_ticket.secret_key, verbose=True, retry=False)
- import_tracker(cli, project.shortname, mount_point,
- {'user_map': json.loads(user_map) if user_map else {}},
+ import_tracker(cli, project.shortname, mount_point, {
+ 'user_map': json.loads(user_map) if user_map else {},
+ 'usernames_match': self.usernames_match(trac_url),
+ },
export_string, validate=False)
AuditLog.log(
'import tool %s from %s' % (
@@ -150,6 +153,20 @@ class TracTicketImporter(ToolImporter):
)
g.post_event('project_updated')
return app
- except Exception as e:
+ except Exception:
h.make_app_admin_only(app)
raise
+
+ def usernames_match(self, trac_url):
+ """Return True if the usernames in the source Trac match the usernames
+ in the destination Allura instance.
+
+ If this is True, Trac usernames will be mapped to their Allura
+ counterparts regardless of whether a user_map file is supplied.
+
+ If this is False, any Trac username not present in the user_map file
+ (or if no file is supplied) will be assumed an unknown or non-existent
+ user in the Allura instance.
+
+ """
+ return False
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b528970/ForgeTracker/forgetracker/import_support.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/import_support.py b/ForgeTracker/forgetracker/import_support.py
index 36c686e..c6a33cb 100644
--- a/ForgeTracker/forgetracker/import_support.py
+++ b/ForgeTracker/forgetracker/import_support.py
@@ -107,7 +107,7 @@ class ImportSupport(object):
self.FIELD_MAP = {
'assigned_to': ('assigned_to_id', self.get_user_id),
'class': None,
- 'date': ('created_date', self.parse_date),
+ 'date': ('created_date', self.parse_date),
'date_updated': ('mod_date', self.parse_date),
'description': True,
'id': None,
@@ -142,11 +142,18 @@ class ImportSupport(object):
return datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%SZ')
def get_user_id(self, username):
- username = self.options['user_map'].get(username)
- if not username:
- return None
- u = M.User.by_username(username)
- return u._id if u else None
+ def _get_user_id(username):
+ u = M.User.by_username(username)
+ return u._id if u else None
+
+ if self.options.get('usernames_match'):
+ return _get_user_id(username)
+
+ mapped_username = self.options['user_map'].get(username)
+ if mapped_username:
+ return _get_user_id(mapped_username)
+
+ return None
def check_custom_field(self, field, value, ticket_status):
field = c.app.globals.get_custom_field(field)
@@ -347,7 +354,7 @@ class ImportSupport(object):
unknown_users = self.find_unknown_users(users)
unknown_users = sorted(list(unknown_users))
if unknown_users:
- self.warnings.append('''Document references unknown users. You should provide
+ self.warnings.append('''Document references unknown users. You should provide
option user_map to avoid losing username information. Unknown users: %s''' % unknown_users)
return {'status': True, 'errors': self.errors, 'warnings': self.warnings}
[22/50] git commit: [#6711] don't delete TicketMonitoringEmail from
the database
Posted by jo...@apache.org.
[#6711] don't delete TicketMonitoringEmail from the database
ForgeTracker's RootRestController.index strips TicketMonitoringEmail from the
response, but was inadvertently removing it from the database also. The
app.config.__json__() result included a ming-instrumented collection so removing
an item from that caused ming to flush that delete to the database.
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/46fffb6f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/46fffb6f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/46fffb6f
Branch: refs/heads/cj/6422
Commit: 46fffb6ff874db9bb3b8d276aec92a712d1a2725
Parents: 55a4588
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Sep 26 15:36:22 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 26 15:36:22 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/project.py | 2 +-
ForgeTracker/forgetracker/tests/functional/test_rest.py | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/46fffb6f/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index ec39157..ec07515 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -981,5 +981,5 @@ class AppConfig(MappedClass):
def __json__(self):
return dict(
_id=self._id,
- options=self.options,
+ options=dict(self.options), # strip away the ming instrumentation
)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/46fffb6f/ForgeTracker/forgetracker/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_rest.py b/ForgeTracker/forgetracker/tests/functional/test_rest.py
index 0025613..6d9a457 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -22,6 +22,7 @@ from mock import patch
from allura.lib import helpers as h
from allura.tests import decorators as td
+from allura import model as M
from alluratest.controller import TestRestApiBase
from forgetracker import model as TM
@@ -122,6 +123,9 @@ class TestRestIndex(TestTrackerApiBase):
def test_ticket_index_noauth(self):
tickets = self.api_get('/rest/p/test/bugs', user='*anonymous')
assert 'TicketMonitoringEmail' not in tickets.json['tracker_config']['options']
+ # make sure it didn't get removed from the db too
+ ticket_config = M.AppConfig.query.get(project_id=c.project._id, tool_name='tickets')
+ assert_equal(ticket_config.options.get('TicketMonitoringEmail'), 'test@localhost')
class TestRestDiscussion(TestTrackerApiBase):
[12/50] git commit: [#6392] ticket:444 Fix js typo
Posted by jo...@apache.org.
[#6392] ticket:444 Fix js typo
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/70e1a8d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/70e1a8d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/70e1a8d9
Branch: refs/heads/cj/6422
Commit: 70e1a8d94c7db463dab91500f7ecc48b8fa00504
Parents: 009fc6e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 24 14:09:31 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/app_admin_permissions.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/70e1a8d9/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index 6fa5246..8f03987 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -83,7 +83,7 @@
});
- $('form[action="block_user"], form[action="unblock_user"').submit(function() {
+ $('form[action="block_user"], form[action="unblock_user"]').submit(function() {
var form = $(this);
function display_error(data) {
[38/50] git commit: [#5775] ticket:433 Don't traverse all commits
when just second needed
Posted by jo...@apache.org.
[#5775] ticket:433 Don't traverse all commits when just second needed
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/baed2859
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/baed2859
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/baed2859
Branch: refs/heads/cj/6422
Commit: baed28595e097eb8fc4b1ab51fdbee93065c92a4
Parents: 7ed43a9
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Oct 1 11:30:20 2013 +0300
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:40:30 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/baed2859/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index cb16763..fa62c23 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -313,9 +313,12 @@ class GitImplementation(M.RepositoryImplementation):
if path:
if renamed and renamed['to'] == path:
rename_details['path'] = '/' + renamed['from']
- revisions = [revision for revision in self._git.iter_commits(revs, renamed['from'])]
+ # get first rev **before** rename
+ _iter = self._git.iter_commits(revs, renamed['from'])
+ prev_rev = next(_iter)
+ prev_rev = next(_iter)
rename_details['commit_url'] = self._repo.url_for_commit(
- revisions[1].hexsha
+ prev_rev.hexsha
)
try:
[31/50] git commit: [#6431] don't rely on bool(cursor)
Posted by jo...@apache.org.
[#6431] don't rely on bool(cursor)
* bool(cursor) is not good either
* refactor some attachment methods up to (Versioned)Artifact
* User.withskill len fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/44963d16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/44963d16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/44963d16
Branch: refs/heads/cj/6422
Commit: 44963d16324b0dc4668bc40f34569bb6a5a22b78
Parents: 9d0d996
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 25 16:45:40 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Oct 1 20:40:41 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 5 ++---
Allura/allura/controllers/trovecategories.py | 2 +-
Allura/allura/ext/admin/templates/project_tools.html | 2 +-
Allura/allura/model/artifact.py | 12 ++++++++++++
Allura/allura/model/discuss.py | 4 ++--
Allura/allura/model/project.py | 2 +-
Allura/allura/templates/widgets/moderate_posts.html | 2 +-
Allura/allura/tests/model/test_discussion.py | 10 +++++-----
Allura/allura/tests/model/test_project.py | 2 +-
ForgeBlog/forgeblog/model/blog.py | 7 -------
.../tests/google/functional/test_tracker.py | 2 +-
ForgeTracker/forgetracker/model/ticket.py | 5 -----
ForgeTracker/forgetracker/templates/tracker/ticket.html | 2 +-
ForgeTracker/forgetracker/tests/functional/test_root.py | 2 +-
.../forgetracker/tests/unit/test_ticket_model.py | 2 +-
ForgeWiki/forgewiki/model/wiki.py | 8 --------
ForgeWiki/forgewiki/tests/functional/test_root.py | 2 +-
17 files changed, 31 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index a1a952c..e36e52e 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -755,9 +755,8 @@ class NeighborhoodAwardsController(object):
@expose('jinja:allura:templates/awards.html')
def index(self, **kw):
require_access(self.neighborhood, 'admin')
- awards = M.Award.query.find(dict(created_by_neighborhood_id=self.neighborhood._id))
- count = awards.count()
- return dict(awards=awards or [], count=count)
+ awards = M.Award.query.find(dict(created_by_neighborhood_id=self.neighborhood._id)).all()
+ return dict(awards=awards or [], count=len(awards))
@expose('jinja:allura:templates/award_not_found.html')
def not_found(self, **kw):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/controllers/trovecategories.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/trovecategories.py b/Allura/allura/controllers/trovecategories.py
index 86d4738..9af28c5 100644
--- a/Allura/allura/controllers/trovecategories.py
+++ b/Allura/allura/controllers/trovecategories.py
@@ -132,7 +132,7 @@ class TroveCategoryController(BaseController):
redirect(redirecturl)
return
- if len(M.User.withskill(cat)) > 0:
+ if M.User.withskill(cat).count() > 0:
m = "This category is used as a skill by at least a user, "
m = m + "therefore it can't be removed."
flash(m, "error")
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/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
index 78fb8f1..36f98f5 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -44,7 +44,7 @@
</span>
</div>
<form method="post" action="update_mounts" id="install_form" style="display:none">
- <input type="hidden" name="new.ordinal" value="{{installable_tools|length + c.project.direct_subprojects.count()}}"/>
+ <input type="hidden" name="new.ordinal" value="{{installable_tools|length + c.project.direct_subprojects|length}}"/>
<input type="hidden" name="new.ep_name" class="new_ep_name">
<label class="grid-13">Label</label>
<div class="grid-13"><input type="text" name="new.mount_label" class="new_mount_label"></div>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 8753f1e..733f2b0 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -409,6 +409,11 @@ class Artifact(MappedClass):
fp=fp, artifact_id=self._id, **kw)
return att
+ @LazyProperty
+ def attachments(self):
+ return self.attachment_class().query.find(dict(
+ app_config_id=self.app_config_id, artifact_id=self._id, type='attachment')).all()
+
def delete(self):
"""Delete this Artifact.
@@ -462,6 +467,13 @@ class Snapshot(Artifact):
def shorthand_id(self):
return '%s#%s' % (self.original().shorthand_id(), self.version)
+
+ @property
+ def attachments(self):
+ orig = self.original()
+ if not orig:
+ return None
+ return orig.attachments
def __getattr__(self, name):
return getattr(self.data, name)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 7f17063..a8cd7a3 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -525,10 +525,10 @@ class Post(Message, VersionedArtifact, ActivityObject):
subject = getattr(artifact, 'email_subject', '')
return subject or '(no subject)'
- @property
+ @LazyProperty
def attachments(self):
return self.attachment_class().query.find(dict(
- post_id=self._id, type='attachment'))
+ post_id=self._id, type='attachment')).all()
def add_multiple_attachments(self, file_info):
if isinstance(file_info, list):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index ec07515..4a56c1b 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -583,7 +583,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
@property
def direct_subprojects(self):
- return self.query.find(dict(parent_id=self._id, deleted=False))
+ return self.query.find(dict(parent_id=self._id, deleted=False)).all()
@property
def accolades(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/templates/widgets/moderate_posts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/moderate_posts.html b/Allura/allura/templates/widgets/moderate_posts.html
index e243b9a..25294a3 100644
--- a/Allura/allura/templates/widgets/moderate_posts.html
+++ b/Allura/allura/templates/widgets/moderate_posts.html
@@ -53,7 +53,7 @@
<td>{{author.display_name}} ({{author.username}})</td>
<td>{{post.thread.subject or '(no subject)'}}</td>
<td>{{h.text.truncate(post.text,200)}}</td>
- <td>{{post.attachments.count()}}</td>
+ <td>{{post.attachments|length}}</td>
<td>
{% if c.app.config.tool_name.lower() != 'discussion' %}
<a href="{{post.thread.artifact.url()}}">[{{post.thread.artifact.shorthand_id()}}]</a>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/tests/model/test_discussion.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_discussion.py b/Allura/allura/tests/model/test_discussion.py
index 36731bc..51a13ee 100644
--- a/Allura/allura/tests/model/test_discussion.py
+++ b/Allura/allura/tests/model/test_discussion.py
@@ -149,7 +149,7 @@ def test_post_methods():
p.commit()
assert p.parent is None
assert p.subject == 'Test Thread'
- assert p.attachments.count() == 0
+ assert_equals(p.attachments, [])
assert 'wiki/_discuss' in p.url()
assert p.reply_subject() == 'Re: Test Thread'
assert p.link_text() == p.subject
@@ -222,8 +222,8 @@ def test_multiple_attachments():
test_post = t.post('test post')
test_post.add_multiple_attachments([test_file1, test_file2])
ThreadLocalORMSession.flush_all()
- assert test_post.attachments.count() == 2, test_post.attachments.count()
- attaches = test_post.attachments.all()
+ assert_equals(len(test_post.attachments), 2)
+ attaches = test_post.attachments
assert 'test1.txt' in [attaches[0].filename, attaches[1].filename]
assert 'test2.txt' in [attaches[0].filename, attaches[1].filename]
@@ -239,8 +239,8 @@ def test_add_attachment():
test_post = t.post('test post')
test_post.add_attachment(test_file)
ThreadLocalORMSession.flush_all()
- assert test_post.attachments.count() == 1, test_post.attachments.count()
- attach = test_post.attachments.first()
+ assert_equals(len(test_post.attachments), 1)
+ attach = test_post.attachments[0]
assert attach.filename == 'test.txt', attach.filename
assert attach.content_type == 'text/plain', attach.content_type
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/Allura/allura/tests/model/test_project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_project.py b/Allura/allura/tests/model/test_project.py
index 2cd7892..c346107 100644
--- a/Allura/allura/tests/model/test_project.py
+++ b/Allura/allura/tests/model/test_project.py
@@ -121,7 +121,7 @@ def test_set_ordinal_to_admin_tool():
def test_users_and_roles():
p = M.Project.query.get(shortname='test')
- sub = p.direct_subprojects.next()
+ sub = p.direct_subprojects[0]
u = M.User.by_username('test-admin')
assert p.users_with_role('Admin') == [u]
assert p.users_with_role('Admin') == sub.users_with_role('Admin')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeBlog/forgeblog/model/blog.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/model/blog.py b/ForgeBlog/forgeblog/model/blog.py
index 2cd16e0..1168fe6 100644
--- a/ForgeBlog/forgeblog/model/blog.py
+++ b/ForgeBlog/forgeblog/model/blog.py
@@ -85,13 +85,6 @@ class BlogPostSnapshot(M.Snapshot):
return g.markdown_wiki.convert(self.data.text)
@property
- def attachments(self):
- orig = self.original()
- if not orig:
- return None
- return orig.attachments
-
- @property
def email_address(self):
orig = self.original()
if not orig:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index ca7c8a5..528c2b6 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -182,7 +182,7 @@ class TestGCTrackerImporter(TestCase):
)
def _assert_attachments(self, actual, *expected):
- self.assertEqual(actual.count(), len(expected))
+ self.assertEqual(len(actual), len(expected))
atts = set((a.filename, a.content_type, a.rfile().read()) for a in actual)
self.assertEqual(atts, set(expected))
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index d0b69c2..a55efab 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -811,11 +811,6 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
if who in (None, User.anonymous()): return 'nobody'
return who.get_pref('display_name')
- @property
- def attachments(self):
- return TicketAttachment.query.find(dict(
- app_config_id=self.app_config_id, artifact_id=self._id, type='attachment'))
-
def update(self, ticket_form):
# update is not allowed to change the ticket_num
ticket_form.pop('ticket_num', None)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeTracker/forgetracker/templates/tracker/ticket.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/ticket.html b/ForgeTracker/forgetracker/templates/tracker/ticket.html
index f780736..95e40a6 100644
--- a/ForgeTracker/forgetracker/templates/tracker/ticket.html
+++ b/ForgeTracker/forgetracker/templates/tracker/ticket.html
@@ -144,7 +144,7 @@
<div id="ticket_content">
{{g.markdown.convert(ticket.description)|safe}}
{% if ticket.attachments %}
- <strong class="grid-18">{{ticket.attachments.count()}} Attachments</strong>
+ <strong class="grid-18">{{ticket.attachments|length}} Attachments</strong>
<div class="clear">
{% for att in ticket.attachments %}
<div class="attachment_thumb">
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 823ec28..9d00bc5 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -560,7 +560,7 @@ class TestFunctionalController(TrackerTestController):
'summary':'zzz'
}, upload_files=[upload]).follow()
ticket = tm.Ticket.query.find({'ticket_num':1}).first()
- filename = ticket.attachments.first().filename
+ filename = ticket.attachments[0].filename
uploaded = PIL.Image.open(file_path)
r = self.app.get('/bugs/1/attachment/'+filename)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 620abcf..93450d1 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -270,7 +270,7 @@ class TestTicketModel(TrackerTestWithModel):
ticket = Ticket.new()
ticket.summary = 'test ticket'
ticket.description = 'test description'
- assert_equal(ticket.attachments.count(), 0)
+ assert_equal(len(ticket.attachments), 0)
f = urllib2.urlopen('file://%s' % __file__)
TicketAttachment.save_attachment('test_ticket_model.py', ResettableStream(f),
artifact_id=ticket._id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index 0321240..e4da9dc 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -76,10 +76,6 @@ class PageHistory(Snapshot):
return g.markdown_wiki.convert(self.data.text)
@property
- def attachments(self):
- return self.original().attachments
-
- @property
def email_address(self):
return self.original().email_address
@@ -161,10 +157,6 @@ class Page(VersionedArtifact, ActivityObject):
text=self.text)
return result
- @property
- def attachments(self):
- return WikiAttachment.query.find(dict(artifact_id=self._id, type='attachment'))
-
@classmethod
def upsert(cls, title, version=None):
"""Update page with `title` or insert new page with that name"""
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44963d16/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index 3312ed7..a55176f 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -391,7 +391,7 @@ class TestRootController(TestController):
self.app.post('/wiki/TEST/attach', upload_files=[upload])
h.set_context('test', 'wiki', neighborhood='Projects')
page = model.Page.query.find(dict(title='TEST')).first()
- filename = page.attachments.first().filename
+ filename = page.attachments[0].filename
uploaded = PIL.Image.open(file_path)
r = self.app.get('/wiki/TEST/attachment/'+filename)
[50/50] git commit: [#6422] Added asf-release.sh script
Posted by jo...@apache.org.
[#6422] Added asf-release.sh script
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/21a2113b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/21a2113b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/21a2113b
Branch: refs/heads/cj/6422
Commit: 21a2113b9554339c4ccd2c594d225e75c9e90033
Parents: 5bca24a
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Oct 3 17:13:28 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu Oct 3 17:13:28 2013 +0000
----------------------------------------------------------------------
scripts/asf-release.sh | 113 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/21a2113b/scripts/asf-release.sh
----------------------------------------------------------------------
diff --git a/scripts/asf-release.sh b/scripts/asf-release.sh
new file mode 100755
index 0000000..c91eed9
--- /dev/null
+++ b/scripts/asf-release.sh
@@ -0,0 +1,113 @@
+#!/bin/bash
+
+function prompt() {
+ ivar="$1"
+ prompt_str="$2: "
+ default="$3"
+ if [[ -n "$default" ]]; then
+ prompt_str="$prompt_str[$default] "
+ fi
+ echo -n "$prompt_str"
+ read $ivar
+ eval $ivar=\${$ivar:-$default}
+}
+
+RELEASE_DIR_BASE=/tmp
+
+VERSION=`git tag -l asf_release_* | sort -rn | head -1 | sed -e 's/^asf_release_//'`
+VERSION=`echo $TVERSION | perl -pe '@_ = split /\./; $_[-1]++; $_ = join ".", @_'`
+prompt VERSION "Version" "$VERSION"
+
+RELEASE_BASE=allura-incubating-$VERSION
+RELEASE_DIR=$RELEASE_DIR_BASE/$RELEASE_BASE
+RELEASE_FILE=$RELEASE_DIR/$RELEASE_BASE.tar.gz
+
+DEFAULT_KEY=`grep default-key ~/.gnupg/gpg.conf | sed -e 's/default-key //'`
+if [[ -z "$DEFAULT_KEY" ]]; then
+ DEFAULT_KEY=`gpg --list-secret-keys | head -3 | tail -1 | sed -e 's/^.*\///' | sed -e 's/ .*//'`
+fi
+prompt KEY "Key" "$DEFAULT_KEY"
+FINGERPRINT=`gpg --fingerprint $KEY | grep fingerprint | cut -d' ' -f 17-20 | sed -e 's/ //g'`
+
+prompt PLUS_VOTES "+1 votes"
+prompt MINUS_VOTES "-1 votes" "0"
+prompt ZERO_VOTES "+0 votes" "0"
+prompt VOTE_THREAD_URL "URL for allura-dev VOTE thread"
+prompt DISCUSS_THREAD_URL "URL for allura-dev DISCUSS thread"
+prompt RAT_LOG_PASTEBIN_URL "URL for RAT log pastebin"
+
+
+
+mkdir $RELEASE_DIR
+ln -s . $RELEASE_BASE
+tar -czf $RELEASE_FILE \
+ --exclude='*.pyc' \
+ --exclude='.git' \
+ --exclude="$RELEASE_BASE/*/LICENSE" \
+ --exclude="$RELEASE_BASE/*/NOTICE" \
+ --exclude="$RELEASE_BASE/allura-incubating-*" \
+ $RELEASE_BASE/*
+rm -f $RELEASE_BASE
+
+gpg --default-key $KEY --armor --output $RELEASE_FILE.asc --detach-sig $RELEASE_FILE
+MD5_CHECKSUM=`md5sum $RELEASE_FILE` ; echo $MD5_CHECKSUM > $RELEASE_FILE.md5
+SHA1_CHECKSUM=`shasum -a1 $RELEASE_FILE` ; echo $SHA1_CHECKSUM > $RELEASE_FILE.sha1
+SHA512_CHECKSUM=`shasum -a512 $RELEASE_FILE` ; echo $SHA512_CHECKSUM > $RELEASE_FILE.sha512
+
+git tag asf_release_$VERSION
+#git push origin asf_release_$VERSION
+COMMIT_SHA=`git rev-parse asf_release_$VERSION`
+
+CLOSE_DATE=`date -d '+72 hours' +%F`
+
+echo "Release is ready at: $RELEASE_DIR"
+echo "Once confirmed, push release tag with: git push origin asf_release_$VERSION"
+echo "Then upload the files and signatures, and post the following:"
+echo "-------------------------------------------------------------"
+echo "Subject: [VOTE] Release of Apache Allura $VERSION (incubating)"
+echo "-------------------------------------------------------------"
+echo <<EOF
+Hello,
+
+This is a call for a vote on Apache Allura 1.0.0 incubating.
+
+A vote was held on developer mailing list and it passed
+with $PLUS_VOTES +1's, $MINUS_VOTES -1's, and $ZERO_VOTES +0's votes, and now requires a vote
+on general@incubator.apache.org.
+
+The [VOTE] and [DISCUSS] threads can be found at:
+ [VOTE]: $VOTE_THREAD_URL
+ [DISCUSS]: $DISCUSS_THREAD_URL
+
+Source tarball and signature are available at:
+ https://dist.apache.org/repos/dist/dev/incubator/allura/$RELEASE_BASE.tar.gz
+ https://dist.apache.org/repos/dist/dev/incubator/allura/$RELEASE_BASE.tar.gz.asc
+
+Checksums:
+ MD5: $MD5_CHECKSUM
+ SHA1: $SHA1_CHECKSUM
+ SHA512: $SHA512_CHECKSUM
+
+The KEYS file can be found at:
+ http://www.apache.org/dist/incubator/allura/KEYS
+
+The release has been signed with key ($KEY):
+ http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x$FINGERPRINT
+
+Source corresponding to this release can be found at:
+ Commit: $COMMIT_SHA
+ Tag: asf_release_$VERSION
+ Browse: https://git-wip-us.apache.org/repos/asf?p=incubator-allura.git;a=shortlog;h=refs/tags/asf_release_$VERSION
+
+The RAT report is available at:
+ $RAT_LOG_PASTEBIN_URL
+
+Vote will be open for at least 72 hours ($CLOSE_DATE 12PM IST).
+
+[ ] +1 approve
+[ ] +0 no opinion
+[ ] -1 disapprove (and reason why)
+
+Thanks & Regards
+EOF
+echo "-------------------------------------------------------------"
[36/50] git commit: [#5775] ticket:433 Allura Code Viewer: "copied
from" improvements
Posted by jo...@apache.org.
[#5775] ticket:433 Allura Code Viewer: "copied from" improvements
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b96a0110
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b96a0110
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b96a0110
Branch: refs/heads/cj/6422
Commit: b96a01104b954682789e4a15218541844d4c5c70
Parents: 2080fae
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Fri Sep 27 12:32:14 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 15:40:30 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 2 +-
ForgeSVN/forgesvn/model/svn.py | 15 +++++++++++++--
ForgeSVN/forgesvn/tests/model/test_repository.py | 6 ++++++
3 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b96a0110/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 29af6c7..955c9b3 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -393,7 +393,7 @@ class GitImplementation(M.RepositoryImplementation):
renamed = {}
if len(commit_lines) > 1: # merge commits don't have any --name-status output
name_stat_parts = commit_lines[1].split(' ')
- if name_stat_parts[0] == 'R100':
+ if name_stat_parts[0] in ['R100', 'R096']:
renamed['from'] = name_stat_parts[1]
renamed['to'] = name_stat_parts[2]
yield (git.Commit(self._git, gitdb.util.hex_to_bin(hexsha)), refs, renamed)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b96a0110/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 089572c..ec8d991 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -535,7 +535,7 @@ class SVNImplementation(M.RepositoryImplementation):
while revno > exclude:
rev = pysvn.Revision(pysvn.opt_revision_kind.number, revno)
try:
- logs = self._svn.log(url, revision_start=rev, limit=page_size,
+ logs = self._svn.log(url, revision_start=rev, peg_revision=rev, limit=page_size,
discover_changed_paths=True)
except pysvn.ClientError as e:
if 'Unable to connect' in e.message:
@@ -553,6 +553,16 @@ class SVNImplementation(M.RepositoryImplementation):
return # we didn't get a full page, don't bother calling SVN again
revno = ci.revision.number - 1
+ def _check_changed_path(self, changed_path, path):
+ if (changed_path['copyfrom_path'] and
+ changed_path['path'] and
+ path and
+ (len(changed_path['path']) < len(path)) and
+ path.startswith(changed_path['path'])):
+ changed_path['copyfrom_path'] = changed_path['copyfrom_path'] + path[len(changed_path['path']):]
+ changed_path['path'] = path
+ return changed_path
+
def _map_log(self, ci, url, path=None):
revno = ci.revision.number
try:
@@ -562,6 +572,7 @@ class SVNImplementation(M.RepositoryImplementation):
rename_details = {}
changed_paths = ci.get('changed_paths', [])
for changed_path in changed_paths:
+ changed_path = self._check_changed_path(changed_path, path)
if changed_path['copyfrom_path'] and changed_path['path'] == path and changed_path['action'] == 'A':
rename_details['path'] = changed_path['copyfrom_path']
rename_details['commit_url'] = self._repo.url_for_commit(
@@ -719,7 +730,7 @@ class SVNImplementation(M.RepositoryImplementation):
url = '/'.join([self._url, path.strip('/')])
rev = pysvn.Revision(pysvn.opt_revision_kind.number, self._revno(self.rev_parse(rev)))
try:
- info = self._svn.list(url, revision=rev, dirent_fields=pysvn.SVN_DIRENT_KIND)[0][0]
+ info = self._svn.list(url, revision=rev, peg_revision=rev, dirent_fields=pysvn.SVN_DIRENT_KIND)[0][0]
return info.kind == pysvn.node_kind.file
except pysvn.ClientError:
return False
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b96a0110/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 2ed5de3..2a69339 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -1050,3 +1050,9 @@ class TestRename(unittest.TestCase):
entry['rename_details']['commit_url'],
self.repo.url_for_commit(2) # previous revision
)
+
+ def test_check_changed_path(self):
+ changed_path = {'copyfrom_path':'/test/path', 'path':'/test/path2'}
+ result = self.repo._impl._check_changed_path(changed_path, '/test/path2/file.txt')
+ assert_equal({'path': '/test/path2/file.txt', 'copyfrom_path': '/test/path/file.txt'}, result)
+
[29/50] git commit: [#6431] ticket:430 Upgrade to ming 0.4.x to avoid
extraneous count() queries
Posted by jo...@apache.org.
[#6431] ticket:430 Upgrade to ming 0.4.x to avoid extraneous count() queries
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f55c8bde
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f55c8bde
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f55c8bde
Branch: refs/heads/cj/6422
Commit: f55c8bde7af0ee01b319a145060574304e26be31
Parents: 182a724
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Sun Sep 22 13:21:07 2013 +0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Oct 1 20:40:40 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/auth.py | 2 +-
Allura/allura/controllers/project.py | 6 +++---
Allura/allura/controllers/trovecategories.py | 2 +-
Allura/allura/ext/admin/templates/project_tools.html | 2 +-
Allura/allura/model/artifact.py | 2 +-
Allura/allura/templates/widgets/moderate_posts.html | 2 +-
ForgeTracker/forgetracker/templates/tracker/ticket.html | 2 +-
ForgeTracker/forgetracker/tests/unit/test_ticket_model.py | 4 ++--
requirements-common.txt | 2 +-
9 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index fa00208..50b550f 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -511,7 +511,7 @@ class UserSkillsController(BaseController):
selected_skill = selected_skill,
parents = parents,
menu = menu,
- add_details_fields=(len(l)==0))
+ add_details_fields=(l.count() == 0))
@expose()
@require_post()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index e2c7ee8..a1a952c 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -537,7 +537,7 @@ class NeighborhoodAdminController(object):
awards = M.Award.query.find(dict(created_by_neighborhood_id=self.neighborhood._id)).all()
awards_count = len(awards)
grants = M.AwardGrant.query.find(dict(granted_by_neighborhood_id=self.neighborhood._id))
- grants_count = len(grants)
+ grants_count = grants.count()
c.project_select = W.project_select(self.neighborhood.url() + '_admin/project_search')
return dict(
awards=awards,
@@ -756,7 +756,7 @@ class NeighborhoodAwardsController(object):
def index(self, **kw):
require_access(self.neighborhood, 'admin')
awards = M.Award.query.find(dict(created_by_neighborhood_id=self.neighborhood._id))
- count = len(awards)
+ count = awards.count()
return dict(awards=awards or [], count=count)
@expose('jinja:allura:templates/award_not_found.html')
@@ -767,7 +767,7 @@ class NeighborhoodAwardsController(object):
def grants(self, **kw):
require_access(self.neighborhood, 'admin')
grants = M.AwardGrant.query.find(dict(granted_by_neighborhood_id=self.neighborhood._id))
- count = len(grants)
+ count = grants.count()
return dict(grants=grants or [], count=count)
@expose()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/Allura/allura/controllers/trovecategories.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/trovecategories.py b/Allura/allura/controllers/trovecategories.py
index 79cb88c..86d4738 100644
--- a/Allura/allura/controllers/trovecategories.py
+++ b/Allura/allura/controllers/trovecategories.py
@@ -59,7 +59,7 @@ class TroveCategoryController(BaseController):
hierarchy = [temp_cat] + hierarchy
temp_cat = temp_cat.parent_category
else:
- l = M.TroveCategory.query.find(dict(trove_parent_id=0))
+ l = M.TroveCategory.query.find(dict(trove_parent_id=0)).all()
selected_cat = None
hierarchy = []
return dict(
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/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
index 36f98f5..78fb8f1 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -44,7 +44,7 @@
</span>
</div>
<form method="post" action="update_mounts" id="install_form" style="display:none">
- <input type="hidden" name="new.ordinal" value="{{installable_tools|length + c.project.direct_subprojects|length}}"/>
+ <input type="hidden" name="new.ordinal" value="{{installable_tools|length + c.project.direct_subprojects.count()}}"/>
<input type="hidden" name="new.ep_name" class="new_ep_name">
<label class="grid-13">Label</label>
<div class="grid-13"><input type="text" name="new.mount_label" class="new_mount_label"></div>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 2804a17..8753f1e 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -540,7 +540,7 @@ class VersionedArtifact(Artifact):
@property
def last_updated(self):
history = self.history()
- if len(history):
+ if history.count():
return self.history().first().timestamp
else:
return self.mod_date
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/Allura/allura/templates/widgets/moderate_posts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/moderate_posts.html b/Allura/allura/templates/widgets/moderate_posts.html
index 25294a3..e243b9a 100644
--- a/Allura/allura/templates/widgets/moderate_posts.html
+++ b/Allura/allura/templates/widgets/moderate_posts.html
@@ -53,7 +53,7 @@
<td>{{author.display_name}} ({{author.username}})</td>
<td>{{post.thread.subject or '(no subject)'}}</td>
<td>{{h.text.truncate(post.text,200)}}</td>
- <td>{{post.attachments|length}}</td>
+ <td>{{post.attachments.count()}}</td>
<td>
{% if c.app.config.tool_name.lower() != 'discussion' %}
<a href="{{post.thread.artifact.url()}}">[{{post.thread.artifact.shorthand_id()}}]</a>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/ForgeTracker/forgetracker/templates/tracker/ticket.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/ticket.html b/ForgeTracker/forgetracker/templates/tracker/ticket.html
index f6288bb..f780736 100644
--- a/ForgeTracker/forgetracker/templates/tracker/ticket.html
+++ b/ForgeTracker/forgetracker/templates/tracker/ticket.html
@@ -144,7 +144,7 @@
<div id="ticket_content">
{{g.markdown.convert(ticket.description)|safe}}
{% if ticket.attachments %}
- <strong class="grid-18">{{ticket.attachments.__len__()}} Attachments</strong>
+ <strong class="grid-18">{{ticket.attachments.count()}} Attachments</strong>
<div class="clear">
{% for att in ticket.attachments %}
<div class="attachment_thumb">
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 7f7fdd7..620abcf 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -270,12 +270,12 @@ class TestTicketModel(TrackerTestWithModel):
ticket = Ticket.new()
ticket.summary = 'test ticket'
ticket.description = 'test description'
- assert_equal(len(ticket.attachments), 0)
+ assert_equal(ticket.attachments.count(), 0)
f = urllib2.urlopen('file://%s' % __file__)
TicketAttachment.save_attachment('test_ticket_model.py', ResettableStream(f),
artifact_id=ticket._id)
ThreadLocalORMSession.flush_all()
- assert_equal(len(ticket.attachments), 1)
+ assert_equal(ticket.attachments.count(), 1)
assert_equal(ticket.attachments.first().filename, 'test_ticket_model.py')
def test_json_parents(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f55c8bde/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index 42bdadb..51c7636 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -21,7 +21,7 @@ httplib2==0.7.4
iso8601==0.1.4
Jinja2==2.6
Markdown==2.2.0
-Ming==0.3.10
+Ming==0.4.1
oauth2==1.5.170
# tg2 dep PasteDeploy must specified before TurboGears2, to avoid a version/allow-hosts problem
Paste==1.7.5.1
[20/50] git commit: [#6709] Misc performance improvements
Posted by jo...@apache.org.
[#6709] Misc performance improvements
- Skip ACE deny check in has_access() if anonymous
- Correct the has_access docstring for recent changes
- Add index for ProjectRole lookups by_name(). Existing project_id index
was being used, but still had to scan all roles for the project.
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a17ae4a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a17ae4a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a17ae4a2
Branch: refs/heads/cj/6422
Commit: a17ae4a23c9431b4935e3bd4305795529a14b5ca
Parents: 2d5a6ab
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Sep 25 16:06:37 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Sep 25 20:14:33 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/security.py | 25 +++++++++++++++++--------
Allura/allura/model/auth.py | 4 ++--
2 files changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a17ae4a2/Allura/allura/lib/security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/security.py b/Allura/allura/lib/security.py
index bbadb1b..a211ae2 100644
--- a/Allura/allura/lib/security.py
+++ b/Allura/allura/lib/security.py
@@ -245,6 +245,9 @@ def has_access(obj, permission, user=None, project=None):
- First, all the roles for a user in the given project context are computed.
+ - If the given object's ACL contains a DENY for this permission on this
+ user's project role, return False and deny access.
+
- Next, for each role, the given object's ACL is examined linearly. If an ACE
is found which matches the permission and user, and that ACE ALLOWs access,
then the function returns True and access is permitted. If the ACE DENYs
@@ -265,10 +268,15 @@ def has_access(obj, permission, user=None, project=None):
obj.parent_security_context(). If the parent_security_context is None, then
the function returns False and access is denied.
- The effect of this processing is that if *any* role for the user is ALLOWed
- access via a linear traversal of the ACLs, then access is allowed. All of the
- users roles must either be explicitly DENYed or processing terminate with no
- matches to DENY access to the resource.
+ The effect of this processing is that:
+
+ 1. If the user's project_role is DENYed, access is denied (e.g. if the user
+ has been blocked for a permission on a specific tool).
+
+ 2. Else, if *any* role for the user is ALLOWed access via a linear
+ traversal of the ACLs, then access is allowed.
+
+ 3. Otherwise, DENY access to the resource.
'''
from allura import model as M
def predicate(obj=obj, user=user, project=project, roles=None):
@@ -290,10 +298,11 @@ def has_access(obj, permission, user=None, project=None):
project = getattr(obj, 'project', None) or c.project
project = project.root_project
roles = cred.user_roles(user_id=user._id, project_id=project._id).reaching_ids
- user_role = user.project_role(project=project)
- deny_user = M.ACE.deny(user_role._id, permission)
- if M.ACL.contains(deny_user, obj.acl):
- return False
+ if user != M.User.anonymous():
+ user_role = user.project_role(project=project)
+ deny_user = M.ACE.deny(user_role._id, permission)
+ if M.ACL.contains(deny_user, obj.acl):
+ return False
chainable_roles = []
for rid in roles:
for ace in obj.acl:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a17ae4a2/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index b048ce6..cb15398 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -727,8 +727,8 @@ class ProjectRole(MappedClass):
unique_indexes = [ ('user_id', 'project_id', 'name') ]
indexes = [
('user_id',),
- ('project_id',),
- ('roles',)
+ ('project_id', 'name'), # used in ProjectRole.by_name()
+ ('roles',),
]
_id = FieldProperty(S.ObjectId)
[03/50] git commit: [#6392] ticket:432 Use ACE/ACL machinery instead
of app_config attr
Posted by jo...@apache.org.
[#6392] ticket:432 Use ACE/ACL machinery instead of app_config attr
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/991f8bc2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/991f8bc2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/991f8bc2
Branch: refs/heads/cj/6422
Commit: 991f8bc2156ebd76132d72d84cf13caa4571621d
Parents: 9442d72
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 11 14:46:41 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 35 ++++++++++----------
.../templates/admin_widgets/card_field.html | 21 +++++-------
.../ext/admin/templates/widgets/block_list.html | 24 ++++++++++++--
.../ext/admin/templates/widgets/block_user.html | 26 ++++++++++++---
Allura/allura/lib/security.py | 7 ++--
Allura/allura/model/project.py | 1 -
Allura/allura/model/types.py | 21 ++++++++++--
.../allura/templates/app_admin_permissions.html | 3 +-
Allura/allura/tests/functional/test_admin.py | 2 +-
9 files changed, 93 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 029da32..8218d53 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -18,6 +18,7 @@
import logging
from urllib import basejoin
from cStringIO import StringIO
+from collections import defaultdict
from tg import expose, redirect, flash
from tg.decorators import without_trailing_slash
@@ -583,21 +584,23 @@ class DefaultAdminController(BaseController):
permanent_redirect('permissions')
@expose()
- def block_user(self, user_name, perm, reason=''):
- user = model.User.by_username(user_name)
+ def block_user(self, username, perm, reason=None):
+ user = model.User.by_username(username)
if not user:
- flash('User "%s" not found' % user_name, 'error')
+ flash('User "%s" not found' % username, 'error')
return redirect(request.referer)
- if perm not in self.app.config.block_user:
- self.app.config.block_user[perm] = dict()
- if user._id not in self.app.config.block_user[perm]:
- self.app.config.block_user[perm][str(user._id)] = reason
+ ace = model.ACE.deny(user.project_role()._id, perm, reason)
+ if ace not in self.app.acl:
+ self.app.acl.append(ace)
return redirect(request.referer)
@expose()
- def unblock_user(self, user_id='', perm=''):
- del self.app.config.block_user[perm][user_id]
+ def unblock_user(self, user_id, perm):
+ user = model.User.query.get(_id=ObjectId(user_id))
+ ace = model.ACE.deny(user.project_role()._id, perm)
+ if ace in self.app.acl:
+ self.app.acl.remove(ace)
return redirect(request.referer)
@expose('jinja:allura:templates/app_admin_permissions.html')
@@ -611,15 +614,7 @@ class DefaultAdminController(BaseController):
c.block_user = BlockUser()
c.block_list = BlockList()
permissions = dict((p, []) for p in self.app.permissions)
- block_list = {}
-
- for perm, users in self.app.config.block_user.items():
- users_id = [ObjectId(_id) for _id in users.keys()]
- block_list[perm] = dict()
- for user in model.User.query.find(dict(_id={'$in': users_id})):
- block_list[perm][str(user._id)] = [user.username, users[str(user._id)]]
-
-
+ block_list = defaultdict(list)
for ace in self.app.config.acl:
if ace.access == model.ACE.ALLOW:
try:
@@ -627,6 +622,10 @@ class DefaultAdminController(BaseController):
except KeyError:
# old, unknown permission
pass
+ elif ace.access == model.ACE.DENY:
+ role = model.ProjectRole.query.get(_id=ace.role_id)
+ if role.name is None and role.user:
+ block_list[ace.permission].append((role.user, getattr(ace, 'reason', None)))
return dict(
app=self.app,
allow_config=has_access(c.project, 'admin')(),
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
index fa958af..964ea65 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
@@ -72,22 +72,17 @@
</a>
</li>
- {%if (name in block_list) and (block_list[name])%}
- <li>
- <a href="#" class="block-list">
- Block list
+ {% if block_list.get(name) %}
+ <li>
+ <a href="#" class="block-list">Block List</a>
<div class="block-list grid-13" style="display: none">
<ul>
- {%for user_id in block_list[name].keys()%}
- <li>
- <input type="checkbox" name="user_id" value="{{user_id}}">{{block_list[name][user_id][0]}} ({{block_list[name][user_id][1]}})
-
- </li>
- {%endfor%}
+ {% for u, reason in block_list[name] %}
+ <li><input type="checkbox" name="user_id" value="{{ u._id }}">{{ u.username }} {{ '(' + reason + ')' if reason else '' }}</li>
+ {% endfor %}
</ul>
</div>
- </a>
- </li>
- {%endif%}
+ </li>
+ {% endif %}
</ul>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/ext/admin/templates/widgets/block_list.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/widgets/block_list.html b/Allura/allura/ext/admin/templates/widgets/block_list.html
index 9f3e7f3..85ff03a 100644
--- a/Allura/allura/ext/admin/templates/widgets/block_list.html
+++ b/Allura/allura/ext/admin/templates/widgets/block_list.html
@@ -1,9 +1,27 @@
+{#-
+ 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.
+-#}
<h1>Block list</h1>
-<form action="unblock_user">
+<form action="unblock_user" method="POST">
<div class="model-block-list"></div>
<input type="hidden" class="block_user_role" name="perm" value="">
<div class="grid-13"> </div>
<hr>
-<div class="grid-13"><div class="grid-13"> </div>
+<div class="grid-13"> </div>
<input type="submit" value="Delete">
-</form>
\ No newline at end of file
+</form>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/ext/admin/templates/widgets/block_user.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/widgets/block_user.html b/Allura/allura/ext/admin/templates/widgets/block_user.html
index d6ea3a6..9f087c3 100644
--- a/Allura/allura/ext/admin/templates/widgets/block_user.html
+++ b/Allura/allura/ext/admin/templates/widgets/block_user.html
@@ -1,13 +1,31 @@
+{#-
+ 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.
+-#}
<h1>Block User</h1>
-<form action="block_user">
+<form action="block_user" method="POST">
<label class="grid-13">User Name</label>
- <input type="text" id="block_user" name="user_name" class="grid-13">
+ <input type="text" id="block_user" name="username" class="grid-13">
<label class="grid-13">Reason</label>
<textarea class="grid-13" name="reason"></textarea>
<input type="hidden" class="block_user_role" name="perm" value="">
<div class="grid-13"> </div>
<hr>
- <div class="grid-13"><div class="grid-13"> </div>
+ <div class="grid-13"> </div>
<input type="submit" value="Save">
- <a href="#" class="close">Cancel</a></div>
+ <a href="#" class="close">Cancel</a>
</form>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/lib/security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/security.py b/Allura/allura/lib/security.py
index fd20542..c992cef 100644
--- a/Allura/allura/lib/security.py
+++ b/Allura/allura/lib/security.py
@@ -290,10 +290,11 @@ def has_access(obj, permission, user=None, project=None):
project = getattr(obj, 'project', None) or c.project
project = project.root_project
roles = cred.user_roles(user_id=user._id, project_id=project._id).reaching_ids
- chainable_roles = []
- block_user = getattr(obj, 'block_user', dict())
- if (permission in block_user) and (str(user._id) in block_user[permission]):
+ user_role = user.project_role(project=project)
+ deny_user = M.ACE.deny(user_role._id, permission)
+ if deny_user in obj.acl:
return False
+ chainable_roles = []
for rid in roles:
for ace in obj.acl:
if M.ACE.match(ace, rid, permission):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 88b9d5a..ec39157 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -942,7 +942,6 @@ class AppConfig(MappedClass):
tool_data = FieldProperty({str:{str:None}}) # entry point: prefs dict
acl = FieldProperty(ACL())
- block_user = FieldProperty({str: {str: str}})
def get_tool_data(self, tool, key, default=None):
return self.tool_data.get(tool, {}).get(key, default)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/model/types.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/types.py b/Allura/allura/model/types.py
index 0dd8150..fa7b332 100644
--- a/Allura/allura/model/types.py
+++ b/Allura/allura/model/types.py
@@ -43,11 +43,14 @@ class ACE(S.Object):
permission=permission)
@classmethod
- def deny(cls, role_id, permission):
- return Object(
+ def deny(cls, role_id, permission, reason=None):
+ ace = Object(
access=cls.DENY,
role_id=role_id,
permission=permission)
+ if reason:
+ ace.reason = reason
+ return ace
@classmethod
def match(cls, ace, role_id, permission):
@@ -61,4 +64,18 @@ class ACL(S.Array):
super(ACL, self).__init__(
field_type=ACE(permissions), **kwargs)
+ def __contains__(self, ace):
+ """Test membership of ace in acl ignoring ace.reason field.
+
+ e.g. `ace in acl` test should evaluate to True with following vars:
+
+ ace = M.ACE.deny(role_id, 'read')
+ acl = [{role_id=ObjectId(...), permission='read', access='DENY', reason='Spammer'}]
+ """
+ def clear_reason(ace):
+ return Object(access=ace.access, role_id=ace.role_id, permission=ace.permission)
+
+ ace = Object(access=ace.access, role_id=ace.role_id, permission=ace.permission)
+ return ace in map(clear_reason, self)
+
DENY_ALL = ACE.deny(EVERYONE, ALL_PERMISSIONS)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index 6a7bd61..69000f8 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -72,7 +72,7 @@
$('input.block_user_role').val(role);
});
$('a.block-list').click(function(){
- var userlist = $(this).find('div.block-list').clone();
+ var userlist = $(this).siblings('div.block-list').clone();
var deck = $(this).closest('ul.deck');
var role = deck.find('li.tcenter h3').text();
$('input.block_user_role').val(role);
@@ -80,4 +80,3 @@
});
</script>
{% endblock %}
-
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/991f8bc2/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 24cf292..007746a 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -164,7 +164,7 @@ class TestProjectAdmin(TestController):
# Check the audit log
r = self.app.get('/admin/audit/')
- assert "uninstall tool test-tool" in r.body, r.bodyt
+ assert "uninstall tool test-tool" in r.body, r.body
@td.with_wiki
def test_add_user_to_block_list(self):
[42/50] git commit: [#5775] Minor change to ensure git process
doesn't do any extra work in the background
Posted by jo...@apache.org.
[#5775] Minor change to ensure git process doesn't do any extra work in the background
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4c1f101a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4c1f101a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4c1f101a
Branch: refs/heads/cj/6422
Commit: 4c1f101ad028f5018d6aed31feabc7c0df5626f9
Parents: 4478bf3
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Oct 2 16:29:01 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 16:29:01 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4c1f101a/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index b1c621b..3efc519 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -314,9 +314,8 @@ class GitImplementation(M.RepositoryImplementation):
if renamed and renamed['to'] == path:
rename_details['path'] = '/' + renamed['from']
# get first rev **before** rename
- _iter = self._git.iter_commits(revs, renamed['from'])
- prev_rev = next(_iter)
- prev_rev = next(_iter)
+ _iter = self._git.iter_commits(revs, renamed['from'], max_count=2)
+ prev_rev = list(_iter)[1]
rename_details['commit_url'] = self._repo.url_for_commit(
prev_rev.hexsha
)
[04/50] git commit: [#6392] ticket:403 code refactoring
Posted by jo...@apache.org.
[#6392] ticket:403 code refactoring
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9442d72b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9442d72b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9442d72b
Branch: refs/heads/cj/6422
Commit: 9442d72b668779887952ca9f7bd844fd62abb9f1
Parents: 5303715
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Fri Aug 9 13:59:33 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 12 ++++++------
.../allura/ext/admin/templates/widgets/block_list.html | 2 +-
Allura/allura/tests/functional/test_admin.py | 3 +--
3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9442d72b/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index d65f155..029da32 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -583,11 +583,6 @@ class DefaultAdminController(BaseController):
permanent_redirect('permissions')
@expose()
- def edit_block_user(self, user_id='', perm=''):
- del self.app.config.block_user[perm][user_id]
- return redirect(request.referer)
-
- @expose()
def block_user(self, user_name, perm, reason=''):
user = model.User.by_username(user_name)
if not user:
@@ -600,6 +595,11 @@ class DefaultAdminController(BaseController):
self.app.config.block_user[perm][str(user._id)] = reason
return redirect(request.referer)
+ @expose()
+ def unblock_user(self, user_id='', perm=''):
+ del self.app.config.block_user[perm][user_id]
+ return redirect(request.referer)
+
@expose('jinja:allura:templates/app_admin_permissions.html')
@without_trailing_slash
def permissions(self):
@@ -614,7 +614,7 @@ class DefaultAdminController(BaseController):
block_list = {}
for perm, users in self.app.config.block_user.items():
- users_id = [ObjectId(id) for id in users.keys()]
+ users_id = [ObjectId(_id) for _id in users.keys()]
block_list[perm] = dict()
for user in model.User.query.find(dict(_id={'$in': users_id})):
block_list[perm][str(user._id)] = [user.username, users[str(user._id)]]
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9442d72b/Allura/allura/ext/admin/templates/widgets/block_list.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/widgets/block_list.html b/Allura/allura/ext/admin/templates/widgets/block_list.html
index f1584b1..9f3e7f3 100644
--- a/Allura/allura/ext/admin/templates/widgets/block_list.html
+++ b/Allura/allura/ext/admin/templates/widgets/block_list.html
@@ -1,5 +1,5 @@
<h1>Block list</h1>
-<form action="edit_block_user">
+<form action="unblock_user">
<div class="model-block-list"></div>
<input type="hidden" class="block_user_role" name="perm" value="">
<div class="grid-13"> </div>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9442d72b/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 3fb799c..24cf292 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -179,7 +179,6 @@ class TestProjectAdmin(TestController):
assert_equals(app.config.block_user['read'], {str(user_id): 'Comment'})
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-list">' in r
- r.showbrowser()
assert '<input type="checkbox" name="user_id" value="%s">test-admin (Comment)' % user_id in r
@td.with_wiki
@@ -188,7 +187,7 @@ class TestProjectAdmin(TestController):
app = M.Project.query.get(shortname='test').app_instance('wiki')
user_id = M.User.by_username('test-admin')._id
assert_equals(app.config.block_user['read'], {str(user_id): ''})
- self.app.post('/admin/wiki/edit_block_user', params={'user_id': str(user_id), 'perm': 'read'})
+ self.app.post('/admin/wiki/unblock_user', params={'user_id': str(user_id), 'perm': 'read'})
assert_equals(app.config.block_user['read'], dict())
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-list">' not in r
[13/50] git commit: [#6392] ticket:432 Fix test
Posted by jo...@apache.org.
[#6392] ticket:432 Fix test
Can't figure out how to send multiple values to one field in test,
so doing it with two different requests. It works through web, though.
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/323d01c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/323d01c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/323d01c0
Branch: refs/heads/cj/6422
Commit: 323d01c06ba65b3613ba9db038cca5fd4ef16135
Parents: 52b7043
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Sep 13 13:42:23 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/tests/functional/test_admin.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/323d01c0/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 b5a3569..38a7272 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -223,7 +223,9 @@ class TestProjectAdmin(TestController):
assert '<input type="checkbox" name="user_id" value="%s">test-admin (Spammer)' % admin._id in r
assert '<input type="checkbox" name="user_id" value="%s">test-user' % user._id in r
- self.app.post('/admin/wiki/unblock_user', params={'user_id': [str(user._id), str(admin._id)], 'perm': 'read'})
+ self.app.post('/admin/wiki/unblock_user', params={'user_id': str(user._id), 'perm': 'read'})
+ self.app.post('/admin/wiki/unblock_user', params={'user_id': str(admin._id), 'perm': 'read'})
+ app = M.Project.query.get(shortname='test').app_instance('wiki')
assert M.ACL.contains(deny_admin, app.acl) is None
assert M.ACL.contains(deny_user, app.acl) is None
r = self.app.get('/admin/wiki/permissions')
[07/50] git commit: [#6392] ticket:432 Fix test fails due to new
ACE.reason field
Posted by jo...@apache.org.
[#6392] ticket:432 Fix test fails due to new ACE.reason field
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4220cb20
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4220cb20
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4220cb20
Branch: refs/heads/cj/6422
Commit: 4220cb20ab00cb86c7c58a422bd1b37d6463125d
Parents: c85fad8
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Sep 13 11:26:21 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/types.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4220cb20/Allura/allura/model/types.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/types.py b/Allura/allura/model/types.py
index 73c4b3b..2e14c86 100644
--- a/Allura/allura/model/types.py
+++ b/Allura/allura/model/types.py
@@ -37,9 +37,10 @@ class ACE(S.Object):
**kwargs)
@classmethod
- def allow(cls, role_id, permission):
+ def allow(cls, role_id, permission, reason=None):
return Object(
access=cls.ALLOW,
+ reason=reason,
role_id=role_id,
permission=permission)
@@ -47,10 +48,9 @@ class ACE(S.Object):
def deny(cls, role_id, permission, reason=None):
ace = Object(
access=cls.DENY,
+ reason=reason,
role_id=role_id,
permission=permission)
- if reason:
- ace.reason = reason
return ace
@classmethod
[10/50] git commit: [#6392] ticket:432 Unblock multiple users at once
and validation
Posted by jo...@apache.org.
[#6392] ticket:432 Unblock multiple users at once and validation
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c85fad83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c85fad83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c85fad83
Branch: refs/heads/cj/6422
Commit: c85fad83ea82c99d37bd2a12de0852cc49c8ccef
Parents: 12420f5
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 11 16:57:21 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 35 ++++++++++++++++-------
Allura/allura/tests/functional/test_admin.py | 10 +++++++
2 files changed, 34 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c85fad83/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index a887375..a9a8816 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -20,11 +20,13 @@ from urllib import basejoin
from cStringIO import StringIO
from collections import defaultdict
-from tg import expose, redirect, flash
+from tg import expose, redirect, flash, validate
from tg.decorators import without_trailing_slash
from pylons import request, app_globals as g, tmpl_context as c
from paste.deploy.converters import asbool, asint
from bson import ObjectId
+from bson.errors import InvalidId
+from formencode import validators as V
from ming.orm import session, state
from ming.utils import LazyProperty
@@ -585,24 +587,35 @@ class DefaultAdminController(BaseController):
@expose()
def block_user(self, username, perm, reason=None):
+ if not username or not perm:
+ redirect(request.referer)
user = model.User.by_username(username)
if not user:
flash('User "%s" not found' % username, 'error')
- return redirect(request.referer)
-
+ redirect(request.referer)
ace = model.ACE.deny(user.project_role()._id, perm, reason)
if not model.ACL.contains(ace, self.app.acl):
self.app.acl.append(ace)
- return redirect(request.referer)
+ redirect(request.referer)
+ @validate(dict(user_id=V.Set(),
+ perm=V.UnicodeString()))
@expose()
- def unblock_user(self, user_id, perm):
- user = model.User.query.get(_id=ObjectId(user_id))
- ace = model.ACE.deny(user.project_role()._id, perm)
- ace = model.ACL.contains(ace, self.app.acl)
- if ace:
- self.app.acl.remove(ace)
- return redirect(request.referer)
+ def unblock_user(self, user_id=None, perm=None):
+ try:
+ user_id = map(ObjectId, user_id)
+ except InvalidId:
+ user_id = []
+ users = model.User.query.find({'_id': {'$in': user_id}}).all()
+ if not users:
+ flash('Select user to unblock', 'error')
+ redirect(request.referer)
+ for user in users:
+ ace = model.ACE.deny(user.project_role()._id, perm)
+ ace = model.ACL.contains(ace, self.app.acl)
+ if ace:
+ self.app.acl.remove(ace)
+ redirect(request.referer)
@expose('jinja:allura:templates/app_admin_permissions.html')
@without_trailing_slash
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c85fad83/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 556eade..a0378e1 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -167,6 +167,16 @@ class TestProjectAdmin(TestController):
assert "uninstall tool test-tool" in r.body, r.body
@td.with_wiki
+ def test_block_user_empty_data(self):
+ # shouldn't fail
+ self.app.post('/admin/wiki/block_user', params={'username': '', 'perm': '', 'reason': ''})
+
+ @td.with_wiki
+ def test_unblock_user_empty_data(self):
+ # shouldn't fail
+ self.app.post('/admin/wiki/unblock_user', params={'user_id': '', 'perm': ''})
+
+ @td.with_wiki
def test_block_user(self):
r = self.app.get('/admin/wiki/permissions')
assert '<a href="#" class="block-user">' in r
[30/50] git commit: [#6431] ticket:430 Fix possible count() call on
list
Posted by jo...@apache.org.
[#6431] ticket:430 Fix possible count() call on list
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9d0d9968
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9d0d9968
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9d0d9968
Branch: refs/heads/cj/6422
Commit: 9d0d9968d63a7f0e976a578413ffa5ac8c9b1203
Parents: f55c8bd
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Sep 23 15:42:06 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Oct 1 20:40:41 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/auth.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9d0d9968/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 50b550f..6562d6e 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -495,7 +495,7 @@ class UserSkillsController(BaseController):
elif self.category:
selected_skill = self.category
else:
- l = M.TroveCategory.query.find(dict(trove_parent_id=0, show_as_skill=True))
+ l = M.TroveCategory.query.find(dict(trove_parent_id=0, show_as_skill=True)).all()
selected_skill = None
if selected_skill:
l = [scat for scat in selected_skill.subcategories
@@ -511,7 +511,7 @@ class UserSkillsController(BaseController):
selected_skill = selected_skill,
parents = parents,
menu = menu,
- add_details_fields=(l.count() == 0))
+ add_details_fields=(len(l) == 0))
@expose()
@require_post()
[28/50] git commit: put in some TODO pointers to #6715
Posted by jo...@apache.org.
put in some TODO pointers to #6715
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/182a724a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/182a724a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/182a724a
Branch: refs/heads/cj/6422
Commit: 182a724a261e63dddbd71273cac435f232321b38
Parents: 7fc8966
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Sep 27 19:45:27 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Sep 27 19:45:27 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/security.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/182a724a/Allura/allura/lib/security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/security.py b/Allura/allura/lib/security.py
index 4e917b6..2a1a827 100644
--- a/Allura/allura/lib/security.py
+++ b/Allura/allura/lib/security.py
@@ -246,7 +246,8 @@ def has_access(obj, permission, user=None, project=None):
- First, all the roles for a user in the given project context are computed.
- If the given object's ACL contains a DENY for this permission on this
- user's project role, return False and deny access.
+ user's project role, return False and deny access. TODO: make ACL order
+ matter instead of doing DENY first; see ticket [#6715]
- Next, for each role, the given object's ACL is examined linearly. If an ACE
is found which matches the permission and user, and that ACE ALLOWs access,
@@ -298,12 +299,15 @@ def has_access(obj, permission, user=None, project=None):
project = getattr(obj, 'project', None) or c.project
project = project.root_project
roles = cred.user_roles(user_id=user._id, project_id=project._id).reaching_ids
+
+ # TODO: move deny logic into loop below; see ticket [#6715]
if user != M.User.anonymous():
user_role = M.ProjectRole.by_user(user, project)
if user_role:
deny_user = M.ACE.deny(user_role._id, permission)
if M.ACL.contains(deny_user, obj.acl):
return False
+
chainable_roles = []
for rid in roles:
for ace in obj.acl:
[09/50] git commit: [#6392] ticket:432 Reason-agnostic contains check
for ACEs
Posted by jo...@apache.org.
[#6392] ticket:432 Reason-agnostic contains check for ACEs
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/394ccc3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/394ccc3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/394ccc3b
Branch: refs/heads/cj/6422
Commit: 394ccc3b8bd3bd951cfe8a384c2cbca14226ec9e
Parents: f47df1c
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 11 15:44:11 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:24 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 7 ++++---
Allura/allura/lib/security.py | 2 +-
Allura/allura/model/types.py | 27 +++++++++++++++++----------
3 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/394ccc3b/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 8218d53..a887375 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -591,7 +591,7 @@ class DefaultAdminController(BaseController):
return redirect(request.referer)
ace = model.ACE.deny(user.project_role()._id, perm, reason)
- if ace not in self.app.acl:
+ if not model.ACL.contains(ace, self.app.acl):
self.app.acl.append(ace)
return redirect(request.referer)
@@ -599,7 +599,8 @@ class DefaultAdminController(BaseController):
def unblock_user(self, user_id, perm):
user = model.User.query.get(_id=ObjectId(user_id))
ace = model.ACE.deny(user.project_role()._id, perm)
- if ace in self.app.acl:
+ ace = model.ACL.contains(ace, self.app.acl)
+ if ace:
self.app.acl.remove(ace)
return redirect(request.referer)
@@ -625,7 +626,7 @@ class DefaultAdminController(BaseController):
elif ace.access == model.ACE.DENY:
role = model.ProjectRole.query.get(_id=ace.role_id)
if role.name is None and role.user:
- block_list[ace.permission].append((role.user, getattr(ace, 'reason', None)))
+ block_list[ace.permission].append((role.user, ace.reason))
return dict(
app=self.app,
allow_config=has_access(c.project, 'admin')(),
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/394ccc3b/Allura/allura/lib/security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/security.py b/Allura/allura/lib/security.py
index c992cef..bbadb1b 100644
--- a/Allura/allura/lib/security.py
+++ b/Allura/allura/lib/security.py
@@ -292,7 +292,7 @@ def has_access(obj, permission, user=None, project=None):
roles = cred.user_roles(user_id=user._id, project_id=project._id).reaching_ids
user_role = user.project_role(project=project)
deny_user = M.ACE.deny(user_role._id, permission)
- if deny_user in obj.acl:
+ if M.ACL.contains(deny_user, obj.acl):
return False
chainable_roles = []
for rid in roles:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/394ccc3b/Allura/allura/model/types.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/types.py b/Allura/allura/model/types.py
index fa7b332..73c4b3b 100644
--- a/Allura/allura/model/types.py
+++ b/Allura/allura/model/types.py
@@ -31,6 +31,7 @@ class ACE(S.Object):
super(ACE, self).__init__(
fields=dict(
access=S.OneOf(self.ALLOW, self.DENY),
+ reason=S.String(),
role_id=S.ObjectId(),
permission=permission),
**kwargs)
@@ -64,18 +65,24 @@ class ACL(S.Array):
super(ACL, self).__init__(
field_type=ACE(permissions), **kwargs)
- def __contains__(self, ace):
- """Test membership of ace in acl ignoring ace.reason field.
+ @classmethod
+ def contains(cls, ace, acl):
+ """Test membership of ace in acl ignoring ace.reason field.
+
+ Return actual ACE with reason filled if ace is found in acl, None otherwise
- e.g. `ace in acl` test should evaluate to True with following vars:
+ e.g. `ACL.contains(ace, acl)` will return `{role_id=ObjectId(...), permission='read', access='DENY', reason='Spammer'}`
+ with following vars:
- ace = M.ACE.deny(role_id, 'read')
- acl = [{role_id=ObjectId(...), permission='read', access='DENY', reason='Spammer'}]
- """
- def clear_reason(ace):
- return Object(access=ace.access, role_id=ace.role_id, permission=ace.permission)
+ ace = M.ACE.deny(role_id, 'read') # reason = None
+ acl = [{role_id=ObjectId(...), permission='read', access='DENY', reason='Spammer'}]
+ """
+ def clear_reason(ace):
+ return Object(access=ace.access, role_id=ace.role_id, permission=ace.permission)
- ace = Object(access=ace.access, role_id=ace.role_id, permission=ace.permission)
- return ace in map(clear_reason, self)
+ ace_without_reason = clear_reason(ace)
+ for a in acl:
+ if clear_reason(a) == ace_without_reason:
+ return a
DENY_ALL = ACE.deny(EVERYONE, ALL_PERMISSIONS)
[46/50] git commit: [#6422] Removed unneccesary Apache 2.0 item from
LICENSE
Posted by jo...@apache.org.
[#6422] Removed unneccesary Apache 2.0 item from LICENSE
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/5bca24a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/5bca24a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/5bca24a7
Branch: refs/heads/cj/6422
Commit: 5bca24a7ce52c2a419e00c5fd872e947ee4a96ef
Parents: bd3b07f
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 24 17:06:58 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Oct 2 19:01:26 2013 +0000
----------------------------------------------------------------------
Allura/LICENSE | 6 +-----
LICENSE | 4 ----
2 files changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5bca24a7/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index ffb5ecb..13b7b54 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -200,7 +200,7 @@
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.
-
+
ALLURA SUBCOMPONENTS:
Apache Allura includes a number of subcomponents with
@@ -208,10 +208,6 @@ separate copyright notices and license terms. Your use of the source code
for the these subcomponents is subject to the terms and conditions of the
following licenses.
-HTML5 Canvas for Internet Explorer, which is available under the
-Apache License, Version 2.0.
-For details, see Allura/allura/public/nf/js/excanvas.compiled.js
-
The file allura/etc/mime.types from the mime-support package,
which is in the public domain. For details, see
http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5bca24a7/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index e558325..c905853 100644
--- a/LICENSE
+++ b/LICENSE
@@ -209,10 +209,6 @@ separate copyright notices and license terms. Your use of the source code
for the these dependencies is subject to the terms and conditions of the
following licenses.
-HTML5 Canvas for Internet Explorer, which is available under the
-Apache License, Version 2.0.
-For details, see Allura/allura/public/nf/js/excanvas.compiled.js
-
The file Allura/allura/etc/mime.types from the mime-support package,
which is in the public domain. For details, see
http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
[43/50] git commit: improve layout of new projects page
Posted by jo...@apache.org.
improve layout of new projects page
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c14b91ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c14b91ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c14b91ae
Branch: refs/heads/cj/6422
Commit: c14b91aeed43ecdae266d5fcb7b826d3588d8a81
Parents: 4c1f101
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Oct 2 18:08:47 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Oct 2 18:08:55 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/site_admin_new_projects.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c14b91ae/Allura/allura/templates/site_admin_new_projects.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_new_projects.html b/Allura/allura/templates/site_admin_new_projects.html
index 3b9dab5..f6dc2f0 100644
--- a/Allura/allura/templates/site_admin_new_projects.html
+++ b/Allura/allura/templates/site_admin_new_projects.html
@@ -61,7 +61,7 @@
</td>
<td><small>{{ p.shortname }}</small></td>
<td><small><a href="{{ p.url() }}">{{ p.name }}</a></small></td>
- <td><small>{{ p.short_description }}</small></td>
+ <td><small>{{ p.short_description|truncate(100) }}</small></td>
<td><small>{{ p.summary }}</small></td>
<td><small>{{ p.external_homepage|urlize(22) }}</small></td>
<td>{% for a in p.admins() %}<small><a href="{{ a.url() }}">{{ a.username }}</a></small> {% endfor %}</td>
@@ -81,6 +81,9 @@
.pad table {
width: 915px;
}
+ td {
+ max-width: 120px;
+ }
</style>
{% endblock %}
[17/50] git commit: [#6392] ticket:444 added ajax for block form
Posted by jo...@apache.org.
[#6392] ticket:444 added ajax for block form
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/83903bb0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/83903bb0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/83903bb0
Branch: refs/heads/cj/6422
Commit: 83903bb0e62c9488209438a01b79d3dac719453b
Parents: 323d01c
Author: coldmind <so...@yandex.ru>
Authored: Thu Sep 19 14:07:31 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 6 +++---
.../allura/templates/app_admin_permissions.html | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/83903bb0/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 74d9c4d..b88f23a 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -585,14 +585,14 @@ class DefaultAdminController(BaseController):
"""
permanent_redirect('permissions')
- @expose()
+ @expose('json:')
+ @require_post()
def block_user(self, username, perm, reason=None):
if not username or not perm:
redirect(request.referer)
user = model.User.by_username(username)
if not user:
- flash('User "%s" not found' % username, 'error')
- redirect(request.referer)
+ return dict(error='User "%s" not found' % username)
ace = model.ACE.deny(user.project_role()._id, perm, reason)
if not model.ACL.contains(ace, self.app.acl):
self.app.acl.append(ace)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/83903bb0/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index 7de150e..96471d4 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -78,5 +78,25 @@
$('input.block_user_role').val(role);
$('div.model-block-list').html(userlist.html());
});
+ $('form[action="block_user"]').submit(function() {
+ var form = $(this);
+ if($(this).is(':visible')) {
+ $.ajax({
+ data: $(this).serialize(),
+ type: $(this).attr('method'),
+ url: $(this).attr('action'),
+ success: function(data) {
+ if(data.error){
+ flash(data.error, 'error');
+ }
+ else {
+ form.parent().slideUp('fast');
+ $('.lb_overlay').hide();
+ }
+ }
+ });
+ return false;
+ }
+ });
</script>
{% endblock %}