2024-08-25 14:19:02 -04:00
<% content_for :title, "Places" %>
2024-11-28 09:54:36 -05:00
<div class="w-full my-5">
2024-12-11 08:21:44 -05:00
<div role="tablist" class="tabs tabs-lifted tabs-lg">
<%= link_to 'Visits', visits_path(status: :confirmed), role: 'tab', class: "tab font-bold text-xl #{active_visit_places_tab?('visits')}" %>
<%= link_to 'Places', places_path, role: 'tab', class: "tab font-bold text-xl #{active_visit_places_tab?('places')}" %>
2024-08-25 14:19:02 -04:00
</div>
<div id="places" class="min-w-full">
<% if @places.empty? %>
<div class="hero min-h-80 bg-base-200">
<div class="hero-content text-center">
<div class="max-w-md">
<h1 class="text-5xl font-bold">Hello there!</h1>
<p class="py-6">
Here you'll find your places, created by Visits suggestion process. But now there are none.
</p>
</div>
</div>
</div>
<% else %>
<div class="flex justify-center my-5">
<div class='flex'>
<%= paginate @places %>
</div>
</div>
<div class="overflow-x-auto">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Created at</th>
<th>Coordinates</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @places.each do |place| %>
<tr>
<td><%= place.name %></td>
2025-04-04 14:15:05 -04:00
<td><%= human_datetime(place.created_at) %></td>
2025-03-09 15:07:39 -04:00
<td><%= "#{place.lat}, #{place.lon}" %></td>
2024-08-25 14:19:02 -04:00
<td>
2025-10-21 14:01:13 -04:00
<%= link_to 'Delete', place, data: { turbo_confirm: "Are you sure? Deleting a place will result in deleting all visits for this place.", turbo_method: :delete }, method: :delete, class: "px-4 py-2 bg-red-500 text-white rounded-md" %>
2024-08-25 14:19:02 -04:00
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
</div>
</div>