Skip to content

Commit

Permalink
added teaser.html files for the new notification api and made some ch…
Browse files Browse the repository at this point in the history
…anges to the passed variables

git-svn-id: http://django-friends.googlecode.com/svn/trunk@38 f9456ae0-1038-0410-abc2-2f1ed958ef3d
  • Loading branch information
jezdez committed Jul 13, 2008
1 parent d6319e8 commit 6652b3f
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions friendsdev/friends/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def save(self):
invitation = FriendshipInvitation(from_user=self.user, to_user=to_user, message=message, status=2)
invitation.save()
if notification:
notification.send([to_user], "friends_invite", {"user": self.user})
notification.send([self.user], "friends_invite_sent", {"user": to_user})
notification.send([to_user], "friends_invite", {"invitation": invitation})
notification.send([self.user], "friends_invite_sent", {"invitation": invitation})
self.user.message_set.create(message="Friendship requested with %s" % to_user.username) # @@@ make link like notification
return invitation
4 changes: 2 additions & 2 deletions friendsdev/friends/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def accept(self, new_user):
notification.send([self.from_user], "join_accept", {"invitation": self, "new_user": new_user})
for user in friend_set_for(new_user) | friend_set_for(self.from_user):
if user != new_user and user != self.from_user:
notification.send([user], "friends_otherconnect", {"from_user": self.from_user, "to_user": new_user})
notification.send([user], "friends_otherconnect", {"invitation": self, "to_user": new_user})

class Admin:
list_display = ('id', 'from_user', 'contact', 'status')
Expand Down Expand Up @@ -184,7 +184,7 @@ def accept(self):
notification.send([self.to_user], "friends_accept_sent", {"invitation": self})
for user in friend_set_for(self.to_user) | friend_set_for(self.from_user):
if user != self.to_user and user != self.from_user:
notification.send([user], "friends_otherconnect", {"from_user": self.from_user, "to_user": self.to_user})
notification.send([user], "friends_otherconnect", {"invitation": self, "to_user": self.to_user})

# @@@ this assumes email-confirmation is being used
def new_user(sender, instance):
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ invitation.to_user }} has accepted your friend request.
{% load i18n %}{% blocktrans %}{{ invitation.to_user }} has accepted your friend request.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n captureas %}{% captureas user_url %}{% url profile_detail username=invitation.to_user.username %}{% endcaptureas %}
{% blocktrans %}{{ invitation.to_user }} has accepted your friend request.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
You accepted {{ invitation.from_user }}'s friend request.
{% load i18n %}{% blocktrans %}You accepted {{ invitation.from_user }}'s friend request.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n captureas %}{% captureas user_url %}{% url profile_detail username=invitation.from_user.username %}{% endcaptureas %}
{% blocktrans %}You accepted <a href="{{ user_url }}">{{ invitation.from_user }}</a>'s friend request.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ user }} has requested to add you as a friend.
{% load i18n %}{% blocktrans %}{{ user }} has requested to add you as a friend.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n captureas %}{% captureas user_url %}{% url profile_detail username=invitation.from_user.username %}{% endcaptureas %}
{% blocktrans %}<a href="{{ user_url }}">{{ invitation.from_user }}</a> has requested to add you as a friend.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
you have invited {{ user }} to add you as a friend.
{% load i18n %}{% blocktrans %}you have invited {{ user }} to add you as a friend.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n captureas %}{% captureas user_url %}{% url profile_detail username=invitation.to_user.username %}{% endcaptureas %}
{% blocktrans %}you have invited <a href="{{ user_url }}">{{ invitation.to_user }}</a> to add you as a friend.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ from_user }} and {{ to_user }} are now friends.
{% load i18n %}{% blocktrans %}{{ from_user }} and {{ to_user }} are now friends.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n captureas %}{% captureas from_user_url %}{% url profile_detail username=invitation.from_user.username %}{% endcaptureas %}{% captureas to_user_url %}{% url profile_detail username=to_user.username %}{% endcaptureas %}
{% blocktrans %}<a href="{{ from_user_url }}">{{ invitation.from_user }}</a> and <a href="{{ to_user_url }}">{{ to_user }}</a> are now friends.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ new_user }} has joined and is now a friend.
{% load i18n %}{% blocktrans %}{{ new_user }} has joined and is now a friend.{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load i18n captureas %}{% captureas user_url %}{% url profile_detail username=new_user.username %}{% endcaptureas %}
{% blocktrans %}<a href="user_url">{{ new_user }} has joined and is now a friend.{% endblocktrans %}

0 comments on commit 6652b3f

Please sign in to comment.