112 Commits

Author SHA1 Message Date
700b351b0e Add edit and delete functionality for food items
Implemented routes and templates to allow users to edit and delete their food items from the dashboard. Updated dashboard template to include Edit and Delete buttons. Refactored template locations and removed unused dashboard.html. Fixed redirect logic in app.py and updated seed data.
2025-06-29 13:54:31 +02:00
970d102831 Add user dashboard and per-user food item ownership
Introduces a user dashboard route and template, moving dashboard logic to a user blueprint. FoodItem now has an owner_id field and a unique constraint on (barcode, owner_id), with relationships set up in the User model. Updates food item creation to associate with the current user, and adds a utility script for dropping a temporary table.
2025-06-29 11:24:34 +02:00
36b189c689 Update food item templates for clarity and styling
Changed table heading in food_items.html to indicate values are per 100g/100ml and applied 'bg-body-tertiary' class to table cells for improved readability. Updated add_food_item.html to use 'form-control-plaintext' for the readonly barcode field for better display consistency.
2025-06-29 09:45:45 +02:00
cfff4b15d0 Add theme toggle and admin nav link, update styles
Introduced a dark/light theme toggle with persistent user preference using localStorage. Updated base template to use Bootstrap's theme system, adjusted body background class, and added a conditional 'Food Items' nav link for admins. Simplified scan page header text.
2025-06-29 09:11:20 +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
0919048cfd Add barcode scanning and nutrition lookup feature
Introduces a new /scan route and template for barcode scanning using ZXing in the browser. Adds a /nutri/<barcode> API endpoint to fetch food item nutrition data by barcode. Updates the FoodItem model to include a barcode field and a to_dict method for JSON serialization. Also updates seed data to include a barcode.
2025-06-29 00:08:25 +02:00
d5e8c3fa94 Refactor food item model and add barcode scanner page
Renamed FoodItems to FoodItem and Units to Unit in models.py, updated related imports and usage throughout the codebase. Added a barcode scanner test page using ZXing in the admin section. Improved food_items.html to display nutritional information in a table. Registered the admin blueprint in app.py and cleaned up blueprint registration in __init__.py. Updated seed.py to use the new FoodItem model.
2025-06-28 12:53:27 +02:00
a5312d7ad0 Add admin check and update FoodItems model
Introduced an admin_required check for all admin routes using Flask-Login's current_user. Updated the FoodItems model to use per-100g nutritional fields and removed unit relationships. Seed script now creates both admin and regular user accounts.
2025-06-27 17:23:54 +02:00
1b428b0bda Update .gitignore 2025-06-27 14:09:47 +02:00
830e4d79a4 Remove migrations from git 2025-06-27 14:09:00 +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
b9f2c420ef Initial commit 2025-06-25 21:58:18 +02:00