mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Updte map view
This commit is contained in:
parent
8c9fc5a5e0
commit
6787273713
11 changed files with 107 additions and 55 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
# [0.34.1] - 2025-10-30
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Broken Stats page for users with no reverse geocoding enabled. #1877
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Date navigation on the map page is no longer shown as floating panel. It is now part of the top navigation bar to prevent overlapping with other map controls. #1894 #1881
|
||||||
|
|
||||||
# [0.34.0] - 2025-10-10
|
# [0.34.0] - 2025-10-10
|
||||||
|
|
||||||
## The Family release
|
## The Family release
|
||||||
|
|
|
||||||
2
Gemfile
2
Gemfile
|
|
@ -49,7 +49,7 @@ gem 'sprockets-rails'
|
||||||
gem 'stackprof'
|
gem 'stackprof'
|
||||||
gem 'stimulus-rails'
|
gem 'stimulus-rails'
|
||||||
gem 'strong_migrations', '>= 2.4.0'
|
gem 'strong_migrations', '>= 2.4.0'
|
||||||
gem 'tailwindcss-rails', '>= 3.3.2'
|
gem 'tailwindcss-rails', '= 3.3.2'
|
||||||
gem 'turbo-rails', '>= 2.0.17'
|
gem 'turbo-rails', '>= 2.0.17'
|
||||||
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
|
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
|
||||||
|
|
||||||
|
|
|
||||||
17
Gemfile.lock
17
Gemfile.lock
|
|
@ -491,14 +491,15 @@ GEM
|
||||||
attr_extras (>= 6.2.4)
|
attr_extras (>= 6.2.4)
|
||||||
diff-lcs
|
diff-lcs
|
||||||
patience_diff
|
patience_diff
|
||||||
tailwindcss-rails (4.3.0)
|
tailwindcss-rails (3.3.2)
|
||||||
railties (>= 7.0.0)
|
railties (>= 7.0.0)
|
||||||
tailwindcss-ruby (~> 4.0)
|
tailwindcss-ruby (~> 3.0)
|
||||||
tailwindcss-ruby (4.1.13)
|
tailwindcss-ruby (3.4.17)
|
||||||
tailwindcss-ruby (4.1.13-aarch64-linux-gnu)
|
tailwindcss-ruby (3.4.17-aarch64-linux)
|
||||||
tailwindcss-ruby (4.1.13-arm64-darwin)
|
tailwindcss-ruby (3.4.17-arm-linux)
|
||||||
tailwindcss-ruby (4.1.13-x86_64-darwin)
|
tailwindcss-ruby (3.4.17-arm64-darwin)
|
||||||
tailwindcss-ruby (4.1.13-x86_64-linux-gnu)
|
tailwindcss-ruby (3.4.17-x86_64-darwin)
|
||||||
|
tailwindcss-ruby (3.4.17-x86_64-linux)
|
||||||
thor (1.4.0)
|
thor (1.4.0)
|
||||||
timeout (0.4.3)
|
timeout (0.4.3)
|
||||||
tsort (0.2.0)
|
tsort (0.2.0)
|
||||||
|
|
@ -600,7 +601,7 @@ DEPENDENCIES
|
||||||
stimulus-rails
|
stimulus-rails
|
||||||
strong_migrations (>= 2.4.0)
|
strong_migrations (>= 2.4.0)
|
||||||
super_diff
|
super_diff
|
||||||
tailwindcss-rails (>= 3.3.2)
|
tailwindcss-rails (= 3.3.2)
|
||||||
turbo-rails (>= 2.0.17)
|
turbo-rails (>= 2.0.17)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
webmock
|
webmock
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -3,6 +3,7 @@
|
||||||
class Users::RegistrationsController < Devise::RegistrationsController
|
class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
before_action :set_invitation, only: %i[new create]
|
before_action :set_invitation, only: %i[new create]
|
||||||
before_action :check_registration_allowed, only: %i[new create]
|
before_action :check_registration_allowed, only: %i[new create]
|
||||||
|
before_action :store_utm_params, only: %i[new]
|
||||||
|
|
||||||
def new
|
def new
|
||||||
build_resource({})
|
build_resource({})
|
||||||
|
|
@ -16,8 +17,9 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
super do |resource|
|
super do |resource|
|
||||||
if resource.persisted? && @invitation
|
if resource.persisted?
|
||||||
accept_invitation_for_user(resource)
|
assign_utm_params(resource)
|
||||||
|
accept_invitation_for_user(resource) if @invitation
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -90,4 +92,23 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
def sign_up_params
|
def sign_up_params
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def store_utm_params
|
||||||
|
utm_params = %w[utm_source utm_medium utm_campaign utm_term utm_content]
|
||||||
|
utm_params.each do |param|
|
||||||
|
session[param] = params[param] if params[param].present?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def assign_utm_params(user)
|
||||||
|
utm_params = %w[utm_source utm_medium utm_campaign utm_term utm_content]
|
||||||
|
utm_data = {}
|
||||||
|
|
||||||
|
utm_params.each do |param|
|
||||||
|
utm_data[param] = session[param] if session[param].present?
|
||||||
|
session.delete(param) # Clean up session after assignment
|
||||||
|
end
|
||||||
|
|
||||||
|
user.update_columns(utm_data) if utm_data.any?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,8 @@ export default class extends BaseController {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add markers and route
|
// Add route (no markers on trip forms)
|
||||||
if (this.coordinates?.length > 0) {
|
if (this.coordinates?.length > 0) {
|
||||||
this.addMarkers()
|
|
||||||
this.addPolyline()
|
this.addPolyline()
|
||||||
this.fitMapToBounds()
|
this.fitMapToBounds()
|
||||||
}
|
}
|
||||||
|
|
@ -246,9 +245,8 @@ export default class extends BaseController {
|
||||||
this.polylinesLayer.clearLayers()
|
this.polylinesLayer.clearLayers()
|
||||||
this.photoMarkers.clearLayers()
|
this.photoMarkers.clearLayers()
|
||||||
|
|
||||||
// Add new markers and route if coordinates exist
|
// Add only polyline (no markers) when coordinates exist
|
||||||
if (this.coordinates?.length > 0) {
|
if (this.coordinates?.length > 0) {
|
||||||
this.addMarkers()
|
|
||||||
this.addPolyline()
|
this.addPolyline()
|
||||||
this.fitMapToBounds()
|
this.fitMapToBounds()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Full Screen Map Container -->
|
<!-- Full Screen Map Container -->
|
||||||
<div class='absolute top-16 left-0 right-0 w-full z-20' style='height: calc(100vh - 4rem);'>
|
<div class='absolute top-16 left-0 right-0 bottom-0 w-full z-20 flex flex-col'>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
<% content_for :title, 'Map' %>
|
<% content_for :title, 'Map' %>
|
||||||
|
|
||||||
<!-- Floating Date Navigation Controls -->
|
<!-- Date Navigation Controls - Native Page Element -->
|
||||||
<div class="fixed top-20 left-0 right-0 flex justify-center" style="z-index: 9999; margin-left: 80px; margin-right: 80px;">
|
<div class="w-full px-4 py-3 bg-base-100" data-controller="map-controls">
|
||||||
<div style="width: 1500px; max-width: 100%;" data-controller="map-controls">
|
|
||||||
<!-- Mobile: Compact Toggle Button -->
|
<!-- Mobile: Compact Toggle Button -->
|
||||||
<div class="lg:hidden justify-center flex">
|
<div class="lg:hidden flex justify-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
data-action="click->map-controls#toggle"
|
data-action="click->map-controls#toggle"
|
||||||
|
|
@ -19,7 +18,7 @@
|
||||||
<!-- Expandable Panel (hidden on mobile by default, always visible on desktop) -->
|
<!-- Expandable Panel (hidden on mobile by default, always visible on desktop) -->
|
||||||
<div
|
<div
|
||||||
data-map-controls-target="panel"
|
data-map-controls-target="panel"
|
||||||
class="hidden lg:!block bg-base-100 bg-opacity-95 rounded-lg shadow-lg p-4 mt-2 lg:mt-0 scale-80">
|
class="hidden lg:!block bg-base-100 rounded-lg shadow-lg p-4 mt-2 lg:mt-0">
|
||||||
<%= form_with url: map_path(import_id: params[:import_id]), method: :get do |f| %>
|
<%= form_with url: map_path(import_id: params[:import_id]), method: :get do |f| %>
|
||||||
<div class="flex flex-col space-y-4 lg:flex-row lg:space-y-0 lg:space-x-4 lg:items-end">
|
<div class="flex flex-col space-y-4 lg:flex-row lg:space-y-0 lg:space-x-4 lg:items-end">
|
||||||
<div class="w-full lg:w-1/12">
|
<div class="w-full lg:w-1/12">
|
||||||
|
|
@ -71,29 +70,30 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Full Screen Map -->
|
<!-- Map Container - Fills remaining space -->
|
||||||
<div
|
<div class="w-full h-full">
|
||||||
id='map'
|
<div
|
||||||
class="absolute inset-0 w-full h-full z-0"
|
id='map'
|
||||||
data-controller="maps points add-visit family-members"
|
class="w-full h-full"
|
||||||
data-points-target="map"
|
data-controller="maps points add-visit family-members"
|
||||||
data-api_key="<%= current_user.api_key %>"
|
data-points-target="map"
|
||||||
data-self_hosted="<%= @self_hosted %>"
|
data-api_key="<%= current_user.api_key %>"
|
||||||
data-user_settings='<%= current_user.safe_settings.settings.to_json %>'
|
data-self_hosted="<%= @self_hosted %>"
|
||||||
data-user_theme="<%= current_user&.theme || 'dark' %>"
|
data-user_settings='<%= current_user.safe_settings.settings.to_json %>'
|
||||||
data-coordinates='<%= @coordinates.to_json.html_safe %>'
|
data-user_theme="<%= current_user&.theme || 'dark' %>"
|
||||||
data-tracks='<%= @tracks.to_json.html_safe %>'
|
data-coordinates='<%= @coordinates.to_json.html_safe %>'
|
||||||
data-distance="<%= @distance %>"
|
data-tracks='<%= @tracks.to_json.html_safe %>'
|
||||||
data-points_number="<%= @points_number %>"
|
data-distance="<%= @distance %>"
|
||||||
data-timezone="<%= Rails.configuration.time_zone %>"
|
data-points_number="<%= @points_number %>"
|
||||||
data-features='<%= @features.to_json.html_safe %>'
|
data-timezone="<%= Rails.configuration.time_zone %>"
|
||||||
data-family-members-features-value='<%= @features.to_json.html_safe %>'
|
data-features='<%= @features.to_json.html_safe %>'
|
||||||
data-family-members-user-theme-value="<%= current_user&.theme || 'dark' %>">
|
data-family-members-features-value='<%= @features.to_json.html_safe %>'
|
||||||
<div data-maps-target="container" class="w-full h-full">
|
data-family-members-user-theme-value="<%= current_user&.theme || 'dark' %>">
|
||||||
<div id="fog" class="fog"></div>
|
<div data-maps-target="container" class="w-full h-full">
|
||||||
|
<div id="fog" class="fog"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
<% if DawarichSettings.reverse_geocoding_enabled? %>
|
<% if DawarichSettings.reverse_geocoding_enabled? %>
|
||||||
<%= render 'stats/reverse_geocoding_stats' %>
|
<%= render 'stats/reverse_geocoding_stats' %>
|
||||||
|
<% else %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class='text-xs text-gray-500 text-center mt-5'>
|
<div class='text-xs text-gray-500 text-center mt-5'>
|
||||||
|
|
|
||||||
11
db/migrate/20251030190924_add_utm_parameters_to_users.rb
Normal file
11
db/migrate/20251030190924_add_utm_parameters_to_users.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class AddUtmParametersToUsers < ActiveRecord::Migration[8.0]
|
||||||
|
def change
|
||||||
|
add_column :users, :utm_source, :string
|
||||||
|
add_column :users, :utm_medium, :string
|
||||||
|
add_column :users, :utm_campaign, :string
|
||||||
|
add_column :users, :utm_term, :string
|
||||||
|
add_column :users, :utm_content, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
33
db/schema.rb
generated
33
db/schema.rb
generated
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[8.0].define(version: 2025_09_30_150256) do
|
ActiveRecord::Schema[8.0].define(version: 2025_10_30_190924) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "pg_catalog.plpgsql"
|
enable_extension "pg_catalog.plpgsql"
|
||||||
enable_extension "postgis"
|
enable_extension "postgis"
|
||||||
|
|
@ -113,10 +113,10 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_30_150256) do
|
||||||
t.integer "status", default: 0, null: false
|
t.integer "status", default: 0, null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["email"], name: "index_family_invitations_on_email"
|
t.index ["family_id", "email"], name: "index_family_invitations_on_family_id_and_email"
|
||||||
t.index ["expires_at"], name: "index_family_invitations_on_expires_at"
|
t.index ["family_id", "status", "expires_at"], name: "index_family_invitations_on_family_status_expires"
|
||||||
t.index ["family_id"], name: "index_family_invitations_on_family_id"
|
t.index ["status", "expires_at"], name: "index_family_invitations_on_status_and_expires_at"
|
||||||
t.index ["status"], name: "index_family_invitations_on_status"
|
t.index ["status", "updated_at"], name: "index_family_invitations_on_status_and_updated_at"
|
||||||
t.index ["token"], name: "index_family_invitations_on_token", unique: true
|
t.index ["token"], name: "index_family_invitations_on_token", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -126,8 +126,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_30_150256) do
|
||||||
t.integer "role", default: 1, null: false
|
t.integer "role", default: 1, null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["family_id", "role"], name: "index_family_memberships_on_family_id_and_role"
|
t.index ["family_id", "role"], name: "index_family_memberships_on_family_and_role"
|
||||||
t.index ["family_id"], name: "index_family_memberships_on_family_id"
|
|
||||||
t.index ["user_id"], name: "index_family_memberships_on_user_id", unique: true
|
t.index ["user_id"], name: "index_family_memberships_on_user_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -316,6 +315,16 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_30_150256) do
|
||||||
t.integer "status", default: 0
|
t.integer "status", default: 0
|
||||||
t.datetime "active_until"
|
t.datetime "active_until"
|
||||||
t.integer "points_count", default: 0, null: false
|
t.integer "points_count", default: 0, null: false
|
||||||
|
t.string "provider"
|
||||||
|
t.string "uid"
|
||||||
|
t.text "patreon_access_token"
|
||||||
|
t.text "patreon_refresh_token"
|
||||||
|
t.datetime "patreon_token_expires_at"
|
||||||
|
t.string "utm_source"
|
||||||
|
t.string "utm_medium"
|
||||||
|
t.string "utm_campaign"
|
||||||
|
t.string "utm_term"
|
||||||
|
t.string "utm_content"
|
||||||
t.index ["email"], name: "index_users_on_email", unique: true
|
t.index ["email"], name: "index_users_on_email", unique: true
|
||||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||||
end
|
end
|
||||||
|
|
@ -342,11 +351,11 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_30_150256) do
|
||||||
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||||
add_foreign_key "areas", "users"
|
add_foreign_key "areas", "users"
|
||||||
add_foreign_key "families", "users", column: "creator_id", validate: false
|
add_foreign_key "families", "users", column: "creator_id"
|
||||||
add_foreign_key "family_invitations", "families", validate: false
|
add_foreign_key "family_invitations", "families"
|
||||||
add_foreign_key "family_invitations", "users", column: "invited_by_id", validate: false
|
add_foreign_key "family_invitations", "users", column: "invited_by_id"
|
||||||
add_foreign_key "family_memberships", "families", validate: false
|
add_foreign_key "family_memberships", "families"
|
||||||
add_foreign_key "family_memberships", "users", validate: false
|
add_foreign_key "family_memberships", "users"
|
||||||
add_foreign_key "notifications", "users"
|
add_foreign_key "notifications", "users"
|
||||||
add_foreign_key "place_visits", "places"
|
add_foreign_key "place_visits", "places"
|
||||||
add_foreign_key "place_visits", "visits"
|
add_foreign_key "place_visits", "visits"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue