2024-11-28 10:11:04 -05:00
|
|
|
|
<%= link_to trip, class: "block hover:shadow-lg rounded-lg" do %>
|
|
|
|
|
|
<div class="card bg-base-200 shadow-xl hover:shadow-2xl transition-shadow duration-200" data-trip-id="<%= trip.id %>" id="trip-<%= trip.id %>">
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
<h2 class="card-title justify-center">
|
|
|
|
|
|
<span class="hover:underline"><%= trip.name %></span>
|
|
|
|
|
|
</h2>
|
|
|
|
|
|
<p class="text-sm text-gray-600 text-center">
|
2025-07-08 12:10:10 -04:00
|
|
|
|
<%= "#{human_date(trip.started_at)} – #{human_date(trip.ended_at)}, #{trip.distance_for_user(current_user).round} #{current_user.safe_settings.distance_unit}" %>
|
2024-11-28 10:11:04 -05:00
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<div style="width: 100%; aspect-ratio: 1/1;"
|
|
|
|
|
|
id="map-<%= trip.id %>"
|
2024-12-01 14:34:39 -05:00
|
|
|
|
class="rounded-lg z-0"
|
2024-11-28 10:11:04 -05:00
|
|
|
|
data-controller="trip-map"
|
|
|
|
|
|
data-trip-map-trip-id-value="<%= trip.id %>"
|
2025-05-15 16:25:47 -04:00
|
|
|
|
data-trip-map-path-value="<%= trip.path.coordinates.to_json %>"
|
2024-11-28 10:11:04 -05:00
|
|
|
|
data-trip-map-api-key-value="<%= current_user.api_key %>"
|
|
|
|
|
|
data-trip-map-user-settings-value="<%= current_user.settings.to_json %>"
|
2025-05-17 15:50:34 -04:00
|
|
|
|
data-trip-map-timezone-value="<%= Rails.configuration.time_zone %>">
|
2024-11-28 10:11:04 -05:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<% end %>
|