From: Tom Hughes Date: Sun, 13 Feb 2022 18:39:21 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/3345' X-Git-Tag: live~2348 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/53aa7259bb0612eb48a17d0b954ad71ea37d87a4?hp=b244905cd2f8d23e97cb6f64c41da078651af29a Merge remote-tracking branch 'upstream/pull/3345' --- diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0f40ec020..86bb9ca3d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,4 @@ -blank_issues_enabled: false +blank_issues_enabled: true contact_links: - name: There is an issue with the default map layer shown on the front page url: https://github.com/gravitystorm/openstreetmap-carto diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 345eed674..8c0827ab7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-09-14 19:29:59 UTC using RuboCop version 1.21.0. +# on 2021-12-28 19:44:27 UTC using RuboCop version 1.24.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -14,7 +14,7 @@ require: - rubocop-rails - rubocop-rake -# Offense count: 524 +# Offense count: 544 # Cop supports --auto-correct. # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https @@ -38,9 +38,9 @@ Lint/AmbiguousOperatorPrecedence: # Configuration parameters: AllowSafeAssignment. Lint/AssignmentInCondition: Exclude: + - 'app/controllers/accounts_controller.rb' - 'app/controllers/api/traces_controller.rb' - 'app/controllers/api/user_preferences_controller.rb' - - 'app/controllers/accounts_controller.rb' - 'app/controllers/application_controller.rb' - 'app/controllers/geocoder_controller.rb' - 'app/controllers/notes_controller.rb' @@ -54,7 +54,7 @@ Lint/AssignmentInCondition: - 'lib/osm.rb' - 'script/deliver-message' -# Offense count: 8 +# Offense count: 7 # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. Lint/DuplicateBranch: Exclude: @@ -62,14 +62,13 @@ Lint/DuplicateBranch: - 'app/controllers/diary_entries_controller.rb' - 'app/controllers/geocoder_controller.rb' - 'app/helpers/browse_tags_helper.rb' - - 'lib/password_hash.rb' -# Offense count: 643 +# Offense count: 663 # Configuration parameters: IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: Max: 189 -# Offense count: 69 +# Offense count: 72 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. # IgnoredMethods: refine Metrics/BlockLength: @@ -83,14 +82,14 @@ Metrics/BlockNesting: # Offense count: 25 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 337 + Max: 313 -# Offense count: 58 +# Offense count: 57 # Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: Max: 25 -# Offense count: 716 +# Offense count: 739 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. Metrics/MethodLength: Max: 179 @@ -100,14 +99,14 @@ Metrics/MethodLength: Metrics/ParameterLists: Max: 6 -# Offense count: 62 +# Offense count: 59 # Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: Max: 26 -# Offense count: 528 +# Offense count: 549 Minitest/MultipleAssertions: - Max: 54 + Max: 52 # Offense count: 3 Naming/AccessorMethodName: @@ -162,6 +161,7 @@ Rails/HelperInstanceVariable: Rails/LexicallyScopedActionFilter: Exclude: - 'app/controllers/oauth2_applications_controller.rb' + - 'app/controllers/oauth2_authorizations_controller.rb' # Offense count: 5 # Configuration parameters: Include. @@ -183,7 +183,12 @@ Rails/OutputSafety: - 'lib/rich_text.rb' - 'test/helpers/application_helper_test.rb' -# Offense count: 91 +# Offense count: 23 +# Cop supports --auto-correct. +Rails/RedundantPresenceValidationOnBelongsTo: + Enabled: false + +# Offense count: 90 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible @@ -199,15 +204,15 @@ Rake/Desc: - 'lib/tasks/subscribe_diary_authors.rake' - 'lib/tasks/subscribe_old_changesets.rake' -# Offense count: 602 +# Offense count: 609 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 73 +# Offense count: 72 # Cop supports --auto-correct. -# Configuration parameters: Strict. +# Configuration parameters: Strict, AllowedNumbers. Style/NumericLiterals: MinDigits: 15 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 474c80b4f..aaa1b5d4b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,8 +38,8 @@ bundle exec rails test:all You can view test coverage statistics by browsing the `coverage` directory. -The tests are automatically run on Pull Requests and other commits with the -results shown on [Travis CI](https://travis-ci.org/openstreetmap/openstreetmap-website). +The tests are automatically run on Pull Requests and other commits via github +actions. The results shown are within the PR display on github. ## Static Analysis @@ -79,14 +79,6 @@ database, and update the list of available keys manually. Adding or removing keys to this list is therefore discouraged, but contributions to the descriptive texts are welcome. -## Code Documentation - -To generate the HTML documentation of the API/rails code, run the command - -``` -rake doc:app -``` - ## Committing When you submit patches, the project maintainer has to read them and diff --git a/Gemfile b/Gemfile index 7ee75cb66..21dbbf421 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" # Require rails -gem "rails", "6.1.4.4" +gem "rails", "6.1.4.6" # Require json for multi_json gem "json" @@ -43,7 +43,7 @@ gem "active_record_union" gem "bootstrap", "~> 4.5.0" gem "bootstrap_form", "~> 4.0" gem "cancancan" -gem "composite_primary_keys", "~> 13.0.0", "!= 13.0.1" +gem "composite_primary_keys", "~> 13.0.0" gem "config" gem "delayed_job_active_record" gem "http_accept_language", "~> 2.1.1" diff --git a/Gemfile.lock b/Gemfile.lock index 8bbb33e81..2e659dfff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,66 +3,66 @@ GEM specs: aasm (5.2.0) concurrent-ruby (~> 1.0) - actioncable (6.1.4.4) - actionpack (= 6.1.4.4) - activesupport (= 6.1.4.4) + actioncable (6.1.4.6) + actionpack (= 6.1.4.6) + activesupport (= 6.1.4.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.4.4) - actionpack (= 6.1.4.4) - activejob (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + actionmailbox (6.1.4.6) + actionpack (= 6.1.4.6) + activejob (= 6.1.4.6) + activerecord (= 6.1.4.6) + activestorage (= 6.1.4.6) + activesupport (= 6.1.4.6) mail (>= 2.7.1) - actionmailer (6.1.4.4) - actionpack (= 6.1.4.4) - actionview (= 6.1.4.4) - activejob (= 6.1.4.4) - activesupport (= 6.1.4.4) + actionmailer (6.1.4.6) + actionpack (= 6.1.4.6) + actionview (= 6.1.4.6) + activejob (= 6.1.4.6) + activesupport (= 6.1.4.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.4.4) - actionview (= 6.1.4.4) - activesupport (= 6.1.4.4) + actionpack (6.1.4.6) + actionview (= 6.1.4.6) + activesupport (= 6.1.4.6) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (6.1.4.4) - actionpack (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + actiontext (6.1.4.6) + actionpack (= 6.1.4.6) + activerecord (= 6.1.4.6) + activestorage (= 6.1.4.6) + activesupport (= 6.1.4.6) nokogiri (>= 1.8.5) - actionview (6.1.4.4) - activesupport (= 6.1.4.4) + actionview (6.1.4.6) + activesupport (= 6.1.4.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_record_union (1.3.0) activerecord (>= 4.0) - activejob (6.1.4.4) - activesupport (= 6.1.4.4) + activejob (6.1.4.6) + activesupport (= 6.1.4.6) globalid (>= 0.3.6) - activemodel (6.1.4.4) - activesupport (= 6.1.4.4) - activerecord (6.1.4.4) - activemodel (= 6.1.4.4) - activesupport (= 6.1.4.4) - activerecord-import (1.2.0) - activerecord (>= 3.2) - activestorage (6.1.4.4) - actionpack (= 6.1.4.4) - activejob (= 6.1.4.4) - activerecord (= 6.1.4.4) - activesupport (= 6.1.4.4) + activemodel (6.1.4.6) + activesupport (= 6.1.4.6) + activerecord (6.1.4.6) + activemodel (= 6.1.4.6) + activesupport (= 6.1.4.6) + activerecord-import (1.3.0) + activerecord (>= 4.2) + activestorage (6.1.4.6) + actionpack (= 6.1.4.6) + activejob (= 6.1.4.6) + activerecord (= 6.1.4.6) + activesupport (= 6.1.4.6) marcel (~> 1.0.0) mini_mime (>= 1.1.0) - activesupport (6.1.4.4) + activesupport (6.1.4.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -70,27 +70,27 @@ GEM zeitwerk (~> 2.3) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) - annotate (3.1.1) - activerecord (>= 3.2, < 7.0) + annotate (3.2.0) + activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) argon2 (2.1.1) ffi (~> 1.14) ffi-compiler (~> 1.0) ast (2.4.2) - autoprefixer-rails (10.3.3.0) + autoprefixer-rails (10.4.2.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.541.0) - aws-sdk-core (3.124.0) + aws-partitions (1.554.0) + aws-sdk-core (3.126.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.52.0) - aws-sdk-core (~> 3, >= 3.122.0) + aws-sdk-kms (1.54.0) + aws-sdk-core (~> 3, >= 3.126.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.109.0) - aws-sdk-core (~> 3, >= 3.122.0) + aws-sdk-s3 (1.112.0) + aws-sdk-core (~> 3, >= 3.126.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) aws-sigv4 (1.4.0) @@ -109,8 +109,8 @@ GEM smart_properties binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.9.3) - msgpack (~> 1.0) + bootsnap (1.10.3) + msgpack (~> 1.2) bootstrap (4.5.3) autoprefixer-rails (>= 9.1.0) popper_js (>= 1.14.3, < 2) @@ -118,14 +118,14 @@ GEM bootstrap_form (4.5.0) actionpack (>= 5.2) activemodel (>= 5.2) - brakeman (5.2.0) + brakeman (5.2.1) browser (5.3.1) builder (3.2.4) bzip2-ffi (1.1.0) ffi (~> 1.0) cancancan (3.3.0) - canonical-rails (0.2.13) - rails (>= 4.1, <= 7.0) + canonical-rails (0.2.14) + rails (>= 4.1, <= 7.1) capybara (3.36.0) addressable matrix @@ -137,30 +137,30 @@ GEM xpath (~> 3.2) childprocess (3.0.0) coderay (1.1.3) - composite_primary_keys (13.0.0) + composite_primary_keys (13.0.3) activerecord (~> 6.1.0) concurrent-ruby (1.1.9) - config (3.1.0) + config (3.1.1) deep_merge (~> 1.2, >= 1.2.1) dry-validation (~> 1.0, >= 1.0.0) connection_pool (2.2.5) crack (0.4.5) rexml crass (1.0.6) - dalli (3.1.4) + dalli (3.2.0) debug_inspector (1.1.0) - deep_merge (1.2.1) - delayed_job (4.1.9) - activesupport (>= 3.0, < 6.2) - delayed_job_active_record (4.1.6) - activerecord (>= 3.0, < 6.2) + deep_merge (1.2.2) + delayed_job (4.1.10) + activesupport (>= 3.0, < 8.0) + delayed_job_active_record (4.1.7) + activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) docile (1.4.0) doorkeeper (5.5.4) railties (>= 5) doorkeeper-i18n (5.2.3) doorkeeper (>= 5.2) - dry-configurable (0.13.0) + dry-configurable (0.14.0) concurrent-ruby (~> 1.0) dry-core (~> 0.6) dry-container (0.9.0) @@ -169,7 +169,7 @@ GEM dry-core (0.7.1) concurrent-ruby (~> 1.0) dry-inflector (0.2.1) - dry-initializer (3.0.4) + dry-initializer (3.1.1) dry-logic (1.2.0) concurrent-ruby (~> 1.0) dry-core (~> 0.5, >= 0.5) @@ -208,26 +208,30 @@ GEM factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - faraday (1.8.0) + faraday (1.9.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) + faraday-net_http_persistent (~> 1.0) faraday-patron (~> 1.0) faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - ffi (1.15.4) + faraday-retry (1.0.3) + ffi (1.15.5) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake @@ -243,9 +247,9 @@ GEM html_tokenizer (0.0.7) htmlentities (4.3.4) http_accept_language (2.1.1) - i18n (1.8.11) + i18n (1.9.1) concurrent-ruby (~> 1.0) - i18n-js (3.9.0) + i18n-js (3.9.1) i18n (>= 0.6.6) image_optim (0.31.1) exifr (~> 1.2, >= 1.2.2) @@ -253,18 +257,19 @@ GEM image_size (>= 1.5, < 4) in_threads (~> 1.3) progress (~> 3.0, >= 3.0.1) - image_optim_rails (0.4.3) + image_optim_rails (0.5.0) image_optim (~> 0.24) - rails + railties sprockets image_processing (1.12.1) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) image_size (3.0.1) - in_threads (1.5.4) - jbuilder (2.11.3) + in_threads (1.6.0) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) - jmespath (1.4.0) + jmespath (1.5.0) jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -274,14 +279,14 @@ GEM kgio (2.11.4) kramdown (2.3.1) rexml - libxml-ruby (3.2.1) - listen (3.7.0) + libxml-ruby (3.2.2) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logstasher (2.1.5) activesupport (>= 5.2) request_store - loofah (2.13.0) + loofah (2.14.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -292,15 +297,15 @@ GEM method_source (1.0.0) mini_magick (4.11.0) mini_mime (1.1.2) - mini_portile2 (2.6.1) + mini_portile2 (2.7.1) minitest (5.15.0) - msgpack (1.4.2) + msgpack (1.4.4) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.1.1) nio4r (2.5.8) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.1) + mini_portile2 (~> 2.7.0) racc (~> 1.4) oauth (0.4.7) oauth-plugin (0.5.1) @@ -340,7 +345,7 @@ GEM omniauth-openid (2.0.1) omniauth (>= 1.0, < 3.0) rack-openid (~> 1.4.0) - omniauth-rails_csrf_protection (1.0.0) + omniauth-rails_csrf_protection (1.0.1) actionpack (>= 4.2) omniauth (~> 2.0) omniauth-windowslive (0.0.12) @@ -348,13 +353,13 @@ GEM omniauth-oauth2 (~> 1.4) openstreetmap-deadlock_retry (1.3.1) parallel (1.21.0) - parser (3.0.3.2) + parser (3.1.0.0) ast (~> 2.4.1) - pg (1.2.3) + pg (1.3.1) popper_js (1.16.0) progress (3.6.0) public_suffix (4.0.6) - puma (5.5.2) + puma (5.6.2) nio4r (~> 2.0) quad_tile (1.0.1) r2 (0.2.7) @@ -370,20 +375,20 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rack-uri_sanitizer (0.0.2) - rails (6.1.4.4) - actioncable (= 6.1.4.4) - actionmailbox (= 6.1.4.4) - actionmailer (= 6.1.4.4) - actionpack (= 6.1.4.4) - actiontext (= 6.1.4.4) - actionview (= 6.1.4.4) - activejob (= 6.1.4.4) - activemodel (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + rails (6.1.4.6) + actioncable (= 6.1.4.6) + actionmailbox (= 6.1.4.6) + actionmailer (= 6.1.4.6) + actionpack (= 6.1.4.6) + actiontext (= 6.1.4.6) + actionview (= 6.1.4.6) + activejob (= 6.1.4.6) + activemodel (= 6.1.4.6) + activerecord (= 6.1.4.6) + activestorage (= 6.1.4.6) + activesupport (= 6.1.4.6) bundler (>= 1.15.0) - railties (= 6.1.4.4) + railties (= 6.1.4.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -397,40 +402,40 @@ GEM rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.1.4.4) - actionpack (= 6.1.4.4) - activesupport (= 6.1.4.4) + railties (6.1.4.6) + actionpack (= 6.1.4.6) + activesupport (= 6.1.4.6) method_source rake (>= 0.13) thor (~> 1.0) - rainbow (3.0.0) + rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.2.0) - request_store (1.5.0) + request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) rinku (2.0.6) rotp (6.2.0) - rubocop (1.23.0) + rubocop (1.25.1) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.12.0, < 2.0) + rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.15.0) + rubocop-ast (1.15.1) parser (>= 3.0.1.1) - rubocop-minitest (0.17.0) + rubocop-minitest (0.17.1) rubocop (>= 0.90, < 2.0) - rubocop-performance (1.12.0) + rubocop-performance (1.13.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.12.4) + rubocop-rails (2.13.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) @@ -472,11 +477,11 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - strong_migrations (0.7.9) - activerecord (>= 5) + strong_migrations (0.8.0) + activerecord (>= 5.2) terser (1.1.8) execjs (>= 0.3.0, < 3) - thor (1.1.0) + thor (1.2.1) tilt (2.0.10) tzinfo (2.0.4) concurrent-ruby (~> 1.0) @@ -493,7 +498,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.5.1) + zeitwerk (2.5.4) PLATFORMS ruby @@ -518,7 +523,7 @@ DEPENDENCIES cancancan canonical-rails capybara (>= 2.15) - composite_primary_keys (~> 13.0.0, != 13.0.1) + composite_primary_keys (~> 13.0.0) config connection_pool dalli @@ -563,7 +568,7 @@ DEPENDENCIES r2 (~> 0.2.7) rack-cors rack-uri_sanitizer - rails (= 6.1.4.4) + rails (= 6.1.4.6) rails-controller-testing rails-i18n (~> 6.0.0) rinku (>= 2.0.6) diff --git a/INSTALL.md b/INSTALL.md index 1faf4bf22..68b0d120e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -90,7 +90,7 @@ Installing other dependencies: * Install Homebrew from https://brew.sh/ * Install the latest version of Ruby: `brew install ruby` -* Install other dependencies: `brew install imagemagick libxml2 gd yarn pngcrush optipng pngquant jhead jpegoptim gifsicle svgo` +* Install other dependencies: `brew install imagemagick libxml2 gd yarn pngcrush optipng pngquant jhead jpegoptim gifsicle svgo advancecomp` * Install Bundler: `gem install bundler` (you might need to `sudo gem install bundler` if you get an error about permissions - or see note below about [developer Ruby setup](#rbenv)) You will need to tell `bundler` that `libxml2` is installed in a Homebrew location. If it uses the system-installed one then you will get errors installing the `libxml-ruby` gem later on. @@ -102,8 +102,7 @@ bundle config build.libxml-ruby --with-xml2-config=/usr/local/opt/libxml2/bin/xm If you want to run the tests, you need `geckodriver` as well: ``` -brew tap homebrew/cask -brew cask install geckodriver +brew install geckodriver ``` Note that OS X does not have a /home directory by default, so if you are using the GPX functions, you will need to change the directories specified in config/application.yml. diff --git a/Vendorfile b/Vendorfile index 0c1f52335..698f7fa33 100644 --- a/Vendorfile +++ b/Vendorfile @@ -4,28 +4,28 @@ folder 'vendor/assets' do end folder 'leaflet' do - from 'git://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.5.1' do + from 'https://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.5.1' do file 'leaflet.contextmenu.js', 'dist/leaflet.contextmenu.js' file 'leaflet.contextmenu.css', 'dist/leaflet.contextmenu.css' end - from 'git://github.com/kajic/leaflet-locationfilter.git' do + from 'https://github.com/kajic/leaflet-locationfilter.git' do file 'leaflet.locationfilter.css', 'src/locationfilter.css' file 'leaflet.locationfilter.js', 'src/locationfilter.js' folder 'img', 'src/img' end - from 'git://github.com/jfirebaugh/leaflet-osm.git' do + from 'https://github.com/jfirebaugh/leaflet-osm.git' do file 'leaflet.osm.js', 'leaflet-osm.js' end - from 'git://github.com/jieter/Leaflet.encoded.git', :tag => '0.0.9' do + from 'https://github.com/jieter/Leaflet.encoded.git', :tag => '0.0.9' do file 'leaflet.polyline.js', 'Polyline.encoded.js' end end folder 'iD' do - from 'git://github.com/openstreetmap/iD', :branch => 'release' do + from 'https://github.com/openstreetmap/iD', :branch => 'release' do folder 'iD/data', 'dist/data' folder 'iD/img', 'dist/img' folder 'iD/locales', 'dist/locales' diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb index a45bf9a57..b8e21b486 100644 --- a/app/abilities/ability.rb +++ b/app/abilities/ability.rb @@ -23,7 +23,7 @@ class Ability can [:index, :show], Redaction can [:new, :create, :destroy], :session can [:index, :show, :data, :georss, :picture, :icon], Trace - can [:terms, :new, :create, :save, :show, :auth_success, :auth_failure], User + can [:terms, :new, :create, :save, :suspended, :show, :auth_success, :auth_failure], User can [:index, :show, :blocks_on, :blocks_by], UserBlock can [:index, :show], Node can [:index, :show, :full, :ways_for_node], Way diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 3b540234b..06eb031c4 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -35,17 +35,19 @@ class AccountsController < ApplicationController :form_action => %w[accounts.google.com *.facebook.com login.live.com github.com meta.wikimedia.org] ) + user_params = params.require(:user).permit(:display_name, :new_email, :pass_crypt, :pass_crypt_confirmation, :auth_provider) + if params[:user][:auth_provider].blank? || (params[:user][:auth_provider] == current_user.auth_provider && params[:user][:auth_uid] == current_user.auth_uid) - update_user(current_user, params) + update_user(current_user, user_params) if current_user.errors.count.zero? redirect_to edit_account_path else render :edit end else - session[:new_user_settings] = params + session[:new_user_settings] = user_params.to_h redirect_to auth_url(params[:user][:auth_provider], params[:user][:auth_uid]), :status => :temporary_redirect end end diff --git a/app/controllers/concerns/session_methods.rb b/app/controllers/concerns/session_methods.rb index eb24f6b20..fca851eeb 100644 --- a/app/controllers/concerns/session_methods.rb +++ b/app/controllers/concerns/session_methods.rb @@ -8,7 +8,7 @@ module SessionMethods def auth_url(provider, uid, referer = nil) params = { :provider => provider } - params[:openid_url] = openid_expand_url(uid) if provider == "openid" + params[:openid_url] = uid if provider == "openid" if referer.nil? params[:origin] = request.path @@ -20,23 +20,6 @@ module SessionMethods auth_path(params) end - ## - # special case some common OpenID providers by applying heuristics to - # try and come up with the correct URL based on what the user entered - def openid_expand_url(openid_url) - if openid_url.nil? - nil - elsif openid_url.match(%r{(.*)gmail.com(/?)$}) || openid_url.match(%r{(.*)googlemail.com(/?)$}) - # Special case gmail.com as it is potentially a popular OpenID - # provider and, unlike yahoo.com, where it works automatically, Google - # have hidden their OpenID endpoint somewhere obscure this making it - # somewhat less user friendly. - "https://www.google.com/accounts/o8/id" - else - openid_url - end - end - ## # process a successful login def successful_login(user, referer = nil) diff --git a/app/controllers/concerns/user_methods.rb b/app/controllers/concerns/user_methods.rb index 9099b37c9..81e9f0064 100644 --- a/app/controllers/concerns/user_methods.rb +++ b/app/controllers/concerns/user_methods.rb @@ -6,15 +6,15 @@ module UserMethods ## # update a user's details def update_user(user, params) - user.display_name = params[:user][:display_name] - user.new_email = params[:user][:new_email] + user.display_name = params[:display_name] + user.new_email = params[:new_email] - unless params[:user][:pass_crypt].empty? && params[:user][:pass_crypt_confirmation].empty? - user.pass_crypt = params[:user][:pass_crypt] - user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation] + unless params[:pass_crypt].empty? && params[:pass_crypt_confirmation].empty? + user.pass_crypt = params[:pass_crypt] + user.pass_crypt_confirmation = params[:pass_crypt_confirmation] end - if params[:user][:auth_provider].nil? || params[:user][:auth_provider].blank? + if params[:auth_provider].nil? || params[:auth_provider].blank? user.auth_provider = nil user.auth_uid = nil end diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index bcb4c1617..e54fa4a5d 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -25,7 +25,7 @@ class ConfirmationsController < ApplicationController render_unknown_user token.user.display_name else user = token.user - user.status = "active" + user.activate user.email_valid = true flash[:notice] = gravatar_status_message(user) if gravatar_enable(user) user.save! diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index bc1220af8..8d651fe0f 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -296,17 +296,17 @@ class GeocoderController < ApplicationController elsif latlon = query.match(/^(\d{1,3}(\.\d*)?)\s*([NS])\W*(\d{1,3}(\.\d*)?)\s*([EW])$/).try(:captures) # decimal degrees [NSEW] params.merge!(nsew_to_decdeg(latlon)).delete(:query) - elsif latlon = query.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(\.\d*)?)?['′]?$/).try(:captures) # [NSEW] degrees, decimal minutes + elsif latlon = query.match(/^([NS])\s*(\d{1,3})°?(?:\s*(\d{1,3}(\.\d*)?)?['′]?)?\W*([EW])\s*(\d{1,3})°?(?:\s*(\d{1,3}(\.\d*)?)?['′]?)?$/).try(:captures) # [NSEW] degrees, decimal minutes params.merge!(ddm_to_decdeg(latlon)).delete(:query) - elsif latlon = query.match(/^(\d{1,3})°?\s*(\d{1,3}(\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(\.\d*)?)?['′]?\s*([EW])$/).try(:captures) # degrees, decimal minutes [NSEW] + elsif latlon = query.match(/^(\d{1,3})°?(?:\s*(\d{1,3}(\.\d*)?)?['′]?)?\s*([NS])\W*(\d{1,3})°?(?:\s*(\d{1,3}(\.\d*)?)?['′]?)?\s*([EW])$/).try(:captures) # degrees, decimal minutes [NSEW] params.merge!(ddm_to_decdeg(latlon)).delete(:query) - elsif latlon = query.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(\.\d*)?)?["″]?$/).try(:captures) # [NSEW] degrees, minutes, decimal seconds + elsif latlon = query.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?(?:\s*(\d{1,3}(\.\d*)?)?["″]?)?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?(?:\s*(\d{1,3}(\.\d*)?)?["″]?)?$/).try(:captures) # [NSEW] degrees, minutes, decimal seconds params.merge!(dms_to_decdeg(latlon)).delete(:query) - elsif latlon = query.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(\.\d*)?)?["″]?\s*([EW])$/).try(:captures) # degrees, minutes, decimal seconds [NSEW] + elsif latlon = query.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?(?:\s*(\d{1,3}(\.\d*)?)?["″]?)?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?(?:\s*(\d{1,3}(\.\d*)?)?["″]?)?\s*([EW])$/).try(:captures) # degrees, minutes, decimal seconds [NSEW] params.merge!(dms_to_decdeg(latlon)).delete(:query) - elsif latlon = query.match(/^\s*([+-]?\d+(\.\d*)?)\s*[\s,]\s*([+-]?\d+(\.\d*)?)\s*$/) + elsif latlon = query.match(/^([+-]?\d+(\.\d*)?)(?:\s+|\s*,\s*)([+-]?\d+(\.\d*)?)$/) params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f).delete(:query) params[:latlon_digits] = true unless params[:whereami] diff --git a/app/controllers/oauth2_authorizations_controller.rb b/app/controllers/oauth2_authorizations_controller.rb index b851d19b2..dca95de4e 100644 --- a/app/controllers/oauth2_authorizations_controller.rb +++ b/app/controllers/oauth2_authorizations_controller.rb @@ -3,12 +3,13 @@ class Oauth2AuthorizationsController < Doorkeeper::AuthorizationsController prepend_before_action :authorize_web before_action :set_locale + before_action :allow_all_form_action, :only => [:new] authorize_resource :class => false - def new - override_content_security_policy_directives(:form_action => []) if Settings.csp_enforce || Settings.key?(:csp_report_url) + private - super + def allow_all_form_action + override_content_security_policy_directives(:form_action => []) if Settings.csp_enforce || Settings.key?(:csp_report_url) end end diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 331575964..502b1357f 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -46,7 +46,7 @@ class PasswordsController < ApplicationController if params[:user] current_user.pass_crypt = params[:user][:pass_crypt] current_user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation] - current_user.status = "active" if current_user.status == "pending" + current_user.activate if current_user.may_activate? current_user.email_valid = true if current_user.save diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index bb3854e69..5b46d67d0 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -12,9 +12,7 @@ class SessionsController < ApplicationController authorize_resource :class => false def new - append_content_security_policy_directives( - :form_action => %w[*] - ) + override_content_security_policy_directives(:form_action => []) if Settings.csp_enforce || Settings.key?(:csp_report_url) session[:referer] = safe_referer(params[:referer]) if params[:referer] end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4f05ece74..39a191d84 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -164,8 +164,6 @@ class UsersController < ApplicationController Rails.logger.info "create: #{session[:referer]}" - current_user.status = "pending" - if current_user.auth_provider.present? && current_user.pass_crypt.empty? # We are creating an account with external authentication and # no password was specified so create a random one @@ -202,15 +200,19 @@ class UsersController < ApplicationController ## # sets a user's status def set_status - @user.status = params[:status] - @user.save + @user.activate! if params[:event] == "activate" + @user.confirm! if params[:event] == "confirm" + @user.unconfirm! if params[:event] == "unconfirm" + @user.hide! if params[:event] == "hide" + @user.unhide! if params[:event] == "unhide" + @user.unsuspend! if params[:event] == "unsuspend" redirect_to user_path(:display_name => params[:display_name]) end ## - # delete a user, marking them as deleted and removing personal data + # destroy a user, marking them as deleted and removing personal data def destroy - @user.delete + @user.soft_destroy! redirect_to user_path(:display_name => params[:display_name]) end diff --git a/app/models/node.rb b/app/models/node.rb index 8bfac993b..3214564c8 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -206,7 +206,7 @@ class Node < ApplicationRecord end def tags - @tags ||= node_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= node_tags.to_h { |t| [t.k, t.v] } end attr_writer :tags diff --git a/app/models/old_node.rb b/app/models/old_node.rb index 81d8e331f..3caf0442b 100644 --- a/app/models/old_node.rb +++ b/app/models/old_node.rb @@ -82,7 +82,7 @@ class OldNode < ApplicationRecord end def tags - @tags ||= old_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= old_tags.to_h { |t| [t.k, t.v] } end attr_writer :tags diff --git a/app/models/old_relation.rb b/app/models/old_relation.rb index d0a03ac25..29edb90ad 100644 --- a/app/models/old_relation.rb +++ b/app/models/old_relation.rb @@ -82,7 +82,7 @@ class OldRelation < ApplicationRecord end def tags - @tags ||= old_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= old_tags.to_h { |t| [t.k, t.v] } end attr_writer :members, :tags diff --git a/app/models/old_way.rb b/app/models/old_way.rb index 9acf8665d..7af8906b1 100644 --- a/app/models/old_way.rb +++ b/app/models/old_way.rb @@ -80,7 +80,7 @@ class OldWay < ApplicationRecord end def tags - @tags ||= old_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= old_tags.to_h { |t| [t.k, t.v] } end attr_writer :nds, :tags diff --git a/app/models/relation.rb b/app/models/relation.rb index 25564940b..a231feddb 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -130,7 +130,7 @@ class Relation < ApplicationRecord end def tags - @tags ||= relation_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= relation_tags.to_h { |t| [t.k, t.v] } end attr_writer :members, :tags diff --git a/app/models/user.rb b/app/models/user.rb index 023604801..7a0d06992 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -45,7 +45,7 @@ class User < ApplicationRecord require "digest" - require "xml/libxml" + include AASM has_many :traces, -> { where(:visible => true) } has_many :diary_entries, -> { order(:created_at => :desc) } @@ -114,7 +114,8 @@ class User < ApplicationRecord validates_email_format_of :email, :if => proc { |u| u.email_changed? } validates_email_format_of :new_email, :allow_blank => true, :if => proc { |u| u.new_email_changed? } - after_initialize :set_defaults + alias_attribute :created_at, :creation_time + before_save :encrypt_password before_save :update_tile after_save :spam_check @@ -158,6 +159,64 @@ class User < ApplicationRecord user end + aasm :column => :status, :no_direct_assignment => true do + state :pending, :initial => true + state :active + state :confirmed + state :suspended + state :deleted + + # A normal account is active + event :activate do + transitions :from => :pending, :to => :active + end + + # Used in test suite, not something that we would normally need to do. + if Rails.env.test? + event :deactivate do + transitions :from => :active, :to => :pending + end + end + + # To confirm an account is used to override the spam scoring + event :confirm do + transitions :from => [:pending, :active, :suspended], :to => :confirmed + end + + # To unconfirm an account is to make it subject to future spam scoring again + event :unconfirm do + transitions :from => :confirmed, :to => :active + end + + # Accounts can be automatically suspended by spam_check + event :suspend do + transitions :from => [:pending, :active], :to => :suspended + end + + # Unsuspending an account moves it back to active without overriding the spam scoring + event :unsuspend do + transitions :from => :suspended, :to => :active + end + + # Mark the account as deleted but keep all data intact + event :hide do + transitions :from => [:pending, :active, :confirmed, :suspended], :to => :deleted + end + + event :unhide do + transitions :from => [:deleted], :to => :active + end + + # Mark the account as deleted and remove personal data + event :soft_destroy do + before do + remove_personal_data + end + + transitions :from => [:pending, :active, :confirmed, :suspended], :to => :deleted + end + end + def description RichText.new(self[:description_format], self[:description]) end @@ -241,8 +300,8 @@ class User < ApplicationRecord end ## - # delete a user - leave the account but purge most personal data - def delete + # remove personal data - leave the account but purge most personal data + def remove_personal_data avatar.purge_later self.display_name = "user_#{id}" @@ -253,7 +312,6 @@ class User < ApplicationRecord self.new_email = nil self.auth_provider = nil self.auth_uid = nil - self.status = "deleted" save end @@ -279,7 +337,7 @@ class User < ApplicationRecord ## # perform a spam check on a user def spam_check - update(:status => "suspended") if status == "active" && spam_score > Settings.spam_threshold + suspend! if may_suspend? && spam_score > Settings.spam_threshold end ## @@ -308,7 +366,7 @@ class User < ApplicationRecord end def max_messages_per_hour - account_age_in_seconds = Time.now.utc - creation_time + account_age_in_seconds = Time.now.utc - created_at account_age_in_hours = account_age_in_seconds / 3600 recent_messages = messages.where("sent_on >= ?", Time.now.utc - 3600).count active_reports = issues.with_status(:open).sum(:reports_count) @@ -317,7 +375,7 @@ class User < ApplicationRecord end def max_friends_per_hour - account_age_in_seconds = Time.now.utc - creation_time + account_age_in_seconds = Time.now.utc - created_at account_age_in_hours = account_age_in_seconds / 3600 recent_friends = Friendship.where(:befriendee => self).where("created_at >= ?", Time.now.utc - 3600).count active_reports = issues.with_status(:open).sum(:reports_count) @@ -327,10 +385,6 @@ class User < ApplicationRecord private - def set_defaults - self.creation_time = Time.now.getutc unless attribute_present?(:creation_time) - end - def encrypt_password if pass_crypt_confirmation self.pass_crypt, self.pass_salt = PasswordHash.create(pass_crypt) diff --git a/app/models/way.rb b/app/models/way.rb index 724965ddf..933cb7c8b 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -112,7 +112,7 @@ class Way < ApplicationRecord end def tags - @tags ||= way_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= way_tags.to_h { |t| [t.k, t.v] } end attr_writer :nds, :tags diff --git a/app/views/accounts/edit.html.erb b/app/views/accounts/edit.html.erb index ba809d16a..0dcab17b0 100644 --- a/app/views/accounts/edit.html.erb +++ b/app/views/accounts/edit.html.erb @@ -61,5 +61,5 @@

<%= t ".public editing note.heading" %>

<%= t ".public editing note.html" %> - <%= button_to t(".make edits public button"), :action => :go_public %> + <%= button_to t(".make edits public button"), user_go_public_path %> <% end %> diff --git a/app/views/api/notes/_note.gpx.builder b/app/views/api/notes/_note.gpx.builder index f6bb39d27..74961b2e0 100644 --- a/app/views/api/notes/_note.gpx.builder +++ b/app/views/api/notes/_note.gpx.builder @@ -1,5 +1,5 @@ xml.wpt("lon" => note.lon, "lat" => note.lat) do - xml.time note.created_at.to_s(:iso8601) + xml.time note.created_at.to_formatted_s(:iso8601) xml.name t("browse.note.title", :id => note.id) xml.desc do diff --git a/app/views/api/notes/_note.rss.builder b/app/views/api/notes/_note.rss.builder index 4dc47d158..3e562d1a2 100644 --- a/app/views/api/notes/_note.rss.builder +++ b/app/views/api/notes/_note.rss.builder @@ -15,7 +15,7 @@ xml.item do xml.dc :creator, note.author.display_name if note.author - xml.pubDate note.created_at.to_s(:rfc822) + xml.pubDate note.created_at.to_formatted_s(:rfc822) xml.geo :lat, note.lat xml.geo :long, note.lon xml.georss :point, "#{note.lat} #{note.lon}" diff --git a/app/views/api/notes/feed.rss.builder b/app/views/api/notes/feed.rss.builder index 1b9e5b584..f0d00470b 100644 --- a/app/views/api/notes/feed.rss.builder +++ b/app/views/api/notes/feed.rss.builder @@ -24,7 +24,7 @@ xml.rss("version" => "2.0", xml.dc :creator, comment.author.display_name if comment.author - xml.pubDate comment.created_at.to_s(:rfc822) + xml.pubDate comment.created_at.to_formatted_s(:rfc822) xml.geo :lat, comment.note.lat xml.geo :long, comment.note.lon xml.georss :point, "#{comment.note.lat} #{comment.note.lon}" diff --git a/app/views/api/user_preferences/index.json.jbuilder b/app/views/api/user_preferences/index.json.jbuilder index 064bf27f2..f4f0d284f 100644 --- a/app/views/api/user_preferences/index.json.jbuilder +++ b/app/views/api/user_preferences/index.json.jbuilder @@ -1,3 +1,3 @@ json.partial! "api/root_attributes" -json.preferences @user_preferences.map { |pref| [pref.k, pref.v] }.to_h +json.preferences(@user_preferences.to_h { |pref| [pref.k, pref.v] }) diff --git a/app/views/api/users/_user.json.jbuilder b/app/views/api/users/_user.json.jbuilder index 7659e4e11..15f0685ac 100644 --- a/app/views/api/users/_user.json.jbuilder +++ b/app/views/api/users/_user.json.jbuilder @@ -1,7 +1,7 @@ json.user do json.id user.id json.display_name user.display_name - json.account_created user.creation_time.xmlschema + json.account_created user.created_at.xmlschema json.description user.description if user.description if current_user && current_user == user && can?(:details, User) diff --git a/app/views/api/users/_user.xml.builder b/app/views/api/users/_user.xml.builder index 7d6b177f2..1791c60ef 100644 --- a/app/views/api/users/_user.xml.builder +++ b/app/views/api/users/_user.xml.builder @@ -1,6 +1,6 @@ xml.tag! "user", :id => user.id, :display_name => user.display_name, - :account_created => user.creation_time.xmlschema do + :account_created => user.created_at.xmlschema do xml.tag! "description", user.description if user.description if current_user && current_user == user && can?(:details, User) xml.tag! "contributor-terms", :agreed => user.terms_agreed.present?, diff --git a/app/views/changeset_comments/_comments.rss.builder b/app/views/changeset_comments/_comments.rss.builder index 8848b9a80..4136b24b4 100644 --- a/app/views/changeset_comments/_comments.rss.builder +++ b/app/views/changeset_comments/_comments.rss.builder @@ -11,6 +11,6 @@ comments.each do |comment| xml.dc :creator, comment.author.display_name if comment.author - xml.pubDate comment.created_at.to_s(:rfc822) + xml.pubDate comment.created_at.to_formatted_s(:rfc822) end end diff --git a/app/views/diary_entries/rss.rss.builder b/app/views/diary_entries/rss.rss.builder index be627437d..06361c49e 100644 --- a/app/views/diary_entries/rss.rss.builder +++ b/app/views/diary_entries/rss.rss.builder @@ -23,7 +23,7 @@ xml.rss("version" => "2.0", xml.guid diary_entry_url(entry.user, entry, :only_path => false) xml.description entry.body.to_html xml.dc :creator, entry.user.display_name - xml.pubDate entry.created_at.to_s(:rfc822) + xml.pubDate entry.created_at.to_formatted_s(:rfc822) xml.comments diary_entry_url(entry.user, entry, :anchor => "comments", :only_path => false) if entry.latitude && entry.longitude diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 3f3513d3a..57b7b7638 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -5,7 +5,7 @@
<%= link_to t("site.search.where_am_i"), "#", :class => "describe_location position-absolute", :title => t("site.search.where_am_i_title") %> - <%= text_field_tag "query", params[:query], :placeholder => t("site.search.search"), :autofocus => autofocus, :autocomplete => "on", :class => "form-control form-control-sm" %> + <%= text_field_tag "query", params[:query], :placeholder => t("site.search.search"), :autofocus => autofocus, :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
<%= submit_tag t("site.search.submit_text"), :class => "btn btn-sm btn-primary", :data => { :disable_with => false } %> @@ -26,7 +26,7 @@ <%= image_tag "marker-green.png", :class => "routing_marker mx-auto d-block", :data => { :type => "from" }, :draggable => "true" %>
- <%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control form-control-sm" %> + <%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
@@ -34,7 +34,7 @@ <%= image_tag "marker-red.png", :class => "routing_marker mx-auto d-block", :data => { :type => "to" }, :draggable => "true" %>
- <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control form-control-sm" %> + <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
diff --git a/app/views/traces/georss.rss.builder b/app/views/traces/georss.rss.builder index b17192ec8..991f74ebb 100644 --- a/app/views/traces/georss.rss.builder +++ b/app/views/traces/georss.rss.builder @@ -30,7 +30,7 @@ xml.rss("version" => "2.0", xml.dc :creator, trace.user.display_name - xml.pubDate trace.timestamp.to_s(:rfc822) + xml.pubDate trace.timestamp.to_formatted_s(:rfc822) if trace.latitude && trace.longitude xml.geo :lat, trace.latitude diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index f01f8d1ed..e419aed1d 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -8,11 +8,11 @@ <%= t "users.index.summary_html", :name => link_to(user.display_name, user_path(user)), :ip_address => link_to(user.creation_ip, :ip => user.creation_ip), - :date => l(user.creation_time, :format => :friendly) %> + :date => l(user.created_at, :format => :friendly) %> <% else %> <%= t "users.index.summary_no_ip_html", :name => link_to(user.display_name, user_path(user)), - :date => l(user.creation_time, :format => :friendly) %> + :date => l(user.created_at, :format => :friendly) %> <% end %>

<%= user.description.to_html %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index b55e61f26..8987785da 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -120,7 +120,7 @@
<%= t ".mapper since" %>
-
<%= l @user.creation_time.to_date, :format => :long %>
+
<%= l @user.created_at.to_date, :format => :long %>
<% unless @user.terms_agreed %>
<%= t ".ct status" %>
@@ -139,30 +139,44 @@