• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

修訂02c18ffcbcf43f32828301fee0827f0bd60a2c66 (tree)
時間2012-06-29 00:18:49
作者Tim Van Steenburgh <tvansteenburgh@gmai...>
CommiterTim Van Steenburgh

Log Message

[#4458] Updates in preparation for putting ActivityStream in prod.

1. Removed old follow and timeline controller methods (replaced by

ForgeActivity). Left the timeline html in the code since we may
want to reuse it in ForgeActivity. Left one activity creation
call in (happens when new ticket created) since it doesn't affect
the UI, and it'll be nice to have a little data gathered.

2. Updated activitystream.enabled config param name to match the

others.

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>

Change Summary

差異

--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -280,7 +280,7 @@ class ProjectController(object):
280280 @with_trailing_slash
281281 def index(self, **kw):
282282 mount = c.project.first_mount('read')
283- activity_enabled = asbool(config.get('activity_stream.enabled', False))
283+ activity_enabled = asbool(config.get('activitystream.enabled', False))
284284 if activity_enabled and c.project.app_instance('activity'):
285285 redirect('activity/')
286286 elif mount is not None:
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -149,20 +149,3 @@ class UserProfileController(BaseController):
149149 name=div['name'],
150150 content=content))
151151 redirect('configuration')
152-
153- @expose()
154- def follow(self, username=None, **kw):
155- user = User.by_username(username)
156- if not user:
157- flash('Invalid username.', 'error')
158- redirect('.')
159- director.connect(c.user, user)
160- flash('You are now following %s.' % username)
161- redirect('.')
162-
163- @expose('jinja:allura.ext.user_profile:templates/user_timeline.html')
164- def timeline(self, **kw):
165- username = c.project.shortname.split('/')[1]
166- user = User.by_username(username)
167- timeline = director.create_timeline(user)
168- return dict(timeline=timeline, user=user)
--- a/Allura/allura/tests/functional/test_root.py
+++ b/Allura/allura/tests/functional/test_root.py
@@ -64,12 +64,12 @@ class TestRootController(TestController):
6464 assert len(response.html.findAll('a',{'href':'/adobe/adobe-2/'})) == 0
6565
6666 def test_project_redirect(self):
67- with push_config(config, **{'activity_stream.enabled': 'false'}):
67+ with push_config(config, **{'activitystream.enabled': 'false'}):
6868 resp = self.app.get('/p/test2/')
6969 assert_equal(resp.status_int, 302)
7070 assert_equal(resp.location, 'http://localhost/p/test2/admin/')
7171
72- with push_config(config, **{'activity_stream.enabled': 'true'}):
72+ with push_config(config, **{'activitystream.enabled': 'true'}):
7373 resp = self.app.get('/p/test2/')
7474 assert_equal(resp.status_int, 302)
7575 assert_equal(resp.location, 'http://localhost/p/test2/activity/')
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -58,7 +58,7 @@ class ForgeActivityController(BaseController):
5858 @expose('jinja:forgeactivity:templates/index.html')
5959 @with_trailing_slash
6060 def index(self, **kw):
61- activity_enabled = asbool(config.get('activity_stream.enabled', False))
61+ activity_enabled = asbool(config.get('activitystream.enabled', False))
6262 if not activity_enabled:
6363 raise HTTPNotFound()
6464
@@ -72,7 +72,7 @@ class ForgeActivityController(BaseController):
7272 @expose('json:')
7373 @validate(W.follow_toggle)
7474 def follow(self, follow, **kw):
75- activity_enabled = asbool(config.get('activity_stream.enabled', False))
75+ activity_enabled = asbool(config.get('activitystream.enabled', False))
7676 if not activity_enabled:
7777 raise HTTPNotFound()
7878
--- a/ForgeActivity/forgeactivity/tests/functional/test_root.py
+++ b/ForgeActivity/forgeactivity/tests/functional/test_root.py
@@ -13,17 +13,17 @@ from allura.lib.helpers import push_config
1313 class TestActivityController(TestController):
1414 def setUp(self, *args, **kwargs):
1515 super(TestActivityController, self).setUp(*args, **kwargs)
16- self._enabled = config.get('activity_stream.enabled', 'false')
17- config['activity_stream.enabled'] = 'true'
16+ self._enabled = config.get('activitystream.enabled', 'false')
17+ config['activitystream.enabled'] = 'true'
1818
1919 def tearDown(self, *args, **kwargs):
2020 super(TestActivityController, self).tearDown(*args, **kwargs)
21- config['activity_stream.enabled'] = self._enabled
21+ config['activitystream.enabled'] = self._enabled
2222
2323 def test_index(self):
2424 resp = self.app.get('/activity/')
2525 assert 'Something happened.' in resp
2626
2727 def test_index_disabled(self):
28- config['activity_stream.enabled'] = 'false'
28+ config['activitystream.enabled'] = 'false'
2929 resp = self.app.get('/activity/', status=404)