1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/helpers/targets_helper.rb
cryptogopher e301665b6a Add Targets #show
Change css classes from subject-oriented to property-oriented
2021-05-05 12:42:30 +02:00

23 lines
752 B
Ruby

module TargetsHelper
def target_markup(date, quantity, target)
content = "#{' '*quantity.depth}#{quantity.name} #{target.to_s}"
classes = []
if date == target&.effective_from
classes << 'bolded' if @goal.quantities.include?(quantity)
else
classes << 'dimmed'
end
content_tag(:span, content, {class: classes}, false)
end
def action_links(date)
link_to(l(:button_reapply), reapply_goal_target_path(@goal, date, @view_params),
{remote: true, class: "icon icon-reload"}) +
link_to(l(:button_edit), edit_goal_target_path(@goal, date, @view_params),
{remote: true, class: "icon icon-edit"}) +
delete_link(goal_target_path(@goal, date), {remote: true, data: {}})
end
end