Skip to content

Add support for nutrition goals #436

@rolandgeider

Description

@rolandgeider

Add support for nutrition goals as implemented in wger-project/react#799 and wger-project/wger#1437

The nutrition page should behave and look as similar as possible to the web variant. Since we will need some new charts, we need to wait till #433 is done, there is some basic work done in feature/nutrition-goals

Basically we have some new fields,

  • onlyLogging
  • goalEnergy, goalProtein, goalCarbohydrates and goalFat

If only logging is active, buttons allowing the user to add a meal are hidden. The planned nutritional values for a plan are either the values from the goal* fields or the calculated values from regular meals.

There is also a new "pseudo meal" box that shows all logs for today that don't belong to any meal

Here are some screenshots from the web:

Dashboard

Goal calories, protein (not fulfilled) and carbohydrates (over the limit, perhaps make this red?). Fat has no goals and just counts up
image

No goals (just count up)
image

Detail page

Only-logging flag activated (there is no button to add meals).
image
image

Form

image
image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions