From: Anton Khorev Date: Wed, 27 Jul 2022 18:28:12 +0000 (+0300) Subject: Merge master with css changes X-Git-Tag: live~1620^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/bb868e0b11b25eb000a2c71cc993db86e383e0f3?hp=eb0f6d5952761257836cf9c99a9b007ad84b70c6 Merge master with css changes --- diff --git a/Gemfile.lock b/Gemfile.lock index 8de786156..4de4c7996 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - aasm (5.2.0) + aasm (5.3.0) concurrent-ruby (~> 1.0) actioncable (7.0.3.1) actionpack (= 7.0.3.1) @@ -86,7 +86,7 @@ GEM autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.608.0) + aws-partitions (1.610.0) aws-sdk-core (3.131.3) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -99,7 +99,7 @@ GEM aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.0) + aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) better_errors (2.9.1) coderay (>= 1.0.0) @@ -165,7 +165,7 @@ GEM docile (1.4.0) doorkeeper (5.5.4) railties (>= 5) - doorkeeper-i18n (5.2.3) + doorkeeper-i18n (5.2.4) doorkeeper (>= 5.2) dry-configurable (0.15.0) concurrent-ruby (~> 1.0) @@ -286,7 +286,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.16.2) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_xml (0.6.0) net-imap (0.2.3) @@ -304,7 +304,7 @@ GEM net-protocol timeout nio4r (2.5.8) - nokogiri (1.13.7) + nokogiri (1.13.8) mini_portile2 (~> 2.8.0) racc (~> 1.4) oauth (0.4.7) @@ -356,7 +356,7 @@ GEM parser (3.1.2.0) ast (~> 2.4.1) pg (1.4.1) - popper_js (2.9.3) + popper_js (2.11.5) progress (3.6.0) public_suffix (4.0.7) puma (5.6.4) @@ -370,7 +370,7 @@ GEM rack-openid (1.4.2) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-protection (2.2.1) + rack-protection (2.2.2) rack rack-test (2.0.2) rack (>= 1.3) @@ -419,14 +419,14 @@ GEM rexml (3.2.5) rinku (2.0.6) rotp (6.2.0) - rubocop (1.31.2) + rubocop (1.32.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.19.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.19.1) @@ -482,13 +482,13 @@ GEM sprockets (>= 3.0.0) strong_migrations (1.2.0) activerecord (>= 5.2) - strscan (3.0.3) + strscan (3.0.4) terser (1.1.12) execjs (>= 0.3.0, < 3) thor (1.2.1) - tilt (2.0.10) + tilt (2.0.11) timeout (0.3.0) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) unicode-display_width (2.2.0) validates_email_format_of (1.6.3) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 2eb6bf98e..1f80a9b5b 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -357,14 +357,6 @@ body.compact-nav { clear: both; width: 100%; } - - h2 { - font-size: 1.5rem; - } - - h3, h4 { - font-size: 1.25rem; - } } .overlay-sidebar #sidebar { @@ -1437,13 +1429,11 @@ dl.dl-inline { .richtext, .prose { code { - font-size: 13px; background: $lightgrey; padding: 2px 3px; } pre { - font-size: 13px; background: $lightgrey; padding: 2px 3px; white-space: pre-wrap; @@ -1486,19 +1476,10 @@ dl.dl-inline { /* Rules for the "Welcome" page */ .site-welcome, .site-fixthemap { - .center { - text-align: center; - .sprite { - float: none; - margin: auto; - } - } - .sprite { background-image: image-url("welcome-sprite.png"); background-size: 500px 250px; display: block; - float: left; } .icon-list { @@ -1548,15 +1529,6 @@ dl.dl-inline { /* no-r2 */ background-position: -350px 0; } - .start-mapping { - margin: auto; - cursor: pointer; - border: none; - padding: 20px 40px; - font-size: 30px; - text-decoration: none; - } - .icon.note { background-color: #333; border-radius: 4px; diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 00b3e78da..02852dc67 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -7,6 +7,7 @@ class SiteController < ApplicationController before_action :redirect_browse_params, :only => :index before_action :redirect_map_params, :only => [:index, :edit, :export] before_action :require_oauth, :only => [:index] + before_action :require_user, :only => [:id] before_action :update_totp, :only => [:index] authorize_resource :class => false diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 534f98810..6215403c9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -271,7 +271,7 @@ class UsersController < ApplicationController session[:new_user].auth_provider = provider session[:new_user].auth_uid = uid - session[:new_user].status = "active" if email_verified && email == session[:new_user].email + session[:new_user].activate if email_verified && email == session[:new_user].email redirect_to :action => "terms" else diff --git a/app/views/site/about.html.erb b/app/views/site/about.html.erb index 3753dcc8d..b4b21a567 100644 --- a/app/views/site/about.html.erb +++ b/app/views/site/about.html.erb @@ -8,14 +8,14 @@
-

<%= t ".used_by_html", :name => tag.span("OpenStreetMap", :class => "user-name"), :locale => @locale %>

+

<%= t ".used_by_html", :name => tag.span("OpenStreetMap", :class => "user-name"), :locale => @locale %>

-

<%= t ".lede_text", :locale => @locale %>

+

<%= t ".lede_text", :locale => @locale %>

<%= t ".local_knowledge_title", :locale => @locale %>

<%= t ".local_knowledge_html", :locale => @locale %>

diff --git a/app/views/site/fixthemap.html.erb b/app/views/site/fixthemap.html.erb index f5adb83ac..70118b980 100644 --- a/app/views/site/fixthemap.html.erb +++ b/app/views/site/fixthemap.html.erb @@ -6,31 +6,29 @@

<%= t ".title" %>

<% end %> -

<%= t "layouts.intro_header" %>

-

<%= t "layouts.intro_text" %>

+

<%= t "layouts.intro_header" %>

+

<%= t "layouts.intro_text" %>

-

<%= t ".how_to_help.title" %>

+

<%= t ".how_to_help.title" %>

-
-
-
-
<%= t ".how_to_help.join_the_community.title" %>
-

<%= t ".how_to_help.join_the_community.explanation_html" %>

-

- <%= t("layouts.start_mapping") %> -

-
-
-
<%= t "site.welcome.add_a_note.title" %>
-

<%= t "site.welcome.add_a_note.paragraph_1_html" %>

-

<%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

-
+
+
+
<%= t ".how_to_help.join_the_community.title" %>
+

<%= t ".how_to_help.join_the_community.explanation_html" %>

+

+ <%= t("layouts.start_mapping") %> +

+
+
+
<%= t "site.welcome.add_a_note.title" %>
+

<%= t "site.welcome.add_a_note.paragraph_1_html" %>

+

<%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

-

<%= t ".other_concerns.title" %>

+

<%= t ".other_concerns.title" %>

<%= t ".other_concerns.explanation_html" %>

-

<%= t "site.welcome.questions.title" %>

- +

<%= t "site.welcome.questions.title" %>

+

<%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %>

diff --git a/app/views/site/welcome.html.erb b/app/views/site/welcome.html.erb index 4617935e7..7c1ee38ab 100644 --- a/app/views/site/welcome.html.erb +++ b/app/views/site/welcome.html.erb @@ -6,66 +6,66 @@

<%= t ".title" %>

<% end %> -

<%= t ".introduction_html" %>

+

<%= t ".introduction_html" %>

-

<%= t ".whats_on_the_map.title" %>

+

<%= t ".whats_on_the_map.title" %>

-
- +
+

<%= t ".whats_on_the_map.on_html" %>

- +

<%= t ".whats_on_the_map.off_html" %>

-

<%= t ".basic_terms.title" %>

+

<%= t ".basic_terms.title" %>

<%= t ".basic_terms.paragraph_1_html" %>

-
+
- +

<%= t ".basic_terms.editor_html" %>

- +

<%= t ".basic_terms.node_html" %>

- +

<%= t ".basic_terms.way_html" %>

- +

<%= t ".basic_terms.tag_html" %>

-
-

<%= t ".rules.title" %>

- +
+

<%= t ".rules.title" %>

+

<%= t ".rules.paragraph_1_html" %>

-
-

<%= t ".questions.title" %>

- +
+

<%= t ".questions.title" %>

+

<%= t ".questions.paragraph_1_html", :help_url => help_path %>

-
-

<%= t ".start_mapping" %>

+
-

<%= t ".add_a_note.title" %>

+

<%= t ".add_a_note.title" %>

<%= t ".add_a_note.paragraph_1_html" %>

<%= t ".add_a_note.paragraph_2_html", :map_url => root_path %>

diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index e72c423d7..69f58b5b8 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -12,19 +12,19 @@ - + - + <% if @trace.inserted? %> - + - + <% end %> - + - + - + - +
<%= t ".filename" %><%= t ".filename" %> <%= @trace.name %> (<%= link_to t(".download"), trace_data_path(@trace) %>)
<%= t ".uploaded" %><%= t ".uploaded" %> <%= l @trace.timestamp, :format => :friendly %>
<%= t ".points" %><%= t ".points" %> <%= number_with_delimiter(@trace.size) %>
<%= t ".start_coordinates" %><%= t ".start_coordinates" %>
<%= t ".coordinates_html", @@ -35,15 +35,15 @@
<%= t ".owner" %><%= t ".owner" %> <%= link_to @trace.user.display_name, user_path(@trace.user) %>
<%= t ".description" %><%= t ".description" %> <%= @trace.description %>
<%= t ".tags" %><%= t ".tags" %> <% unless @trace.tags.empty? %> <%= safe_join(@trace.tags.collect { |tag| link_to tag.tag, :controller => "traces", :action => "index", :tag => tag.tag, :id => nil }, ", ") %> @@ -53,13 +53,11 @@
<%= t ".visibility" %><%= t ".visibility" %> <%= t "traces.visibility.#{@trace.visibility}" %>
-

