-
-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added kilojoules property to ingredient model (Issue #568) #577
Conversation
…d calculator to reflect change on front end.
I worked on these changes with my partner, @derekli17, which is why his name is also included in AUTHORS.rst. We are currently undergraduates studying computer science, so if you have any feedback or want us to make changes, please feel free to let us know! Thanks. |
While showing everywhere both the kcal and the kJ would break the UI flow, I'd add them to the nutrition list and the nutritional data table under the plan, then this would be ready to merge |
Hi, thanks for your feedback! We've implemented your suggested changes. We found the "4,184" / "4.184" issue very funny, but that now is fixed 👍 . Additionally, we wanted your feedback on an aesthetic issue, which we've attached a picture of. As you can see in the red circle, sometimes the kilojoules wrap around onto the next line. Let us know your thoughts on this. We'd be more than willing to change some of the HTML/CSS to make it look cleaner if necessary. |
I also had to laugh when I opened a plan and saw like half a million kJ 😂 And as for the line wrapping issue, we can save some space by removing the decimal place but other than that I wouldn't change much Edit: it has technically nothing to do with this issue, but can you perhaps take a look at #581? |
We have experimented with removing the decimal place, but we are still observing the line wrapping issue. We didn't make any further changes for this reason |
Merged, thanks!! |
Proposed Changes
added "energy_kilojoule" property to Ingredient class in wger/nutrition/models.py
added kilojoules to display on ingredient details page in wger/nutrition/templates/ingredient/view.html
added to wger/nutrition/static/js/nutrition.js, making kilojoules responsive to updates in ingredient amount according to user input
added test to wger/nutrition/tests/test_ingredient.py, verifying correct kilojoule conversion
Please check that the PR fulfills these requirements
flake8 --config .github/linters/.flake8
)and isort (
isort
)Other questions
what changes might users need to make in their running application due to
this PR?)
No