diff --git a/app/controllers/map_controller.rb b/app/controllers/map/leaflet_controller.rb similarity index 97% rename from app/controllers/map_controller.rb rename to app/controllers/map/leaflet_controller.rb index 622f8112..2c5e2672 100644 --- a/app/controllers/map_controller.rb +++ b/app/controllers/map/leaflet_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class MapController < ApplicationController +class Map::LeafletController < ApplicationController before_action :authenticate_user! layout 'map', only: :index diff --git a/app/controllers/maps/maplibre_controller.rb b/app/controllers/map/maplibre_controller.rb similarity index 98% rename from app/controllers/maps/maplibre_controller.rb rename to app/controllers/map/maplibre_controller.rb index 302f3a54..506eb733 100644 --- a/app/controllers/maps/maplibre_controller.rb +++ b/app/controllers/map/maplibre_controller.rb @@ -1,4 +1,4 @@ -module Maps +module Map class MaplibreController < ApplicationController before_action :authenticate_user! layout 'map' diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb deleted file mode 100644 index efbb024f..00000000 --- a/app/controllers/maps_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class MapsController < ApplicationController - def index - redirect_to maps_v2_path - end -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 16f117bb..3f5bc50a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -144,9 +144,9 @@ module ApplicationHelper end def preferred_map_path - return map_path unless user_signed_in? + return map_v1_path unless user_signed_in? preferred_version = current_user.safe_settings.maps&.dig('preferred_version') - preferred_version == 'v2' ? maps_v2_path : map_path + preferred_version == 'v2' ? map_v2_path : map_v1_path end end diff --git a/app/views/map/_settings_modals.html.erb b/app/views/map/leaflet/_settings_modals.html.erb similarity index 100% rename from app/views/map/_settings_modals.html.erb rename to app/views/map/leaflet/_settings_modals.html.erb diff --git a/app/views/map/index.html.erb b/app/views/map/leaflet/index.html.erb similarity index 96% rename from app/views/map/index.html.erb rename to app/views/map/leaflet/index.html.erb index 6b506660..1086601b 100644 --- a/app/views/map/index.html.erb +++ b/app/views/map/leaflet/index.html.erb @@ -29,7 +29,7 @@ -<%= render 'map/settings_modals' %> +<%= render 'map/leaflet/settings_modals' %> <%= render 'shared/place_creation_modal' %> diff --git a/app/views/maps/maplibre/_area_creation_modal.html.erb b/app/views/map/maplibre/_area_creation_modal.html.erb similarity index 100% rename from app/views/maps/maplibre/_area_creation_modal.html.erb rename to app/views/map/maplibre/_area_creation_modal.html.erb diff --git a/app/views/maps/maplibre/_settings_panel.html.erb b/app/views/map/maplibre/_settings_panel.html.erb similarity index 100% rename from app/views/maps/maplibre/_settings_panel.html.erb rename to app/views/map/maplibre/_settings_panel.html.erb diff --git a/app/views/maps/maplibre/_visit_creation_modal.html.erb b/app/views/map/maplibre/_visit_creation_modal.html.erb similarity index 100% rename from app/views/maps/maplibre/_visit_creation_modal.html.erb rename to app/views/map/maplibre/_visit_creation_modal.html.erb diff --git a/app/views/maps/maplibre/index.html.erb b/app/views/map/maplibre/index.html.erb similarity index 91% rename from app/views/maps/maplibre/index.html.erb rename to app/views/map/maplibre/index.html.erb index c0e33add..9d6bc8ac 100644 --- a/app/views/maps/maplibre/index.html.erb +++ b/app/views/map/maplibre/index.html.erb @@ -36,13 +36,13 @@ - <%= render 'maps/maplibre/settings_panel' %> + <%= render 'map/maplibre/settings_panel' %> - <%= render 'maps/maplibre/visit_creation_modal' %> + <%= render 'map/maplibre/visit_creation_modal' %> - <%= render 'maps/maplibre/area_creation_modal' %> + <%= render 'map/maplibre/area_creation_modal' %> <%= render 'shared/place_creation_modal' %> diff --git a/app/views/shared/map/_date_navigation_v2.html.erb b/app/views/shared/map/_date_navigation_v2.html.erb index b3262c50..15cf0756 100644 --- a/app/views/shared/map/_date_navigation_v2.html.erb +++ b/app/views/shared/map/_date_navigation_v2.html.erb @@ -17,12 +17,12 @@