Added Targets index
This commit is contained in:
@@ -14,11 +14,15 @@ module BodyTrackersHelper
|
||||
end
|
||||
end
|
||||
|
||||
def format_time(t)
|
||||
t.strftime("%R") if t
|
||||
def format_date(d)
|
||||
d&.strftime("%F")
|
||||
end
|
||||
|
||||
def toggle_exposure_options(enabled, domain)
|
||||
def format_time(t)
|
||||
t&.strftime("%R")
|
||||
end
|
||||
|
||||
def toggle_exposure_options(enabled, domain = :all)
|
||||
enabled = enabled.map { |q| [q.name, q.id] }
|
||||
enabled_ids = enabled.map(&:last)
|
||||
|
||||
@@ -49,8 +53,7 @@ module BodyTrackersHelper
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: rename to quantities_table_header
|
||||
def table_header_spec(quantities)
|
||||
def quantities_table_header(quantities)
|
||||
# spec: table of rows (tr), where each row is a hash of cells (td) (hash keeps items
|
||||
# ordered the way they were added). Hash values determine cell property:
|
||||
# * int > 0 - quantity name-labelled cell with 'int' size colspan
|
||||
|
||||
@@ -3,11 +3,11 @@ module TargetsHelper
|
||||
Target::CONDITIONS
|
||||
end
|
||||
|
||||
def action_links(m)
|
||||
link_to(l(:button_retake), retake_measurement_path(m, @view_params),
|
||||
def action_links(d)
|
||||
link_to(l(:button_reapply), reapply_project_targets_path(@project, d, @view_params),
|
||||
{remote: true, class: "icon icon-reload"}) +
|
||||
link_to(l(:button_edit), edit_measurement_path(m, @view_params),
|
||||
link_to(l(:button_edit), edit_target_path(@project, d, @view_params),
|
||||
{remote: true, class: "icon icon-edit"}) +
|
||||
delete_link(measurement_path(m), {remote: true, data: {}})
|
||||
delete_link(target_path(d), {remote: true, data: {}})
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user