From: Tom Hughes Date: Wed, 24 Jan 2024 11:23:29 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/4126' X-Git-Tag: live~313 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/c3498b490b7e695f0be0898e3df76961bda4738e?hp=75a4d406b9e8471c0fe0ebf2a47d47f0ae36289a Merge remote-tracking branch 'upstream/pull/4126' --- diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0608b699b..9fc132014 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -50,7 +50,7 @@ jobs: rubygems: 3.4.10 bundler-cache: true - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: yarn-${{ env.os }}-${{ hashFiles('yarn.lock') }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f2fa6763a..bfe456076 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: rubygems: 3.4.10 bundler-cache: true - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: yarn-ubuntu-${{ matrix.ubuntu }}-${{ hashFiles('yarn.lock') }} diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8a196f52e..9874aa379 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -66,7 +66,7 @@ Metrics/BlockNesting: # Offense count: 26 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 299 + Max: 305 # Offense count: 59 # Configuration parameters: AllowedMethods, AllowedPatterns. diff --git a/Gemfile.lock b/Gemfile.lock index 0135ebb87..8949abcbf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,36 +3,35 @@ GEM specs: aasm (5.5.0) concurrent-ruby (~> 1.0) - abbrev (0.1.2) - actioncable (7.1.2) - actionpack (= 7.1.2) - activesupport (= 7.1.2) + actioncable (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.2) - actionpack (= 7.1.2) - activejob (= 7.1.2) - activerecord (= 7.1.2) - activestorage (= 7.1.2) - activesupport (= 7.1.2) + actionmailbox (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.2) - actionpack (= 7.1.2) - actionview (= 7.1.2) - activejob (= 7.1.2) - activesupport (= 7.1.2) + actionmailer (7.1.3) + actionpack (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activesupport (= 7.1.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.2) - actionview (= 7.1.2) - activesupport (= 7.1.2) + actionpack (7.1.3) + actionview (= 7.1.3) + activesupport (= 7.1.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -42,39 +41,39 @@ GEM rails-html-sanitizer (~> 1.6) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (7.1.2) - actionpack (= 7.1.2) - activerecord (= 7.1.2) - activestorage (= 7.1.2) - activesupport (= 7.1.2) + actiontext (7.1.3) + actionpack (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.2) - activesupport (= 7.1.2) + actionview (7.1.3) + activesupport (= 7.1.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) active_record_union (1.3.0) activerecord (>= 4.0) - activejob (7.1.2) - activesupport (= 7.1.2) + activejob (7.1.3) + activesupport (= 7.1.3) globalid (>= 0.3.6) - activemodel (7.1.2) - activesupport (= 7.1.2) - activerecord (7.1.2) - activemodel (= 7.1.2) - activesupport (= 7.1.2) + activemodel (7.1.3) + activesupport (= 7.1.3) + activerecord (7.1.3) + activemodel (= 7.1.3) + activesupport (= 7.1.3) timeout (>= 0.4.0) activerecord-import (1.5.1) activerecord (>= 4.2) - activestorage (7.1.2) - actionpack (= 7.1.2) - activejob (= 7.1.2) - activerecord (= 7.1.2) - activesupport (= 7.1.2) + activestorage (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activesupport (= 7.1.3) marcel (~> 1.0) - activesupport (7.1.2) + activesupport (7.1.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -96,8 +95,8 @@ GEM autoprefixer-rails (10.4.16.0) execjs (~> 2) aws-eventstream (1.3.0) - aws-partitions (1.877.0) - aws-sdk-core (3.190.1) + aws-partitions (1.883.0) + aws-sdk-core (3.190.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) @@ -123,10 +122,10 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties - bigdecimal (3.1.5) + bigdecimal (3.1.6) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.17.0) + bootsnap (1.17.1) msgpack (~> 1.2) bootstrap (5.3.2) autoprefixer-rails (>= 9.1.0) @@ -153,7 +152,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) config (5.1.0) deep_merge (~> 1.2, >= 1.2.1) dry-validation (~> 1.0, >= 1.0.0) @@ -257,8 +256,7 @@ GEM google-protobuf (3.25.2) hashdiff (1.1.0) hashie (5.0.0) - highline (3.0.0) - abbrev + highline (3.0.1) htmlentities (4.3.4) http_accept_language (2.1.1) i18n (1.14.1) @@ -289,9 +287,9 @@ GEM image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - image_size (3.3.0) + image_size (3.4.0) in_threads (1.6.0) - io-console (0.7.1) + io-console (0.7.2) irb (1.11.1) rdoc reline (>= 0.4.2) @@ -333,7 +331,7 @@ GEM mini_portile2 (2.8.5) mini_racer (0.8.0) libv8-node (~> 18.16.0.0) - minitest (5.20.0) + minitest (5.21.2) msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) @@ -401,7 +399,7 @@ GEM omniauth (~> 2.0) openstreetmap-deadlock_retry (1.3.1) parallel (1.24.0) - parser (3.3.0.2) + parser (3.3.0.5) ast (~> 2.4.1) racc pg (1.5.4) @@ -431,20 +429,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.2) - actioncable (= 7.1.2) - actionmailbox (= 7.1.2) - actionmailer (= 7.1.2) - actionpack (= 7.1.2) - actiontext (= 7.1.2) - actionview (= 7.1.2) - activejob (= 7.1.2) - activemodel (= 7.1.2) - activerecord (= 7.1.2) - activestorage (= 7.1.2) - activesupport (= 7.1.2) + rails (7.1.3) + actioncable (= 7.1.3) + actionmailbox (= 7.1.3) + actionmailer (= 7.1.3) + actionpack (= 7.1.3) + actiontext (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activemodel (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) bundler (>= 1.15.0) - railties (= 7.1.2) + railties (= 7.1.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -459,9 +457,9 @@ GEM rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.2) - actionpack (= 7.1.2) - activesupport (= 7.1.2) + railties (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -485,11 +483,11 @@ GEM rouge (4.2.0) rtlcss (0.2.1) mini_racer (>= 0.6.3) - rubocop (1.59.0) + rubocop (1.60.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) @@ -502,7 +500,7 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-minitest (0.34.4) + rubocop-minitest (0.34.5) rubocop (>= 1.39, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) rubocop-performance (1.20.2) @@ -528,7 +526,8 @@ GEM google-protobuf (~> 3.23) rake (>= 13.0.0) secure_headers (6.5.0) - selenium-webdriver (4.16.0) + selenium-webdriver (4.17.0) + base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -558,7 +557,7 @@ GEM activerecord (>= 5.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - terser (1.1.20) + terser (1.2.0) execjs (>= 0.3.0, < 3) thor (1.3.0) tilt (2.3.0) diff --git a/INSTALL.md b/INSTALL.md index ec219b504..63aad6f1a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,7 +23,7 @@ of packages required before you can get the various gems installed. ## Minimum requirements * Ruby 3.0+ -* PostgreSQL 12+ +* PostgreSQL 13+ * Bundler (see note below about [developer Ruby setup](#rbenv)) * Javascript Runtime @@ -226,11 +226,11 @@ After installing this software, you may need to carry out some [configuration st # Ruby development install and versions (optional) -For simplicity, this document explains how to install all the website dependencies as "system" dependencies. While this is simpler, and usually faster, you might want more control over the process or the ability to install multiple different versions of software alongside eachother. For many developers, [`rbenv`](https://github.com/rbenv/rbenv) is the easiest way to manage multiple different Ruby versions on the same computer - with the added advantage that the installs are all in your home directory, so you don't need administrator permissions. +For simplicity, this document explains how to install all the website dependencies as "system" dependencies. While this is simpler, and usually faster, you might want more control over the process or the ability to install multiple different versions of software alongside each other. For many developers, [`rbenv`](https://github.com/rbenv/rbenv) is the easiest way to manage multiple different Ruby versions on the same computer - with the added advantage that the installs are all in your home directory, so you don't need administrator permissions. If you choose to install Ruby and Bundler via `rbenv`, then you do not need to install the system libraries for Ruby: -* For Ubuntu, you do not need to install the following packages: `ruby3.0 libruby3.0 ruby3.0-dev bundler`, +* For Ubuntu, you do not need to install the following packages: `ruby ruby-dev ruby-bundler`, * For Fedora, you do not need to install the following packages: `ruby ruby-devel rubygem-rdoc rubygem-bundler rubygems` * For MacOSX, you do not need to `brew install ruby` - but make sure you've installed a version of Ruby using `rbenv` before running `gem install bundler`! diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb index c7080595c..4a4eee390 100644 --- a/app/abilities/ability.rb +++ b/app/abilities/ability.rb @@ -6,6 +6,9 @@ class Ability def initialize(user) can [:relation, :relation_history, :way, :way_history, :node, :node_history, :changeset, :query], :browse + can [:show], OldNode + can [:show], OldWay + can [:show], OldRelation can [:show, :new], Note can :search, :direction can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :communities, :preview, :copyright, :key, :id], :site diff --git a/app/abilities/api_ability.rb b/app/abilities/api_ability.rb index 4876380d0..0eae46f82 100644 --- a/app/abilities/api_ability.rb +++ b/app/abilities/api_ability.rb @@ -5,7 +5,6 @@ class ApiAbility def initialize(user) can :show, :capability - can :index, :change can :index, :map can :show, :permission can :show, :version @@ -22,17 +21,9 @@ class ApiAbility can [:history, :version], OldWay can [:history, :version], OldRelation can [:show], UserBlock - end - - if user&.active? - can :welcome, :site - can [:revoke, :authorize], :oauth - if Settings.status != "database_offline" - can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication - can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message + if user&.active? can [:comment, :close, :reopen], Note - can [:new, :create], Report can [:create, :show, :update, :destroy, :data], Trace can [:details, :gpx_files], User can [:index, :show, :update, :update_all, :destroy], UserPreference diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 706647ef5..8ffa05c53 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -355,6 +355,16 @@ $(document).ready(function () { return page; }; + OSM.OldBrowse = function () { + var page = {}; + + page.pushstate = page.popstate = function (path) { + OSM.loadSidebarContent(path); + }; + + return page; + }; + var history = OSM.History(map); OSM.router = OSM.Router(map, { @@ -369,8 +379,11 @@ $(document).ready(function () { "/user/:display_name/history": history, "/note/:id": OSM.Note(map), "/node/:id(/history)": OSM.Browse(map, "node"), + "/node/:id/history/:version": OSM.OldBrowse(), "/way/:id(/history)": OSM.Browse(map, "way"), + "/way/:id/history/:version": OSM.OldBrowse(), "/relation/:id(/history)": OSM.Browse(map, "relation"), + "/relation/:id/history/:version": OSM.OldBrowse(), "/changeset/:id": OSM.Changeset(map), "/query": OSM.Query(map) }); diff --git a/app/assets/javascripts/index/note.js b/app/assets/javascripts/index/note.js index e7790c904..15fedb1d1 100644 --- a/app/assets/javascripts/index/note.js +++ b/app/assets/javascripts/index/note.js @@ -52,20 +52,18 @@ OSM.Note = function (map) { OSM.loadSidebarContent(path, function () { initialize(path, id, moveToNote); }); + }, + error: function (xhr) { + $(form).find("#comment-error") + .text(xhr.responseText) + .prop("hidden", false); + updateButtons(form); } }); }); content.find("textarea").on("input", function (e) { - var form = e.target.form; - - if ($(e.target).val() === "") { - $(form.close).val($(form.close).data("defaultActionText")); - $(form.comment).prop("disabled", true); - } else { - $(form.close).val($(form.close).data("commentActionText")); - $(form.comment).prop("disabled", false); - } + updateButtons(e.target.form); }); content.find("textarea").val("").trigger("input"); @@ -84,6 +82,17 @@ OSM.Note = function (map) { if (callback) callback(); } + function updateButtons(form) { + $(form).find("input[type=submit]").prop("disabled", false); + if ($(form.text).val() === "") { + $(form.close).val($(form.close).data("defaultActionText")); + $(form.comment).prop("disabled", true); + } else { + $(form.close).val($(form.close).data("commentActionText")); + $(form.comment).prop("disabled", false); + } + } + function moveToNote() { var data = $(".details").data(); if (!data) return; diff --git a/app/controllers/old_nodes_controller.rb b/app/controllers/old_nodes_controller.rb new file mode 100644 index 000000000..a5b9cf563 --- /dev/null +++ b/app/controllers/old_nodes_controller.rb @@ -0,0 +1,19 @@ +class OldNodesController < ApplicationController + layout :map_layout + + before_action :authorize_web + before_action :set_locale + before_action -> { check_database_readable(:need_api => true) } + before_action :require_oauth + + authorize_resource + + around_action :web_timeout + + def show + @type = "node" + @feature = OldNode.preload(:old_tags, :changeset => [:changeset_tags, :user]).find([params[:id], params[:version]]) + rescue ActiveRecord::RecordNotFound + render :action => "not_found", :status => :not_found + end +end diff --git a/app/controllers/old_relations_controller.rb b/app/controllers/old_relations_controller.rb new file mode 100644 index 000000000..9dda82021 --- /dev/null +++ b/app/controllers/old_relations_controller.rb @@ -0,0 +1,19 @@ +class OldRelationsController < ApplicationController + layout :map_layout + + before_action :authorize_web + before_action :set_locale + before_action -> { check_database_readable(:need_api => true) } + before_action :require_oauth + + authorize_resource + + around_action :web_timeout + + def show + @type = "relation" + @feature = OldRelation.preload(:old_tags, :changeset => [:changeset_tags, :user], :old_members => :member).find([params[:id], params[:version]]) + rescue ActiveRecord::RecordNotFound + render :action => "not_found", :status => :not_found + end +end diff --git a/app/controllers/old_ways_controller.rb b/app/controllers/old_ways_controller.rb new file mode 100644 index 000000000..d18121e6f --- /dev/null +++ b/app/controllers/old_ways_controller.rb @@ -0,0 +1,19 @@ +class OldWaysController < ApplicationController + layout :map_layout + + before_action :authorize_web + before_action :set_locale + before_action -> { check_database_readable(:need_api => true) } + before_action :require_oauth + + authorize_resource + + around_action :web_timeout + + def show + @type = "way" + @feature = OldWay.preload(:old_tags, :changeset => [:changeset_tags, :user], :old_nodes => { :node => [:node_tags, :ways] }).find([params[:id], params[:version]]) + rescue ActiveRecord::RecordNotFound + render :action => "not_found", :status => :not_found + end +end diff --git a/app/helpers/svg_helper.rb b/app/helpers/svg_helper.rb index a40fa7086..9c02fc1d9 100644 --- a/app/helpers/svg_helper.rb +++ b/app/helpers/svg_helper.rb @@ -1,4 +1,12 @@ module SvgHelper + def previous_page_svg_tag(**options) + adjacent_page_svg_tag(dir == "rtl" ? 1 : -1, **options) + end + + def next_page_svg_tag(**options) + adjacent_page_svg_tag(dir == "rtl" ? -1 : 1, **options) + end + def key_svg_tag(**options) border_width = options["border"] ? (options["border-width"] || 1) : 0 rect_attrs = { @@ -31,6 +39,17 @@ module SvgHelper private + # returns "<" shape if side == -1; ">" if side == 1 + def adjacent_page_svg_tag(side, **options) + height = 15 + pad = 2 + segment = (0.5 * height) - pad + width = segment + (2 * pad) + path_data = "M#{side * (pad - (0.5 * width))},#{pad} l#{side * segment},#{segment} l#{-side * segment},#{segment}" + path_tag = tag.path :d => path_data, :fill => "none", :stroke => "currentColor", :"stroke-width" => 1.5 + tag.svg path_tag, :width => width, :height => height, :viewBox => "-#{0.5 * width} 0 #{width} #{height}", :class => options[:class] + end + def stroke_attrs(attrs, prefix) attrs.select { |key| key.start_with?(prefix) }.transform_keys { |key| key.delete_prefix(prefix).prepend("stroke") } end diff --git a/app/models/user.rb b/app/models/user.rb index bc95f20c1..7faf748cd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -34,12 +34,12 @@ # # Indexes # -# users_auth_idx (auth_provider,auth_uid) UNIQUE -# users_display_name_idx (display_name) UNIQUE -# users_display_name_lower_idx (lower((display_name)::text)) -# users_email_idx (email) UNIQUE -# users_email_lower_idx (lower((email)::text)) -# users_home_idx (home_tile) +# users_auth_idx (auth_provider,auth_uid) UNIQUE +# users_display_name_canonical_idx (lower(NORMALIZE(display_name, NFKC))) +# users_display_name_idx (display_name) UNIQUE +# users_email_idx (email) UNIQUE +# users_email_lower_idx (lower((email)::text)) +# users_home_idx (home_tile) # class User < ApplicationRecord @@ -95,10 +95,11 @@ class User < ApplicationRecord validates :display_name, :presence => true, :length => 3..255, :exclusion => %w[new terms save confirm confirm-email go_public reset-password forgot-password suspended] validates :display_name, :if => proc { |u| u.display_name_changed? }, - :uniqueness => { :case_sensitive => false } + :normalized_uniqueness => { :case_sensitive => false } validates :display_name, :if => proc { |u| u.display_name_changed? }, :characters => { :url_safe => true }, :whitespace => { :leading => false, :trailing => false } + validate :display_name_cannot_be_user_id_with_other_id, :if => proc { |u| u.display_name_changed? } validates :email, :presence => true, :confirmation => true, :characters => true validates :email, :if => proc { |u| u.email_changed? }, :uniqueness => { :case_sensitive => false } @@ -123,6 +124,12 @@ class User < ApplicationRecord before_save :update_tile after_save :spam_check + def display_name_cannot_be_user_id_with_other_id + display_name&.match(/^user_(\d+)$/i) do |m| + errors.add :display_name, I18n.t("activerecord.errors.messages.display_name_is_user_n") unless m[1].to_i == id + end + end + def to_param display_name end @@ -132,7 +139,7 @@ class User < ApplicationRecord user = find_by("email = ? OR display_name = ?", options[:username].strip, options[:username]) if user.nil? - users = where("LOWER(email) = LOWER(?) OR LOWER(display_name) = LOWER(?)", options[:username].strip, options[:username]) + users = where("LOWER(email) = LOWER(?) OR LOWER(NORMALIZE(display_name, NFKC)) = LOWER(NORMALIZE(?, NFKC))", options[:username].strip, options[:username]) user = users.first if users.count == 1 end diff --git a/app/validators/normalized_uniqueness_validator.rb b/app/validators/normalized_uniqueness_validator.rb new file mode 100644 index 000000000..eb3600c7b --- /dev/null +++ b/app/validators/normalized_uniqueness_validator.rb @@ -0,0 +1,18 @@ +class NormalizedUniquenessValidator < ActiveModel::EachValidator + def validate_each(record, attribute, value) + relation = if options.fetch(:case_sensitive, true) + record.class.where("NORMALIZE(#{attribute}, NFKC) = NORMALIZE(?, NFKC)", value) + else + record.class.where("LOWER(NORMALIZE(#{attribute}, NFKC)) = LOWER(NORMALIZE(?, NFKC))", value) + end + + relation = relation.where.not(record.class.primary_key => [record.id_in_database]) if record.persisted? + + if relation.exists? + error_options = options.except(:case_sensitive) + error_options[:value] = value + + record.errors.add(attribute, :taken, **error_options) + end + end +end diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 4726799e7..7d3f8e829 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -1,6 +1,6 @@

<%= t "browse.version" %> - #<%= common_details.version %> + #<%= link_to_unless_current common_details.version, :controller => "old_#{@type.pluralize}", :action => :show, :version => common_details.version %>

@@ -19,7 +19,7 @@

  • <%= t "browse.in_changeset" %> - #<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %> + #<%= link_to common_details.changeset_id, changeset_path(common_details.changeset) %>
  • <% if @type == "node" and common_details.visible? %> @@ -33,4 +33,4 @@ <% end %> -<%= render :partial => "tag_details", :object => common_details.tags %> +<%= render :partial => "browse/tag_details", :object => common_details.tags %> diff --git a/app/views/browse/_node.html.erb b/app/views/browse/_node.html.erb index 152223ae7..cc8597292 100644 --- a/app/views/browse/_node.html.erb +++ b/app/views/browse/_node.html.erb @@ -8,7 +8,7 @@ <% else %>
    - <%= render :partial => "common_details", :object => node %> + <%= render :partial => "browse/common_details", :object => node %> <% unless node.ways.empty? and node.containing_relation_members.empty? %>

    <%= t "browse.part_of" %>

    @@ -17,7 +17,7 @@ <%= t "browse.part_of_ways", :count => node.ways.uniq.count %> @@ -26,7 +26,7 @@
    > <%= t "browse.part_of_relations", :count => node.containing_relation_members.uniq.count %>
      - <%= render :partial => "containing_relation", :collection => node.containing_relation_members.uniq %> + <%= render :partial => "browse/containing_relation", :collection => node.containing_relation_members.uniq %>
    <% end %> diff --git a/app/views/browse/_relation.html.erb b/app/views/browse/_relation.html.erb index 8db40c8c7..c513ea6d1 100644 --- a/app/views/browse/_relation.html.erb +++ b/app/views/browse/_relation.html.erb @@ -8,7 +8,7 @@
    <% else %>
    - <%= render :partial => "common_details", :object => relation %> + <%= render :partial => "browse/common_details", :object => relation %> <% unless relation.containing_relation_members.empty? %>

    <%= t "browse.part_of" %>

    @@ -25,7 +25,7 @@
    > <%= t ".members_count", :count => relation.relation_members.count %>
      - <%= render :partial => "relation_member", :collection => relation.relation_members %> + <%= render :partial => "browse/relation_member", :collection => relation.relation_members %>
    <% end %> diff --git a/app/views/browse/_relation_member.html.erb b/app/views/browse/_relation_member.html.erb index 5c96dadaf..5e52c04e8 100644 --- a/app/views/browse/_relation_member.html.erb +++ b/app/views/browse/_relation_member.html.erb @@ -1,5 +1,5 @@ <% member_class = link_class(relation_member.member_type.downcase, relation_member.member) - linked_name = link_to printable_name(relation_member.member), { :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s }, { :title => link_title(relation_member.member), :rel => link_follow(relation_member.member) } + linked_name = link_to printable_name(relation_member.member), { :controller => :browse, :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s }, { :title => link_title(relation_member.member), :rel => link_follow(relation_member.member) } type_str = t ".type.#{relation_member.member_type.downcase}" %>
  • <%= if relation_member.member_role.blank? diff --git a/app/views/browse/_tag_details.html.erb b/app/views/browse/_tag_details.html.erb index 9129ddaf5..cc08fe16a 100644 --- a/app/views/browse/_tag_details.html.erb +++ b/app/views/browse/_tag_details.html.erb @@ -2,7 +2,7 @@

    <%= t ".tags" %>

    - <%= render :partial => "tag", :collection => tag_details.sort %> + <%= render :partial => "browse/tag", :collection => tag_details.sort %>
    <% end %> diff --git a/app/views/browse/_way.html.erb b/app/views/browse/_way.html.erb index 4fdcd035e..26403f3fd 100644 --- a/app/views/browse/_way.html.erb +++ b/app/views/browse/_way.html.erb @@ -8,7 +8,7 @@
  • <% else %>
    - <%= render :partial => "common_details", :object => way %> + <%= render :partial => "browse/common_details", :object => way %> <% unless way.containing_relation_members.empty? %>

    <%= t "browse.part_of" %>

    @@ -27,10 +27,10 @@