1
0

Create Readouts controller

Move #readouts + #toggle_exposure from Measurements to Readouts
This commit is contained in:
cryptogopher
2021-05-08 01:02:57 +02:00
parent 40cce31bff
commit 7b2b855d56
13 changed files with 62 additions and 49 deletions

View File

@@ -22,6 +22,10 @@ module BodyTrackersHelper
t&.strftime("%R")
end
def format_datetime(dt)
dt.strftime("%F <small>%R&emsp;(~#{time_ago_in_words(dt)} ago)</small>").html_safe
end
def toggle_exposure_options(enabled, domain = :all)
enabled = enabled.map { |q| [q.name, q.id] }
enabled_ids = enabled.map(&:last)

View File

@@ -1,10 +1,4 @@
module MeasurementsHelper
def format_datetime(m)
m.taken_at
.strftime("%F <small>%R&emsp;(~#{time_ago_in_words(m.taken_at)} ago)</small>")
.html_safe
end
def action_links(m)
link_to(l(:button_retake), retake_measurement_path(m, @view_params),
{remote: true, class: "icon icon-reload"}) +