mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
78 lines
2.7 KiB
Text
78 lines
2.7 KiB
Text
<% content_for :title, @trip.name %>
|
|
|
|
<div class="container mx-auto px-4 py-8 max-w-4xl">
|
|
<!-- Header Section -->
|
|
<div class="text-center mb-8">
|
|
<h1 class="text-4xl font-bold mb-2"><%= @trip.name %></h1>
|
|
<p class="text-md text-base-content/60">
|
|
<%= human_date(@trip.started_at) %> - <%= human_date(@trip.ended_at) %>
|
|
</p>
|
|
<% if @trip.countries.any? %>
|
|
<p class="text-lg text-base-content/60">
|
|
<%= @trip.countries.join(', ') %>
|
|
</p>
|
|
<% end %>
|
|
</div>
|
|
|
|
<!-- Map and Description Section -->
|
|
<div class="bg-base-100 mb-8">
|
|
<div class="p-6 grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div class="w-full">
|
|
<div
|
|
id='map'
|
|
class="w-full h-full"
|
|
data-controller="trips"
|
|
data-trips-target="container"
|
|
data-distance_unit="<%= DISTANCE_UNIT %>"
|
|
data-api_key="<%= current_user.api_key %>"
|
|
data-user_settings="<%= current_user.settings.to_json %>"
|
|
data-coordinates="<%= @coordinates.to_json %>"
|
|
data-timezone="<%= Rails.configuration.time_zone %>">
|
|
<div data-trips-target="container" class="h-[25rem] w-full min-h-screen">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-full">
|
|
<div class="min-h-20">
|
|
<%= @trip.field_notes.body %>
|
|
</div>
|
|
|
|
<!-- Photos Grid Section -->
|
|
<% if @photos.any? %>
|
|
<% @photos.each_slice(4) do |slice| %>
|
|
<div class="h-32 flex gap-4 mt-4 justify-center">
|
|
<% slice.each do |photo| %>
|
|
<div class="flex-1 h-full overflow-hidden rounded-lg transition-transform duration-300 hover:scale-105 hover:shadow-lg">
|
|
<img
|
|
src="<%= photo[:url] %>"
|
|
loading='lazy'
|
|
class="h-full w-full object-cover"
|
|
>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<div class="text-center mt-6">
|
|
<%= link_to "More photos on Immich", immich_search_url(current_user.settings['immich_url'], @trip.started_at, @trip.ended_at), class: "btn btn-primary", target: '_blank' %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Action Buttons Section -->
|
|
<div class="bg-base-100 items-center">
|
|
<div class="flex flex-wrap gap-2 justify-center">
|
|
<%= link_to "Edit this trip", edit_trip_path(@trip), class: "btn" %>
|
|
<%= link_to "Destroy this trip",
|
|
trip_path(@trip),
|
|
data: {
|
|
turbo_confirm: "Are you sure?",
|
|
turbo_method: :delete
|
|
},
|
|
class: "btn" %>
|
|
<%= link_to "Back to trips", trips_path, class: "btn" %>
|
|
</div>
|
|
</div>
|
|
</div>
|