From: Andy Allan Date: Wed, 29 Nov 2017 12:18:39 +0000 (+0000) Subject: Merge branch 'master' into moderation X-Git-Tag: live~3064^2~91 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/effb1b7f4170bb7244c4dfffcbe6134fe00e2bc4?hp=-c Merge branch 'master' into moderation --- effb1b7f4170bb7244c4dfffcbe6134fe00e2bc4 diff --combined Gemfile index 92e0def8f,79d95f9d5..43f39340a --- a/Gemfile +++ b/Gemfile @@@ -1,7 -1,7 +1,7 @@@ source "https://rubygems.org" # Require rails - gem "rails", "5.0.5" + gem "rails", "5.1.4" # Require things which have moved to gems in ruby 1.9 gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19 @@@ -32,7 -32,7 +32,7 @@@ gem "jquery-rails gem "jsonify-rails" # Use R2 for RTL conversion - gem "r2" + gem "r2", "~> 0.2.7" # Use autoprefixer to generate CSS prefixes gem "autoprefixer-rails" @@@ -42,12 -42,12 +42,12 @@@ gem "image_optim_rails # Load rails plugins gem "actionpack-page_caching" - gem "composite_primary_keys", "~> 9.0.7" - gem "deadlock_retry", ">= 1.2.0" + gem "composite_primary_keys", "~> 10.0.0" gem "dynamic_form" gem "http_accept_language", "~> 2.0.0" gem "i18n-js", ">= 3.0.0" gem "oauth-plugin", ">= 0.5.1" + gem "openstreetmap-deadlock_retry", ">= 1.3.0", :require => "deadlock_retry" gem "paperclip", "~> 4.0" gem "rack-cors" gem "rails-i18n", "~> 4.0.0" @@@ -70,9 -70,6 +70,9 @@@ gem "omniauth-windowslive # Markdown formatting support gem "redcarpet" +# For status transitions of Issues +gem "aasm" + # Load libxml support for XML parsing and generation gem "libxml-ruby", ">= 2.0.5", :require => "libxml" @@@ -107,6 -104,7 +107,7 @@@ gem "logstasher # Gems useful for development group :development do + gem "annotate" gem "listen" gem "vendorer" end @@@ -114,7 -112,6 +115,7 @@@ # Gems needed for running tests group :test do gem "minitest", "~> 5.1", :platforms => [:ruby_19, :ruby_20] + gem "minitest-rails-capybara" gem "rails-controller-testing" gem "rubocop" gem "webmock" @@@ -122,9 -119,10 +123,10 @@@ en # Needed in development as well so rake can see konacha tasks group :development, :test do + gem "capybara", "~> 2.13" gem "coveralls", :require => false - gem "factory_girl_rails" + gem "factory_bot_rails" gem "jshint" - # gem "konacha" gem "poltergeist" + gem "puma", "~> 3.7" end diff --combined Gemfile.lock index ce2b4f114,b65ec4ed9..d67d34d47 --- a/Gemfile.lock +++ b/Gemfile.lock @@@ -2,59 -2,61 +2,62 @@@ GE remote: https://rubygems.org/ specs: SystemTimer (1.2.3) + aasm (4.1.0) - actioncable (5.0.5) - actionpack (= 5.0.5) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.4) + actionpack (= 5.1.4) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.5) - actionpack (= 5.0.5) - actionview (= 5.0.5) - activejob (= 5.0.5) + actionmailer (5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.5) - actionview (= 5.0.5) - activesupport (= 5.0.5) + actionpack (5.1.4) + actionview (= 5.1.4) + activesupport (= 5.1.4) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionpack-page_caching (1.1.0) actionpack (>= 4.0.0, < 6) - actionview (5.0.5) - activesupport (= 5.0.5) + actionview (5.1.4) + activesupport (= 5.1.4) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.5) - activesupport (= 5.0.5) + activejob (5.1.4) + activesupport (= 5.1.4) globalid (>= 0.3.6) - activemodel (5.0.5) - activesupport (= 5.0.5) - activerecord (5.0.5) - activemodel (= 5.0.5) - activesupport (= 5.0.5) - arel (~> 7.0) - activesupport (5.0.5) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) + arel (~> 8.0) + activesupport (5.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) - arel (7.1.4) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + annotate (2.7.2) + activerecord (>= 3.2, < 6.0) + rake (>= 10.4, < 13.0) + arel (8.0.0) ast (2.3.0) - autoprefixer-rails (7.1.2.3) + autoprefixer-rails (7.1.6) execjs bigdecimal (1.1.0) builder (3.2.3) canonical-rails (0.2.1) rails (>= 4.1, < 5.2) - capybara (2.14.4) + capybara (2.15.4) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) @@@ -70,8 -72,8 +73,8 @@@ coffee-script-source execjs coffee-script-source (1.12.2) - composite_primary_keys (9.0.7) - activerecord (~> 5.0.0) + composite_primary_keys (10.0.1) + activerecord (~> 5.1.0) concurrent-ruby (1.0.5) coveralls (0.8.21) json (>= 1.8, < 3) @@@ -83,30 -85,30 +86,30 @@@ safe_yaml (~> 1.0.0) crass (1.0.2) dalli (2.7.6) - deadlock_retry (1.2.0) docile (1.1.5) dynamic_form (1.1.4) - erubis (2.7.0) + erubi (1.7.0) execjs (2.7.0) - exifr (1.3.1) - factory_girl (4.8.0) + exifr (1.3.2) + factory_bot (4.8.2) activesupport (>= 3.0.0) - factory_girl_rails (4.8.0) - factory_girl (~> 4.8.0) + factory_bot_rails (4.8.2) + factory_bot (~> 4.8.2) railties (>= 3.0.0) faraday (0.12.2) multipart-post (>= 1.2, < 3) ffi (1.9.18) fspath (3.1.0) geoip (1.6.3) - globalid (0.4.0) + globalid (0.4.1) activesupport (>= 4.2.0) - hashdiff (0.3.4) + hashdiff (0.3.7) hashie (3.5.6) htmlentities (4.3.4) http_accept_language (2.0.5) - i18n (0.8.6) - i18n-js (3.0.0) + i18n (0.9.0) + concurrent-ruby (~> 1.0) + i18n-js (3.0.2) i18n (~> 0.6, >= 0.6.6) image_optim (0.25.0) exifr (~> 1.2, >= 1.2.2) @@@ -143,41 -145,29 +146,43 @@@ rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) logstash-event (1.2.02) - logstasher (1.2.1) + logstasher (1.2.2) activesupport (>= 4.0) logstash-event (~> 1.2.0) request_store - loofah (2.0.3) + loofah (2.1.1) + crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.6.6) mime-types (>= 1.16, < 4) - method_source (0.8.2) + method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mimemagic (0.3.0) - mini_portile2 (2.2.0) + mini_mime (0.1.4) + mini_portile2 (2.3.0) minitest (5.10.3) + minitest-capybara (0.8.2) + capybara (~> 2.2) + minitest (~> 5.0) + rake + minitest-metadata (0.6.0) + minitest (>= 4.7, < 6.0) + minitest-rails (3.0.0) + minitest (~> 5.8) + railties (~> 5.0) + minitest-rails-capybara (3.0.1) + capybara (~> 2.7) + minitest-capybara (~> 0.8) + minitest-metadata (~> 0.6) + minitest-rails (~> 3.0) - multi_json (1.12.1) + multi_json (1.12.2) multi_xml (0.6.0) multipart-post (2.0.0) nio4r (2.1.0) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) + nokogiri (1.8.1) + mini_portile2 (~> 2.3.0) nokogumbo (1.4.13) nokogiri oauth (0.4.7) @@@ -192,7 -182,7 +197,7 @@@ multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (1.6.1) + omniauth (1.7.1) hashie (>= 3.4.6, < 3.6.0) rack (>= 1.6.2, < 3) omniauth-facebook (4.0.0) @@@ -220,6 -210,7 +225,7 @@@ omniauth-windowslive (0.0.12) multi_json (~> 1.12) omniauth-oauth2 (~> 1.4) + openstreetmap-deadlock_retry (1.3.0) paperclip (4.3.7) activemodel (>= 3.2.0) activesupport (>= 3.2.0) @@@ -230,34 -221,35 +236,35 @@@ parser (2.4.0.0) ast (~> 2.2) pg (0.21.0) - poltergeist (1.15.0) + poltergeist (1.16.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) - progress (3.3.1) + progress (3.4.0) psych (2.2.4) - public_suffix (2.0.5) + public_suffix (3.0.0) + puma (3.10.0) r2 (0.2.7) rack (2.0.3) - rack-cors (1.0.1) + rack-cors (1.0.2) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-test (0.6.3) - rack (>= 1.0) + rack-test (0.7.0) + rack (>= 1.0, < 3) rack-uri_sanitizer (0.0.2) - rails (5.0.5) - actioncable (= 5.0.5) - actionmailer (= 5.0.5) - actionpack (= 5.0.5) - actionview (= 5.0.5) - activejob (= 5.0.5) - activemodel (= 5.0.5) - activerecord (= 5.0.5) - activesupport (= 5.0.5) + rails (5.1.4) + actioncable (= 5.1.4) + actionmailer (= 5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + activemodel (= 5.1.4) + activerecord (= 5.1.4) + activesupport (= 5.1.4) bundler (>= 1.3.0) - railties (= 5.0.5) + railties (= 5.1.4) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@@ -271,15 -263,15 +278,15 @@@ rails-i18n (4.0.2) i18n (~> 0.6) rails (>= 4.0) - railties (5.0.5) - actionpack (= 5.0.5) - activesupport (= 5.0.5) + railties (5.1.4) + actionpack (= 5.1.4) + activesupport (= 5.1.4) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake - rake (12.0.0) + rake (12.2.1) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) @@@ -288,24 -280,24 +295,24 @@@ redcarpet (3.4.0) ref (2.0.0) request_store (1.3.2) - rinku (2.0.2) + rinku (2.0.3) rotp (3.3.0) - rubocop (0.49.1) + rubocop (0.51.0) parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-openid (2.7.0) - ruby-progressbar (1.8.1) + ruby-progressbar (1.9.0) ruby_dep (1.5.0) safe_yaml (1.0.4) sanitize (4.5.0) crass (~> 1.0.2) nokogiri (>= 1.4.4) nokogumbo (~> 1.4.1) - sass (3.5.1) + sass (3.5.3) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@@ -316,17 -308,17 +323,17 @@@ sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - secure_headers (3.6.7) - useragent + secure_headers (5.0.1) + useragent (>= 0.15.0) simplecov (0.14.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.1) + simplecov-html (0.10.2) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.0) + sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) @@@ -339,7 -331,7 +346,7 @@@ thread_safe (0.3.6) tilt (2.0.8) tins (1.15.0) - tzinfo (1.2.3) + tzinfo (1.2.4) thread_safe (~> 0.1) uglifier (3.2.0) execjs (>= 0.3.0, < 3) @@@ -348,7 -340,7 +355,7 @@@ validates_email_format_of (1.6.3) i18n vendorer (0.1.16) - webmock (3.0.1) + webmock (3.1.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff @@@ -363,18 -355,18 +370,19 @@@ PLATFORM DEPENDENCIES SystemTimer (>= 1.1.3) + aasm actionpack-page_caching + annotate autoprefixer-rails bigdecimal (~> 1.1.0) canonical-rails + capybara (~> 2.13) coffee-rails (~> 4.2) - composite_primary_keys (~> 9.0.7) + composite_primary_keys (~> 10.0.0) coveralls dalli - deadlock_retry (>= 1.2.0) dynamic_form - factory_girl_rails + factory_bot_rails faraday geoip htmlentities @@@ -390,7 -382,6 +398,7 @@@ listen logstasher minitest (~> 5.1) + minitest-rails-capybara oauth-plugin (>= 0.5.1) omniauth omniauth-facebook @@@ -399,14 -390,16 +407,16 @@@ omniauth-mediawiki (>= 0.0.3) omniauth-openid omniauth-windowslive + openstreetmap-deadlock_retry (>= 1.3.0) paperclip (~> 4.0) pg poltergeist psych - r2 + puma (~> 3.7) + r2 (~> 0.2.7) rack-cors rack-uri_sanitizer - rails (= 5.0.5) + rails (= 5.1.4) rails-controller-testing rails-i18n (~> 4.0.0) record_tag_helper @@@ -423,4 -416,4 +433,4 @@@ webmock BUNDLED WITH - 1.13.7 + 1.15.4 diff --combined app/assets/stylesheets/common.scss index 6755b7e56,6b99662a4..4e89c04c9 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@@ -1664,6 -1664,10 +1664,10 @@@ tr.turn:hover display: inline; } + .pagination { + padding-top: $lineheight; + } + /* Rules for the diary entry page */ .diary_entry { @@@ -2776,12 -2780,30 +2780,30 @@@ input.richtext_title[type="text"] vertical-align: middle; background: 40px 40px image-url('about/sprite.png') no-repeat; - &.local { background-position: 0px 0px; } - &.community { background-position: 0px -40px; } - &.open { background-position: 0px -80px; } - &.partners { background-position: 0px -120px; } - &.infringement { background-position: 0px -160px; } - &.legal { background-position: -45px -160px; } + &.local { + /* no-r2 */ + background-position: 0px 0px; + } + &.community { + /* no-r2 */ + background-position: 0px -40px; + } + &.open { + /* no-r2 */ + background-position: 0px -80px; + } + &.partners { + /* no-r2 */ + background-position: 0px -120px; + } + &.infringement { + /* no-r2 */ + background-position: 0px -160px; + } + &.legal { + /* no-r2 */ + background-position: -45px -160px; + } } } @@@ -2792,48 -2814,3 +2814,48 @@@ display: none; } } + +.read-reports { + background: #eee; + opacity: 0.7; +} + +.report-related-block { + display:inline-block; +} + +.report-block { + width:475px; + float:left; + margin-right:100px; +} + +.related-block{ + width:280px; + float:right; +} + +.issue-comments { + width:475px; +} + +.new-report-checkbox{ + float:left; + margin-left:10px; + margin-top:3px; +} + +.new-report-string { + font-size:15px; +} + +.report-button { + float:right; +} + +.disclaimer { + width: 600px; + background: #fff1f0; + color: #d85030; + border-color: rgba(216, 80, 48, 0.3); +} diff --combined app/controllers/diary_entry_controller.rb index 1b57fa59b,9e0fd4991..88febbe2f --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@@ -8,6 -8,7 +8,7 @@@ class DiaryEntryController < Applicatio before_action :check_database_readable before_action :check_database_writable, :only => [:new, :edit, :comment, :hide, :hidecomment, :subscribe, :unsubscribe] before_action :require_administrator, :only => [:hide, :hidecomment] + before_action :allow_thirdparty_images, :only => [:new, :edit, :list, :view, :comments] def new @title = t "diary_entry.new.title" @@@ -185,9 -186,6 +186,9 @@@ @entry = @this_user.diary_entries.visible.where(:id => params[:id]).first if @entry @title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title + if params[:comment_id] + @reported_comment = DiaryComment.where(:id => params[:comment_id]) + end else @title = t "diary_entry.no_such_entry.title", :id => params[:id] render :action => "no_such_entry", :status => :not_found diff --combined app/models/user.rb index 63c9527c7,7a8414ec0..678bbad9d --- a/app/models/user.rb +++ b/app/models/user.rb @@@ -1,3 -1,48 +1,48 @@@ + # == Schema Information + # + # Table name: users + # + # email :string not null + # id :integer not null, primary key + # pass_crypt :string not null + # creation_time :datetime not null + # display_name :string default(""), not null + # data_public :boolean default(FALSE), not null + # description :text default(""), not null + # home_lat :float + # home_lon :float + # home_zoom :integer default(3) + # nearby :integer default(50) + # pass_salt :string + # image_file_name :text + # email_valid :boolean default(FALSE), not null + # new_email :string + # creation_ip :string + # languages :string + # status :enum default("pending"), not null + # terms_agreed :datetime + # consider_pd :boolean default(FALSE), not null + # auth_uid :string + # preferred_editor :string + # terms_seen :boolean default(FALSE), not null + # description_format :enum default("markdown"), not null + # image_fingerprint :string + # changesets_count :integer default(0), not null + # traces_count :integer default(0), not null + # diary_entries_count :integer default(0), not null + # image_use_gravatar :boolean default(FALSE), not null + # image_content_type :string + # auth_provider :string + # + # 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)) + # + class User < ActiveRecord::Base require "xml/libxml" @@@ -28,12 -73,6 +73,12 @@@ has_many :roles, :class_name => "UserRole" + has_many :issues, :class_name => "Issue", :foreign_key => :reported_user_id + has_one :issue, :class_name => "Issue", :foreign_key => :updated_by + has_many :issue_comments + + has_many :reports + scope :visible, -> { where(:status => %w[pending active confirmed]) } scope :active, -> { where(:status => %w[active confirmed]) } scope :identifiable, -> { where(:data_public => true) } diff --combined config/locales/en-GB.yml index c5b2630cf,07f8eaeec..e6ebbb6a8 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@@ -150,7 -150,6 +150,7 @@@ en-GB title_comment: Changeset %{id} - %{comment} join_discussion: Log in to join the discussion discussion: Discussion + report: Report this changeset? node: title: 'Node: %{name}' history_title: 'Node History: %{name}' @@@ -232,7 -231,6 +232,7 @@@ reopened_by_anonymous: Reactivated by anonymous %{when} ago hidden_by: Hidden by %{user} %{when} ago + report: Report this note? query: title: Query Features introduction: Click on the map to find nearby features. @@@ -324,12 -322,10 +324,12 @@@ edit_link: Edit this entry hide_link: Hide this entry confirm: Confirm + report: Report this entry? diary_comment: comment_from: Comment from %{link_user} on %{comment_created_at} hide_link: Hide this comment confirm: Confirm + report: Report this comment? location: location: 'Location:' view: View @@@ -403,7 -399,6 +403,6 @@@ search: title: latlon: Results from Internal - us_postcode: Results from Geocoder.us uk_postcode: Results from NPEMap / FreeThe Postcode ca_postcode: Results from Geocoder.CA @@@ -944,118 -939,6 +943,118 @@@ results: no_results: No results found more_results: More results + issues: + report: Report + resolve: Resolve + ignore: Ignore + reopen: Reopen + index: + search: + user_not_found: User does not exist + issues_not_found: No such issues found + create: + successful_report: Your report has been registered sucessfully + provide_details: Please provide the required details + update: + new_report: Your report been registered sucessfully + successful_update: Your report has been updated successfully + provide_details: Please provide the required details + new: + details: Please provide some more details into the problem. (This field cannot be left blank!) + select: Select a reason for your report + disclaimer: + placeholder: Before sending in a report for official action, be sure that + placeholder1: You are sure that the problem is not just a mistake + placeholder2: You are unable to fix the problem yourself + placeholder3: You have tried to resolve the problem with the user + show: + comments: + reassign: The Issue was reassigned + reassign_param: Reassign Issue? + comment: + provide_details: Please provide the required details + comment_created: Your comment was successfully created + resolved: Issue status has been set to 'Resolved' + ignored: Issue status has been set to 'Ignored' + reopened: Issue status has been set to 'Open' + report_strings: + DiaryEntry: + spam: + type: "[SPAM]" + details: This Diary Entry is/contains spam + offensive: + type: "[OFFENSIVE]" + details: This Diary Entry is obscene/offensive + threat: + type: "[THREAT]" + details: This Diary Entry contains a threat + other: + type: "[OTHER]" + details: Other + DiaryComment: + spam: + type: "[SPAM]" + details: This Diary Comment is/contains spam + offensive: + type: "[OFFENSIVE]" + details: This Diary Comment is obscene/offensive + threat: + type: "[THREAT]" + details: This Diary Comment contains a threat + other: + type: "[OTHER]" + details: Other + User: + spam: + type: "[SPAM]" + details: This User profile is/contains spam + offensive: + type: "[OFFENSIVE]" + details: This User profile is obscene/offensive + threat: + type: "[THREAT]" + details: This User profile contains a threat + vandal: + type: "[VANDAL]" + details: This User is a vandal + other: + type: "[OTHER]" + details: Other + Changeset: + undiscussed_import: + type: "[UNDISCUSSED-IMPORT]" + details: This changeset is an undiscussed import + mechanical_edit: + type: "[MECH-EDIT]" + details: This changeset is a mechanical edit + edit_error: + type: "[EDIT-ERROR]" + details: This changeset contains a newbie or an editor error + spam: + type: "[SPAM]" + details: This changeset is/contains spam + vandalism: + type: "[VANDALISM]" + details: This changeset is/contains vandalism + other: + type: "[OTHER]" + details: Other + Note: + spam: + type: "[SPAM]" + details: This note is spam + vandalism: + type: "[VANDALISM]" + details: This note is vandalism + personal: + type: "[PERSONAL]" + details: This note contains personal data + abusive: + type: "[ABUSIVE]" + details: This note is abusive + other: + type: "[OTHER]" + details: Other layouts: project_name: title: OpenStreetMap @@@ -1072,7 -955,6 +1071,7 @@@ edit: Edit history: History export: Export + reports: Reports data: Data export_data: Export Data gps_traces: GPS Traces @@@ -1478,11 -1360,6 +1477,11 @@@ details: More details about the changeset can be found at %{url}. unsubscribe: To unsubscribe from updates to this changeset, visit %{url} and click "Unsubscribe". + new_issue_notification: + subject: "[OpenStreetMap] New Issue" + greeting: "Hi," + new_issue: "A new issue has been created" + url: You can view the issue here message: inbox: title: Inbox @@@ -1545,6 -1422,7 +1544,7 @@@ date: Date reply_button: Reply unread_button: Mark as unread + delete_button: Delete back: Back to: To wrong_user: You are logged in as `%{user}' but the message you have asked to @@@ -1811,8 -1689,6 +1811,8 @@@ require_cookies: cookies_needed: You appear to have cookies disabled - please enable cookies in your browser before continuing. + require_admin: + not_an_admin: You need to be an admin to perform that action. require_moderator: not_a_moderator: You need to be a moderator to perform that action. setup_user_auth: @@@ -2116,7 -1992,6 +2116,7 @@@ friends_diaries: friends' diary entries nearby_changesets: nearby user changesets nearby_diaries: nearby user diary entries + report: Report this user? popup: your location: Your location nearby mapper: Nearby mapper @@@ -2508,6 -2383,7 +2508,7 @@@ ascend: Ascend engines: graphhopper_bicycle: Bicycle (GraphHopper) + graphhopper_car: Car (GraphHopper) graphhopper_foot: Foot (GraphHopper) mapquest_bicycle: Bicycle (MapQuest) mapquest_car: Car (MapQuest) diff --combined config/locales/en.yml index ac66ba0f5,062fd95d4..7393d6efd --- a/config/locales/en.yml +++ b/config/locales/en.yml @@@ -131,7 -131,6 +131,7 @@@ en title_comment: "Changeset %{id} - %{comment}" join_discussion: "Log in to join the discussion" discussion: Discussion + report: Report this changeset? node: title: "Node: %{name}" history_title: "Node History: %{name}" @@@ -207,7 -206,6 +207,7 @@@ reopened_by: "Reactivated by %{user} %{when} ago" reopened_by_anonymous: "Reactivated by anonymous %{when} ago" hidden_by: "Hidden by %{user} %{when} ago" + report: Report this note? query: title: "Query Features" introduction: "Click on the map to find nearby features." @@@ -298,12 -296,10 +298,12 @@@ edit_link: Edit this entry hide_link: Hide this entry confirm: Confirm + report: Report this entry? diary_comment: comment_from: "Comment from %{link_user} on %{comment_created_at}" hide_link: Hide this comment confirm: Confirm + report: Report this comment? location: location: "Location:" view: "View" @@@ -371,7 -367,6 +371,6 @@@ search: title: latlon: 'Results from Internal' - us_postcode: 'Results from Geocoder.us' uk_postcode: 'Results from NPEMap / FreeThe Postcode' ca_postcode: 'Results from Geocoder.CA' osm_nominatim: 'Results from OpenStreetMap Nominatim' @@@ -908,118 -903,6 +907,118 @@@ results: no_results: "No results found" more_results: "More results" + issues: + report: Report + resolve: Resolve + ignore: Ignore + reopen: Reopen + index: + search: + user_not_found: User does not exist + issues_not_found: No such issues found + create: + successful_report: Your report has been registered sucessfully + provide_details: Please provide the required details + update: + new_report: Your report been registered sucessfully + successful_update: Your report has been updated successfully + provide_details: Please provide the required details + new: + details: Please provide some more details into the problem. (This field cannot be left blank!) + select: Select a reason for your report + disclaimer: + intro: Before sending in a report for official action, be sure that + not_just_mistake: You are sure that the problem is not just a mistake + unable_to_fix: You are unable to fix the problem yourself + resolve_with_user: You have tried to resolve the problem with the user + show: + comments: + reassign: The Issue was reassigned + reassign_param: Reassign Issue? + comment: + provide_details: Please provide the required details + comment_created: Your comment was successfully created + resolved: Issue status has been set to 'Resolved' + ignored: Issue status has been set to 'Ignored' + reopened: Issue status has been set to 'Open' + report_strings: + DiaryEntry: + spam: + type: "[SPAM]" + details: This Diary Entry is/contains spam + offensive: + type: "[OFFENSIVE]" + details: This Diary Entry is obscene/offensive + threat: + type: "[THREAT]" + details: This Diary Entry contains a threat + other: + type: "[OTHER]" + details: Other + DiaryComment: + spam: + type: "[SPAM]" + details: This Diary Comment is/contains spam + offensive: + type: "[OFFENSIVE]" + details: This Diary Comment is obscene/offensive + threat: + type: "[THREAT]" + details: This Diary Comment contains a threat + other: + type: "[OTHER]" + details: Other + User: + spam: + type: "[SPAM]" + details: This User profile is/contains spam + offensive: + type: "[OFFENSIVE]" + details: This User profile is obscene/offensive + threat: + type: "[THREAT]" + details: This User profile contains a threat + vandal: + type: "[VANDAL]" + details: This User is a vandal + other: + type: "[OTHER]" + details: Other + Changeset: + undiscussed_import: + type: "[UNDISCUSSED-IMPORT]" + details: This changeset is an undiscussed import + mechanical_edit: + type: "[MECH-EDIT]" + details: This changeset is a mechanical edit + edit_error: + type: "[EDIT-ERROR]" + details: This changeset contains a newbie or an editor error + spam: + type: "[SPAM]" + details: This changeset is/contains spam + vandalism: + type: "[VANDALISM]" + details: This changeset is/contains vandalism + other: + type: "[OTHER]" + details: Other + Note: + spam: + type: "[SPAM]" + details: This note is spam + vandalism: + type: "[VANDALISM]" + details: This note is vandalism + personal: + type: "[PERSONAL]" + details: This note contains personal data + abusive: + type: "[ABUSIVE]" + details: This note is abusive + other: + type: "[OTHER]" + details: Other layouts: project_name: # in @@@ -1038,7 -921,6 +1037,7 @@@ edit: Edit history: History export: Export + issues: Issues data: Data export_data: Export Data gps_traces: GPS Traces @@@ -1050,7 -932,7 +1049,7 @@@ intro_header: Welcome to OpenStreetMap! intro_text: OpenStreetMap is a map of the world, created by people like you and free to use under an open license. intro_2_create_account: "Create a user account" - partners_html: "Hosting is supported by %{ucl}, %{bytemark} and %{ic}, and other %{partners}." + partners_html: "Hosting is supported by %{ucl}, %{bytemark}, %{ic}, and other %{partners}." partners_ucl: "UCL" partners_ic: "Imperial College London" partners_bytemark: "Bytemark Hosting" @@@ -1123,9 -1005,7 +1122,7 @@@ more_title_html: Finding out more more_1_html: | Read more about using our data, and how to credit us, at the <a - href="http://osmfoundation.org/Licence">OSMF Licence page</a> and the community <a - href="http://wiki.openstreetmap.org/wiki/Legal_FAQ">Legal - FAQ</a>. + href="http://osmfoundation.org/Licence">OSMF Licence page</a>. more_2_html: | Although OpenStreetMap is open data, we cannot provide a free-of-charge map API for third-parties. @@@ -1233,8 -1113,8 +1230,8 @@@ paragraph_1_html: | OpenStreetMap has few formal rules but we expect all participants to collaborate with, and communicate with, the community. If you are considering - any activities other than editing by hand, please read and follow the guidelines on - <a href='http://wiki.openstreetmap.org/wiki/Import/Guidelines'>Imports</a> and + any activities other than editing by hand, please read and follow the guidelines on + <a href='http://wiki.openstreetmap.org/wiki/Import/Guidelines'>Imports</a> and <a href='http://wiki.openstreetmap.org/wiki/Automated_Edits_code_of_conduct'>Automated Edits</a>. questions: title: Any questions? @@@ -1260,7 -1140,7 +1257,7 @@@ title: Join the community explanation_html: | If you have noticed a problem with our map data, for example a road is missing or your address, the best way to - proceed is to join the OpenStreetMap community and add or repair the data yourself. + proceed is to join the OpenStreetMap community and add or repair the data yourself. add_a_note: instructions_html: | Just click <a class='icon note'></a> or the same icon on the map display. @@@ -1270,8 -1150,8 +1267,8 @@@ title: Other concerns explanation_html: | If you have concerns about how our data is being used or about the contents please consult our - <a href='/copyright'>copyright page</a> for more legal information, or contact the appropriate - <a href='http://wiki.osmfoundation.org/wiki/Working_Groups'>OSMF working group</a>. + <a href='/copyright'>copyright page</a> for more legal information, or contact the appropriate + <a href='http://wiki.osmfoundation.org/wiki/Working_Groups'>OSMF working group</a>. help_page: title: Getting Help introduction: | @@@ -1327,7 -1207,9 +1324,9 @@@ Our contributors include enthusiast mappers, GIS professionals, engineers running the OSM servers, humanitarians mapping disaster-affected areas, and many more. - To learn more about the community, see the <a href='%{diary_path}'>user diaries</a>, + To learn more about the community, see the + <a href='https://blog.openstreetmap.org'>OpenStreetMap Blog</a>, + <a href='%{diary_path}'>user diaries</a>, <a href='http://blogs.openstreetmap.org/'>community blogs</a>, and the <a href='http://www.osmfoundation.org/'>OSM Foundation</a> website. open_data_title: Open Data @@@ -1339,13 -1221,13 +1338,13 @@@ License page</a> for details. legal_title: Legal legal_html: | - This site and many other related services are formally operated by the - <a href='http://osmfoundation.org/'>OpenStreetMap Foundation</a> (OSMF) - on behalf of the community. Use of all OSMF operated services is subject + This site and many other related services are formally operated by the + <a href='http://osmfoundation.org/'>OpenStreetMap Foundation</a> (OSMF) + on behalf of the community. Use of all OSMF operated services is subject to our <a href="http://wiki.openstreetmap.org/wiki/Acceptable_Use_Policy"> Acceptable Use Policies</a> and our <a href="http://wiki.osmfoundation.org/wiki/Privacy_Policy">Privacy Policy</a> - <br> - Please <a href='http://osmfoundation.org/Contact'>contact the OSMF</a> + <br> + Please <a href='http://osmfoundation.org/Contact'>contact the OSMF</a> if you have licensing, copyright or other legal questions and issues. partners_title: Partners notifier: @@@ -1437,11 -1319,6 +1436,11 @@@ partial_changeset_without_comment: "without comment" details: "More details about the changeset can be found at %{url}." unsubscribe: 'To unsubscribe from updates to this changeset, visit %{url} and click "Unsubscribe".' + new_issue_notification: + subject: "[OpenStreetMap] New Issue" + greeting: "Hi," + new_issue: "A new issue has been created" + url: You can view the issue here message: inbox: title: "Inbox" @@@ -1544,7 -1421,7 +1543,7 @@@ get_directions_title: "Find directions between two points" from: "From" to: "To" - where_am_i: "Where am I?" + where_am_i: "Where is this?" where_am_i_title: Describe the current location using the search engine submit_text: "Go" key: @@@ -1746,8 -1623,6 +1745,8 @@@ application: require_cookies: cookies_needed: "You appear to have cookies disabled - please enable cookies in your browser before continuing." + require_admin: + not_an_admin: You need to be an admin to perform that action. require_moderator: not_a_moderator: "You need to be a moderator to perform that action." setup_user_auth: @@@ -2019,7 -1894,6 +2018,7 @@@ friends_diaries: "friends' diary entries" nearby_changesets: "nearby user changesets" nearby_diaries: "nearby user diary entries" + report: "Report this user?" popup: your location: "Your location" nearby mapper: "Nearby mapper" diff --combined config/routes.rb index 277bd34ea,98bb332f2..8a5dca166 --- a/config/routes.rb +++ b/config/routes.rb @@@ -223,7 -223,7 +223,7 @@@ OpenStreetMap::Application.routes.draw match "/user/:display_name/diary" => "diary_entry#list", :via => :get match "/diary/:language" => "diary_entry#list", :via => :get match "/diary" => "diary_entry#list", :via => :get - match "/user/:display_name/diary/:id" => "diary_entry#view", :via => :get, :id => /\d+/ + match "/user/:display_name/diary/:id" => "diary_entry#view", :via => :get, :id => /\d+/, :as => :diary_entry match "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :via => :post, :id => /\d+/ match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/ match "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :via => :post, :id => /\d+/, :as => :hide_diary_entry @@@ -246,7 -246,6 +246,6 @@@ # geocoder match "/search" => "geocoder#search", :via => :get, :as => :search match "/geocoder/search_latlon" => "geocoder#search_latlon", :via => :get - match "/geocoder/search_us_postcode" => "geocoder#search_us_postcode", :via => :get match "/geocoder/search_uk_postcode" => "geocoder#search_uk_postcode", :via => :get match "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode", :via => :get match "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim", :via => :get @@@ -290,19 -289,6 +289,19 @@@ resources :user_blocks match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block" + # issues and reports + resources :issues do + resources :comments, :controller => :issue_comments + member do + post "resolve" + post "assign" + post "ignore" + post "reopen" + end + end + + resources :reports + # redactions resources :redactions end diff --combined test/test_helper.rb index 0e06c3c9e,70f69a3ae..552bda7d5 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@@ -5,11 -5,10 +5,11 @@@ ENV["RAILS_ENV"] = "test require File.expand_path("../../config/environment", __FILE__) require "rails/test_help" require "webmock/minitest" +require "minitest/rails/capybara" module ActiveSupport class TestCase - include FactoryGirl::Syntax::Methods + include FactoryBot::Syntax::Methods ## # takes a block which is executed in the context of a different @@@ -151,13 -150,5 +151,13 @@@ end end end + + def sign_in_as(user) + stub_hostip_requests + visit login_path + fill_in "username", :with => user.email + fill_in "password", :with => "test" + click_on "Login", :match => :first + end end end