Update timestamps

This commit is contained in:
Eugene Burmakin
2025-04-04 20:15:05 +02:00
parent 0ed6fb7ea8
commit 4fcfdc7bd7
11 changed files with 29 additions and 12 deletions

View File

@@ -71,3 +71,4 @@ volumes:
dawarich_shared:
dawarich_public:
dawarich_watched:
dawarich_storage:

View File

@@ -67,6 +67,7 @@ If your hardware doesn't have enough memory to migrate the imports, you can dele
- `rake points:migrate_to_lonlat` task now also reindexes the points table.
- Fixed filling `lonlat` column for old places after reverse geocoding.
- Deleting an import now correctly recalculates stats.
- Datetime across the app is now being displayed in human readable format, i.e 26 Dec 2024, 13:49. Hover over the datetime to see the ISO 8601 timestamp.
# 0.25.3 - 2025-03-22

View File

@@ -115,6 +115,17 @@ module ApplicationHelper
date.strftime('%e %B %Y')
end
def human_datetime(datetime)
return unless datetime
content_tag(
:span,
datetime.strftime('%e %b %Y, %H:%M'),
class: 'tooltip',
data: { tip: datetime.iso8601 }
)
end
def speed_text_color(speed)
return 'text-default' if speed.to_i >= 0

View File

@@ -37,7 +37,7 @@
<% @exports.each do |export| %>
<tr>
<td><%= export.name %></td>
<td><%= export.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
<td><%= human_datetime(export.created_at) %></td>
<td><%= export.status %></td>
<td>
<% if export.completed? %>

View File

@@ -15,7 +15,7 @@
<td>
<%= "#{number_with_delimiter import.points.size}" %>
</td>
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td>
<td><%= human_datetime(import.created_at) %></td>
</tr>
</tbody>
</table>

View File

@@ -68,12 +68,17 @@
<td data-reverse-geocoded-points-count>
<%= number_with_delimiter import.reverse_geocoded_points_count %>
</td>
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td>
<td><%= human_datetime(import.created_at) %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="flex justify-center my-5">
<div class='flex'>
<%= paginate @imports %>
</div>
</div>
<% end %>
</div>
</div>

View File

@@ -38,7 +38,7 @@
<% @places.each do |place| %>
<tr>
<td><%= place.name %></td>
<td><%= place.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
<td><%= human_datetime(place.created_at) %></td>
<td><%= "#{place.lat}, #{place.lon}" %></td>
<td>
<%= link_to 'Delete', place, data: { confirm: "Are you sure? Deleting a place will result in deleting all visits for this place.", 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" %>

View File

@@ -14,7 +14,7 @@
%>
</td>
<td class='<%= speed_text_color(point.velocity) %>'><%= point.velocity %></td>
<td><%= point.recorded_at %></td>
<td><%= human_datetime(point.recorded_at) %></td>
<td><%= point.lat %>, <%= point.lon %></td>
<td></td>
</tr>

View File

@@ -26,7 +26,7 @@
<%= number_with_delimiter user.tracked_points.count %>
</td>
<td>
<%= user.created_at.strftime('%Y-%m-%d %H:%M:%S') %>
<%= human_datetime(user.created_at) %>
</td>
</tr>
<% end %>

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/application"
require "importmap/commands"
require_relative '../config/application'
require 'importmap/commands'

View File

@@ -6,6 +6,7 @@ pin_all_from 'app/javascript/channels', under: 'channels'
pin 'application', preload: true
pin '@rails/actioncable', to: 'actioncable.esm.js'
pin '@rails/activestorage', to: 'activestorage.esm.js'
pin '@hotwired/turbo-rails', to: 'turbo.min.js', preload: true
pin '@hotwired/stimulus', to: 'stimulus.min.js', preload: true
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js', preload: true
@@ -17,10 +18,8 @@ pin 'chartkick', to: 'chartkick.js'
pin 'Chart.bundle', to: 'Chart.bundle.js'
pin 'leaflet.heat' # @0.2.0
pin 'leaflet-draw' # @1.0.4
pin '@rails/actioncable', to: 'actioncable.esm.js'
pin_all_from 'app/javascript/channels', under: 'channels'
pin 'notifications_channel', to: 'channels/notifications_channel.js'
pin 'points_channel', to: 'channels/points_channel.js'
pin 'imports_channel', to: 'channels/imports_channel.js'
pin "trix"
pin "@rails/actiontext", to: "actiontext.esm.js"
pin 'trix'
pin '@rails/actiontext', to: 'actiontext.esm.js'