Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1625] Add 'new user 'activity stream event.
Add activity_dict_save() function to ckan/lib/dictization/model_save.py. Initialises an Activity object from a dict and adds the object to the sqlalchemy session so that it gets saved to the database. Also added a simple test case to ckan/tests/lib/test_dictization.py. Add activity_create() function to ckan/logic/action/create.py. This is the logic function for creating an activity stream event, to be called by other logic functions. It pretty much just wraps activity_dict_save(), but creates a new revision for the new activity and commits the change to the db. The two functions above will work for any kind of activity stream event. Extended the user_create() logic function in ckan/logic/action/create.py to construct an activity dict and call activity_create(), so that a 'new user' activity stream event is emitted whenever a new user is created. Added HTML renderer for 'new user' activity to ckan/logic/action/get.py, and added new_user.html template to ckan/templates/activity_streams. Added Activity and ActivityDetail classes to ckan/model/__init__.py.
- Loading branch information
Sean Hammond
committed
Jan 10, 2012
1 parent
ae3be84
commit eb62fb7
Showing
6 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html | ||
xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:i18n="http://genshi.edgewall.org/i18n" | ||
xmlns:py="http://genshi.edgewall.org/" | ||
xmlns:xi="http://www.w3.org/2001/XInclude" | ||
py:strip="" | ||
> | ||
<xi:include href="../_util.html" /> | ||
<div> | ||
<div style="font-weight:bold;"> | ||
${h.linked_user(activity.user_id)} | ||
<span style="background:yellow;">signed up</span> | ||
${h.render_datetime(activity.timestamp, '%B %d %Y')} | ||
</div> | ||
</div> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters