mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Add link to date of city visit to right sidebar
This commit is contained in:
parent
ab4f76b2e6
commit
8c70dd484a
4 changed files with 13 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class PointsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PointsHelper
|
||||
def link_to_date(timestamp)
|
||||
datetime = Time.zone.at(timestamp)
|
||||
|
||||
link_to points_path(start_at: datetime.beginning_of_day, end_at: datetime.end_of_day), \
|
||||
class: 'underline hover:no-underline' do
|
||||
datetime.strftime('%d.%m.%Y')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<ul>
|
||||
<% country[:cities].each do |city| %>
|
||||
<li>
|
||||
<%= city[:city] %> (<%= Time.zone.at(city[:timestamp]).strftime("%d.%m.%Y") %>)
|
||||
<%= city[:city] %> (<%= link_to_date(city[:timestamp]) %>)
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Reference in a new issue