From 64e50285145fc1a0e8003c4cc29135e72fc02bf3 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sun, 24 Mar 2024 19:53:19 +0100 Subject: [PATCH] Update import show page --- app/views/imports/_import.html.erb | 28 ++++++++++++-- app/views/imports/show.html.erb | 6 +-- app/views/points/_table.html.erb | 61 ------------------------------ 3 files changed, 27 insertions(+), 68 deletions(-) delete mode 100644 app/views/points/_table.html.erb diff --git a/app/views/imports/_import.html.erb b/app/views/imports/_import.html.erb index 783ba5d3..49fbb5a8 100644 --- a/app/views/imports/_import.html.erb +++ b/app/views/imports/_import.html.erb @@ -1,8 +1,28 @@
-

- Name: - <%= import.name %> -

+ + + + + + + + + + + + + + + + + + +
NameProcessedDoublesCreated at
+ <%= link_to import.name, import, class: 'underline hover:no-underline' %> (<%= import.source %>) + + <%= "✅" if import.processed == import.raw_points %> + <%= "#{import.processed}/#{import.raw_points}" %> + <%= import.doubles %><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %>
<% if action_name != "show" %> <%= link_to "Show this import", import, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> diff --git a/app/views/imports/show.html.erb b/app/views/imports/show.html.erb index 2605a75d..e6188ad2 100644 --- a/app/views/imports/show.html.erb +++ b/app/views/imports/show.html.erb @@ -6,10 +6,10 @@ <%= render @import %> - <%= link_to "Edit this import", edit_import_path(@import), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%= link_to "Edit this import", edit_import_path(@import), class: "mt-2 rounded-lg py-3 px-5 bg-secondary-content inline-block font-medium" %>
- <%= link_to "Destroy this import", import_path(@import), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure? This action will delete all points imported with this file", turbo_method: :delete }, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %> + <%= link_to "Destroy this import", import_path(@import), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure? This action will delete all points imported with this file", turbo_method: :delete }, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-secondary-content font-medium" %>
- <%= link_to "Back to imports", imports_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%= link_to "Back to imports", imports_path, class: "ml-2 rounded-lg py-3 px-5 bg-secondary-content inline-block font-medium" %>
diff --git a/app/views/points/_table.html.erb b/app/views/points/_table.html.erb deleted file mode 100644 index 66af236a..00000000 --- a/app/views/points/_table.html.erb +++ /dev/null @@ -1,61 +0,0 @@ -

Points Table

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% @points.each do |point| %> - - - - - - - - - - - - - - - - - - - - - - - - - - <% end %> - -
IDBattery StatusPingBatteryTracked IDTopicAltitudeVelocityTriggerBSSIDSSIDConnectionVertical AccuracyAccuracyTimestampModeLatitudeLongitudeInridsIn RegionsRaw DataTracker IDCreated AtUpdated At
<%= point.id %><%= point.battery_status %><%= point.ping %><%= point.battery %><%= point.tracker_id %><%= point.topic %><%= point.altitude %><%= point.velocity %><%= point.trigger %><%= point.bssid %><%= point.ssid %><%= point.connection %><%= point.vertical_accuracy %><%= point.accuracy %><%= point.timestamp %><%= point.mode %><%= point.latitude %><%= point.longitude %><%= point.inrids %><%= point.in_regions %><%= point.raw_data %><%= point.created_at %><%= point.updated_at %>