2024-06-12 15:10:53 -04:00
|
|
|
<% content_for :title, 'Map' %>
|
|
|
|
|
|
2024-11-28 09:54:36 -05:00
|
|
|
<div class="flex flex-col lg:flex-row lg:space-x-4 my-5 w-full">
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class='w-full lg:w-5/6'>
|
|
|
|
|
<div class="flex flex-col space-y-4 mb-4 w-full">
|
|
|
|
|
<%= form_with url: map_path(import_id: params[:import_id]), method: :get do |f| %>
|
|
|
|
|
<div class="flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4 sm:items-end">
|
2024-11-28 11:23:11 -05:00
|
|
|
<div class="w-full sm:w-2/12 md:w-1/12 lg:w-3/12">
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class="flex flex-col space-y-2">
|
|
|
|
|
<%= f.label :start_at, class: "text-sm font-semibold" %>
|
2024-11-28 11:23:11 -05:00
|
|
|
<%= f.datetime_local_field :start_at, include_seconds: false, class: "input input-bordered hover:cursor-pointer hover:input-primary", value: @start_at %>
|
2024-10-02 17:41:46 -04:00
|
|
|
</div>
|
2024-05-23 14:12:23 -04:00
|
|
|
</div>
|
2024-11-28 11:23:11 -05:00
|
|
|
<div class="w-full sm:w-2/12 md:w-1/12 lg:w-3/12">
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class="flex flex-col space-y-2">
|
|
|
|
|
<%= f.label :end_at, class: "text-sm font-semibold" %>
|
2024-11-28 11:23:11 -05:00
|
|
|
<%= f.datetime_local_field :end_at, include_seconds: false, class: "input input-bordered hover:cursor-pointer hover:input-primary", value: @end_at %>
|
2024-10-02 17:41:46 -04:00
|
|
|
</div>
|
2024-05-23 14:12:23 -04:00
|
|
|
</div>
|
2024-11-28 11:23:11 -05:00
|
|
|
<div class="w-full sm:w-6/12 md:w-2/12 lg:w-1/12">
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class="flex flex-col space-y-2">
|
2024-11-28 11:13:04 -05:00
|
|
|
<%= f.submit "Search", class: "btn btn-primary hover:btn-info" %>
|
2024-10-02 17:41:46 -04:00
|
|
|
</div>
|
2024-05-23 14:12:23 -04:00
|
|
|
</div>
|
2024-11-28 11:23:11 -05:00
|
|
|
<div class="w-full sm:w-6/12 md:w-2/12 lg:w-1/12">
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class="flex flex-col space-y-2 text-center">
|
2024-11-28 11:13:04 -05:00
|
|
|
<%= link_to "Yesterday",
|
|
|
|
|
map_path(start_at: Date.yesterday.beginning_of_day, end_at: Date.yesterday.end_of_day, import_id: params[:import_id]),
|
|
|
|
|
class: "btn btn-neutral hover:btn-ghost" %>
|
2024-10-02 17:41:46 -04:00
|
|
|
</div>
|
2024-05-30 17:36:12 -04:00
|
|
|
</div>
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class="w-full sm:w-6/12 md:w-3/12 lg:w-2/12">
|
|
|
|
|
<div class="flex flex-col space-y-2 text-center">
|
2024-11-28 11:13:04 -05:00
|
|
|
<%= 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-neutral hover:btn-ghost" %>
|
2024-10-02 17:41:46 -04:00
|
|
|
</div>
|
2024-05-30 17:36:12 -04:00
|
|
|
</div>
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class="w-full sm:w-6/12 md:w-3/12 lg:w-2/12">
|
|
|
|
|
<div class="flex flex-col space-y-2 text-center">
|
2024-11-28 11:13:04 -05:00
|
|
|
<%= 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-neutral hover:btn-ghost" %>
|
2024-10-02 17:41:46 -04:00
|
|
|
</div>
|
2024-05-30 17:36:12 -04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-10-02 17:41:46 -04:00
|
|
|
<% end %>
|
2024-05-23 14:12:23 -04:00
|
|
|
|
2024-10-02 17:41:46 -04:00
|
|
|
<div
|
2024-11-03 10:48:43 -05:00
|
|
|
id='map'
|
2024-12-01 07:57:17 -05:00
|
|
|
class="w-full z-0"
|
2024-11-03 10:48:43 -05:00
|
|
|
data-controller="maps points"
|
|
|
|
|
data-points-target="map"
|
2024-10-02 17:41:46 -04:00
|
|
|
data-distance_unit="<%= DISTANCE_UNIT %>"
|
|
|
|
|
data-api_key="<%= current_user.api_key %>"
|
|
|
|
|
data-user_settings=<%= current_user.settings.to_json %>
|
|
|
|
|
data-coordinates="<%= @coordinates %>"
|
|
|
|
|
data-timezone="<%= Rails.configuration.time_zone %>">
|
2024-11-28 07:20:03 -05:00
|
|
|
<div data-maps-target="container" class="h-[25rem] rounded-lg w-full min-h-screen">
|
2024-10-02 17:41:46 -04:00
|
|
|
<div id="fog" class="fog"></div>
|
|
|
|
|
</div>
|
2024-06-25 15:57:22 -04:00
|
|
|
</div>
|
2024-05-23 14:12:23 -04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-10-02 17:41:46 -04:00
|
|
|
<div class='w-full lg:w-1/6 mt-8 lg:mt-0 mx-auto'>
|
|
|
|
|
<%= render 'shared/right_sidebar' %>
|
|
|
|
|
</div>
|
2024-05-23 14:12:23 -04:00
|
|
|
</div>
|
|
|
|
|
|
2024-08-28 14:24:35 -04:00
|
|
|
<%= render 'map/settings_modals' %>
|