dawarich/app/views/map/index.html.erb

62 lines
2.6 KiB
Text
Raw Normal View History

2024-06-12 15:10:53 -04:00
<% content_for :title, 'Map' %>
2024-07-04 16:20:12 -04:00
<div class='w-4/5 mt-8'>
2024-05-23 14:12:23 -04:00
<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| %>
2024-05-23 14:12:23 -04:00
<div class="flex flex-col md:flex-row md:space-x-4 md:items-end">
<div class="w-full md:w-2/12">
2024-05-23 14:12:23 -04:00
<div class="flex flex-col space-y-2">
<%= f.label :start_at, class: "text-sm font-semibold" %>
<%= f.datetime_local_field :start_at, class: "rounded-md w-full", value: @start_at %>
</div>
</div>
<div class="w-full md:w-2/12">
2024-05-23 14:12:23 -04:00
<div class="flex flex-col space-y-2">
<%= f.label :end_at, class: "text-sm font-semibold" %>
<%= f.datetime_local_field :end_at, class: "rounded-md w-full", value: @end_at %>
</div>
</div>
<div class="w-full md:w-2/12">
2024-05-23 14:12:23 -04:00
<div class="flex flex-col space-y-2">
<%= f.submit "Search", class: "px-4 py-2 bg-blue-500 text-white rounded-md" %>
</div>
</div>
<div class="w-full md:w-2/12">
<div class="flex flex-col space-y-2 text-center">
<%= 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: "px-4 py-2 bg-gray-500 text-white rounded-md" %>
</div>
</div>
<div class="w-full md:w-2/12">
<div class="flex flex-col space-y-2 text-center">
<%= 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: "px-4 py-2 bg-gray-500 text-white rounded-md" %>
</div>
</div>
<div class="w-full md:w-2/12">
<div class="flex flex-col space-y-2 text-center">
<%= 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: "px-4 py-2 bg-gray-500 text-white rounded-md" %>
</div>
</div>
2024-05-23 14:12:23 -04:00
</div>
<% end %>
<div
class="w-full"
2024-08-28 17:54:00 -04:00
data-controller="maps"
data-distance_unit="<%= DISTANCE_UNIT %>"
data-api_key="<%= current_user.api_key %>"
2024-08-28 14:24:35 -04:00
data-user_settings=<%= current_user.settings.to_json %>
2024-05-23 14:12:23 -04:00
data-coordinates="<%= @coordinates %>"
2024-08-28 14:24:35 -04:00
data-timezone="<%= Rails.configuration.time_zone %>">
2024-06-25 15:57:22 -04:00
<div data-maps-target="container" class="h-[25rem] w-auto min-h-screen">
<div id="fog" class="fog"></div>
</div>
2024-05-23 14:12:23 -04:00
</div>
</div>
</div>
2024-07-04 16:20:12 -04:00
<div class='w-1/5 mt-8'>
2024-05-23 14:12:23 -04:00
<%= render 'shared/right_sidebar' %>
</div>
2024-08-28 14:24:35 -04:00
<%= render 'map/settings_modals' %>