- <% if current_user && (current_user==@trace.user || current_user.administrator? || current_user.moderator?) %>
<% if current_user == @trace.user %> diff --git a/config/locales/de.yml b/config/locales/de.yml index 9d2d4b1be..761aa0102 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -2114,21 +2114,20 @@ de: ist credit_1_html: 'Wenn du OpenStreetMap-Daten verwendest, musst du die folgenden zwei Bedingungen erfüllen:' - credit_2_1_html: "
    \n
  • Nenne OpenStreetMap, indem du unseren Urheberrechts-Hinweis - anzeigst
  • \n
  • Mache deutlich, dass die Daten unter der Open-Database-Lizenz + credit_2_1_html: "
      \n
    • Nenne OpenStreetMap, indem du unseren Urheberrechtshinweis + anzeigst.
    • \n
    • Mache deutlich, dass die Daten unter der Open-Database-Lizenz verfügbar sind.
    • \n
    " credit_3_1_html: Für den Urheberrechtshinweis haben wir unterschiedliche Anforderungen, wie dieser angezeigt werden muss, je nachdem, wie du unsere Daten verwendest. Beispielsweise gelten unterschiedliche Regeln für die Anzeige des Urheberrechtsvermerks, je nachdem, ob du eine blätterbare Karte, eine gedruckte Karte oder ein statisches Bild erstellt hast. Ausführliche Informationen zu den Anforderungen - findest du im den Richtlinien + findest du in den Richtlinien zur Namensnennung. credit_4_html: |- Du musst auch klarstellen, dass die Daten unter der Open-Database-Lizenz verfügbar sind. Du kannst dies tun, indem du auf diese Urheberrechtsseite verlinkst. - Ersatzweise, und als Erfordernis, falls du OSM in Datenform weitergibst, - kannst du die Lizenz(en) direkt verlinken und benennen. In Medien, in denen keine Links möglich sind (z.B. gedruckte Werken), empfehlen wir dir, deine Leser direkt auf openstreetmap.org zu verweisen (möglicherweise mit dem Erweitern von „OpenStreetMap“ zur vollen Adresse), auf opendatacommons.org, und, sofern zutreffend, auf creativecommons.org. + Ersatzweise kannst du bzw. musst du, falls du OSM in Datenform weitergibst, die Lizenz(en) direkt verlinken und benennen. In Medien, in denen keine Links möglich sind (z. B. in gedruckten Werken), empfehlen wir dir, deine Leser direkt auf openstreetmap.org zu verweisen (möglicherweise mit dem Erweitern von „OpenStreetMap“ zur vollen Adresse), auf opendatacommons.org und, sofern zutreffend, auf creativecommons.org. attribution_example: alt: Beispiel, wie man auf OpenStreetMap auf einer Webseite hinweist title: Namensnennungs-Beispiel auf einer Website mit elektronischer Karte diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 76c06f438..27fee15cc 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1209,7 +1209,7 @@ zh-TW: village: 村里 "yes": 地點 railway: - abandoned: 已拆除鐵路 + abandoned: 遺跡鐵路 buffer_stop: 緩衝站 construction: 建造中鐵路 disused: 廢棄鐵路 diff --git a/test/controllers/site_controller_test.rb b/test/controllers/site_controller_test.rb index 2d47e7de7..ccd8ba254 100644 --- a/test/controllers/site_controller_test.rb +++ b/test/controllers/site_controller_test.rb @@ -520,4 +520,12 @@ class SiteControllerTest < ActionDispatch::IntegrationTest assert_template "id" assert_template :layout => false end + + # Test the id frame when not logged in + def test_id_without_login + get id_path + + assert_response :redirect + assert_redirected_to login_path(:referer => "/id") + end end diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index 7163e1b72..d7f6f5200 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -384,15 +384,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest end def test_user_create_google_success - OmniAuth.config.add_mock(:google, :uid => "123454321", :extra => { - :id_info => { "openid_id" => "http://localhost:1123/new.tester" } - }) - new_email = "newtester-google@osm.org" display_name = "new_tester-google" password = "testtest" + + OmniAuth.config.add_mock(:google, :uid => "123454321", :info => { "email" => new_email }) + assert_difference("User.count") do - assert_difference("ActionMailer::Base.deliveries.size", 1) do + assert_no_difference("ActionMailer::Base.deliveries.size") do perform_enqueued_jobs do post "/user/new", :params => { :user => { :email => new_email, @@ -419,6 +418,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :pass_crypt_confirmation => password }, :read_ct => 1, :read_tou => 1 } assert_response :redirect + assert_redirected_to welcome_path follow_redirect! end end @@ -426,7 +426,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success - assert_template "confirmations/confirm" + assert_template "site/welcome" ActionMailer::Base.deliveries.clear end @@ -538,13 +538,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest end def test_user_create_facebook_success - OmniAuth.config.add_mock(:facebook, :uid => "123454321") - new_email = "newtester-facebook@osm.org" display_name = "new_tester-facebook" password = "testtest" + + OmniAuth.config.add_mock(:facebook, :uid => "123454321", :info => { "email" => new_email }) + assert_difference("User.count") do - assert_difference("ActionMailer::Base.deliveries.size", 1) do + assert_no_difference("ActionMailer::Base.deliveries.size") do perform_enqueued_jobs do post "/user/new", :params => { :user => { :email => new_email, @@ -571,6 +572,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :pass_crypt_confirmation => password }, :read_ct => 1, :read_tou => 1 } assert_response :redirect + assert_redirected_to welcome_path follow_redirect! end end @@ -578,7 +580,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success - assert_template "confirmations/confirm" + assert_template "site/welcome" ActionMailer::Base.deliveries.clear end @@ -688,11 +690,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest end def test_user_create_windowslive_success - OmniAuth.config.add_mock(:windowslive, :uid => "123454321") - new_email = "newtester-windowslive@osm.org" display_name = "new_tester-windowslive" password = "testtest" + + OmniAuth.config.add_mock(:windowslive, :uid => "123454321", :info => { "email" => new_email }) + assert_difference("User.count") do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do @@ -721,6 +724,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :pass_crypt_confirmation => password }, :read_ct => 1, :read_tou => 1 } assert_response :redirect + assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name follow_redirect! end end @@ -838,11 +842,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest end def test_user_create_github_success - OmniAuth.config.add_mock(:github, :uid => "123454321") - new_email = "newtester-github@osm.org" display_name = "new_tester-github" password = "testtest" + + OmniAuth.config.add_mock(:github, :uid => "123454321", :info => { "email" => new_email }) + assert_difference("User.count") do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do @@ -872,6 +877,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :read_ct => 1, :read_tou => 1 } assert_response :redirect + assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name follow_redirect! end end @@ -990,11 +996,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest end def test_user_create_wikipedia_success - OmniAuth.config.add_mock(:wikipedia, :uid => "123454321") - new_email = "newtester-wikipedia@osm.org" display_name = "new_tester-wikipedia" password = "testtest" + + OmniAuth.config.add_mock(:wikipedia, :uid => "123454321", :info => { "email" => new_email }) + assert_difference("User.count") do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do @@ -1024,6 +1031,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :read_ct => 1, :read_tou => 1 } assert_response :redirect + assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name follow_redirect! end end