feat(meal-planner): add auto-generate meal plan functionality
Add new utility function to generate daily meal plans based on user's calorie targets and food categories. Include auto-generate button in meal planner UI with confirmation prompt. Add new Filipino food items to seed data for better meal variety. Fix database column references to use capitalized field names consistently.
This commit is contained in:
@@ -64,10 +64,21 @@
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<!-- Add Button -->
|
||||
<button onclick="openPlanModal('<%= dateStr %>')" class="w-full py-2 border-2 border-dashed border-gray-300 rounded-lg text-gray-400 hover:border-primary hover:text-primary transition text-sm mt-auto">
|
||||
+ Plan Meal
|
||||
</button>
|
||||
<!-- Buttons -->
|
||||
<div class="mt-auto space-y-2">
|
||||
<!-- Add Button -->
|
||||
<button onclick="openPlanModal('<%= dateStr %>')" class="w-full py-2 border-2 border-dashed border-gray-300 rounded-lg text-gray-400 hover:border-primary hover:text-primary transition text-sm">
|
||||
+ Plan Meal
|
||||
</button>
|
||||
|
||||
<!-- Auto Generate Button -->
|
||||
<form action="/meal-planner/auto-generate" method="POST" onsubmit="return confirm('This will replace any existing meal plan for this date. Continue?');">
|
||||
<input type="hidden" name="date" value="<%= dateStr %>">
|
||||
<button type="submit" class="w-full py-2 bg-green-50 text-green-600 rounded-lg hover:bg-green-100 transition text-sm font-medium">
|
||||
⚡ Auto Generate
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% }); %>
|
||||
|
||||
Reference in New Issue
Block a user