From c3c997be025a413d5453563c2cb3944f6e0c88cd Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 19 Aug 2025 23:32:06 +0200 Subject: [PATCH 1/2] Add a separate layout for full screen map --- app/controllers/map_controller.rb | 1 + app/views/layouts/map.html.erb | 109 ++++++++++++++++++++++++++++++ app/views/map/index.html.erb | 2 +- 3 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 app/views/layouts/map.html.erb diff --git a/app/controllers/map_controller.rb b/app/controllers/map_controller.rb index 82d9435f..f75f75d7 100644 --- a/app/controllers/map_controller.rb +++ b/app/controllers/map_controller.rb @@ -2,6 +2,7 @@ class MapController < ApplicationController before_action :authenticate_user! + layout 'map', only: :index def index @points = filtered_points diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb new file mode 100644 index 00000000..29918ff7 --- /dev/null +++ b/app/views/layouts/map.html.erb @@ -0,0 +1,109 @@ + + + + <%= full_title(yield(:title)) %> + + <%= action_cable_meta_tag %> + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + + + + <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + <%= javascript_include_tag "https://unpkg.com/protomaps-leaflet@5.0.0/dist/protomaps-leaflet.js" %> + + <%= render 'application/favicon' %> + <%= Sentry.get_trace_propagation_meta.html_safe if Sentry.initialized? %> + <% if !DawarichSettings.self_hosted? %> + + <% end %> + + + + +
+
+ <%= render 'shared/navbar' %> +
+
+ + +
+
+ <%= render 'shared/flash' %> +
+
+ + +
+
+ <%= form_with url: map_path(import_id: params[:import_id]), method: :get, class: "w-full" do |f| %> +
+
+
+ + <%= link_to map_path(start_at: @start_at - 1.day, end_at: @end_at - 1.day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost w-full" do %> + ◀️ + <% end %> + +
+
+
+
+ <%= f.label :start_at, class: "text-xs font-semibold" %> + <%= f.datetime_local_field :start_at, include_seconds: false, class: "input input-sm input-bordered hover:cursor-pointer hover:input-primary", value: @start_at %> +
+
+
+
+ <%= f.label :end_at, class: "text-xs font-semibold" %> + <%= f.datetime_local_field :end_at, include_seconds: false, class: "input input-sm input-bordered hover:cursor-pointer hover:input-primary", value: @end_at %> +
+
+
+
+ + <%= link_to map_path(start_at: @start_at + 1.day, end_at: @end_at + 1.day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost w-full" do %> + ▶️ + <% end %> + +
+
+
+
+ <%= f.submit "Search", class: "btn btn-sm btn-primary hover:btn-info" %> +
+
+
+
+ <%= link_to "Today", + map_path(start_at: Time.current.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), + class: "btn btn-sm border border-base-300 hover:btn-ghost" %> +
+
+
+
+ <%= link_to "Last 7 days", map_path(start_at: 1.week.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost" %> +
+
+
+
+ <%= link_to "Last month", map_path(start_at: 1.month.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost" %> +
+
+
+ <% end %> +
+
+ + +
+ <%= yield %> +
+ + <%= render 'map/onboarding_modal' %> + + diff --git a/app/views/map/index.html.erb b/app/views/map/index.html.erb index 354b028b..42852ee0 100644 --- a/app/views/map/index.html.erb +++ b/app/views/map/index.html.erb @@ -1,6 +1,6 @@ <% content_for :title, 'Map' %> -
+
<%= form_with url: map_path(import_id: params[:import_id]), method: :get do |f| %> From 86a76db2c0a1bfde9a59962269682eae4b754538 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 19 Aug 2025 23:53:10 +0200 Subject: [PATCH 2/2] Fix date nav hidden under navbar --- app/views/layouts/map.html.erb | 62 +--------------------------------- app/views/map/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 62 deletions(-) diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index 29918ff7..c8fd7714 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -38,69 +38,9 @@
-
-
- <%= form_with url: map_path(import_id: params[:import_id]), method: :get, class: "w-full" do |f| %> -
-
-
- - <%= link_to map_path(start_at: @start_at - 1.day, end_at: @end_at - 1.day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost w-full" do %> - ◀️ - <% end %> - -
-
-
-
- <%= f.label :start_at, class: "text-xs font-semibold" %> - <%= f.datetime_local_field :start_at, include_seconds: false, class: "input input-sm input-bordered hover:cursor-pointer hover:input-primary", value: @start_at %> -
-
-
-
- <%= f.label :end_at, class: "text-xs font-semibold" %> - <%= f.datetime_local_field :end_at, include_seconds: false, class: "input input-sm input-bordered hover:cursor-pointer hover:input-primary", value: @end_at %> -
-
-
-
- - <%= link_to map_path(start_at: @start_at + 1.day, end_at: @end_at + 1.day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost w-full" do %> - ▶️ - <% end %> - -
-
-
-
- <%= f.submit "Search", class: "btn btn-sm btn-primary hover:btn-info" %> -
-
-
-
- <%= link_to "Today", - map_path(start_at: Time.current.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), - class: "btn btn-sm border border-base-300 hover:btn-ghost" %> -
-
-
-
- <%= link_to "Last 7 days", map_path(start_at: 1.week.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost" %> -
-
-
-
- <%= link_to "Last month", map_path(start_at: 1.month.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "btn btn-sm border border-base-300 hover:btn-ghost" %> -
-
-
- <% end %> -
-
-
+
<%= yield %>
diff --git a/app/views/map/index.html.erb b/app/views/map/index.html.erb index 42852ee0..9af06639 100644 --- a/app/views/map/index.html.erb +++ b/app/views/map/index.html.erb @@ -2,7 +2,7 @@
-
+
<%= form_with url: map_path(import_id: params[:import_id]), method: :get do |f| %>