Commit Graph

13 Commits

Author SHA1 Message Date
312eda85df Can now set macro target 2025-10-10 19:50:18 +02:00
d78f48710e Add meal v2 flow and user timezone support
Introduces a new add_meal_v2 blueprint with barcode scanning, item search, and improved meal logging UI. Adds user timezone support: login form now captures timezone, User model and database schema updated, and timezone is set on login. Refactors templates and forms to support these changes, and removes the old login template.
2025-08-14 06:08:17 +02:00
97ff4acf02 Add change password functionality for users
Introduces a change password route, form, and template, allowing authenticated users to update their password. Updates the User model with a method to set the must_change_password flag. Adjusts login and navigation logic to support the new flow and ensures users are redirected to change their password if required.
2025-08-11 18:03:18 +02:00
0da580faf1 Refactor login flow to use auth blueprint
Moved login route and logic from app.py to application/auth/routes.py under the 'auth' blueprint. Updated all references to the login route to use 'auth.login'. Added a dedicated login.html template under application/auth/templates. Adjusted login_required utility and default_return logic for consistency.
2025-08-11 17:43:46 +02:00
3f9bd8984d Change energy field from integer to float
Updated the FoodItem model and FoodItemForm to use float for the energy field instead of integer.
2025-08-11 16:51:31 +02:00
5a0dbef28f Update forms.py
added input mode to form to indicate a decimal value is expected for each value
2025-08-11 16:50:19 +02:00
7fe30bfebf Improve FoodItem uniqueness and add name constraint
Refactored add_meal routes to check for existing FoodItems by name or barcode and improved form handling. Made barcode optional in FoodItemForm. Added a unique constraint on (name, owner_id) for FoodItem in both the model and database migrations, while retaining the (barcode, owner_id) constraint. Updated FoodItem relationship to cascade deletes.
2025-08-11 14:32:53 +02:00
c552a4571e Add barcode-based meal logging workflow
Introduces a new add_meal blueprint with routes and templates for scanning barcodes, adding new food items, and logging meals. Updates FoodItemForm and FoodLogForm validation, changes FoodLog.amount to float, and integrates the new workflow into the daily log UI. Refactors user routes and templates to support the new meal logging process.
2025-08-07 17:00:56 +02:00
bb5b2e8bc7 Change barcode field from integer to string
Updated the barcode field in FoodItem model and form from integer to string to support barcodes with leading zeros or non-numeric values. Added validation to ensure barcode contains only digits. Updated seed data to use string barcodes.
2025-07-08 11:06:03 +02:00
74ce42c578 Add food logging functionality for users
Introduces a new FoodLogForm and a /log_food/<item_id> route to allow users to log food consumption. Updates the food item route to redirect to the log page, adds a log_food.html template, and updates the Bootstrap CDN version in base.html.
2025-07-07 13:23:50 +02:00
a6f6cdf346 Add manual food item entry and update food item management
Introduces a new route and template for manually adding food items. Updates food item edit and delete operations to use the food item's ID instead of barcode and adds ownership checks. Adjusts form and model to make barcode optional, and updates navigation and dashboard templates to reflect these changes.
2025-06-29 17:41:58 +02:00
a39f54dbb0 Add food item management and improve barcode workflow
Implemented routes and forms for adding and viewing food items by barcode, including templates for displaying and entering nutritional information. Enhanced the scan workflow to redirect to food item details or entry form. Added admin ability to delete food items. Improved UI for login and scan pages. Updated FoodItem model and form fields for consistency and accuracy.
2025-06-29 08:39:25 +02:00
b498f3693a Initial commit: Flask calorie counter app setup
Add base Flask application with user authentication, SQLAlchemy models for users, units, and food items, admin blueprint, and basic templates. Includes database migration setup, login form, and seed script for initial user creation.
2025-06-26 14:19:09 +02:00