]> git.openstreetmap.org Git - rails.git/commitdiff
Welcome screen displays 'Continue with authorization'
authorMilan Cvetkovic <mcvetkovic@microsoft.com>
Mon, 6 Nov 2023 13:16:49 +0000 (13:16 +0000)
committerMilan Cvetkovic <mcvetkovic@microsoft.com>
Tue, 21 Nov 2023 11:56:09 +0000 (11:56 +0000)
do not hide notes

app/controllers/users_controller.rb
app/views/site/welcome.html.erb
config/locales/en.yml

index 36c9f4e2288f06185726045826ae82ed9d927bb0..6db39d2d0ca3360af3dcc5408ffb02b491f35fdb 100644 (file)
@@ -199,8 +199,9 @@ class UsersController < ApplicationController
 
           referer = welcome_path
 
+          uri = URI(session[:referer]) if session[:referer].present?
+
           begin
-            uri = URI(session[:referer])
             %r{map=(.*)/(.*)/(.*)}.match(uri.fragment) do |m|
               editor = Rack::Utils.parse_query(uri.query).slice("editor")
               referer = welcome_path({ "zoom" => m[1],
@@ -212,6 +213,7 @@ class UsersController < ApplicationController
           end
 
           if current_user.status == "active"
+            referer = welcome_path({"oauth_return_url" => uri.to_s}) if uri&.path == oauth_authorization_path
             session[:referer] = referer
             successful_login(current_user)
           else
index b05620f599efbbc74ed6f32603d4c2e77d312f45..8ec32ea9c86e8446f870b9f3506ccec2158cf17a 100644 (file)
 </div>
 
 <div class='clearfix text-center'>
-  <p class="display-5"><a href="<%= edit_path %>" class="button start-mapping"><%= t ".start_mapping" %></a></p>
+  <p class="display-5">
+<% if params[:oauth_return_url] %>
+  <a class="btn btn-primary" href="<%= params[:oauth_return_url] %>"><%= t ".continue_authorization" %></a>
+<% else %>
+  <a class="button btn btn-primary start-mapping" href="<%= edit_path %>"><%= t ".start_mapping" %></a>
+<% end %>
+  </p>
 </div>
 
 <div class='alert alert-primary'>
index 1a41dcce814de5f00882f7393c780f5b616f12c6..f98a78a3156796c34d9bebb0d564628a847d2c8a 100644 (file)
@@ -2382,6 +2382,7 @@ en:
         automated_edits: Automated Edits
         automated_edits_url: https://wiki.openstreetmap.org/wiki/Automated_Edits_code_of_conduct
       start_mapping: Start Mapping
+      continue_authorization: Continue Authorization
       add_a_note:
         title: No Time To Edit? Add a Note!
         para_1: |