From: Tom Hughes Date: Wed, 29 Jan 2020 17:55:55 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/2524' X-Git-Tag: live~3327 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/774a8dd5f9ed6e6c24c30b36dc8c1a13a4030127?hp=404024f6212d11a969e4943ab2c33c09c0196934 Merge remote-tracking branch 'upstream/pull/2524' --- diff --git a/Gemfile.lock b/Gemfile.lock index 59919e69b..778d6fa34 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,13 +74,13 @@ GEM autoprefixer-rails (9.7.4) execjs aws-eventstream (1.0.3) - aws-partitions (1.266.0) + aws-partitions (1.267.0) aws-sdk-core (3.89.1) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.27.0) + aws-sdk-kms (1.28.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.60.1) @@ -190,12 +190,12 @@ GEM dry-initializer (~> 3.0) dry-schema (~> 1.4, >= 1.4.3) dynamic_form (1.1.4) - erb_lint (0.0.30) + erb_lint (0.0.31) activesupport better_html (~> 1.0.7) html_tokenizer rainbow - rubocop (~> 0.51) + rubocop (~> 0.79.0) smart_properties erubi (1.9.0) execjs (2.7.0) @@ -417,7 +417,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - secure_headers (6.1.2) + secure_headers (6.3.0) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 4c39d6781..1c095a36b 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -142,12 +142,20 @@ OSM.Directions = function (map) { $(".directions_form .reverse_directions").on("click", function () { var from = endpoints[0].latlng, - to = endpoints[1].latlng; + to = endpoints[1].latlng, + routeFrom = "", + routeTo = ""; + if (from) { + routeFrom = from.lat + "," + from.lng; + } + if (to) { + routeTo = to.lat + "," + to.lng; + } OSM.router.route("/directions?" + querystring.stringify({ from: $("#route_to").val(), to: $("#route_from").val(), - route: to.lat + "," + to.lng + ";" + from.lat + "," + from.lng + route: routeTo + ";" + routeFrom })); }); diff --git a/config/environments/production.rb b/config/environments/production.rb index 4016be615..407650d2d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,7 +22,8 @@ Rails.application.configure do # Apache or NGINX already handles this. config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? - # Compress CSS using a preprocessor. + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. diff --git a/config/initializers/sanitize.rb b/config/initializers/sanitize.rb index c7b7b3326..30fe37820 100644 --- a/config/initializers/sanitize.rb +++ b/config/initializers/sanitize.rb @@ -1,5 +1,5 @@ Sanitize::Config::OSM = Sanitize::Config::RELAXED.dup Sanitize::Config::OSM[:elements] -= %w[div style] -Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferer" } } +Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferrer" } } Sanitize::Config::OSM[:remove_contents] = %w[script style] diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 01bba8778..c74b48310 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1106,9 +1106,10 @@ ca: reopen: reopened: L'estat de la incidència ha passat a "Obert" comments: + comment_from_html: Comentari de %{user_link} a %{comment_created_at} reassign_param: Reassigna incidència? reports: - reported_by_html: Denunciat com a %{category} per %{user} + reported_by_html: Denunciat com a %{category} per %{user} a %{updated_at} helper: reportable_title: diary_comment: '%{entry_title}, comentari #%{comment_id}' diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 22e4febc1..a9ad552d1 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1076,9 +1076,10 @@ cs: reopen: reopened: Stav problému změněn na „Otevřeno” comments: + comment_from_html: Komentář od %{user_link} z %{comment_created_at} reassign_param: Znovu pověřit řešením problému? reports: - reported_by_html: Nahlášeno jako %{category} uživatelem %{user} + reported_by_html: Nahlášeno jako %{category} uživatelem %{user} v %{updated_at} helper: reportable_title: diary_comment: '%{entry_title}, komentář #%{comment_id}' diff --git a/config/locales/de.yml b/config/locales/de.yml index b128ce828..e90b20abd 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -387,7 +387,7 @@ de: index: title: Änderungssätze title_user: Änderungssätze von %{user} - title_friend: Änderungssätze meiner Freunde + title_friend: Änderungssätze von meinen Freunden title_nearby: Änderungssätze von Benutzern in der Nähe empty: Keine Änderungssätze gefunden. empty_area: Keine Änderungssätze in diesem Bereich. @@ -414,7 +414,7 @@ de: hast, für den Abruf zu lang. diary_entries: new: - title: Neuer Blog-Eintrag + title: Neuer Blogeintrag form: subject: 'Betreff:' body: 'Text:' @@ -1142,6 +1142,7 @@ de: reopen: reopened: Der Problemstatus wurde auf „Offen“ geändert comments: + comment_from_html: Kommentar von %{user_link} erstellt am %{comment_created_at} reassign_param: Problem erneut zuweisen? reports: reported_by_html: Gemeldet als %{category} von %{user} bei %{updated_at} diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 74d311592..2c6d55920 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -1205,7 +1205,7 @@ eo: hi: Saluton %{to_user}, subject: '[OpenStreetMap] %{user} aldonis vin kiel amikon' had_added_you: '%{user} aldonis vin kiel amikon je OpenStreetMap.' - see_their_profile: Vi povas vidi lian profilon ĉe %{userurl}. + see_their_profile: Vi povas vidi ties profilon ĉe %{userurl}. befriend_them: Vi ankaŭ povas aldoni vin kiel amikon ĉe %{befriendurl}. gpx_notification: greeting: Saluton, diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 93115a964..0f0f56424 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1097,9 +1097,10 @@ gl: reopen: reopened: O estado da incidencia mudou a "Aberta" comments: + comment_from_html: Comentario de %{user_link} no %{comment_created_at} reassign_param: Reasignar o erro? reports: - reported_by_html: Denunciouse coma %{category} por %{user} + reported_by_html: Denunciado coma %{category} por %{user} o %{updated_at} helper: reportable_title: diary_comment: '%{entry_title}, comentario #%{comment_id}' diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml index 1a953a4ae..ca1f1fe08 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -1114,9 +1114,10 @@ pt-PT: reopen: reopened: O estado do problema foi alterado para 'Aberto' comments: + comment_from_html: Comentário de %{user_link} no %{comment_created_at} reassign_param: Reatribuir o problema? reports: - reported_by_html: Denunciado como %{category} por %{user} + reported_by_html: Reportado como %{category} por %{user} em %{updated_at} helper: reportable_title: diary_comment: '%{entry_title}, comentário #%{comment_id}' diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 5e47ffbf6..de077b020 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1438,11 +1438,11 @@ sv: \nOpenStreetMap Foundation (OSMF) \npå gemenskapens vägnar. Användning av alla OSMF-drivna tjänster är föremål\nför våra \npolicyer - för acceptabel användning och vår integritetspolicy\n
- \nVänligen kontakta OSMF \nom - du har frågor eller funderingar om licenser, upphovsrätt eller andra rättsliga - frågor.\n
\nOpenStreetMap, förstoringsglaslogotypen och State of the Map - är registrerade + för acceptabel användning och vår integritetspolicy." + legal_2_html: "Vänligen kontakta + OSMF \nom du har frågor eller funderingar om licenser, upphovsrätt eller + andra rättsliga frågor.\n
\nOpenStreetMap, förstoringsglaslogotypen och + State of the Map är registrerade varumärken av OSMF." partners_title: Partners copyright: @@ -2062,6 +2062,7 @@ sv: no_apps_html: Har du ett program som du vill registrera för användning hos oss med hjälp av %{oauth}-standarden? Du måste registrera din webbapplikation innan du kan göra OAuth-anropp till den här tjänsten. + oauth: OAuth registered_apps: 'Du har följande klientapplikationer registrerade:' register_new: Registrera din applikation form: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 07cf0302d..b7d0974b1 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1127,9 +1127,10 @@ uk: reopen: reopened: Статус проблеми був змінений на 'Відкрито' comments: + comment_from_html: Коментар від %{user_link}, %{comment_created_at} reassign_param: Перепризначити проблему? reports: - reported_by_html: Повідомлено як %{category}, %{user} + reported_by_html: Повідомлено як %{category}, %{user}, %{updated_at} helper: reportable_title: diary_comment: '%{entry_title}, коментар #%{comment_id}' @@ -1445,7 +1446,8 @@ uk: \nвід імені спільноти. Використання усіх сервісів, підконтрольних OSMF, здійснюється на основі \nПравил щодо прийнятного використання та нашій Політиці - конфіденційності.\n
\nБудь ласка, звʼяжіться + конфіденційності." + legal_2_html: "Будь ласка, звʼяжіться з OSMF, \nякщо у Вас є питання чи проблеми щодо ліцензування, авторських прав та інших юридичних питань.\n
\nЛоготип OpenStreepMap та State of the Map є зареєстрованими @@ -2058,6 +2060,7 @@ uk: no_apps_html: Чи є у вас програми, які б ви хотіли зареєструватися для взаємодії з нами через стандарт %{oauth}? Ви повинні зареєструвати ваш веб-застосунок перед тим, як він зможе зробити OAuth-запит до цієї служби. + oauth: OAuth registered_apps: 'У вас зареєстровані наступні клієнтські застосунки:' register_new: Зареєструвати ваш застосунок form: @@ -2531,7 +2534,7 @@ uk: until_login: Активне до тих пір, доки користувач не увійде в систему. time_future_and_until_login: Закінчується через %{time} і після входу користувача в систему. - time_past: Закінчилось %{time} тому. + time_past: Закінчилось %{time}. block_duration: hours: one: '%{count} година' diff --git a/lib/rich_text.rb b/lib/rich_text.rb index 1de7b882b..8950c6888 100644 --- a/lib/rich_text.rb +++ b/lib/rich_text.rb @@ -61,9 +61,9 @@ module RichText def linkify(text, mode = :urls) if text.html_safe? - Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferer")).html_safe + Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferrer")).html_safe else - Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferer")) + Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferrer")) end end end diff --git a/test/lib/rich_text_test.rb b/test/lib/rich_text_test.rb index e1603fb09..80cf0ae37 100644 --- a/test/lib/rich_text_test.rb +++ b/test/lib/rich_text_test.rb @@ -8,14 +8,14 @@ class RichTextTest < ActiveSupport::TestCase assert_html r do assert_select "a", 1 assert_select "a[href='http://example.com/']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("html", "foo bar baz") assert_html r do assert_select "a", 1 assert_select "a[href='http://example.com/']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("html", "foo example@example.com bar") @@ -27,7 +27,7 @@ class RichTextTest < ActiveSupport::TestCase assert_html r do assert_select "a", 1 assert_select "a[href='mailto:example@example.com']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("html", "foo
bar
baz") @@ -64,28 +64,28 @@ class RichTextTest < ActiveSupport::TestCase assert_html r do assert_select "a", 1 assert_select "a[href='http://example.com/']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("markdown", "foo [bar](http://example.com/) baz") assert_html r do assert_select "a", 1 assert_select "a[href='http://example.com/']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("markdown", "foo example@example.com bar") assert_html r do assert_select "a", 1 assert_select "a[href='mailto:example@example.com']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("markdown", "foo [bar](mailto:example@example.com) bar") assert_html r do assert_select "a", 1 assert_select "a[href='mailto:example@example.com']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("markdown", "foo ![bar](http://example.com/example.png) bar") @@ -162,7 +162,7 @@ class RichTextTest < ActiveSupport::TestCase assert_html r do assert_select "a", 1 assert_select "a[href='http://example.com/']", 1 - assert_select "a[rel='nofollow noopener noreferer']", 1 + assert_select "a[rel='nofollow noopener noreferrer']", 1 end r = RichText.new("text", "foo example@example.com bar")