2024-06-12 15:10:53 -04:00
|
|
|
<% content_for :title, 'Imports' %>
|
|
|
|
|
|
2024-03-15 18:27:31 -04:00
|
|
|
<div class="w-full">
|
|
|
|
|
<div class="flex justify-between items-center">
|
|
|
|
|
<h1 class="font-bold text-4xl">Imports</h1>
|
|
|
|
|
<%= link_to "New import", new_import_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="imports" class="min-w-full">
|
2024-06-12 15:02:42 -04:00
|
|
|
<% if @imports.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">
|
2024-07-27 09:05:08 -04:00
|
|
|
Here you'll find your imports, but now there are none. Let's <%= link_to 'create one', new_import_path, class: 'link' %>!
|
2024-06-12 15:02:42 -04:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% else %>
|
2024-07-31 13:35:35 -04:00
|
|
|
<div class="flex justify-center my-5">
|
|
|
|
|
<div class='flex'>
|
|
|
|
|
<%= paginate @imports %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-06-12 15:02:42 -04:00
|
|
|
<div class="overflow-x-auto">
|
|
|
|
|
<table class="table">
|
|
|
|
|
<thead>
|
2024-03-23 08:36:09 -04:00
|
|
|
<tr>
|
2024-06-12 15:02:42 -04:00
|
|
|
<th>Name</th>
|
2024-06-30 06:52:06 -04:00
|
|
|
<th>Imported points</th>
|
2024-06-12 15:02:42 -04:00
|
|
|
<th>Created at</th>
|
2024-03-23 08:36:09 -04:00
|
|
|
</tr>
|
2024-06-12 15:02:42 -04:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<% @imports.each do |import| %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
<%= link_to import.name, import, class: 'underline hover:no-underline' %> (<%= import.source %>)
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2024-06-30 06:31:21 -04:00
|
|
|
<%= "#{number_with_delimiter import.points.size}" %>
|
2024-06-12 15:02:42 -04:00
|
|
|
</td>
|
|
|
|
|
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2024-03-15 18:27:31 -04:00
|
|
|
</div>
|
|
|
|
|
</div>
|