1
0

Rearranged Meals index columns

This commit is contained in:
cryptogopher
2020-04-24 15:36:16 +02:00
parent 5ab17cf69b
commit cdd7107567
6 changed files with 45 additions and 37 deletions

View File

@@ -5,9 +5,14 @@ module MealsHelper
delete_link(meal_path(m), {remote: true, data: {}})
end
def display_notes(m)
content_tag(:span, m.notes) +
link_to(l(:button_notes), edit_notes_meal_path(m),
{remote: true, class: "icon icon-wiki-page", style: "float: right"})
def adjustment_buttons(i)
{'- -' => -10, '-' => -1, '+' => 1, '++' => 10}.map do |text, value|
link_to text, adjust_ingredient_path(i, adjustment: value),
{remote: true, method: :post, class: "button #{value>0 ? 'green' : 'red'}"}
end.reduce(&:+)
end
def notes(m)
content_tag(:span, m.notes)
end
end