Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@AntonKhorev It's a good point, I'll try to fix it and, as we will need more complex solution than just adding `max-height`, I'll also take @kcne's recommendations into account. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#issuecomment-2352041533 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@AntonKhorev Currently, as I found in the project, for icons we use `.icon` class, which uses sprite with `background-image` and `background-position` properties. Adding icon to the sprite was solely for the accordance with the current state and practices of the project. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#issuecomment-2352051737 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. e02866a8b5003ae8a8c82c141db9c522b209680b Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/64c4f7e97c2dcf835e6ed9c1fc1242310def14d9..e02866a8b5003ae8a8c82c141db9c522b209680b You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
Thank you for the review @tomhughes I've updated accordingly @AntonKhorev If it's okay to directly use SVG instead of the `.icon` class practice of the project, I am all for it. I think it's even better solution and produces cleaner, more reusable code. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#issuecomment-2352088020 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@AntonKhorev Okay, thanks. I'll update it to ``. It will be more comfortable to reuse and will produce cleaner code. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#issuecomment-2352793179 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
I almost finished the code. I think it will be ready tomorrow. The idea is to truncate entries server-side and, for example, if we show only 1000 characters, estimate that image will take space of 500, therefore, it will truncate text and also won't allow to add many photos that will overload diary entries list page. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#issuecomment-2353547373 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
[openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
This PR addresses "Modify the way 'Friends' are added" issue mentioned in https://github.com/openstreetmap/openstreetmap-website/issues/3310 This PR replaces all occurrences of "friends" to "followers", including texts, tests and URLs. This PR was not broken down to smaller pieces to maintain consistency and avoid different names of the same functionality. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5261 -- Commit Summary -- * Modify the way Friends are added -- File Changes -- M app/abilities/ability.rb (2) M app/controllers/diary_entries_controller.rb (2) M app/controllers/friendships_controller.rb (12) M app/helpers/changesets_helper.rb (2) M app/mailers/user_mailer.rb (2) M app/views/dashboards/_contact.html.erb (6) M app/views/dashboards/show.html.erb (10) R app/views/friendships/follow_user.html.erb (0) R app/views/friendships/unfollow_user.html.erb (0) M app/views/user_mailer/friendship_notification.html.erb (4) M app/views/user_mailer/friendship_notification.text.erb (4) M app/views/users/show.html.erb (4) M config/locales/en.yml (54) M config/routes.rb (4) M test/controllers/friendships_controller_test.rb (84) M test/controllers/oauth2_authorized_applications_controller_test.rb (2) M test/system/dashboard_test.rb (8) M test/system/friendships_test.rb (8) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/5261.patch https://github.com/openstreetmap/openstreetmap-website/pull/5261.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261 You are receiving this because you are subscribed to this thread. Message ID:___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > @@ -0,0 +1,12 @@ + + + + + <% unless disabled %> + + <% Language.order(:english_name).each do |language| %> +><%= language.name %> If there was not a cookie, none of the options would be preselected. But for the better UX this code was updated to use `I18n.locale.to_s` and show preselected language even if it is set not by the cookie but browser. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r1789747124 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. f5754b8cd7e4c60add5abc9b7f7b247a1b77 Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/34d2e252b3c9fe2735ea607d43caea8b849613c5..f5754b8cd7e4c60add5abc9b7f7b247a1b77 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > @@ -78,6 +78,15 @@ <%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %> + +<% if current_user && current_user.id %> + <%= link_to(preferences_path, :class => "nav-link text-secondary ms-1") do %> I updated it to be consistent for both situations. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r1789743530 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Update error pages (PR #5131)
Is there anything that prevents Bootstrap and `common.scss` to be used for the error pages? It would need less SCSS code, and it would be much more consistent. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5131#issuecomment-2393673361 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Update error pages (PR #5131)
@nertc commented on this pull request. > @@ -1,3 +1,5 @@ + I know that these two lines were copied from the `_head.html.erb`, but for the consistency of this file, I think, it will be better if we use `<%= tag.meta ... %>` instead. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5131#pullrequestreview-2348031426 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc pushed 1 commit. 8393857518195d145a5f1e8252b939f731cff25c Modify the way Friends are added -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261/files/e1a1b87211fde02664d5a16a970a98c6df5d061a..8393857518195d145a5f1e8252b939f731cff25c You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. 41cb49e6a084607132ed9818e9139925f924a19b Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/f5754b8cd7e4c60add5abc9b7f7b247a1b77..41cb49e6a084607132ed9818e9139925f924a19b You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. 80708ff796458168ebb1060bcb16e07ecf2e6fb5 Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/41cb49e6a084607132ed9818e9139925f924a19b..80708ff796458168ebb1060bcb16e07ecf2e6fb5 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > + <% Locale.available + .map { |locale| Language.find_by(:code => locale.to_s) } + .select { |locale| locale } + .sort_by { |locale| locale[:english_name] } + .each do |language| %> +><%= language.name %> Pushed code can be shortened as `Language.where(:code => Locale.available.map {|locale| locale.to_s})`. This approach will also cause only one DB query. If there is no other reason for language not to be used, I'll push the code with this approach. Translating language names using i18n and not having one source for them, may cause duplicate translations or inconsistency (because of multiple functionalities using language names). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r1812499419 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > @@ -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 `follow users` part was removed -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812502642 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > - <%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %> + <%= render :partial => "contact", :collection => friends, :locals => { :type => "followed user" } %> `followed user` was shortened as `following` (according to the common practice mentioned in the https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1803345542) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812504884 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > - heading: "Unfriend %{user}?" - button: "Unfriend" - success: "%{name} was removed from your friends." - not_a_friend: "%{name} is not one of your friends." +follow_user: + heading: "Do you want to follow %{user}?" + button: "Follow User" + success: "You are now following %{name}!" + failed: "Sorry, failed to follow %{name}." + already_followed: "You already follow %{name}." + limit_exceeded: "You have followed a lot of users recently. Please wait a while before trying to follow any more." +unfollow_user: + heading: "Do you want to unfollow %{user}?" + button: "Unfollow" + success: "%{name} was unfollowed by you." + not_followed: "%{name} is not followed by you." Wording was changed according to the suggestion. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812509078 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > @@ -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." `had` was removed and now key is `followed_you`. Also, wording was changed according to suggestions. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812507608 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > - heading: "Add %{user} as a friend?" - button: "Add as friend" - success: "%{name} is now your friend!" - failed: "Sorry, failed to add %{name} as a friend." - already_a_friend: "You are already friends with %{name}." - limit_exceeded: "You have friended a lot of users recently. Please wait a while before trying to friend any more." -remove_friend: - heading: "Unfriend %{user}?" - button: "Unfriend" - success: "%{name} was removed from your friends." - not_a_friend: "%{name} is not one of your friends." +follow_user: + heading: "Do you want to follow %{user}?" + button: "Follow User" + success: "You are now following %{name}!" + failed: "Sorry, failed to follow %{name}." Wording was changed according to the suggestion. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812509419 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > @@ -27,19 +27,19 @@ - <%= t ".my friends" %> + <%= t ".followed users" %> I agree with you. Wording was changed from `followed users` to `followings`. I was also thinking about it. `followed users` is more understandable, but `followings` keeps sufficient understandability and makes terminology shorter and more visually appealing. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812530270 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > -remove_friend: - heading: "Unfriend %{user}?" - button: "Unfriend" - success: "%{name} was removed from your friends." - not_a_friend: "%{name} is not one of your friends." +follow_user: + heading: "Do you want to follow %{user}?" + button: "Follow User" + success: "You are now following %{name}!" + failed: "Sorry, failed to follow %{name}." + already_followed: "You already follow %{name}." + limit_exceeded: "You have followed a lot of users recently. Please wait a while before trying to follow any more." +unfollow_user: + heading: "Do you want to unfollow %{user}?" + button: "Unfollow" + success: "%{name} was unfollowed by you." Wording was changed according to the suggestion. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1812530890 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
@nertc commented on this pull request. > @@ -86,6 +86,16 @@ OSM.initializeDataLayer = function (map) { if (dataLoader) dataLoader.abort(); +let spanLoading = $("#layers-data-loading"); + +if (!spanLoading.length) { + spanLoading = $("") +.attr("id", "layers-data-loading") +.appendTo($("#label-layers-data")); + + spanLoading.append(" " + I18n.t("javascripts.map.layers.loading")); `Loading` text was changed with the loader spinner. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009#discussion_r1812536296 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
If there are no other change requests for this PR, I'll create a new PR for the [leaflet-osm](https://github.com/openstreetmap/leaflet-osm) to merge changes done in the `vendor/assets/leaflet/leaflet.osm.js`. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009#issuecomment-2431821834 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)
@nertc commented on this pull request. > @@ -60,6 +61,13 @@ <%= link_to t(".reports_count", :count => issue.reports_count), issue %> <%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %> <%= link_to issue.reported_user.display_name, issue.reported_user if issue.reported_user %> + +<% unique_reporters = issue.reports.uniq { |report| report.user.id } %> +<% unique_reporters[..2].each_with_index do |report, index| %> + <%= link_to(report.user.display_name, report.user) %><%= "," unless index == 2 || index == unique_reporters.size - 1 %> +<% end %> +<%= "..." if unique_reporters.size > 3 %> Tooltips were added to show all names, and truncation was done using CSS -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4990#discussion_r1812577030 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)
@nertc commented on this pull request. > @@ -60,6 +61,13 @@ <%= link_to t(".reports_count", :count => issue.reports_count), issue %> <%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %> <%= link_to issue.reported_user.display_name, issue.reported_user if issue.reported_user %> + +<% unique_reporters = issue.reports.uniq { |report| report.user.id } %> To avoid Ruby on Rails logic code in the HTML, `preload` logic was moved in the controller. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4990#discussion_r1812585358 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc 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" When I started implementing same architecture as `user_mutes`, it caused to change some more files and add some complexities. This PR is already `+104 -104` line change. I think, it will be better to create a separate PR about changing routing architecture of the `follow` functionality after this PR will be merged to avoid making it even bigger and more complex. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1810085018 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
Thank you for the review. This PR was updated according to recommendations. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#issuecomment-2428445343 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc 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" @AntonKhorev `app/views/user_mailer/friendship_notification.html.erb` and `app/views/user_mailer/friendship_notification.text.erb` changes are about redirections from mail notifications. For the consistent visual output this PR is focused on changing every occurrence of "friend" on user side and changing them to "following". Main focus is what will users see (including both texts and URLs). I agree that it will be great if friendship functionality is refactored (currently it is just renamed), but those changes are out of scope of this PR and will be done as a separate PR as soon as this PR will be merged (adding them to this PR will complicate things as there will be not only user side changes, but logical changes in `routes.rb`, `ability.rb` and etc. which will need much deeper testing than just text and URL comparisons). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1814440209 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > @@ -0,0 +1,6 @@ +$(document).ready(function () { + $(".language-change-trigger").on("change", function () { Code was updated according to the recommendation. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r1820338578 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. 25fd157b9ce6e7945bf5d5e9871d04388e9e5f19 Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/80708ff796458168ebb1060bcb16e07ecf2e6fb5..25fd157b9ce6e7945bf5d5e9871d04388e9e5f19 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
This PR was updated according to the suggestion of @AntonKhorev. As described in the `CONTRIBUTING.md` only updated language config was `en`: > ## i18n > > If you make a change that involve the locale files (in `config/locales`) then > please only submit changes to the `en.yml` file. The other files are updated > via [Translatewiki](https://translatewiki.net/wiki/Translating:OpenStreetMap) > and should not be included in your pull request. Because of this, currently only English is shown in the list of language selector. At first, I thought to make a list of all language names in the config file, but when translations will be made, there will be a lot of duplication. The only downside of the current solution is that there will be only those languages shown, which have `shared.language_selector.language` key. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#issuecomment-2443318213 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. e5de62853b9ff5e5bb99572d38a2f5d1c0a37eda Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/d20e90d5a8e55b94805cbe21c3c0633ddea36cc6..e5de62853b9ff5e5bb99572d38a2f5d1c0a37eda You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
[openstreetmap/openstreetmap-website] Add profile location (PR #5302)
PR adds location name info on the user profile page. Location name can be changed from "Edit Profile" page either by manual typing or auto-filling according to the home location. One column was added to the user table to save user's location. JS logics are responsible for handling: 1) Delete-Undelete buttons interactions 2) Nominatim calls to locate home locations country name 3) Warning logic of the location name    You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5302 -- Commit Summary -- * Add profile location -- File Changes -- M app/assets/javascripts/user.js (96) M app/controllers/profiles_controller.rb (1) M app/models/user.rb (1) M app/views/profiles/edit.html.erb (7) M app/views/users/show.html.erb (8) M config/locales/en.yml (1) A db/migrate/20241030090336_add_user_location_name.rb (5) M db/structure.sql (4) A test/system/user_location_change_test.rb (22) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/5302.patch https://github.com/openstreetmap/openstreetmap-website/pull/5302.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302 You are receiving this because you are subscribed to this thread. Message ID:___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)
@nertc commented on this pull request. > @@ -60,6 +61,13 @@ <%= link_to t(".reports_count", :count => issue.reports_count), issue %> <%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %> <%= link_to issue.reported_user.display_name, issue.reported_user if issue.reported_user %> + +<% unique_reporters = issue.reports.uniq { |report| report.user.id } %> +<% unique_reporters[..2].each_with_index do |report, index| %> `safe_join` was used to join names list. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4990#discussion_r1812580222 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
@nertc pushed 1 commit. ca019cd28c25eed1bd211f070b0bd8f10293878d Map Data checkbox: perhaps use toggle slider instead -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009/files/41e606921c8d7a08800b07f43a22d7d64c0ed024..ca019cd28c25eed1bd211f070b0bd8f10293878d You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
PR was updated to include changes made in the https://github.com/openstreetmap/leaflet-osm/pull/38. As leaflet-osm PR is now merged, this PR can be reviewed and merged. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009#issuecomment-2367588989 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. 713eaaaff248f5b0a91680e081f7217f69fd7c4b Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/e02866a8b5003ae8a8c82c141db9c522b209680b..713eaaaff248f5b0a91680e081f7217f69fd7c4b You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
PR was updated to include SVG in the HTML. I tried several different methods to move SVG from sprite, including adding it to the SvgHelper module and adding separate file for it, but current solution turned out to be the most optimal one (SvgHelper had conflicts with the linter because of long lines and separate file was not sufficiently customizable with Bootstrap classes). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#issuecomment-2367319701 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc pushed 1 commit. 34d2e252b3c9fe2735ea607d43caea8b849613c5 Add locale selector -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201/files/713eaaaff248f5b0a91680e081f7217f69fd7c4b..34d2e252b3c9fe2735ea607d43caea8b849613c5 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > @@ -76,6 +85,15 @@ <%= link_to t("layouts.copyright"), copyright_path, :class => "dropdown-item" %> <%= link_to t("layouts.help"), help_path, :class => "dropdown-item" %> <%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %> + +<% if current_user && current_user.id %> + <%= link_to(preferences_path) do %> +<%= render "shared/language_selector", :hoverable => true, :black => true, :classes => "dropdown-item", :disabled => true %> I've updated this PR. Tried several solutions and current one needed the smallest and cleanest code. Also, one CSS class was added `.text-transparent` to make text and background of the `` tag visually hidden but still focusable. Language selector will no more be moved to the compact menu. Visually it doesn't take much space and contextually it's more relevant to be as an icon than as a compacted menu button. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r1776583692 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > @@ -76,6 +85,15 @@ <%= link_to t("layouts.copyright"), copyright_path, :class => "dropdown-item" %> <%= link_to t("layouts.help"), help_path, :class => "dropdown-item" %> <%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %> + +<% if current_user && current_user.id %> + <%= link_to(preferences_path) do %> +<%= render "shared/language_selector", :hoverable => true, :black => true, :classes => "dropdown-item", :disabled => true %> I'll try to solve the focusing issue without any custom classes. In terms of collapsibility of the translation icon, purpose was to take as little space as possible when the screen is smaller. Without collapsing, HTML code will be shorter and with less "if-else"-es. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r1772865699 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add locale selector (PR #5201)
@nertc commented on this pull request. > @@ -76,6 +85,15 @@ <%= link_to t("layouts.copyright"), copyright_path, :class => "dropdown-item" %> <%= link_to t("layouts.help"), help_path, :class => "dropdown-item" %> <%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %> + +<% if current_user && current_user.id %> + <%= link_to(preferences_path) do %> +<%= render "shared/language_selector", :hoverable => true, :black => true, :classes => "dropdown-item", :disabled => true %> I'll try to move it out of the "More" and test with different resolutions. If it doesn't break any resolution, I'll keep it out of the "More". It will need less HTML code. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5201#discussion_r177377 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
@nertc pushed 1 commit. 4b91e799bfed30f71dac5d10723dec016a34c26b Map Data asynchronous checkbox -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009/files/ca019cd28c25eed1bd211f070b0bd8f10293878d..4b91e799bfed30f71dac5d10723dec016a34c26b You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
@AntonKhorev I couldn't reproduce JS errors in the console. But I changed logic and now when user clicks "Map Data" checkbox, previous action is skipped immediately. Therefore, there will be no 2*n loads and errors. When we will be okay with the solution, I'll create a new PR in the [leaflet-osm](https://github.com/openstreetmap/leaflet-osm). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009#issuecomment-2385224902 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc pushed 1 commit. 2f6e72a8c8f2215847fc23e6afd70fe1e7ce0d0c Provide a truncated view of recent diaries -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121/files/d71a59541a80c6f5a821ee6bc7c1d08900d69a6b..2f6e72a8c8f2215847fc23e6afd70fe1e7ce0d0c You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
This PR was updated. Now truncation is handled in the back end. After 1000 characters, entry is truncated and `...` are added to it. Every image is handled as 500 characters to avoid entries with a big number of images. @kcne @AntonKhorev Thank you for reviews and recommendations -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#issuecomment-2357437014 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add older/newer links in front of diary, comment, issue, block pages (PR #5262)
@nertc approved this pull request. Tested and works perfectly. Every occurrence of "shared/pagination" has its own pair on top of the page. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5262#pullrequestreview-2418102474 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@tomhughes Thank you for the comment. I agree with you about the complexity of the code, but there are several reasons for both methods. Changing location name manually solves cases like: 1. Disputed areas - someone living in the area A may not want to show that area is part of country B and not C. 2. Several countries - someone who has citizenship of several countries may want to set his location name to something like "Georgia & Germany" 3. Choosing privacy - someone may want to explicitly mention "Tbilisi, Georgia", but someone may want to just show the country and keep other details private Meanwhile, changing location with Nominatim autofill introduces: 1. Better UX - if user is okay with showing only home country, autofill avoids extra typing from user 2. Standardization - default value introduces default standard for user to easily perceive what kind of and what detalization of information is recommended for the field 3. Motivation to fill - when user sees a warning about the field that it doesn't match home location, it subconsciously motivates him to click the autofill button (just one easy click) and increases use of the feature By choosing only one solution we sacrifice either functionality or better UX. Currently, autofill suggests name of the country and warning is only shown if manually typed location doesn't contain country name. Therefore, "Germany & Georgia", "Tbilisi, Georgia", "Georgia" won't show any autofill warning if user has home location set in Georgia. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#issuecomment-2464688461 You are receiving this because you are subscribed to this thread. Message ID:___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. 5fd8b6165732618de7d8ef987d170809eacfb59a Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/9f8d33b3d3b972ab4e653f2e9aefb18606d8b2f6..5fd8b6165732618de7d8ef987d170809eacfb59a You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. 91030dc47f1b2e1d1fcc1475e9c2c8e109a9108e Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/e5de62853b9ff5e5bb99572d38a2f5d1c0a37eda..91030dc47f1b2e1d1fcc1475e9c2c8e109a9108e You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. 9f8d33b3d3b972ab4e653f2e9aefb18606d8b2f6 Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/91030dc47f1b2e1d1fcc1475e9c2c8e109a9108e..9f8d33b3d3b972ab4e653f2e9aefb18606d8b2f6 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > @@ -178,6 +220,42 @@ $(document).ready(function () { } } + function updateHomeLocation() { +const lat = $("#home_lat").val().trim(); +const lon = $("#home_lon").val().trim(); +if (!lat || !lon) { + return; +} + +const geocodeUrl = `${OSM.NOMINATIM_URL}reverse?format=json&lat=${lat}&lon=${lon}`; + +if (locationInput.request) locationInput.request.abort(); +locationInput.request = $.getJSON(geocodeUrl, function (data) { Was updated to get information from the local call instead of directly accessing Nominatim. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1856293650 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > @@ -0,0 +1,22 @@ +require "application_system_test_case" + +class UserLocationChangeTest < ApplicationSystemTestCase + def setup +stub_request(:get, /.*gravatar.com.*d=404/).to_return(:status => 404) + end + + test "User can change their location" do +user = create(:user) +sign_in_as(user) + +visit user_path(user.display_name) Was updated and removed to remain consistent in the test file. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1856292264 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)
@AntonKhorev It will make `Reporter Users` cells too high which will cause additional whitespaces in other cells. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4990#issuecomment-2484796738 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc pushed 1 commit. f5a5cfc94be4aa89137401a308a7716effa640f5 Provide a truncated view of recent diaries -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121/files/e13e04e4bcaa5749f543b5e5d15bc96b8d69f808..f5a5cfc94be4aa89137401a308a7716effa640f5 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc commented on this pull request. > + def truncate_html(html, max_length, empty_tag_length = 500) +doc = Nokogiri::HTML::DocumentFragment.parse(html) +accumulated_length = 0 +truncated_node = nil + +doc.traverse do |node| + if accumulated_length >= max_length +node.remove unless truncated_node.ancestors.include?(node) +next + end + + next unless node.children.empty? + + content_length = node.text? ? node.text.length : empty_tag_length + if accumulated_length + content_length >= max_length +node.content = node.text.truncate(max_length - accumulated_length) if node.text? Truncation was removed and character limit was increased to 2000. Thanks for reviewing. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1847067632 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > @@ -280,8 +280,10 @@ 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" + scope "/user/:display_name" do +resource :follow, :only => [:create, :destroy], :path => "follow" + end + get "/user/:display_name/follow" => "follows#index" It's a page that either shows unfollow functionality or follow functionality based on if user already follows `:display_name`. As it is default `GET` method for this functionality (while other ones are `POST` and `DELETE`), I decided to name it `follows#index`. If you have an idea of a better name, I am open to it. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1847076063 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
PR was updated. Paragraph truncation was removed. Max length of the diary entry in the list was changed to 2000. Images now take size of 1000 character. Additional parsing to the RichText was removed and now HTML is directly sanitized and marked as safe. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#issuecomment-2483807720 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc commented on this pull request. > @@ -2,7 +2,7 @@ <%= render :partial => "diary_entry_heading", :object => diary_entry, :as => "diary_entry" %> -<%= diary_entry.body.to_html %> +<%= truncated ? diary_entry.truncated_body(1000).to_html : diary_entry.body.to_html %> Additional parsing was removed and now HTML is directly sanitized and converted using `RichText::SimpleFormat.new.sanitize` -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1847066121 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc pushed 1 commit. e13e04e4bcaa5749f543b5e5d15bc96b8d69f808 Provide a truncated view of recent diaries -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121/files/2f6e72a8c8f2215847fc23e6afd70fe1e7ce0d0c..e13e04e4bcaa5749f543b5e5d15bc96b8d69f808 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc commented on this pull request. > + def truncate_html(html, max_length, empty_tag_length = 500) +doc = Nokogiri::HTML::DocumentFragment.parse(html) +accumulated_length = 0 +truncated_node = nil + +doc.traverse do |node| + if accumulated_length >= max_length +node.remove unless truncated_node.ancestors.include?(node) +next + end + + next unless node.children.empty? + + content_length = node.text? ? node.text.length : empty_tag_length + if accumulated_length + content_length >= max_length +node.content = node.text.truncate(max_length - accumulated_length) if node.text? What do you think is a good number for the limit? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1846278714 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > @@ -178,6 +220,42 @@ $(document).ready(function () { } } + function updateHomeLocation() { +const lat = $("#home_lat").val().trim(); +const lon = $("#home_lon").val().trim(); +if (!lat || !lon) { + return; +} + +const geocodeUrl = `${OSM.NOMINATIM_URL}reverse?format=json&lat=${lat}&lon=${lon}`; Thank you for the suggested code. Was updated accordingly. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1856296376 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > + +<%= t ".location_name_warning" %> + + Was changed with the button named "Autofill %{country}". -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1856295293 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
Thank you for the review. PR was updated according to the comments. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#issuecomment-2497515015 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a summary view of recent diaries (PR #5103)
Closed #5103. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5103#event-15294308158 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc 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" PR was updated accordingly to include refactor and renaming of the `friendship` functionality. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1841719866 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a summary view of recent diaries (PR #5103)
Closing this PR in favor of #5121 PR -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5103#issuecomment-2475654591 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
PR was updated. Now friendship controller and model are refactored to be named as "follow" and also implement standard CRUD architecture using `create` and `destroy`. Old controllers, models, views and tests were removed, and new ones were added with the new names and architecture. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#issuecomment-2475646211 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)
> And if there's more than say 3, write something like > > > UserA > > UserB... > > UserC > > and 2 more users @AntonKhorev do you mean to make this kind of truncation in the tooltip? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4990#issuecomment-2475631174 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc commented on this pull request. > + def truncate_html(html, max_length, empty_tag_length = 500) +doc = Nokogiri::HTML::DocumentFragment.parse(html) +accumulated_length = 0 +truncated_node = nil + +doc.traverse do |node| + if accumulated_length >= max_length +node.remove unless truncated_node.ancestors.include?(node) +next + end + + next unless node.children.empty? + + content_length = node.text? ? node.text.length : empty_tag_length + if accumulated_length + content_length >= max_length +node.content = node.text.truncate(max_length - accumulated_length) if node.text? If we discard it as a whole, diary entry of someone who created only one huge paragraph, won't be shown at all. If we keep it fully, diary entry of someone who created only one huge paragraph, will overload diary entries list. That's why I think truncation is the best method in this case. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1841712743 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc pushed 2 commits. aaffdaadbf13fff043f9171e815161a079014b11 Modify the way Friends are added 02bede750de8a388d0ef378e2c2c583bfba1ca4a Refactor friendships controller and model -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261/files/8393857518195d145a5f1e8252b939f731cff25c..02bede750de8a388d0ef378e2c2c583bfba1ca4a You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Please make contact information fields, how to contact the user, email address, telegrams, various social networks https://www.openstreetmap.org (#2245)
I agree with the issue, current User Profile page provides functionalities for social interactions like Friendship, Messaging, Profile Description and etc. But to strengthen up community beyond the website and ease communication, it would be great if Social Profile Links could be added to the profile page. For example, GitHub has such functionality on the profile page. Of course, it should be optional, and user should have ability to add, delete or modify Social Profile Links. One way, I think, to add this feature, is to add a separate DB table for Social Profile Links, which contains Url, Id and User_id columns. Then Ruby on Rails will do parsing to distinguish different kinds of websites and links. And finally, front-end will use Bootstrap Icons to show visual part. There won't be needed any additional gems or libraries. Visual Idea: I think, it will be a smoother UX if user can change Social Profile Links while directly standing on the profile page (without redirecting on the separate page). It will add about 5 lines of JS, but I think, it's worth it. I'll open a PR after the implementation will be in accordance with the ideas discussed in this issue. Example screenshots:   -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/2245#issuecomment-2528034752 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc pushed 1 commit. 46f7da62f4bad5b672fb9193644a64c1c8c72083 Add social profile links -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439/files/471cbf6462bf835a1a3e35dbd72862d4a6e75b3c..46f7da62f4bad5b672fb9193644a64c1c8c72083 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc commented on this pull request. > @@ -280,8 +280,10 @@ 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" + scope "/user/:display_name" do +resource :follow, :only => [:create, :destroy], :path => "follow" + end + get "/user/:display_name/follow" => "follows#index" I agree with you. Changed `GET /follow` to `GET /follow/edit`. It's much intuitive and consistent. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261#discussion_r1896582646 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Modify the way "Friends" are added (PR #5261)
@nertc pushed 1 commit. 36fba94eaa196762872d337975836625a65c107e Refactor friendships controller and model -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5261/files/02bede750de8a388d0ef378e2c2c583bfba1ca4a..36fba94eaa196762872d337975836625a65c107e You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. 777eb643422fcd5267c647b388e14144e8f5fe09 Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/aac929d79e91cb554655a60b1a2cc81a364d6d7f..777eb643422fcd5267c647b388e14144e8f5fe09 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. defb24f00bf08f00b778c0270b9887502b48a340 Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/77e3f39bdf29c9a41475e1ea1347560add9c65d3..defb24f00bf08f00b778c0270b9887502b48a340 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > +http://www.w3.org/2000/svg"; width="16" > height="16" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 > 16"> + + `<%= t ".home location" %>` was added to the svg. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1903785459 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > +if (!locationInput.dirty || > locationName.includes(locationInput.countryName)) { + $("#location_name_warning").addClass("d-none"); +} else { + $("#location_name_warning").removeClass("d-none"); +} As we updated logic, this code became redundant and was removed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1903786291 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc pushed 1 commit. 55c89e6cc0cf41327059dff1ddf1b8116d4580e6 Add social profile links -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439/files/46f7da62f4bad5b672fb9193644a64c1c8c72083..55c89e6cc0cf41327059dff1ddf1b8116d4580e6 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)
> > It will make Reporter Users cells too high which will cause additional > > whitespaces in other cells. > > Is that additional whitespace going to be a problem? Sorry for the late answer. I think it will be a problem in terms of UI and UX: UI - visually, additional whitespaces in the table make cells feel disconnected from each other and also create an impression that something is missing in the cell (something went wrong) UX - as there will be additional whitespaces, they'll make page longer and, therefore, harder to scroll down. In addition to this, big whitespaces in cells generally make information harder to read (instead of regular left-to-right or right-to-left reading, user has to read every block of information top-to-bottom) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4990#issuecomment-2560763133 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc commented on this pull request. > + if accumulated_length >= max_length +node.remove unless !last_child.nil? && last_child.ancestors.include?(node) +next + end + + next unless node.children.empty? + + accumulated_length += node.text? ? node.text.length : empty_tag_length + if accumulated_length < max_length +last_child = node + else +node.remove + end +end + +RichText::SimpleFormat.new.sanitize(doc) Sorry for the late answer. As HTML was truncated and, therefore, changed, Ruby required additional sanitization to ensure that everything was still okay. I'll move truncation method in the `RichText::Base`. I think, it will solve most of problems and additional complexities introduced by adding this method to the concern. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1896487537 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > +:substack => %r{substack\.com/@([a-zA-Z0-9_-]+)}, +:telegram => %r{t\.me/([a-zA-Z0-9_]+)}, +:threads => %r{threads\.net/@([a-zA-Z0-9_]+)}, +:tiktok => %r{tiktok\.com/@([a-zA-Z0-9_]+)}, +:twitch => %r{twitch\.tv/([a-zA-Z0-9_]+)}, +:twitter_x => %r{(?:twitter|x)\.com/([a-zA-Z0-9_]+)}, +:vimeo => %r{vimeo.com/([a-zA-Z0-9_]+)}, +:whatsapp => %r{wa\.me/(\d+)}, +:youtube => %r{youtube\.com/@([a-zA-Z0-9_-]+)} + }.freeze + + NO_USERNAME_PLATFORMS = %w[discord line skype slack].freeze + + def parsed +URL_PATTERNS.each do |platform, pattern| + username = url.match(pattern) It's a user's name shown in the URL of some websites' profile page (for example, in the `https://github.com/nertc` `nertc` is a `username`) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1898344770 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > @@ -40,6 +40,21 @@ + +<%= t ".social_links.legend" %> + + <%= f.fields_for :social_links do |social_link_form| %> + + <%= social_link_form.text_field :url, :hide_label => true, :wrapper_class => "col-sm-8" %> + <%= social_link_form.check_box :_destroy, :wrapper_class => "d-none social_link_destroy" %> + <%= social_link_form.label :_destroy, t(".social_links.remove"), :class => "btn btn-outline-primary col-sm-1 align-self-start" %> + + <% end %> + + +<%= link_to "+", "#", :id => "add-social-link", :class => "btn btn-outline-primary" %> I had a different logic that needed a link, as I changed logic, I agree with you, I'll change it to button. My idea was that `+` sign doesn't require any additional icons and is intuitive, while `Remove` needs `trash icon` to be intuitive (`-` sign doesn't always mean removal and sometimes it may be ambiguous). But I agree with you, maybe it's better to be consistent in this too. Which one do you think is better, to change `+` sign to `Add` (which will be much easier and less-code solution) or to change `Remove` to `trash icon` (which may be nicer in terms of UI, but will require trash icon and, therefore, more code)? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1898348555 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
PR was updated. Branch was synced with master and conflicts were resolved. Also, instead of handling canceling layer loading in the `setTimeout` callback, now it is handled by clearing `setTimeouts`. Optimizations for layer rendering were done in https://github.com/openstreetmap/leaflet-osm/pull/43, but still this PR is relevant, because it adds loading spinner for those cases when data is processed by the back end, and also for slower CPUs (for example, when I set `6x slowdown` to the CPU) it will provide smooth asynchronous loading without any freezes. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009#issuecomment-2633687241 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
@nertc pushed 1 commit. af830a16cb6e09c4d1d25ec96b9c2a6d315975d6 Map Data asynchronous checkbox -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009/files/4b91e799bfed30f71dac5d10723dec016a34c26b..af830a16cb6e09c4d1d25ec96b9c2a6d315975d6 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
@nertc commented on this pull request. > +def truncate_html(html_doc, max_length = nil, empty_tag_length = 1000) + return html_doc if max_length.nil? + + doc = Nokogiri::HTML::DocumentFragment.parse(html_doc) + accumulated_length = 0 + last_child = nil + + doc.traverse do |node| +if accumulated_length >= max_length + node.remove unless !last_child.nil? && last_child.ancestors.include?(node) + next +end + +next unless node.children.empty? + +accumulated_length += node.text? ? node.text.length : empty_tag_length Maybe changing checking if the tag is empty to checking if the tag is `` will be better. Therefore, tags like `` or `` will take 1 symbol space, while `` will take for example 1000 symbol space. If we want any other tags to be treated in a specific way, feel free to suggest. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1937179354 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Map Data checkbox: perhaps use toggle slider instead (PR #5009)
@nertc pushed 1 commit. fca12a2c06dd0ddcf2b9a937e0eeb36d97a20747 Map Data asynchronous checkbox -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5009/files/af830a16cb6e09c4d1d25ec96b9c2a6d315975d6..fca12a2c06dd0ddcf2b9a937e0eeb36d97a20747 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > @@ -40,6 +40,21 @@ + What do you think is a good place for it? Should it be between the description and avatar, before the description or the last one? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1944303773 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc commented on this pull request. > +if params[:format] == "json" + render :html => @results.pluck(:name).join(", ") PR was updated. Instead of HTML now `format=json` returns JSON array. I thought about plaintext, but I think, JSON object is much more versatile. Plus, it contains all the data that is contained in the html version (without `format=json`) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1944231608 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. cce58d16a4c4a48b06bd1b4d3b5eca5182865f3f Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/ea0667a47a41ed957f10dcf10b5aa8d9f46e15fd..cce58d16a4c4a48b06bd1b4d3b5eca5182865f3f You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add profile location (PR #5302)
@nertc pushed 1 commit. 47191675b5aaea734dff6afa0cac4c961963c264 Add profile location -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5302/files/cce58d16a4c4a48b06bd1b4d3b5eca5182865f3f..47191675b5aaea734dff6afa0cac4c961963c264 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > @@ -231,10 +231,15 @@ <% end %> -<%= @user.description.to_html %> - -<% if current_user and @user.id == current_user.id %> - -<%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %> + + +<%= render "social_links/show", + :social_links => @user.social_links %> +<% if current_user and @user.id == current_user.id %> + +<%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %> + +<% end %> I also thought about a separate page or in-place editing for social links, but for consistency, preferred to keep it in the way that everything is done on the profile page. I agree with you about changing general behavior of editing profile page, but, I think, it will be better if we do it as a separate issue and PR and it will change not some part of `profile/edit` but whole behavior to in-place edit. For now, to avoid any confusion from users about the function of the button, I'll move it to where it was before (under the description block). -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1949664318 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc pushed 1 commit. 411888ca16b5ae3877497dc607b73bffe3fafaed Add social profile links -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439/files/8263827fa86f1b6a3b21919ee8e016ac5d64b6f2..411888ca16b5ae3877497dc607b73bffe3fafaed You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
PR was updated according to the comments. Also, master was rebased as a base for this branch. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#issuecomment-2653813177 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > +:substack => %r{substack\.com/@([a-zA-Z0-9_-]+)}, +:telegram => %r{t\.me/([a-zA-Z0-9_]+)}, +:threads => %r{threads\.net/@([a-zA-Z0-9_]+)}, +:tiktok => %r{tiktok\.com/@([a-zA-Z0-9_]+)}, +:twitch => %r{twitch\.tv/([a-zA-Z0-9_]+)}, +:twitter_x => %r{(?:twitter|x)\.com/([a-zA-Z0-9_]+)}, +:vimeo => %r{vimeo.com/([a-zA-Z0-9_]+)}, +:whatsapp => %r{wa\.me/(\d+)}, +:youtube => %r{youtube\.com/@([a-zA-Z0-9_-]+)} + }.freeze + + NO_USERNAME_PLATFORMS = %w[discord line skype slack].freeze + + def parsed +URL_PATTERNS.each do |platform, pattern| + names = url.match(pattern) >From now it will check whether regex of the websites directly follows to >`http://www.`, `https://www.`, `http://` or `https://`. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1952720826 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > +:mastodon => %r{mastodon\.social/@([a-zA-Z0-9_]+)}, +:medium => %r{medium\.com/@([a-zA-Z0-9_]+)}, +:quora => %r{quora\.com/profile/([a-zA-Z0-9_-]+)}, +:reddit => %r{reddit\.com/user/([a-zA-Z0-9_-]+)}, +:skype => %r{join\.skype\.com/invite/([a-zA-Z0-9_-]+)}, +:slack => %r{join\.slack\.com/shareDM/([a-zA-Z0-9_~-]+)}, +:snapchat => %r{snapchat\.com/add/([a-zA-Z0-9_-]+)}, +:stackoverflow => %r{stackoverflow\.com/users/(\d+/[a-zA-Z0-9_-]+)}, +:strava => %r{strava\.com/athletes/([a-zA-Z0-9_-]+)}, +:substack => %r{substack\.com/@([a-zA-Z0-9_-]+)}, +:telegram => %r{t\.me/([a-zA-Z0-9_]+)}, +:threads => %r{threads\.net/@([a-zA-Z0-9_]+)}, +:tiktok => %r{tiktok\.com/@([a-zA-Z0-9_]+)}, +:twitch => %r{twitch\.tv/([a-zA-Z0-9_]+)}, +:twitter_x => %r{(?:twitter|x)\.com/([a-zA-Z0-9_]+)}, +:vimeo => %r{vimeo.com/([a-zA-Z0-9_]+)}, Was fixed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1952722032 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev
Re: [openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
@nertc commented on this pull request. > + +<%= image_tag "/assets/social_link_icons/#{social_link.parsed[:platform].nil? ? 'other' : social_link.parsed[:platform]}.svg", + :alt => social_link.parsed[:platform].nil? ? "other" : social_link.parsed[:platform], + :class => "me-2" %> +<%= link_to social_link.parsed[:name], social_link.url, :class => "text-body-secondary", :rel => "nofollow me" %> + >From now, URL won't wrap and will show ellipses (`...`) if it doesn't fit. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1952726566 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev