]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3523'
authorTom Hughes <tom@compton.nu>
Tue, 12 Apr 2022 16:12:16 +0000 (17:12 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 12 Apr 2022 16:12:16 +0000 (17:12 +0100)
32 files changed:
Gemfile.lock
app/controllers/api/changeset_comments_controller.rb
app/controllers/api/changesets_controller.rb
app/controllers/api/map_controller.rb
app/controllers/api/nodes_controller.rb
app/controllers/api/notes_controller.rb
app/controllers/api/old_controller.rb
app/controllers/api/permissions_controller.rb
app/controllers/api/relations_controller.rb
app/controllers/api/tracepoints_controller.rb
app/controllers/api/traces_controller.rb
app/controllers/api/users_controller.rb
app/controllers/api/ways_controller.rb
app/views/api/changesets/_changeset.json.jbuilder [new file with mode: 0644]
app/views/api/changesets/_changeset.xml.builder [moved from app/views/api/changesets/_changeset.builder with 100% similarity]
app/views/api/changesets/changeset.json.jbuilder [new file with mode: 0644]
app/views/api/changesets/changeset.xml.builder [moved from app/views/api/changesets/changeset.builder with 100% similarity]
app/views/api/changesets/changesets.json.jbuilder [new file with mode: 0644]
app/views/api/changesets/changesets.xml.builder [moved from app/views/api/changesets/changesets.builder with 100% similarity]
app/views/layouts/_header.html.erb
config/initializers/doorkeeper.rb
config/locales/ce.yml
config/locales/cs.yml
config/locales/fa.yml
config/locales/hr.yml
config/locales/ko.yml
config/locales/lb.yml
config/locales/sk.yml
config/locales/tl.yml
test/controllers/api/changeset_comments_controller_test.rb
test/controllers/api/changesets_controller_test.rb
yarn.lock

index 34ff51957537122e5a300fe31c23a5a2dddfb495..9a04b3765e9279510045c98fad4751d4b74133d9 100644 (file)
@@ -86,7 +86,7 @@ GEM
     autoprefixer-rails (10.4.2.0)
       execjs (~> 2)
     aws-eventstream (1.2.0)
-    aws-partitions (1.573.0)
+    aws-partitions (1.575.0)
     aws-sdk-core (3.130.0)
       aws-eventstream (~> 1, >= 1.0.2)
       aws-partitions (~> 1, >= 1.525.0)
@@ -124,7 +124,7 @@ GEM
     bootstrap_form (4.5.0)
       actionpack (>= 5.2)
       activemodel (>= 5.2)
-    brakeman (5.2.1)
+    brakeman (5.2.2)
     browser (5.3.1)
     builder (3.2.4)
     bzip2-ffi (1.1.0)
@@ -218,7 +218,7 @@ GEM
     faraday (2.2.0)
       faraday-net_http (~> 2.0)
       ruby2_keywords (>= 0.0.4)
-    faraday-net_http (2.0.1)
+    faraday-net_http (2.0.2)
     ffi (1.15.5)
     ffi-compiler (1.0.1)
       ffi (>= 1.0.0)
@@ -287,7 +287,7 @@ GEM
     mini_mime (1.1.2)
     mini_portile2 (2.8.0)
     minitest (5.15.0)
-    msgpack (1.4.5)
+    msgpack (1.5.1)
     multi_json (1.15.0)
     multi_xml (0.6.0)
     net-imap (0.2.3)
@@ -305,7 +305,7 @@ GEM
       net-protocol
       timeout
     nio4r (2.5.8)
-    nokogiri (1.13.3)
+    nokogiri (1.13.4)
       mini_portile2 (~> 2.8.0)
       racc (~> 1.4)
     oauth (0.4.7)
@@ -359,7 +359,7 @@ GEM
     pg (1.3.5)
     popper_js (1.16.0)
     progress (3.6.0)
-    public_suffix (4.0.6)
+    public_suffix (4.0.7)
     puma (5.6.4)
       nio4r (~> 2.0)
     quad_tile (1.0.1)
@@ -414,13 +414,13 @@ GEM
     rb-fsevent (0.11.1)
     rb-inotify (0.10.1)
       ffi (~> 1.0)
-    regexp_parser (2.2.1)
+    regexp_parser (2.3.0)
     request_store (1.5.1)
       rack (>= 1.4)
     rexml (3.2.5)
     rinku (2.0.6)
     rotp (6.2.0)
-    rubocop (1.26.1)
+    rubocop (1.27.0)
       parallel (~> 1.10)
       parser (>= 3.1.0.0)
       rainbow (>= 2.2.2, < 4.0)
@@ -429,9 +429,9 @@ GEM
       rubocop-ast (>= 1.16.0, < 2.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 3.0)
-    rubocop-ast (1.16.0)
+    rubocop-ast (1.17.0)
       parser (>= 3.1.1.0)
-    rubocop-minitest (0.18.0)
+    rubocop-minitest (0.19.1)
       rubocop (>= 0.90, < 2.0)
     rubocop-performance (1.13.3)
       rubocop (>= 1.7.0, < 2.0)
index 4cd33a92b6b3115b5b76a5e24f2cd5d69d5b2ee7..8b971834d76432d2728a2d7c0bd059691a9328e4 100644 (file)
@@ -1,12 +1,13 @@
 module Api
   class ChangesetCommentsController < ApiController
+    before_action :check_api_writable
+    before_action :check_api_readable, :except => [:create]
     before_action :authorize
 
     authorize_resource
 
     before_action :require_public_data, :only => [:create]
-    before_action :check_api_writable
-    before_action :check_api_readable, :except => [:create]
+    before_action :set_request_formats
     around_action :api_call_handle_error
     around_action :api_call_timeout
 
@@ -41,6 +42,11 @@ module Api
       # Return a copy of the updated changeset
       @changeset = changeset
       render "api/changesets/changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##
@@ -61,6 +67,11 @@ module Api
       # Return a copy of the updated changeset
       @changeset = comment.changeset
       render "api/changesets/changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##
@@ -81,6 +92,11 @@ module Api
       # Return a copy of the updated changeset
       @changeset = comment.changeset
       render "api/changesets/changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
   end
 end
index df27ab5ca7a1866ea6dfa0577a01d0893978573f..24e7fb9252ca12e161bdae5ac444bb1824b16e49 100644 (file)
@@ -4,14 +4,14 @@ module Api
   class ChangesetsController < ApiController
     require "xml/libxml"
 
+    before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe]
+    before_action :check_api_readable, :except => [:create, :update, :upload, :download, :query, :subscribe, :unsubscribe]
     before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
 
     authorize_resource
 
     before_action :require_public_data, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
-    before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe]
-    before_action :check_api_readable, :except => [:create, :update, :upload, :download, :query, :subscribe, :unsubscribe]
-    before_action :set_request_formats, :only => [:download]
+    before_action :set_request_formats, :except => [:create, :close, :upload]
 
     around_action :api_call_handle_error
     around_action :api_call_timeout, :except => [:upload]
@@ -42,6 +42,11 @@ module Api
       @changeset = Changeset.find(params[:id])
       @include_discussion = params[:include_discussion].presence
       render "changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##
@@ -171,6 +176,11 @@ module Api
       # preload users, tags and comments, and render result
       @changesets = changesets.preload(:user, :changeset_tags, :comments)
       render "changesets"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##
@@ -191,6 +201,11 @@ module Api
       check_changeset_consistency(@changeset, current_user)
       @changeset.update_from(new_changeset, current_user)
       render "changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##
@@ -212,6 +227,11 @@ module Api
       # Return a copy of the updated changeset
       @changeset = changeset
       render "changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##
@@ -233,6 +253,11 @@ module Api
       # Return a copy of the updated changeset
       @changeset = changeset
       render "changeset"
+
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     private
index 1b5150537bccb8299a990d4e0c47b20598a7df53..0d123fc3e7851f2d0eae4748d4cacf38575e8e47 100644 (file)
@@ -1,8 +1,9 @@
 module Api
   class MapController < ApiController
+    before_action :check_api_readable
+
     authorize_resource :class => false
 
-    before_action :check_api_readable
     around_action :api_call_handle_error, :api_call_timeout
 
     before_action :set_request_formats
index 62eb76505b6228f4c6530476024e7c8afbdae397..92779dd67f18ca160a83772bc311b5dde29b875a 100644 (file)
@@ -4,13 +4,13 @@ module Api
   class NodesController < ApiController
     require "xml/libxml"
 
+    before_action :check_api_writable, :only => [:create, :update, :delete]
+    before_action :check_api_readable, :except => [:create, :update, :delete]
     before_action :authorize, :only => [:create, :update, :delete]
 
     authorize_resource
 
     before_action :require_public_data, :only => [:create, :update, :delete]
-    before_action :check_api_writable, :only => [:create, :update, :delete]
-    before_action :check_api_readable, :except => [:create, :update, :delete]
     around_action :api_call_handle_error, :api_call_timeout
 
     before_action :set_request_formats, :except => [:create, :update, :delete]
index 8a41d5db804b2eac4a156404d7213b1d2fadc644..7454e7f19387ee178c97ce8efb8f751b2bb4972d 100644 (file)
@@ -1,12 +1,12 @@
 module Api
   class NotesController < ApiController
     before_action :check_api_readable
+    before_action :check_api_writable, :only => [:create, :comment, :close, :reopen, :destroy]
     before_action :setup_user_auth, :only => [:create, :comment, :show]
     before_action :authorize, :only => [:close, :reopen, :destroy, :comment]
 
     authorize_resource
 
-    before_action :check_api_writable, :only => [:create, :comment, :close, :reopen, :destroy]
     before_action :set_locale
     around_action :api_call_handle_error, :api_call_timeout
 
index f8e42476f878c11aaa6aac42f81b5f5ddf7d5536..ceed10978d9b614dbab6fa16298189ee9b5565ea 100644 (file)
@@ -5,13 +5,13 @@ module Api
   class OldController < ApiController
     require "xml/libxml"
 
+    before_action :check_api_readable
+    before_action :check_api_writable, :only => [:redact]
     before_action :setup_user_auth, :only => [:history, :version]
     before_action :authorize, :only => [:redact]
 
     authorize_resource
 
-    before_action :check_api_readable
-    before_action :check_api_writable, :only => [:redact]
     around_action :api_call_handle_error, :api_call_timeout
     before_action :lookup_old_element, :except => [:history]
     before_action :lookup_old_element_versions, :only => [:history]
index 07685ed6806546e58a795f7cdb74ba61774e9be5..8c0c949dc2c71302f64b1611f2977961a71d7718 100644 (file)
@@ -1,8 +1,9 @@
 module Api
   class PermissionsController < ApiController
+    before_action :check_api_readable
+
     authorize_resource :class => false
 
-    before_action :check_api_readable
     before_action :setup_user_auth
     before_action :set_request_formats
     around_action :api_call_handle_error, :api_call_timeout
index 9bb3eb87c4ebf4e2f2c4404a30981957b859a70d..5dd5632ba89aff98187c763b654b9c5efdfe9eb3 100644 (file)
@@ -2,13 +2,13 @@ module Api
   class RelationsController < ApiController
     require "xml/libxml"
 
+    before_action :check_api_writable, :only => [:create, :update, :delete]
+    before_action :check_api_readable, :except => [:create, :update, :delete]
     before_action :authorize, :only => [:create, :update, :delete]
 
     authorize_resource
 
     before_action :require_public_data, :only => [:create, :update, :delete]
-    before_action :check_api_writable, :only => [:create, :update, :delete]
-    before_action :check_api_readable, :except => [:create, :update, :delete]
     around_action :api_call_handle_error, :api_call_timeout
 
     before_action :set_request_formats, :except => [:create, :update, :delete]
index e758d559f99d0bb69eaeaca8ec7cecd8a1740862..e8bd97b64196503f9d3279dd9e749496880cf38c 100644 (file)
@@ -1,8 +1,9 @@
 module Api
   class TracepointsController < ApiController
+    before_action :check_api_readable
+
     authorize_resource
 
-    before_action :check_api_readable
     around_action :api_call_handle_error, :api_call_timeout
 
     # Get an XML response containing a list of tracepoints that have been uploaded
index 6a0ec81ec72d82f698beebecd5773c92ede80ce0..8121764a1b4f7f8fb76ace6db6865613f0c500e5 100644 (file)
@@ -1,13 +1,13 @@
 module Api
   class TracesController < ApiController
+    before_action :check_database_readable, :except => [:show, :data]
+    before_action :check_database_writable, :only => [:create, :update, :destroy]
     before_action :authorize_web
     before_action :set_locale
     before_action :authorize
 
     authorize_resource
 
-    before_action :check_database_readable, :except => [:show, :data]
-    before_action :check_database_writable, :only => [:create, :update, :destroy]
     before_action :check_api_readable, :only => [:show, :data]
     before_action :check_api_writable, :only => [:create, :update, :destroy]
     before_action :offline_error, :only => [:create, :destroy, :data]
index a452cb9301ead6467f3c8ed6852156c55ba71e56..d4baf4a820a0c1dada9c5a4f13342d440f536a0f 100644 (file)
@@ -1,12 +1,12 @@
 module Api
   class UsersController < ApiController
+    before_action :check_api_readable
     before_action :disable_terms_redirect, :only => [:details]
     before_action :setup_user_auth, :only => [:show, :index]
     before_action :authorize, :only => [:details, :gpx_files]
 
     authorize_resource
 
-    before_action :check_api_readable
     around_action :api_call_handle_error
     before_action :lookup_user_by_id, :only => [:show]
 
index f88f3a1d011d7609c0c0eb8a3704ee2c31746fe1..ca4acd6113797ff373dc7eb503e1fd453154e561 100644 (file)
@@ -2,13 +2,13 @@ module Api
   class WaysController < ApiController
     require "xml/libxml"
 
+    before_action :check_api_writable, :only => [:create, :update, :delete]
+    before_action :check_api_readable, :except => [:create, :update, :delete]
     before_action :authorize, :only => [:create, :update, :delete]
 
     authorize_resource
 
     before_action :require_public_data, :only => [:create, :update, :delete]
-    before_action :check_api_writable, :only => [:create, :update, :delete]
-    before_action :check_api_readable, :except => [:create, :update, :delete]
     around_action :api_call_handle_error, :api_call_timeout
 
     before_action :set_request_formats, :except => [:create, :update, :delete]
diff --git a/app/views/api/changesets/_changeset.json.jbuilder b/app/views/api/changesets/_changeset.json.jbuilder
new file mode 100644 (file)
index 0000000..25b3660
--- /dev/null
@@ -0,0 +1,33 @@
+# basic attributes
+json.id changeset.id
+json.created_at changeset.created_at.xmlschema
+json.open changeset.open?
+json.comments_count changeset.comments.length
+json.changes_count changeset.num_changes
+
+json.closed_at changeset.closed_at.xmlschema unless changeset.open?
+if changeset.bbox.complete?
+  json.min_lat GeoRecord::Coord.new(changeset.bbox.to_unscaled.min_lat)
+  json.min_lon GeoRecord::Coord.new(changeset.bbox.to_unscaled.min_lon)
+  json.max_lat GeoRecord::Coord.new(changeset.bbox.to_unscaled.max_lat)
+  json.max_lon GeoRecord::Coord.new(changeset.bbox.to_unscaled.max_lon)
+end
+
+# user attributes
+if changeset.user.data_public?
+  json.uid changeset.user_id
+  json.user changeset.user.display_name
+end
+
+json.tags changeset.tags unless changeset.tags.empty?
+
+if @include_discussion
+  json.comments(changeset.comments) do |comment|
+    json.date comment.created_at.xmlschema
+    if comment.author.data_public?
+      json.uid comment.author.id
+      json.user comment.author.display_name
+    end
+    json.text comment.body
+  end
+end
diff --git a/app/views/api/changesets/changeset.json.jbuilder b/app/views/api/changesets/changeset.json.jbuilder
new file mode 100644 (file)
index 0000000..7a840c1
--- /dev/null
@@ -0,0 +1,5 @@
+json.partial! "api/root_attributes"
+
+json.changeset do
+  json.partial! @changeset
+end
diff --git a/app/views/api/changesets/changesets.json.jbuilder b/app/views/api/changesets/changesets.json.jbuilder
new file mode 100644 (file)
index 0000000..f52d698
--- /dev/null
@@ -0,0 +1,5 @@
+json.partial! "api/root_attributes"
+
+json.changesets(@changesets) do |changeset|
+  json.partial! changeset
+end
index 3609b253e31f0e0dedae452e69ab35be0a6aed4f..ed302715a9e57564cd1b4cc47906c327e72ba7c4 100644 (file)
@@ -36,7 +36,7 @@
   </nav>
   <nav class='secondary'>
     <ul class='mx-1 px-0'>
-      <% if can? :index, Issue %>
+      <% if Settings.status != "database_offline" && can?(:index, Issue) %>
         <li class="compact-hide nav-item <%= current_page_class(issues_path) %>">
           <%= link_to issues_path(:status => "open"), :class => "nav-link" do %>
             <%= t("layouts.issues") %>
index e8caa395fe52dee9dd476a8cf68762fe7534ba68..8dce1c8707fe149fa823e7432c6e8cf7f0c4890f 100644 (file)
@@ -49,7 +49,7 @@ Rails.application.reloader.to_prepare do
     #   end
     # end
 
-    application_class "Oauth2Application"
+    application_class "Oauth2Application" unless Settings.status == "database_offline"
 
     # Enables polymorphic Resource Owner association for Access Tokens and Access Grants.
     # By default this option is disabled.
index 7394f89aeeb4fc1887a35bcf99de801929ac2bb3..6ded0788fa358891787281857f21b27525ddc34f 100644 (file)
@@ -21,7 +21,7 @@ ce:
       message:
         create: ДӀадахьийта
       client_application:
-        create: ДӀайаздар
+        create: ДӀайаздала
         update: Хийца
       redaction:
         create: Нисдар кхоллар
@@ -925,7 +925,7 @@ ce:
       application: ТӀетохаран цӀе
   users:
     new:
-      title: ДӀайаздар кхоллар
+      title: ДӀайаздалар
       display name: 'Гуш йолу цӀе:'
       continue: Кхин дӀа
     terms:
@@ -937,7 +937,7 @@ ce:
         rest_of_world: Дисна дуьйне
     no_such_user:
       title: Иштта деъашхочун агӀо йац
-      heading: '%{user} Ð´Ó\80айаздаÑ\80 Ð´ац'
+      heading: '%{user} Ð°ÐºÐºÐ°Ñ\83нÑ\82 Ð¹ац'
       deleted: дӀайаьккхина
     show:
       my diary: Сан дӀайаздарш
index 7bb5d494e9a957455da31714173c63486fc21ee3..b586fa3a95f0983dfb9ad10065b68e1b877ceb32 100644 (file)
@@ -31,6 +31,7 @@
 # Author: Mkyral
 # Author: Mormegil
 # Author: Mr. Richard Bolla
+# Author: MrJaroslavik
 # Author: Nemo bis
 # Author: Patriccck
 # Author: Paxt
@@ -177,7 +178,7 @@ cs:
         auth_provider: Poskytovatel autentizace
         auth_uid: Autentifikační UID
         email: E-mail
-        email_confirmation: potvrzení e-mailem
+        email_confirmation: Potvrzení e-mailu
         new_email: nová emailová adresa
         active: Aktivní
         display_name: Zobrazované jméno
index 6160683cfc5a07c90d6ad9c5fd12288a904934a2..02696add003a012536a39fbe744db103289eab78 100644 (file)
@@ -29,6 +29,7 @@
 # Author: Mjbmr
 # Author: Mobin2008
 # Author: Mohammad ebz
+# Author: Mojtabakd
 # Author: Movyn
 # Author: Nbi
 # Author: Omidh
@@ -280,6 +281,31 @@ fa:
       entry:
         comment: نظر
         full: یادداشت کامل
+  account:
+    deletions:
+      show:
+        title: حذف حساب من
+        warning: هشدار! فرآیند حذف حساب قطعی است و امکان لغو ندارد.
+        delete_account: حساب را حذف کن
+        delete_introduction: 'با فشردن دکمهٔ زیر می‌توانید حساب اوپن‌استریت‌مپ خود
+          را حذف کنید. لطفاً به نکات زیر توجه نمایید:'
+        delete_profile: اطلاعات نمایهٔ شما شامل عکس، توضیحات و موقعیت خانه حذف خواهد
+          شد.
+        delete_display_name: نام نمایشی شما حذف خواهد شد و حساب‌های دیگر می‌توانند
+          از آن استفاده کنند.
+        retain_caveats: اگرچه، حتی پس از حذف شدن حسابتان برخی اطلاعات شما در اوپن‌استریت‌مپ
+          حفظ خواهد شد.
+        retain_edits: همهٔ ویرایش‌های شما در پایگاه دادهٔ نقشه حفظ خواهد شد.
+        retain_traces: همهٔ ردهایی که بارگذاری کرده‌اید حفظ خواهد شد.
+        retain_diary_entries: همهٔ روزنوشت‌ها و نظراتی که به روزنوشت‌ها داده‌اید حفظ
+          خواهد شد اما نمایش داده نمی‌شود.
+        retain_notes: همهٔ یادداشت‌های نقشه و نظراتی که به یادداشت‌های نقشه داده‌اید
+          حفظ خواهد شد اما نمایش داده نمی‌شود.
+        retain_changeset_discussions: همهٔ گفت‌وگوهای شما روی بسته‌های تغییر حفظ خواهد
+          شد.
+        retain_email: نشانی رایانامهٔ شما حفظ خواهد شد.
+        confirm_delete: آیا مطمئن هستید؟
+        cancel: لغو
   accounts:
     edit:
       title: ویرایش حساب
@@ -314,14 +340,17 @@ fa:
           شرایط جدید مشارکت‌کننده، موافقت خود را با آن اعلام کنید.
         agreed_with_pd: شما همچنین اعلام کرده‌اید که ویرایش‌هایتان در مالکیت عمومی
           باشد.
-        link: https://www.osmfoundation.org/wiki/License/Contributor_Terms
+        link: https://wiki.osmfoundation.org/wiki/Licence/Contributor_Terms
         link text: این چیست؟
       save changes button: ذخیره‌کردن تغییرات
       make edits public button: همهٔ ویرایش‌های من را عمومی کن
+      delete_account: حذف حساب...
     update:
       success_confirm_needed: اطلاعات کاربر با موفقیت روزآمد شد. برای تأیید نشانی
         ایمیل جدید، یادداشت ارسال‌شده به ایمیل‌تان را بررسی کنید.
       success: اطلاعات کاربر با موفقیت روزآمد شد.
+    destroy:
+      success: حساب حذف شد.
   browse:
     created: ایجاد شد
     closed: بسته شد
@@ -597,7 +626,10 @@ fa:
         title: ‫روزنوشت‌های OpenStreetMap‬
         description: ‫روزنوشت‌های اخیر از کاربران OpenStreetMap‬
     comments:
-      no_comments: فاقد پیام روزانه
+      title: نظراتی که %{user} به روزنوشت‌ها داده است
+      heading: نظرات %{user} به روزنوشت‌ها
+      subheading_html: نظراتی که %{user} به روزنوشت‌ها داده است
+      no_comments: به روزنوشت‌ها نظری نداده است
       post: فرسته
       when: زمان
       comment: نظر
@@ -829,7 +861,7 @@ fa:
           warehouse: انبار
           "yes": ساختمان
         club:
-          sport: کلوپ ورزشی
+          sport: باشگاه ورزشی
           "yes": باشگاه
         craft:
           blacksmith: آهنگر
@@ -2031,7 +2063,7 @@ fa:
           با اجازهٔ صریح و آشکار از صاحبان حق‌نشر.
         infringement_2_html: اگر بر این باورید که دادهٔ مشمول حق‌نشر به‌طور نامناسبی
           به پایگاه‌دادهٔ OpenStreetMap  یا به این وبسایت افزوده شده، لطفاً به <a
-          href="https://www.osmfoundation.org/wiki/License/Takedown_procedure">روندنامهٔ
+          href="https://wiki.osmfoundation.org/wiki/Takedown_procedure">روندنامهٔ
           حذف</a> مراجعه کنید یا دادخواست خود را مستقیماً در <a href="https://dmca.openstreetmap.org/">صفحهٔ
           دادخواهی برخط</a> تسلیم کنید.
         trademarks_title_html: <span id="trademarks"></span>نشان‌های تجاری
@@ -2459,6 +2491,7 @@ fa:
       write_gpx: آپلود ردهای جی‌پی‌اس
       write_notes: اصلاح یادداشت‌ها
       read_email: خواندن نشانی ایمیل کاربر
+      skip_authorization: اپلیکیشن با تأیید خودکار
   oauth_clients:
     new:
       title: ثبت اپلیکیشن تازه
@@ -2578,7 +2611,7 @@ fa:
       read_tou: شرایط استفاده را خوانده‌ام و آن را می‌پذیرم
       consider_pd: علاوه بر موارد بالا، می‌پذیرم که مشارکت‌هایم در مالکیت عمومی باشد.
       consider_pd_why: این چیست؟
-      consider_pd_why_url: https://www.osmfoundation.org/wiki/License/Why_would_I_want_my_contributions_to_be_public_domain
+      consider_pd_why_url: https://wiki.osmfoundation.org/wiki/Licence_and_Legal_FAQ/Why_would_I_want_my_contributions_to_be_public_domain
       guidance_html: 'اطلاعاتی برای کمک به درک شرایط مشارکت‌کننده: <a href="%{summary}">خلاصهٔ
         خوانا برای انسان</a> و <a href="%{translations}">ترجمه‌های غیررسمی</a>'
       continue: ادامه
@@ -2820,7 +2853,7 @@ fa:
       title: یادداشت‌هایی که %{user} ارسال کرده یا روی آن‌ها نظر داده
       heading: یادداشت‌های %{user}
       subheading_html: یادداشت‌هایی که %{user} ارسال کرده یا روی آن‌ها نظر داده
-      no_notes: فاقد یادداشت
+      no_notes: یادداشتی ننوشته است
       id: شناسه
       creator: ایجادکننده
       description: شرح
index 8ff5346b5b2704d4c12f75d6c1c5553f854bdfaa..45b1998251efc22398b13ed8dafe36231606b5d9 100644 (file)
@@ -1757,11 +1757,10 @@ hr:
         da priredi za stvaranje korisničkog računa - pokušati ćemo se pozabaviti s
         ovime u najkraćem vremenu.
       about:
-        header: Slobodna i može ju svatko uređivati
+        header: Slobodna i svatko je može uređivati
         html: |-
-          <p>Za razliku od drugih karata, OpenStreetMap su u potpunosti napravili ljudi kao vi,
-          i slobodno ju svatko može popraviti, osvježiti, skinuti i koristiti.</p>
-          <p>Prijavite se i krenite uređivati. Poslat ćemo vam e-mail kako bi potvrdili vaš račun.</p>
+          <p>Za razliku od drugih karata, OpenStreetMap su u potpunosti napravili ljudi kao Vi. Svatko ih može slobodno popravljati, osvježavati, skidati i upotrebljavati.</p>
+          <p>Prijavite se i krenite uređivati. Poslat ćemo vam e-mail kako biste potvrdili svoj račun.</p>
       email address: 'Email:'
       confirm email address: 'Potvrdi e-mail:'
       display name: 'Korisničko ime:'
index 8b53b395f54e0cb6151ce57a8324f2628ffa4fab..67c1524cb050571a0b6bcf0ea06640e3360e9764 100644 (file)
@@ -12,6 +12,7 @@
 # Author: Cubbe
 # Author: D6283
 # Author: Drhyme
+# Author: Ellif
 # Author: Freebiekr
 # Author: Garam
 # Author: Hym411
@@ -609,6 +610,7 @@ ko:
           hangar: 격납고
           helipad: 헬기 착륙장
           holding_position: 정지 위치
+          navigationaid: 항공 네비게이션 보조
           parking_position: 주차 위치
           runway: 활주로
           taxilane: 유도선
@@ -1736,7 +1738,7 @@ ko:
     about:
       next: 다음
       copyright_html: <span>&copy;</span>OpenStreetMap<br>기여자
-      used_by_html: '%{name}ì\9d\98 ì§\80ë\8f\84 ì\9e\90ë£\8cë\8a\94 ì\88\98ë§\8eì\9d\80 ì\9b¹ì\82¬ì\9d´í\8a¸ì\99\80 ëª¨ë°\94ì\9d¼ ì\95±, í\95\98ë\93\9cì\9b¨ì\96´ ì\9e¥ì¹\98를 ì\9c\84í\95´ ì \9cê³µë\90©ë\8b\88ë\8b¤'
+      used_by_html: '%{name}ì\9d\80 ì\88\98ë§\8eì\9d\80 ì\9b¹ì\82¬ì\9d´í\8a¸ì\99\80 ëª¨ë°\94ì\9d¼ ì\95±, í\95\98ë\93\9cì\9b¨ì\96´ ì\9e¥ì¹\98를 ì\9c\84í\95´ ì§\80ë\8f\84 ì\9e\90ë£\8c를 ì \9cê³µí\95©ë\8b\88ë\8b¤'
       lede_text: OpenStreetMap은 도로나 오솔길, 카페, 기차역 등에 대한 전세계에 있는 자료를 유지하고 기여하는 지도 제작자
         공동체로부터 제작됩니다.
       local_knowledge_title: 지역 지식
@@ -2234,7 +2236,7 @@ ko:
     require_admin:
       not_an_admin: 해당 동작을 수행하려면 관리자 권한이 필요합니다.
     setup_user_auth:
-      blocked_zero_hour: OpenStreetMap 웹 사이트에 긴급 메시지가 있습니다. 편집을 저장하기 전에 이 메시지를 읽어야
+      blocked_zero_hour: OpenStreetMap 웹사이트에 중요 메시지가 있습니다. 편집을 저장하기 전에 이 메시지를 읽어야
         합니다.
       blocked: API에 대한 접근을 차단했습니다. 자세한 내용을 알아보려면 웹 인터페이스에 로그인하세요.
       need_to_see_terms: API에 대한 접근을 일시적으로 중지했습니다. 기여자 약관을 보려면 웹 인터페이스에 로그인하세요. 기여자
index 250dfc0b162ea54e6c4e40e450b9f24c33b9927d..03353dd2f076584b450f80a872424ae2adb4396a 100644 (file)
@@ -1747,7 +1747,7 @@ lb:
       destroy_button: Läschen
     mark:
       as_read: Message als gelies markéiert
-      as_unread: Message als net geliest markéiert
+      as_unread: Message als net gelies markéiert
     destroy:
       destroyed: Message geläscht
   passwords:
index ad5a9efa13c2862e2213d523110de6c31b37fa73..0c16d1b1c8f0f89962db10d703a69c302ce936ba 100644 (file)
@@ -730,7 +730,9 @@ sk:
           food_court: Food court
           fountain: Fontána
           fuel: Benzínová pumpa
+          gambling: Hazardné hry
           grave_yard: Cintorín
+          grit_bin: Nádoba na štrk
           hospital: Nemocnica
           hunting_stand: Poľovnícky posed
           ice_cream: Zmrzlina
@@ -738,12 +740,16 @@ sk:
           kindergarten: Materská škola
           language_school: Jazyková škola
           library: Knižnica
+          loading_dock: Nakladací dok
+          love_hotel: Hotel pre zamilovaných
           marketplace: Tržnica
           monastery: Kláštor
+          music_school: Hudobná škola
           nightclub: Nočný klub
           nursing_home: Sanatórium
           parking: Parkovisko
           parking_entrance: Vjazd na parkovisko
+          parking_space: Parkovacie miesto
           payment_terminal: Platobný terminál
           pharmacy: lekáreň
           place_of_worship: Miesto pre bohoslužby
@@ -752,6 +758,8 @@ sk:
           post_office: Pošta
           prison: Väzenie
           pub: Krčma
+          public_bath: Verejné kúpele
+          public_bookcase: Verejná knihovnička
           public_building: Verejná budova
           recycling: Recyklačné miesto
           restaurant: Reštaurácia
@@ -774,31 +782,39 @@ sk:
           village_hall: Spoločenská miestnosť
           waste_basket: Odpadkový kôš
           waste_disposal: Popolnica
+          "yes": Občianske vybavenie
         boundary:
+          aboriginal_lands: Pôda domorodcov
           administrative: Administratívna hranica
           census: Hranica pre potreby sčítania
           national_park: Národný park
           political: Hranica volebného okrsku
           protected_area: Chránená oblasť
+          "yes": Hranica
         bridge:
           aqueduct: Akvadukt
+          boardwalk: Promenáda
           suspension: Visutý most
           swing: Otočný most
           viaduct: Viadukt
           "yes": Most
         building:
+          apartment: Apartmán
           apartments: Bytový dom
           barn: Stodola
           bungalow: Bungalov
+          cabin: Chatka
           chapel: Kaplnka
           church: Kostol
           civic: Budova občianskej vybavenosti
+          college: Budova vysokej školy
           commercial: Komerčné budovy
           construction: Budova vo výstavbe
           detached: Rodinný dom (samostatne stojaci)
           dormitory: Študentský domov
           duplex: Dvojdom
           farm: Hospodárska budova
+          farm_auxiliary: Hospodárska budova
           garage: Garáž
           garages: Garáže
           greenhouse: Skleník
@@ -806,23 +822,32 @@ sk:
           hospital: Nemocničné budovy
           hotel: Hotel
           house: Dom
+          houseboat: Hausbót
+          hut: Chata
           industrial: Priemyselné budovy
           kindergarten: Materská škola
+          manufacture: Výrobná budova
           office: Administratívna budova
           public: Verejná budova
           residential: Obytné budovy
           retail: Maloobchodné budovy
           roof: Strecha
+          ruins: Zničená budova
           school: Škola
           semidetached_house: Dvojdom
+          service: Technická budova
           shed: Kôlňa
           stable: Stajňa
+          static_caravan: Príves
+          temple: Budova chrámu
           terrace: Radová zástavba
           train_station: Železničná stanica
           university: Univerzitné budovy
           warehouse: Sklad
           "yes": Budova
         club:
+          scout: Skautská základňa
+          sport: Športový klub
           "yes": Klub
         craft:
           beekeeper: Včelár
@@ -835,18 +860,31 @@ sk:
           electrician: Elektrikár
           electronics_repair: Oprava elektroniky
           gardener: Záhradník
+          glaziery: Sklenárstvo
+          handicraft: Remeslo
           painter: Maliar
           photographer: Fotograf
           plumber: Inštalatér
+          roofer: Pokrývač
+          sawmill: Píla
           shoemaker: Obuvník
+          stonemason: Kamenárstvo
           tailor: Krajčír
+          window_construction: Montáž okien
           winery: Vináreň
+          "yes": Remeselná dielňa
+        crossing: Priechod
         emergency:
+          access_point: Prístupový bod
           ambulance_station: Stanica záchrannej služby
           assembly_point: Miesto zhromaždenia
           defibrillator: Defibrilátor
           fire_extinguisher: Hasiaci prístroj
+          fire_water_pond: Požiarna nádrž
+          landing_site: Pristávacia plocha záchranky
+          life_ring: Záchranný kruh
           phone: Núdzový telefón
+          siren: Núdzová siréna
         highway:
           abandoned: Zrušená cesta
           bridleway: Cesta pre kone
@@ -913,12 +951,14 @@ sk:
           monument: Pamätník
           roman_road: Rímska cesta
           ruins: Ruina
+          stone: Balvan
           tomb: Náhrobok
           tower: Veža
           wayside_chapel: Kaplnka pri ceste
           wayside_cross: Božie muky
           wayside_shrine: Malá kaplnka pri ceste
           wreck: Zrúcanina
+          "yes": Historické miesto
         junction:
           "yes": Križovatka
         landuse:
@@ -952,11 +992,17 @@ sk:
           retail: Obchodná zóna
           village_green: Verejná zeleň
           vineyard: Vinica
+          "yes": Využitie krajiny
         leisure:
           adult_gaming_centre: Herňa
+          amusement_arcade: Hrací automat
+          bandstand: Hudobné pódium
           beach_resort: Plážové letovisko
           bird_hide: Vtáčia pozorovateľňa
+          bleachers: Bielidlo
+          bowling_alley: Bowlingová dráha
           common: Verejné priestranstvo
+          dance: Tančiareň
           dog_park: Psí park
           firepit: Ohnisko
           fishing: Rybolov (športový)
@@ -969,10 +1015,13 @@ sk:
           marina: Prístav pre jachty
           miniature_golf: Mini golf
           nature_reserve: Prírodná rezervácia
+          outdoor_seating: Vonkajšie posedenie
           park: Park
+          picnic_table: Piknikový stôl
           pitch: Športové ihrisko
           playground: Detské ihrisko
           recreation_ground: Rekreačná oblasť
+          resort: Letovisko
           sauna: Sauna
           slipway: Lodný sklz
           sports_centre: Športové stredisko
@@ -982,6 +1031,9 @@ sk:
           water_park: Aquapark
           "yes": Voľný čas
         man_made:
+          advertising: Reklama
+          antenna: Anténa
+          avalanche_protection: Protilavínová ochrana
           beacon: Maják
           beehive: Včelí úľ
           breakwater: Vlnolam
@@ -995,14 +1047,26 @@ sk:
           flagpole: Vlajkový stožiar
           gasometer: Plynojem
           lighthouse: Maják
+          manhole: Vchod do kanála
           mast: Stožiar
           mine: Baňa
           mineshaft: Šachta bane
+          monitoring_station: Monitorovacia stanica
           petroleum_well: Ropný vrt
+          pier: Mólo
           pipeline: Vodovod
           silo: Silo
           snow_cannon: Snehové delo
+          snow_fence: Protisnehový plot
+          storage_tank: Skladovacia nádrž
+          street_cabinet: Pouličná skrinka
+          surveillance: Dohľad
+          telescope: Teleskop
           tower: Veža
+          utility_pole: Telefónny stĺp
+          wastewater_plant: Čistička odpadových vôd
+          watermill: Vodný mlyn
+          water_tap: Vodovodný kohútik
           water_tower: Vodojem
           water_well: Studňa
           water_works: Vodáreň
@@ -1013,9 +1077,14 @@ sk:
           airfield: Vojenské letisko
           barracks: Kasárne
           bunker: Bunker
+          checkpoint: Kontrolný bod
+          trench: Brázda
+          "yes": Armáda
         mountain_pass:
           "yes": Priesmyk
         natural:
+          atoll: Atol
+          bare_rock: Holá skala
           bay: Zátoka, záliv
           beach: Pláž
           cape: Mys
@@ -1051,31 +1120,46 @@ sk:
           stone: Balvan
           strait: Úžina
           tree: Strom
+          tree_row: Stromoradie
+          tundra: Tundra
           valley: Dolina
           volcano: Sopka
           water: Voda
           wetland: Mokrina
           wood: Les (neudržiavaný)
+          "yes": Prírodný prvok
         office:
           accountant: Účtovník
+          administrative: Administratíva
+          advertising_agency: Reklamná agentúra
           architect: Architektonický ateliér
+          association: Asociácia
           company: Súkromná firma
+          diplomatic: Diplomatická kancelária
+          educational_institution: Vzdelávacia inštitúcia
           employment_agency: Sprostredkovanie práce
           energy_supplier: Dodávateľ energií
           estate_agent: Realitná kancelária
+          financial: Finančný úrad
           government: Vládny úrad
           insurance: Poisťovňa
+          it: Počítačová kancelária
           lawyer: Právnická kancelária
+          logistics: Kancelária prepravcu
           newspaper: Redakcia novín
           ngo: Mimovládna organizácia
           notary: Notár
+          religion: Kancelária náboženskej organizácie
+          research: Výskumná kancelária
           tax_advisor: Daňový poradca
           telecommunication: Telekomunikácie
           travel_agent: Cestovná kancelária
           "yes": Úrad
         place:
           allotments: Záhradkárska osada
+          archipelago: Súostrovie
           city: Mesto nad 100 tis.
+          city_block: Mestský blok
           country: Štát
           county: Okres
           farm: Farma
@@ -1172,6 +1256,7 @@ sk:
           hearing_aids: Načúvacie prístroje
           hifi: Hi-Fi
           houseware: Domáce potreby
+          ice_cream: Zmrzlina
           jewelry: Zlatníctvo
           kiosk: Novinový stánok
           laundry: Práčovňa
@@ -1181,6 +1266,7 @@ sk:
           mobile_phone: Obchod s mobilnými telefónmi
           motorcycle: Motocyklový obchod
           music: Hudobniny
+          musical_instrument: Hudobné nástroje
           newsagent: Novinový stánok
           nutrition_supplements: Doplnky výživy
           optician: Očná optika
@@ -1267,12 +1353,18 @@ sk:
       more_results: Viac výsledkov
   issues:
     index:
+      title: Problémy
+      reported_user: Nahlásený používateľ
+      not_updated: Neaktualizované
       search: Hľadať
       user_not_found: Používateľ neexistuje
       status: Stav
+      reports: Hlásenia
+      last_updated: Posledná úprava
       last_updated_time_html: <abbr title='%{title}'>%{time}</abbr>
       last_updated_time_user_html: <abbr title='%{title}'>%{time}</abbr> od používateľa
         %{user}
+      link_to_reports: Zobraziť hlásenia
       reported_item: Hlásená položka
       states:
         ignored: Ignorované
@@ -1685,6 +1777,9 @@ sk:
         windowslive:
           title: Prihlásenie sa pomocou Windows Live
           alt: Prihlásenie sa pomocou účtu Windows Live
+        github:
+          title: Prihlásiť sa cez GitHub
+          alt: Prihlásiť sa pomocou účtu na GitHube
         wikipedia:
           title: Prihlásiť sa pomocou Wikipédie
         wordpress:
index 53497b3e91cb8f80c4d16ba0c2e3c851adb7b931..5ad262d1398d6f0df858190b632e92a2d3b560cb 100644 (file)
@@ -52,6 +52,7 @@ tl:
   activerecord:
     errors:
       messages:
+        invalid_email_address: mukhang hindi wasto ang tirahan ng e-liham
         email_address_not_routable: hindi maaaring i-ruta
     models:
       acl: Talaan ng Pantaban sa Pagpunta
@@ -208,6 +209,7 @@ tl:
   account:
     deletions:
       show:
+        retain_email: Pananatilihin ang iyong tirahan ng e-liham.
         confirm_delete: Sigurado ka ba?
         cancel: Huwag ituloy
   accounts:
@@ -293,6 +295,8 @@ tl:
         title_comment: '%{id} ng angkat ng pagbabago - %{comment}'
       join_discussion: Lumagda para sumali sa talakayan
       discussion: Talakayan
+      still_open: Bukas pa rin ang pangkat ng pagbabago - magbubukas ang talakayan
+        pag naisara na ang pangkat ng pagbabago.
     relation:
       members: Mga kasapi
     relation_member:
@@ -399,6 +403,8 @@ tl:
   changeset_comments:
     comment:
       comment: 'Bagong puna sa pangkat ng pagbabago #%{changeset_id} ni %{author}'
+    index:
+      title_all: Pagtalakay ng pangkat ng pagbabago sa OpenStreetMap
   dashboards:
     contact:
       km away: '%{count}km ang layo'
@@ -568,6 +574,7 @@ tl:
           hunting_stand: Pook-tayuan na Pangpangangaso
           ice_cream: Sorbetes
           kindergarten: Kindergarten
+          language_school: Paaralang Pangwika
           library: Aklatan
           marketplace: Palengke
           monastery: Monasteryo
@@ -1017,6 +1024,7 @@ tl:
   issues:
     index:
       title: Mga isyu
+      not_updated: Hindi Naisapanahon
       search: Maghanap
       search_guidance: 'Maghanap ng mga Isyu:'
       reports: Mga ulat
@@ -1322,6 +1330,8 @@ tl:
       flash changed: Napalitan na ang hudyat mo.
       flash token bad: Hindi natagpuan ang ganyang kahalip, suriin kaya ang URL?
   preferences:
+    show:
+      preferred_languages: Nais na mga Wika
     edit:
       cancel: Huwag ituloy
   profiles:
@@ -2257,6 +2267,7 @@ tl:
       directions_from: Mga direksyon mula rito
       directions_to: Mga direksyon papunta rito
       add_note: Magdagdag ng tala dito
+      show_address: Ipakita ang tirahan
       centre_map: Igitna ang mapa dito
   redactions:
     edit:
index ce7c08a659d8b63269b7d8fb353d486e1eb6f15a..26500babdcb24f47b727c3be384ecc084a668db8 100644 (file)
@@ -9,14 +9,26 @@ module Api
         { :path => "/api/0.6/changeset/1/comment", :method => :post },
         { :controller => "api/changeset_comments", :action => "create", :id => "1" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changeset/1/comment.json", :method => :post },
+        { :controller => "api/changeset_comments", :action => "create", :id => "1", :format => "json" }
+      )
       assert_routing(
         { :path => "/api/0.6/changeset/comment/1/hide", :method => :post },
         { :controller => "api/changeset_comments", :action => "destroy", :id => "1" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changeset/comment/1/hide.json", :method => :post },
+        { :controller => "api/changeset_comments", :action => "destroy", :id => "1", :format => "json" }
+      )
       assert_routing(
         { :path => "/api/0.6/changeset/comment/1/unhide", :method => :post },
         { :controller => "api/changeset_comments", :action => "restore", :id => "1" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changeset/comment/1/unhide.json", :method => :post },
+        { :controller => "api/changeset_comments", :action => "restore", :id => "1", :format => "json" }
+      )
     end
 
     ##
index 3b4eef25a35fd71e5abe4ef548cb1523ffbfa51e..af5cabbaaa771b4ea9baa3500b22c242cba14fa4 100644 (file)
@@ -21,14 +21,26 @@ module Api
         { :path => "/api/0.6/changeset/1", :method => :get },
         { :controller => "api/changesets", :action => "show", :id => "1" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changeset/1.json", :method => :get },
+        { :controller => "api/changesets", :action => "show", :id => "1", :format => "json" }
+      )
       assert_routing(
         { :path => "/api/0.6/changeset/1/subscribe", :method => :post },
         { :controller => "api/changesets", :action => "subscribe", :id => "1" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changeset/1/subscribe.json", :method => :post },
+        { :controller => "api/changesets", :action => "subscribe", :id => "1", :format => "json" }
+      )
       assert_routing(
         { :path => "/api/0.6/changeset/1/unsubscribe", :method => :post },
         { :controller => "api/changesets", :action => "unsubscribe", :id => "1" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changeset/1/unsubscribe.json", :method => :post },
+        { :controller => "api/changesets", :action => "unsubscribe", :id => "1", :format => "json" }
+      )
       assert_routing(
         { :path => "/api/0.6/changeset/1", :method => :put },
         { :controller => "api/changesets", :action => "update", :id => "1" }
@@ -41,6 +53,10 @@ module Api
         { :path => "/api/0.6/changesets", :method => :get },
         { :controller => "api/changesets", :action => "query" }
       )
+      assert_routing(
+        { :path => "/api/0.6/changesets.json", :method => :get },
+        { :controller => "api/changesets", :action => "query", :format => "json" }
+      )
     end
 
     # -----------------------
@@ -168,6 +184,99 @@ module Api
       assert_select "osm>changeset>discussion>comment", 3
     end
 
+    def test_show_json
+      changeset = create(:changeset)
+
+      get changeset_show_path(changeset), :params => { :format => "json" }
+      assert_response :success, "cannot get first changeset"
+
+      js = ActiveSupport::JSON.decode(@response.body)
+      assert_not_nil js
+
+      assert_equal Settings.api_version, js["version"]
+      assert_equal "OpenStreetMap server", js["generator"]
+      assert_equal changeset.id, js["changeset"]["id"]
+      assert js["changeset"]["open"]
+      assert_equal changeset.created_at.xmlschema, js["changeset"]["created_at"]
+      assert_nil js["changeset"]["closed_at"]
+      assert_nil js["changeset"]["tags"]
+      assert_nil js["changeset"]["comments"]
+      assert_equal changeset.user.id, js["changeset"]["uid"]
+      assert_equal changeset.user.display_name, js["changeset"]["user"]
+
+      get changeset_show_path(changeset), :params => { :format => "json", :include_discussion => true }
+      assert_response :success, "cannot get first changeset with comments"
+
+      js = ActiveSupport::JSON.decode(@response.body)
+      assert_not_nil js
+      assert_equal Settings.api_version, js["version"]
+      assert_equal "OpenStreetMap server", js["generator"]
+      assert_equal changeset.id, js["changeset"]["id"]
+      assert js["changeset"]["open"]
+      assert_equal changeset.created_at.xmlschema, js["changeset"]["created_at"]
+      assert_nil js["changeset"]["closed_at"]
+      assert_nil js["changeset"]["tags"]
+      assert_nil js["changeset"]["min_lat"]
+      assert_nil js["changeset"]["min_lon"]
+      assert_nil js["changeset"]["max_lat"]
+      assert_nil js["changeset"]["max_lon"]
+      assert_equal 0, js["changeset"]["comments"].count
+    end
+
+    def test_show_tag_and_discussion_json
+      changeset = create(:changeset, :closed)
+
+      tag1 = ChangesetTag.new
+      tag1.changeset_id = changeset.id
+      tag1.k = "created_by"
+      tag1.v = "JOSM/1.5 (18364)"
+
+      tag2 = ChangesetTag.new
+      tag2.changeset_id = changeset.id
+      tag2.k = "comment"
+      tag2.v = "changeset comment"
+
+      changeset.changeset_tags = [tag1, tag2]
+
+      create_list(:changeset_comment, 3, :changeset_id => changeset.id)
+
+      get changeset_show_path(changeset), :params => { :format => "json", :include_discussion => true }
+      assert_response :success, "cannot get closed changeset with comments"
+
+      js = ActiveSupport::JSON.decode(@response.body)
+
+      assert_not_nil js
+      assert_equal Settings.api_version, js["version"]
+      assert_equal "OpenStreetMap server", js["generator"]
+      assert_equal changeset.id, js["changeset"]["id"]
+      assert_not js["changeset"]["open"]
+      assert_equal changeset.created_at.xmlschema, js["changeset"]["created_at"]
+      assert_equal changeset.closed_at.xmlschema, js["changeset"]["closed_at"]
+      assert_equal 2, js["changeset"]["tags"].count
+      assert_equal 3, js["changeset"]["comments"].count
+      assert_equal 3, js["changeset"]["comments_count"]
+      assert_equal 0, js["changeset"]["changes_count"]
+      assert_not_nil js["changeset"]["comments"][0]["uid"]
+      assert_not_nil js["changeset"]["comments"][0]["user"]
+      assert_not_nil js["changeset"]["comments"][0]["text"]
+    end
+
+    def test_show_bbox_json
+      # test bbox attribute
+      changeset = create(:changeset, :min_lat => (-5 * GeoRecord::SCALE).round, :min_lon => (5 * GeoRecord::SCALE).round,
+                                     :max_lat => (15 * GeoRecord::SCALE).round, :max_lon => (12 * GeoRecord::SCALE).round)
+
+      get changeset_show_path(changeset), :params => { :format => "json" }
+      assert_response :success, "cannot get first changeset"
+
+      js = ActiveSupport::JSON.decode(@response.body)
+      assert_not_nil js
+      assert_equal(-5, js["changeset"]["min_lat"])
+      assert_equal  5, js["changeset"]["min_lon"]
+      assert_equal 15, js["changeset"]["max_lat"]
+      assert_equal 12, js["changeset"]["max_lon"]
+    end
+
     ##
     # check that a changeset that doesn't exist returns an appropriate message
     def test_show_not_found
@@ -1542,6 +1651,17 @@ module Api
       assert_response :success, "can't get changesets by user name"
       assert_changesets [private_user_changeset, private_user_closed_changeset]
 
+      # test json endpoint
+      get changesets_path(:display_name => private_user.display_name), :headers => auth_header, :params => { :format => "json" }
+      assert_response :success, "can't get changesets by user name"
+
+      js = ActiveSupport::JSON.decode(@response.body)
+      assert_not_nil js
+
+      assert_equal Settings.api_version, js["version"]
+      assert_equal "OpenStreetMap server", js["generator"]
+      assert_equal 2, js["changesets"].count
+
       # check that the correct error is given when we provide both UID and name
       get changesets_path(:user => private_user.id,
                           :display_name => private_user.display_name), :headers => auth_header
index f9e4f6f74d7c58bd7b4c6c7a4c65548dcb06026f..07b5b6d7ec488893dd4156db71e43958a0911716 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -189,9 +189,9 @@ eslint-visitor-keys@^3.3.0:
   integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==
 
 eslint@^8.0.0:
-  version "8.12.0"
-  resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.12.0.tgz#c7a5bd1cfa09079aae64c9076c07eada66a46e8e"
-  integrity sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==
+  version "8.13.0"
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.13.0.tgz#6fcea43b6811e655410f5626cfcf328016badcd7"
+  integrity sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ==
   dependencies:
     "@eslint/eslintrc" "^1.2.1"
     "@humanwhocodes/config-array" "^0.9.2"