From: Tom Hughes Date: Wed, 28 Aug 2024 17:59:09 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/4565' X-Git-Tag: live~710 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/5f2a5cadcb693b34b81a9232b8879c3b4f12843d?ds=sidebyside;hp=-c Merge remote-tracking branch 'upstream/pull/4565' --- 5f2a5cadcb693b34b81a9232b8879c3b4f12843d diff --combined app/assets/javascripts/index.js index 5c7b2d26e,eac3f82cc..4f3c414f5 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@@ -12,9 -12,9 +12,9 @@@ //= require leaflet.contextmenu //= require index/contextmenu //= require index/search -//= require index/browse +//= require index/layers/data //= require index/export -//= require index/notes +//= require index/layers/notes //= require index/history //= require index/note //= require index/new_note @@@ -160,12 -160,12 +160,12 @@@ $(document).ready(function () OSM.initializeContextMenu(map); if (OSM.STATUS !== "api_offline" && OSM.STATUS !== "database_offline") { - OSM.initializeNotes(map); + OSM.initializeNotesLayer(map); if (params.layers.indexOf(map.noteLayer.options.code) >= 0) { map.addLayer(map.noteLayer); } - OSM.initializeBrowse(map); + OSM.initializeDataLayer(map); if (params.layers.indexOf(map.dataLayer.options.code) >= 0) { map.addLayer(map.dataLayer); } @@@ -396,7 -396,7 +396,7 @@@ OSM.router.load(); $(document).on("click", "a", function (e) { - if (e.isDefaultPrevented() || e.isPropagationStopped()) { + if (e.isDefaultPrevented() || e.isPropagationStopped() || $(e.target).data("turbo")) { return; } diff --combined app/views/changesets/show.html.erb index 915b0ef35,110caab03..13f40ce50 --- a/app/views/changesets/show.html.erb +++ b/app/views/changesets/show.html.erb @@@ -3,7 -3,7 +3,7 @@@ <%= render "sidebar_header", :title => t(".title", :id => @changeset.id) %>
-

+

<%= linkify(@changeset.tags["comment"].to_s.presence || t("browse.no_comment")) %>

<%= changeset_details(@changeset) %>

@@@ -18,17 -18,9 +18,17 @@@ <% if current_user %>
<% if @changeset.subscribers.exists?(current_user.id) %> - + <%= tag.button t(".unsubscribe"), + :class => "btn btn-sm btn-primary", + :name => "unsubscribe", + :data => { :method => "POST", + :url => api_changeset_unsubscribe_url(@changeset) } %> <% else %> - + <%= tag.button t(".subscribe"), + :class => "btn btn-sm btn-primary", + :name => "subscribe", + :data => { :method => "POST", + :url => api_changeset_subscribe_url(@changeset) } %> <% end %>
<% end %> @@@ -45,7 -37,7 +45,7 @@@ :user => link_to(comment.author.display_name, comment.author) %> <% if current_user&.moderator? %> — - <%= tag.button t("javascripts.changesets.show.#{comment.visible ? 'hide' : 'unhide'}_comment"), + <%= tag.button t(".#{comment.visible ? 'hide' : 'unhide'}_comment"), :class => "btn btn-sm small btn-link link-secondary p-0 align-baseline", :data => { :method => "POST", :url => comment.visible ? changeset_comment_hide_url(comment) : changeset_comment_unhide_url(comment) } %> @@@ -74,12 -66,7 +74,12 @@@
- + <%= tag.button t(".comment"), + :class => "btn btn-primary", + :name => "comment", + :disabled => true, + :data => { :method => "POST", + :url => changeset_comment_url(@changeset) } %>
<% else %> @@@ -90,42 -77,15 +90,15 @@@ <% end %> <% unless @ways.empty? %> - <%= render :partial => "paging_nav", :locals => { :type => "way", :pages => @way_pages } %> - + <%= render :partial => "elements", :locals => { :type => "way", :elements => @ways, :pages => @way_pages } %> <% end %> <% unless @relations.empty? %> - <%= render :partial => "paging_nav", :locals => { :type => "relation", :pages => @relation_pages } %> - + <%= render :partial => "elements", :locals => { :type => "relation", :elements => @relations, :pages => @relation_pages } %> <% end %> <% unless @nodes.empty? %> - <%= render :partial => "paging_nav", :locals => { :type => "node", :pages => @node_pages } %> - + <%= render :partial => "elements", :locals => { :type => "node", :elements => @nodes, :pages => @node_pages } %> <% end %>