[openstreetmap/openstreetmap-website] Language selection enhancements (PR #6412)
Tom Hughes
notifications at github.com
Mon Sep 22 20:11:37 UTC 2025
@tomhughes commented on this pull request.
This isn't a complete review because I need to refresh my memory of how the language changes work and the changes this is making to that because it all looks horrible to me and I want to see if there's a better way to do it so this is just a few initial thoughts.
> @@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class LanguagesController < ApplicationController
+ before_action :authorize_web
+ before_action :set_locale
+ authorize_resource :class => false
+
+ def show
+ @source_page = params[:source]
+ render :partial => "layouts/select_language_list_frame"
Why not use the standard rails view name of `languages/show` for this, then you would just need `render :layout => false` like the other panes?
> @@ -208,6 +208,7 @@
post "/login" => "sessions#create"
match "/logout" => "sessions#destroy", :via => [:get, :post]
get "/offline" => "site#offline"
+ resource :language, :path => "/select_language_list", :only => :show
Maybe we should use the same naming as the other panes?
```suggestion
resource :languages_pane, :path => "/panes/languages", :only => :show
```
> @@ -116,15 +116,21 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= t "javascripts.close" %>"></button>
</div>
<div class="modal-body px-1">
- <% if current_user&.id %>
- <%= form_tag basic_preferences_path, :method => "PUT" do %>
- <%= hidden_field_tag "referer", request.fullpath %>
- <%= hidden_field_tag "language", I18n.locale %>
- <%= render "layouts/select_language_list" %>
- <% end %>
- <% else %>
- <%= render "layouts/select_language_list" %>
- <% end %>
+ <div class="mb-3 px-2">
What's the logic behind rendering the search form in the main page instead of as part of the turbo frame?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6412#pullrequestreview-3254980074
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6412/review/3254980074 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250922/ac8f1c48/attachment.htm>
More information about the rails-dev
mailing list