friendship if it doesn't already exist. Closes #2754.
end
def friend_notification(friend)
- befriender = User.find_by_id(friend.user_id)
- befriendee = User.find_by_id(friend.friend_user_id)
-
- common_headers befriendee
- subject I18n.t('notifier.friend_notification.subject', :user => befriender.display_name, :locale => locale)
- body :user => befriender.display_name,
- :userurl => url_for(:host => SERVER_URL,
- :controller => "user", :action => "view",
- :display_name => befriender.display_name)
+ common_headers friend.befriendee
+ subject I18n.t('notifier.friend_notification.subject', :user => friend.befriender.display_name, :locale => locale)
+ body :friend => friend
end
private
-<%= t'notifier.friend_notification.had_added_you', :user => @user %>
+<%=
+ t 'notifier.friend_notification.had_added_you',
+ :user => @friend.befriender.display_name
+%>
-<%= t'notifier.friend_notification.see_their_profile', :userurl => @userurl %>
+<%=
+ t 'notifier.friend_notification.see_their_profile',
+ :userurl => url_for(:host => SERVER_URL,
+ :controller => "user", :action => "view",
+ :display_name => @friend.befriender.display_name)
+%>
+<%=
+ unless @friend.befriendee.is_friends_with?(@friend.befriender)
+ t 'notifier.friend_notification.befriend_them',
+ :befriendurl => url_for(:host => SERVER_URL,
+ :controller => "user", :action => "make_friend",
+ :display_name => @friend.befriender.display_name)
+ end
+%>
friend_notification:
subject: "[OpenStreetMap] {{user}} added you as a friend"
had_added_you: "{{user}} has added you as a friend on OpenStreetMap."
- see_their_profile: "You can see their profile at {{userurl}} and add them as a friend too if you wish."
+ see_their_profile: "You can see their profile at {{userurl}}."
+ befriend_them: "You can also add them as a friend at {{befriendurl}}."
gpx_notification:
greeting: "Hi,"
your_gpx_file: "It looks like your GPX file"