Permalink
Browse files

Show flattr activities to followers

  • Loading branch information...
1 parent 51c705a commit de68bbc4ce6f96366d6899b3f35c3e7d8742016c @pthulin pthulin committed Mar 31, 2012
Showing with 10 additions and 0 deletions.
  1. +6 −0 activities.py
  2. +4 −0 scripts/Menu.js
View
@@ -1,3 +1,5 @@
+from model import YoutifyUser
+from model import FollowRelation
from model import Activity
from model import get_youtify_user_struct
from model import get_playlist_struct_from_playlist_model
@@ -47,3 +49,7 @@ def create_flattr_activity(youtify_user_model, thing_id, thing_title):
m = Activity(owner=youtify_user_model, verb='flattr', user=user, data=data)
m.put()
+
+ for relation in FollowRelation.all().filter('user2 =', youtify_user_model.key().id()):
+ m = Activity(owner=YoutifyUser.get_by_id(relation.user1), verb='flattr', user=user, data=data)
+ m.put()
View
@@ -304,6 +304,10 @@ function MenuItem(type) {
if (user.id === UserManager.currentUser.id) {
$div.append('<span>You flatted </span>');
$div.append(getFlattrThingActivityElem(thing));
+ } else {
+ $div.append(getUserActivityElem(user));
+ $div.append('<span> flattred </span>');
+ $div.append(getFlattrThingActivityElem(thing));
}
break;
}

0 comments on commit de68bbc

Please sign in to comment.