[openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)

Tom Hughes notifications at github.com
Tue Oct 15 18:02:19 UTC 2024


@tomhughes commented on this pull request.



> @@ -280,8 +280,8 @@
   resource :profile, :only => [:edit, :update]
 
   # friendships
-  match "/user/:display_name/make_friend" => "friendships#make_friend", :via => [:get, :post], :as => "make_friend"
-  match "/user/:display_name/remove_friend" => "friendships#remove_friend", :via => [:get, :post], :as => "remove_friend"
+  match "/user/:display_name/follow_user" => "friendships#follow_user", :via => [:get, :post], :as => "follow_user"
+  match "/user/:display_name/unfollow_user" => "friendships#unfollow_user", :via => [:get, :post], :as => "unfollow_user"

I think the URL here could just be `/follow` and `/unfollow` and we don't really need the `_user` suffix? Possibly the actions should be `create` and `destroy` though? Probably the controller should be renamed to though I'm not sure what to...

>            </ul>
         </nav>
         <div>
-          <%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %>
+          <%= render :partial => "contact", :collection => friends, :locals => { :type => "followed user" } %>

This is purely internal, and not user visible, but a simple `followed` probably suffices as a type?

> @@ -1603,12 +1603,12 @@ en:
       footer_html: "You can also read the message at %{readurl} and you can send a message to the author at %{replyurl}"
     friendship_notification:
       hi: "Hi %{to_user},"
-      subject: "[OpenStreetMap] %{user} added you as a friend"
-      had_added_you: "%{user} has added you as a friend on OpenStreetMap."
+      subject: "[OpenStreetMap] %{user} followed you"
+      had_followed_you: "%{user} has followed you on OpenStreetMap."

I'm not sure why this key has a `had_` prefix but it was always incorrect so I'd suggest just dropping it and using `followed_you`.

> @@ -91,7 +91,7 @@ en:
         support_url: Support URL
         allow_read_prefs:  read their user preferences
         allow_write_prefs: modify their user preferences
-        allow_write_diary: create diary entries, comments and make friends
+        allow_write_diary: create diary entries, comments and follow users

Agreed as that is never used and there's no good reason to include that Id just drop it from the comment and if we ever want a permission for managing follows we can add that separately.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5261#pullrequestreview-2370177042
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5261/review/2370177042 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241015/ad3ae41c/attachment.htm>


More information about the rails-dev mailing list